From 4cc0985c98574f1ab1a4810646aad59bd72033b8 Mon Sep 17 00:00:00 2001 From: GermanVor Date: Thu, 3 Oct 2024 18:00:06 +0200 Subject: [PATCH 1/4] feat: generate-code and big models update BREAKING CHANGE: new services paths --- cloudapi | 2 +- examples/chat-with-assistant.ts | 102 + package.json | 6 +- scripts/generate-code.ts | 96 +- scripts/services.ts | 374 +- src/generated/google/protobuf/descriptor.ts | 16 +- src/generated/google/protobuf/struct.ts | 4 +- src/generated/yandex/cloud/access/access.ts | 9 +- .../cloud/ai/assistants/v1/assistant.ts | 503 ++ .../ai/assistants/v1/assistant_service.ts | 1730 +++++ .../yandex/cloud/ai/assistants/v1/common.ts | 375 + .../yandex/cloud/ai/assistants/v1/runs/run.ts | 667 ++ .../ai/assistants/v1/runs/run_service.ts | 1235 +++ .../ai/assistants/v1/searchindex/common.ts | 223 + .../assistants/v1/searchindex/search_index.ts | 650 ++ .../v1/searchindex/search_index_file.ts | 200 + .../searchindex/search_index_file_service.ts | 468 ++ .../v1/searchindex/search_index_service.ts | 1311 ++++ .../cloud/ai/assistants/v1/threads/message.ts | 826 +++ .../assistants/v1/threads/message_service.ts | 542 ++ .../cloud/ai/assistants/v1/threads/thread.ts | 411 + .../assistants/v1/threads/thread_service.ts | 1186 +++ .../cloud/ai/assistants/v1/users/user.ts | 406 + .../ai/assistants/v1/users/user_service.ts | 1136 +++ .../yandex/cloud/ai/common/common.ts | 259 + .../yandex/cloud/ai/files/v1/file.ts | 406 + .../yandex/cloud/ai/files/v1/file_service.ts | 1331 ++++ .../v1/embedding/embedding_service.ts | 331 + .../v1/image_generation/image_generation.ts | 337 + .../image_generation_service.ts | 365 + .../text_classification.ts | 214 + .../text_classification_service.ts | 632 ++ .../ai/foundation_models/v1/text_common.ts | 607 ++ .../text_generation_service.ts | 643 ++ src/generated/yandex/cloud/ai/index.ts | 60 +- .../yandex/cloud/ai/llm/v1alpha/llm.ts | 2 +- src/generated/yandex/cloud/ai/ocr/v1/ocr.ts | 564 +- .../yandex/cloud/ai/ocr/v1/ocr_service.ts | 20 +- src/generated/yandex/cloud/ai/stt/v3/stt.ts | 234 +- .../ai/translate/v2/translation_service.ts | 6 +- src/generated/yandex/cloud/ai/tts/v3/tts.ts | 273 + src/generated/yandex/cloud/airflow/index.ts | 3 + .../yandex/cloud/airflow/v1/cluster.ts | 1979 +++++ .../cloud/airflow/v1/cluster_service.ts | 2502 +++++++ .../yandex/cloud/airflow/v1/common.ts | 155 + .../yandex/cloud/apploadbalancer/index.ts | 26 +- .../cloud/apploadbalancer/v1/load_balancer.ts | 2 +- .../v1/load_balancer_service.ts | 2 +- .../yandex/cloud/audittrails/index.ts | 2 + .../yandex/cloud/audittrails/v1/trail.ts | 2297 ++++++ .../cloud/audittrails/v1/trail_service.ts | 1898 +++++ src/generated/yandex/cloud/backup/index.ts | 14 +- .../yandex/cloud/backup/v1/policy.ts | 115 +- .../yandex/cloud/backup/v1/policy_service.ts | 33 + .../cloud/backup/v1/provider_service.ts | 17 + .../yandex/cloud/backup/v1/resource.ts | 249 + .../cloud/backup/v1/resource_service.ts | 282 +- src/generated/yandex/cloud/billing/index.ts | 22 +- .../yandex/cloud/billing/v1/customer.ts | 48 +- .../cloud/billing/v1/customer_service.ts | 16 +- .../yandex/cloud/billing/v1/sku_service.ts | 1 + src/generated/yandex/cloud/cdn/index.ts | 22 +- .../yandex/cloud/cdn/v1/cache_service.ts | 2 +- src/generated/yandex/cloud/cdn/v1/resource.ts | 381 +- src/generated/yandex/cloud/cdn/v1/rule.ts | 175 + .../yandex/cloud/cdn/v1/rule_service.ts | 1170 +++ .../yandex/cloud/certificatemanager/index.ts | 6 +- src/generated/yandex/cloud/cic/index.ts | 14 + .../cic/v1/common/lag_allocation_settings.ts | 238 + .../yandex/cloud/cic/v1/common/lag_info.ts | 128 + .../cloud/cic/v1/common/transceiver_type.ts | 66 + src/generated/yandex/cloud/cic/v1/partner.ts | 172 + .../yandex/cloud/cic/v1/partner_service.ts | 456 ++ src/generated/yandex/cloud/cic/v1/peering.ts | 216 + .../yandex/cloud/cic/v1/point_of_presence.ts | 120 + .../cloud/cic/v1/point_of_presence_service.ts | 500 ++ .../yandex/cloud/cic/v1/private_connection.ts | 501 ++ .../cic/v1/private_connection_service.ts | 519 ++ .../yandex/cloud/cic/v1/public_connection.ts | 523 ++ .../cloud/cic/v1/public_connection_service.ts | 519 ++ .../yandex/cloud/cic/v1/trunk_connection.ts | 921 +++ .../cloud/cic/v1/trunk_connection_service.ts | 518 ++ src/generated/yandex/cloud/cloudapps/index.ts | 2 + .../workload/v1/cloud_application.ts | 450 ++ .../workload/v1/cloud_application_service.ts | 376 + .../yandex/cloud/cloudrouter/index.ts | 2 + .../cloud/cloudrouter/v1/routing_instance.ts | 930 +++ .../v1/routing_instance_service.ts | 791 ++ src/generated/yandex/cloud/compute/index.ts | 58 +- src/generated/yandex/cloud/compute/v1/disk.ts | 140 + .../v1/disk_placement_group_service.ts | 112 + .../yandex/cloud/compute/v1/disk_service.ts | 172 + .../cloud/compute/v1/filesystem_service.ts | 112 + .../cloud/compute/v1/gpu_cluster_service.ts | 112 + .../cloud/compute/v1/hardware_generation.ts | 331 + .../yandex/cloud/compute/v1/host_group.ts | 156 +- .../cloud/compute/v1/host_group_service.ts | 420 +- .../yandex/cloud/compute/v1/image.ts | 32 + .../yandex/cloud/compute/v1/image_service.ts | 144 + .../yandex/cloud/compute/v1/instance.ts | 230 +- .../cloud/compute/v1/instance_service.ts | 1430 +++- .../v1/instancegroup/instance_group.ts | 412 +- .../yandex/cloud/compute/v1/maintenance.ts | 50 + .../compute/v1/placement_group_service.ts | 112 + .../yandex/cloud/compute/v1/snapshot.ts | 32 + .../compute/v1/snapshot_schedule_service.ts | 112 + .../cloud/compute/v1/snapshot_service.ts | 144 + .../yandex/cloud/containerregistry/index.ts | 28 +- .../containerregistry/v1/registry_service.ts | 15 + .../cloud/containerregistry/v1/scanner.ts | 30 + src/generated/yandex/cloud/dataproc/index.ts | 24 +- .../yandex/cloud/dataproc/manager/v1/job.ts | 298 + .../cloud/dataproc/manager/v1/job_service.ts | 521 ++ .../yandex/cloud/datasphere/index.ts | 33 +- .../yandex/cloud/datasphere/v2/community.ts | 15 + .../cloud/datasphere/v2/community_service.ts | 606 ++ .../cloud/datasphere/v2/dataset_service.ts | 311 + .../datasphere/v2/docker_image_service.ts | 197 + .../yandex/cloud/datasphere/v2/jobs/jobs.ts | 2531 +++++++ .../datasphere/v2/jobs/project_job_service.ts | 3623 +++++++++ .../yandex/cloud/datasphere/v2/project.ts | 111 + .../cloud/datasphere/v2/project_service.ts | 677 +- .../cloud/datasphere/v2/resource_types.ts | 84 + .../cloud/datasphere/v2/restrictions.ts | 494 ++ .../yandex/cloud/datasphere/v2/s3_service.ts | 295 + .../yandex/cloud/datatransfer/index.ts | 28 +- .../yandex/cloud/datatransfer/v1/endpoint.ts | 65 + .../datatransfer/v1/endpoint/clickhouse.ts | 251 +- .../cloud/datatransfer/v1/endpoint/common.ts | 70 +- .../cloud/datatransfer/v1/endpoint/kafka.ts | 82 +- .../cloud/datatransfer/v1/endpoint/metrika.ts | 300 + .../cloud/datatransfer/v1/endpoint/mongo.ts | 122 +- .../cloud/datatransfer/v1/endpoint/mysql.ts | 222 +- .../cloud/datatransfer/v1/endpoint/parsers.ts | 17 + .../datatransfer/v1/endpoint/postgres.ts | 204 +- .../cloud/datatransfer/v1/endpoint/ydb.ts | 224 +- .../cloud/datatransfer/v1/endpoint/yds.ts | 503 ++ .../yandex/cloud/datatransfer/v1/transfer.ts | 2119 +++++- .../cloud/datatransfer/v1/transfer_service.ts | 210 +- src/generated/yandex/cloud/dns/index.ts | 4 +- src/generated/yandex/cloud/dns/v1/dns_zone.ts | 17 + .../yandex/cloud/dns/v1/dns_zone_service.ts | 34 + src/generated/yandex/cloud/iam/index.ts | 37 +- src/generated/yandex/cloud/iam/v1/api_key.ts | 55 + .../yandex/cloud/iam/v1/api_key_service.ts | 307 + .../iam/v1/awscompatibility/access_key.ts | 20 + .../yandex/cloud/iam/v1/iam_token_service.ts | 192 +- src/generated/yandex/cloud/iam/v1/key.ts | 20 + .../yandex/cloud/iam/v1/refresh_token.ts | 308 + .../cloud/iam/v1/refresh_token_service.ts | 831 +++ src/generated/yandex/cloud/iam/v1/resource.ts | 118 + .../yandex/cloud/iam/v1/service_account.ts | 21 + .../yandex/cloud/iam/v1/service_control.ts | 374 + .../cloud/iam/v1/service_control_service.ts | 1067 +++ .../iam/v1/workload/federated_credential.ts | 197 + .../workload/federated_credential_service.ts | 946 +++ .../cloud/iam/v1/workload/oidc/federation.ts | 383 + .../v1/workload/oidc/federation_service.ts | 1524 ++++ src/generated/yandex/cloud/index.ts | 9 + .../yandex/cloud/iot/broker/v1/broker.ts | 141 + .../cloud/iot/broker/v1/broker_service.ts | 43 +- .../yandex/cloud/iot/devices/v1/registry.ts | 148 + .../cloud/iot/devices/v1/registry_service.ts | 393 +- src/generated/yandex/cloud/iot/index.ts | 18 +- src/generated/yandex/cloud/k8s/index.ts | 18 +- .../cloud/k8s/marketplace/v1/helm_release.ts | 346 + .../marketplace/v1/helm_release_service.ts | 1312 ++++ src/generated/yandex/cloud/k8s/v1/cluster.ts | 2 +- .../yandex/cloud/k8s/v1/version_service.ts | 2 +- src/generated/yandex/cloud/kms/index.ts | 18 +- .../yandex/cloud/loadbalancer/index.ts | 10 +- .../agent/v1/agent_registration_service.ts | 150 + .../loadtesting/agent/v1/agent_service.ts | 526 ++ .../cloud/loadtesting/agent/v1/job_service.ts | 1 + .../yandex/cloud/loadtesting/agent/v1/test.ts | 447 +- .../loadtesting/agent/v1/test_service.ts | 591 +- .../cloud/loadtesting/api/v1/agent/agent.ts | 171 + .../api/v1/agent/create_compute_instance.ts | 18 + .../loadtesting/api/v1/agent/log_settings.ts | 107 + .../cloud/loadtesting/api/v1/agent/status.ts | 18 + .../cloud/loadtesting/api/v1/agent_service.ts | 650 ++ .../loadtesting/api/v1/common/quantiles.ts | 302 + .../cloud/loadtesting/api/v1/common/tag.ts | 115 + .../cloud/loadtesting/api/v1/config/config.ts | 206 + .../loadtesting/api/v1/config_service.ts | 825 ++ .../api/v1/regression/dashboard.ts | 343 + .../loadtesting/api/v1/regression/widget.ts | 665 ++ .../api/v1/regression_dashboard_service.ts | 1272 ++++ .../cloud/loadtesting/api/v1/report/kpi.ts | 1177 +++ .../loadtesting/api/v1/report/kpi_value.ts | 135 + .../cloud/loadtesting/api/v1/report/status.ts | 59 + .../loadtesting/api/v1/report/table/report.ts | 375 + .../loadtesting/api/v1/report_service.ts | 698 ++ .../loadtesting/api/v1/test/agent_selector.ts | 140 + .../api/v1/test/artifact_settings.ts | 176 + .../cloud/loadtesting/api/v1/test/details.ts | 182 + .../loadtesting/api/v1/test/file_pointer.ts | 116 + .../api/v1/test/imbalance_point.ts | 178 + .../loadtesting/api/v1/test/object_storage.ts | 122 + .../api/v1/test/single_agent_configuration.ts | 297 + .../cloud/loadtesting/api/v1/test/status.ts | 140 + .../cloud/loadtesting/api/v1/test/summary.ts | 322 + .../cloud/loadtesting/api/v1/test/test.ts | 193 + .../cloud/loadtesting/api/v1/test_service.ts | 1023 +++ .../yandex/cloud/loadtesting/index.ts | 48 +- src/generated/yandex/cloud/lockbox/index.ts | 8 +- .../yandex/cloud/lockbox/v1/secret.ts | 312 + .../yandex/cloud/lockbox/v1/secret_service.ts | 68 +- src/generated/yandex/cloud/logging/index.ts | 20 +- .../yandex/cloud/logging/v1/export.ts | 336 + .../yandex/cloud/logging/v1/export_service.ts | 1961 ++++- .../yandex/cloud/marketplace/index.ts | 20 +- .../saas/v1/instance_service.ts | 173 + .../licensemanager/saas/v1/lock_service.ts | 367 + .../marketplace/licensemanager/v1/instance.ts | 19 + .../licensemanager/v1/instance_service.ts | 49 + .../marketplace/licensemanager/v1/lock.ts | 26 + .../licensemanager/v1/lock_service.ts | 339 +- .../marketplace/licensemanager/v1/template.ts | 15 + .../cloud/mdb/clickhouse/v1/backup_service.ts | 185 + .../yandex/cloud/mdb/clickhouse/v1/cluster.ts | 101 +- .../mdb/clickhouse/v1/cluster_service.ts | 963 ++- .../mdb/clickhouse/v1/config/clickhouse.ts | 1862 ++++- .../cloud/mdb/clickhouse/v1/format_schema.ts | 9 + .../clickhouse/v1/format_schema_service.ts | 75 + .../yandex/cloud/mdb/clickhouse/v1/user.ts | 252 + .../cloud/mdb/elasticsearch/v1/cluster.ts | 53 +- .../mdb/elasticsearch/v1/cluster_service.ts | 15 + .../yandex/cloud/mdb/greenplum/v1/backup.ts | 132 + .../cloud/mdb/greenplum/v1/backup_service.ts | 30 +- .../yandex/cloud/mdb/greenplum/v1/cluster.ts | 82 + .../cloud/mdb/greenplum/v1/cluster_service.ts | 565 ++ .../yandex/cloud/mdb/greenplum/v1/config.ts | 259 +- .../yandex/cloud/mdb/greenplum/v1/hba_rule.ts | 302 + .../mdb/greenplum/v1/hba_rule_service.ts | 992 +++ .../yandex/cloud/mdb/greenplum/v1/host.ts | 8 +- .../yandex/cloud/mdb/greenplum/v1/pxf.ts | 2312 +++++- .../cloud/mdb/greenplum/v1/pxf_service.ts | 972 +++ src/generated/yandex/cloud/mdb/index.ts | 332 +- .../yandex/cloud/mdb/kafka/v1/cluster.ts | 187 +- .../cloud/mdb/kafka/v1/cluster_service.ts | 32 + .../yandex/cloud/mdb/kafka/v1/topic.ts | 934 +-- .../yandex/cloud/mdb/kafka/v1/user.ts | 6 +- .../yandex/cloud/mdb/mongodb/v1/backup.ts | 16 + .../yandex/cloud/mdb/mongodb/v1/cluster.ts | 2161 +++++- .../cloud/mdb/mongodb/v1/cluster_service.ts | 6606 ++++++++++++----- .../cloud/mdb/mongodb/v1/config/mongodb.ts | 3279 ++++++++ .../cloud/mdb/mongodb/v1/config/mongodb4_2.ts | 651 ++ .../cloud/mdb/mongodb/v1/config/mongodb4_4.ts | 651 ++ .../v1/config/mongodb4_4_enterprise.ts | 584 +- .../cloud/mdb/mongodb/v1/config/mongodb5_0.ts | 678 ++ .../v1/config/mongodb5_0_enterprise.ts | 611 +- .../cloud/mdb/mongodb/v1/config/mongodb6_0.ts | 678 ++ .../v1/config/mongodb6_0_enterprise.ts | 611 +- .../yandex/cloud/mdb/mysql/v1/backup.ts | 56 + .../cloud/mdb/mysql/v1/backup_service.ts | 31 + .../yandex/cloud/mdb/mysql/v1/cluster.ts | 17 +- .../cloud/mdb/mysql/v1/cluster_service.ts | 19 +- .../cloud/mdb/mysql/v1/config/mysql5_7.ts | 49 + .../cloud/mdb/mysql/v1/config/mysql8_0.ts | 49 + .../yandex/cloud/mdb/opensearch/v1/auth.ts | 27 + .../yandex/cloud/mdb/opensearch/v1/cluster.ts | 190 +- .../mdb/opensearch/v1/cluster_service.ts | 381 +- .../yandex/cloud/mdb/postgresql/v1/backup.ts | 56 + .../yandex/cloud/mdb/postgresql/v1/cluster.ts | 43 +- .../mdb/postgresql/v1/cluster_service.ts | 27 +- .../mdb/postgresql/v1/config/postgresql10.ts | 66 + .../postgresql/v1/config/postgresql10_1c.ts | 66 + .../mdb/postgresql/v1/config/postgresql11.ts | 66 + .../postgresql/v1/config/postgresql11_1c.ts | 66 + .../mdb/postgresql/v1/config/postgresql12.ts | 66 + .../postgresql/v1/config/postgresql12_1c.ts | 66 + .../mdb/postgresql/v1/config/postgresql13.ts | 66 + .../postgresql/v1/config/postgresql13_1c.ts | 66 + .../mdb/postgresql/v1/config/postgresql14.ts | 66 + .../postgresql/v1/config/postgresql14_1c.ts | 66 + .../mdb/postgresql/v1/config/postgresql15.ts | 72 + .../postgresql/v1/config/postgresql15_1c.ts | 72 + .../mdb/postgresql/v1/config/postgresql16.ts | 72 + .../postgresql/v1/config/postgresql16_1c.ts | 72 + .../mdb/postgresql/v1/config/postgresql9_6.ts | 3 + .../yandex/cloud/mdb/postgresql/v1/user.ts | 340 +- .../cloud/mdb/postgresql/v1/user_service.ts | 25 + .../cloud/mdb/redis/v1/backup_service.ts | 170 + .../yandex/cloud/mdb/redis/v1/cluster.ts | 183 +- .../cloud/mdb/redis/v1/cluster_service.ts | 292 +- .../yandex/cloud/mdb/redis/v1/config/redis.ts | 2 +- .../cloud/mdb/redis/v1/config/redis5_0.ts | 2 +- .../cloud/mdb/redis/v1/config/redis6_0.ts | 2 +- .../cloud/mdb/redis/v1/config/redis6_2.ts | 2 +- .../cloud/mdb/redis/v1/config/redis7_0.ts | 2 +- .../yandex/cloud/monitoring/index.ts | 18 +- .../cloud/monitoring/v3/chart_widget.ts | 271 + .../yandex/cloud/monitoring/v3/dashboard.ts | 37 + .../cloud/monitoring/v3/dashboard_service.ts | 74 + src/generated/yandex/cloud/oauth/claims.ts | 44 + .../yandex/cloud/organizationmanager/index.ts | 29 +- .../cloud/organizationmanager/v1/group.ts | 2 +- .../v1/os_login_service.ts | 2431 ++++++ .../v1/saml/federation_service.ts | 323 + .../organizationmanager/v1/user_ssh_key.ts | 237 + .../v1/user_ssh_key_service.ts | 1148 +++ .../yandex/cloud/resourcemanager/index.ts | 8 +- .../cloud/resourcemanager/v1/cloud_service.ts | 35 + .../resourcemanager/v1/folder_service.ts | 35 + .../serverless/apigateway/v1/apigateway.ts | 24 + .../apigateway/v1/apigateway_service.ts | 47 + .../serverless/containers/v1/container.ts | 360 +- .../containers/v1/container_service.ts | 19 +- .../cloud/serverless/eventrouter/v1/bus.ts | 398 + .../serverless/eventrouter/v1/bus_service.ts | 1730 +++++ .../serverless/eventrouter/v1/connector.ts | 836 +++ .../eventrouter/v1/connector_service.ts | 2192 ++++++ .../eventrouter/v1/event_service.ts | 186 + .../cloud/serverless/eventrouter/v1/rule.ts | 2025 +++++ .../serverless/eventrouter/v1/rule_service.ts | 2156 ++++++ .../cloud/serverless/functions/v1/function.ts | 433 +- .../functions/v1/function_service.ts | 54 + .../functions/v1/network_service.ts | 1417 ++++ .../yandex/cloud/serverless/index.ts | 39 +- .../cloud/serverless/triggers/v1/trigger.ts | 407 + .../serverless/workflows/v1/execution.ts | 681 ++ .../workflows/v1/execution_service.ts | 1177 +++ .../serverless/workflows/v1/history_entry.ts | 770 ++ .../cloud/serverless/workflows/v1/workflow.ts | 991 +++ .../workflows/v1/workflow_service.ts | 1855 +++++ src/generated/yandex/cloud/service_clients.ts | 371 +- .../yandex/cloud/smartcaptcha/index.ts | 2 + .../yandex/cloud/smartcaptcha/v1/captcha.ts | 1882 +++++ .../cloud/smartcaptcha/v1/captcha_service.ts | 1303 ++++ .../yandex/cloud/smartwebsecurity/index.ts | 8 + .../advanced_rate_limiter_profile.ts | 1437 ++++ .../advanced_rate_limiter_profile_service.ts | 1460 ++++ .../smartwebsecurity/v1/security_profile.ts | 2275 ++++++ .../v1/security_profile_service.ts | 1506 ++++ .../v1/waf/rule_set_descriptor.ts | 300 + .../v1/waf/rule_set_descriptor_service.ts | 201 + .../smartwebsecurity/v1/waf/waf_profile.ts | 1168 +++ .../v1/waf/waf_profile_service.ts | 1513 ++++ .../yandex/cloud/speechsense/index.ts | 19 + .../v1/analysis/conversation_statistics.ts | 148 + .../v1/analysis/interrupts_statistics.ts | 287 + .../cloud/speechsense/v1/analysis/points.ts | 195 + .../v1/analysis/predefined_classifiers.ts | 410 + .../v1/analysis/silence_statistics.ts | 204 + .../v1/analysis/speaker_statistics.ts | 254 + .../v1/analysis/speech_statistics.ts | 205 + .../v1/analysis/statistics_common.ts | 372 + .../speechsense/v1/analysis/summarization.ts | 344 + .../v1/analysis/text_classifiers.ts | 427 ++ .../speechsense/v1/analysis/transcription.ts | 835 +++ .../v1/analysis/utterance_statistics.ts | 301 + .../yandex/cloud/speechsense/v1/audio.ts | 714 ++ .../yandex/cloud/speechsense/v1/project.ts | 336 + .../cloud/speechsense/v1/project_service.ts | 295 + .../yandex/cloud/speechsense/v1/search.ts | 1302 ++++ .../yandex/cloud/speechsense/v1/talk.ts | 628 ++ .../cloud/speechsense/v1/talk_service.ts | 1693 +++++ .../yandex/cloud/speechsense/v1/text.ts | 302 + src/generated/yandex/cloud/storage/index.ts | 5 +- .../yandex/cloud/storage/v1/bucket.ts | 317 + .../yandex/cloud/storage/v1/s3api.ts | 2295 ++++++ src/generated/yandex/cloud/video/index.ts | 13 + .../yandex/cloud/video/v1/channel.ts | 331 + .../yandex/cloud/video/v1/channel_service.ts | 1331 ++++ .../yandex/cloud/video/v1/episode.ts | 563 ++ .../yandex/cloud/video/v1/episode_service.ts | 2403 ++++++ .../yandex/cloud/video/v1/manifest.ts | 162 + src/generated/yandex/cloud/video/v1/stream.ts | 674 ++ .../yandex/cloud/video/v1/stream_line.ts | 1134 +++ .../cloud/video/v1/stream_line_service.ts | 2819 +++++++ .../yandex/cloud/video/v1/stream_service.ts | 1966 +++++ .../yandex/cloud/video/v1/thumbnail.ts | 162 + .../cloud/video/v1/thumbnail_service.ts | 1030 +++ src/generated/yandex/cloud/video/v1/video.ts | 762 ++ .../yandex/cloud/video/v1/video_service.ts | 2554 +++++++ src/generated/yandex/cloud/vpc/index.ts | 26 +- src/generated/yandex/cloud/vpc/v1/address.ts | 164 +- .../yandex/cloud/vpc/v1/address_service.ts | 160 + src/generated/yandex/cloud/vpc/v1/gateway.ts | 12 +- src/generated/yandex/cloud/vpc/v1/network.ts | 12 +- .../vpc/v1/privatelink/private_endpoint.ts | 760 ++ .../privatelink/private_endpoint_service.ts | 2124 ++++++ .../yandex/cloud/vpc/v1/route_table.ts | 18 +- .../yandex/cloud/vpc/v1/security_group.ts | 47 +- .../cloud/vpc/v1/security_group_service.ts | 186 +- src/generated/yandex/cloud/vpc/v1/subnet.ts | 19 +- .../yandex/cloud/vpc/v1/subnet_service.ts | 203 +- src/generated/yandex/cloud/ydb/index.ts | 20 +- src/service-endpoints.ts | 9 + src/session.ts | 4 +- src/token-service/iam-token-service.ts | 4 +- src/utils/operation/wait-for.ts | 16 +- tsconfig.json | 3 +- 394 files changed, 172196 insertions(+), 6580 deletions(-) create mode 100644 examples/chat-with-assistant.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/assistant.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/assistant_service.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/common.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/runs/run.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/runs/run_service.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/searchindex/common.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index_file.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index_file_service.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index_service.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/threads/message.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/threads/message_service.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/threads/thread.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/threads/thread_service.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/users/user.ts create mode 100644 src/generated/yandex/cloud/ai/assistants/v1/users/user_service.ts create mode 100644 src/generated/yandex/cloud/ai/common/common.ts create mode 100644 src/generated/yandex/cloud/ai/files/v1/file.ts create mode 100644 src/generated/yandex/cloud/ai/files/v1/file_service.ts create mode 100644 src/generated/yandex/cloud/ai/foundation_models/v1/embedding/embedding_service.ts create mode 100644 src/generated/yandex/cloud/ai/foundation_models/v1/image_generation/image_generation.ts create mode 100644 src/generated/yandex/cloud/ai/foundation_models/v1/image_generation/image_generation_service.ts create mode 100644 src/generated/yandex/cloud/ai/foundation_models/v1/text_classification/text_classification.ts create mode 100644 src/generated/yandex/cloud/ai/foundation_models/v1/text_classification/text_classification_service.ts create mode 100644 src/generated/yandex/cloud/ai/foundation_models/v1/text_common.ts create mode 100644 src/generated/yandex/cloud/ai/foundation_models/v1/text_generation/text_generation_service.ts create mode 100644 src/generated/yandex/cloud/airflow/index.ts create mode 100644 src/generated/yandex/cloud/airflow/v1/cluster.ts create mode 100644 src/generated/yandex/cloud/airflow/v1/cluster_service.ts create mode 100644 src/generated/yandex/cloud/airflow/v1/common.ts create mode 100644 src/generated/yandex/cloud/audittrails/index.ts create mode 100644 src/generated/yandex/cloud/audittrails/v1/trail.ts create mode 100644 src/generated/yandex/cloud/audittrails/v1/trail_service.ts create mode 100644 src/generated/yandex/cloud/cdn/v1/rule.ts create mode 100644 src/generated/yandex/cloud/cdn/v1/rule_service.ts create mode 100644 src/generated/yandex/cloud/cic/index.ts create mode 100644 src/generated/yandex/cloud/cic/v1/common/lag_allocation_settings.ts create mode 100644 src/generated/yandex/cloud/cic/v1/common/lag_info.ts create mode 100644 src/generated/yandex/cloud/cic/v1/common/transceiver_type.ts create mode 100644 src/generated/yandex/cloud/cic/v1/partner.ts create mode 100644 src/generated/yandex/cloud/cic/v1/partner_service.ts create mode 100644 src/generated/yandex/cloud/cic/v1/peering.ts create mode 100644 src/generated/yandex/cloud/cic/v1/point_of_presence.ts create mode 100644 src/generated/yandex/cloud/cic/v1/point_of_presence_service.ts create mode 100644 src/generated/yandex/cloud/cic/v1/private_connection.ts create mode 100644 src/generated/yandex/cloud/cic/v1/private_connection_service.ts create mode 100644 src/generated/yandex/cloud/cic/v1/public_connection.ts create mode 100644 src/generated/yandex/cloud/cic/v1/public_connection_service.ts create mode 100644 src/generated/yandex/cloud/cic/v1/trunk_connection.ts create mode 100644 src/generated/yandex/cloud/cic/v1/trunk_connection_service.ts create mode 100644 src/generated/yandex/cloud/cloudapps/index.ts create mode 100644 src/generated/yandex/cloud/cloudapps/workload/v1/cloud_application.ts create mode 100644 src/generated/yandex/cloud/cloudapps/workload/v1/cloud_application_service.ts create mode 100644 src/generated/yandex/cloud/cloudrouter/index.ts create mode 100644 src/generated/yandex/cloud/cloudrouter/v1/routing_instance.ts create mode 100644 src/generated/yandex/cloud/cloudrouter/v1/routing_instance_service.ts create mode 100644 src/generated/yandex/cloud/compute/v1/hardware_generation.ts create mode 100644 src/generated/yandex/cloud/compute/v1/maintenance.ts create mode 100644 src/generated/yandex/cloud/datasphere/v2/dataset_service.ts create mode 100644 src/generated/yandex/cloud/datasphere/v2/docker_image_service.ts create mode 100644 src/generated/yandex/cloud/datasphere/v2/jobs/jobs.ts create mode 100644 src/generated/yandex/cloud/datasphere/v2/jobs/project_job_service.ts create mode 100644 src/generated/yandex/cloud/datasphere/v2/resource_types.ts create mode 100644 src/generated/yandex/cloud/datasphere/v2/restrictions.ts create mode 100644 src/generated/yandex/cloud/datasphere/v2/s3_service.ts create mode 100644 src/generated/yandex/cloud/datatransfer/v1/endpoint/metrika.ts create mode 100644 src/generated/yandex/cloud/datatransfer/v1/endpoint/yds.ts create mode 100644 src/generated/yandex/cloud/iam/v1/refresh_token.ts create mode 100644 src/generated/yandex/cloud/iam/v1/refresh_token_service.ts create mode 100644 src/generated/yandex/cloud/iam/v1/resource.ts create mode 100644 src/generated/yandex/cloud/iam/v1/service_control.ts create mode 100644 src/generated/yandex/cloud/iam/v1/service_control_service.ts create mode 100644 src/generated/yandex/cloud/iam/v1/workload/federated_credential.ts create mode 100644 src/generated/yandex/cloud/iam/v1/workload/federated_credential_service.ts create mode 100644 src/generated/yandex/cloud/iam/v1/workload/oidc/federation.ts create mode 100644 src/generated/yandex/cloud/iam/v1/workload/oidc/federation_service.ts create mode 100644 src/generated/yandex/cloud/k8s/marketplace/v1/helm_release.ts create mode 100644 src/generated/yandex/cloud/k8s/marketplace/v1/helm_release_service.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/agent/log_settings.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/common/quantiles.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/common/tag.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/config/config.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/config_service.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/regression/dashboard.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/regression/widget.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/regression_dashboard_service.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/report/kpi.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/report/kpi_value.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/report/status.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/report/table/report.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/report_service.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/test/agent_selector.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/test/artifact_settings.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/test/details.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/test/file_pointer.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/test/imbalance_point.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/test/object_storage.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/test/single_agent_configuration.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/test/status.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/test/summary.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/test/test.ts create mode 100644 src/generated/yandex/cloud/loadtesting/api/v1/test_service.ts create mode 100644 src/generated/yandex/cloud/marketplace/licensemanager/saas/v1/instance_service.ts create mode 100644 src/generated/yandex/cloud/marketplace/licensemanager/saas/v1/lock_service.ts create mode 100644 src/generated/yandex/cloud/mdb/greenplum/v1/hba_rule.ts create mode 100644 src/generated/yandex/cloud/mdb/greenplum/v1/hba_rule_service.ts create mode 100644 src/generated/yandex/cloud/mdb/greenplum/v1/pxf_service.ts create mode 100644 src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb.ts create mode 100644 src/generated/yandex/cloud/organizationmanager/v1/os_login_service.ts create mode 100644 src/generated/yandex/cloud/organizationmanager/v1/user_ssh_key.ts create mode 100644 src/generated/yandex/cloud/organizationmanager/v1/user_ssh_key_service.ts create mode 100644 src/generated/yandex/cloud/serverless/eventrouter/v1/bus.ts create mode 100644 src/generated/yandex/cloud/serverless/eventrouter/v1/bus_service.ts create mode 100644 src/generated/yandex/cloud/serverless/eventrouter/v1/connector.ts create mode 100644 src/generated/yandex/cloud/serverless/eventrouter/v1/connector_service.ts create mode 100644 src/generated/yandex/cloud/serverless/eventrouter/v1/event_service.ts create mode 100644 src/generated/yandex/cloud/serverless/eventrouter/v1/rule.ts create mode 100644 src/generated/yandex/cloud/serverless/eventrouter/v1/rule_service.ts create mode 100644 src/generated/yandex/cloud/serverless/functions/v1/network_service.ts create mode 100644 src/generated/yandex/cloud/serverless/workflows/v1/execution.ts create mode 100644 src/generated/yandex/cloud/serverless/workflows/v1/execution_service.ts create mode 100644 src/generated/yandex/cloud/serverless/workflows/v1/history_entry.ts create mode 100644 src/generated/yandex/cloud/serverless/workflows/v1/workflow.ts create mode 100644 src/generated/yandex/cloud/serverless/workflows/v1/workflow_service.ts create mode 100644 src/generated/yandex/cloud/smartcaptcha/index.ts create mode 100644 src/generated/yandex/cloud/smartcaptcha/v1/captcha.ts create mode 100644 src/generated/yandex/cloud/smartcaptcha/v1/captcha_service.ts create mode 100644 src/generated/yandex/cloud/smartwebsecurity/index.ts create mode 100644 src/generated/yandex/cloud/smartwebsecurity/v1/advanced_rate_limiter/advanced_rate_limiter_profile.ts create mode 100644 src/generated/yandex/cloud/smartwebsecurity/v1/advanced_rate_limiter/advanced_rate_limiter_profile_service.ts create mode 100644 src/generated/yandex/cloud/smartwebsecurity/v1/security_profile.ts create mode 100644 src/generated/yandex/cloud/smartwebsecurity/v1/security_profile_service.ts create mode 100644 src/generated/yandex/cloud/smartwebsecurity/v1/waf/rule_set_descriptor.ts create mode 100644 src/generated/yandex/cloud/smartwebsecurity/v1/waf/rule_set_descriptor_service.ts create mode 100644 src/generated/yandex/cloud/smartwebsecurity/v1/waf/waf_profile.ts create mode 100644 src/generated/yandex/cloud/smartwebsecurity/v1/waf/waf_profile_service.ts create mode 100644 src/generated/yandex/cloud/speechsense/index.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/analysis/conversation_statistics.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/analysis/interrupts_statistics.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/analysis/points.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/analysis/predefined_classifiers.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/analysis/silence_statistics.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/analysis/speaker_statistics.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/analysis/speech_statistics.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/analysis/statistics_common.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/analysis/summarization.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/analysis/text_classifiers.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/analysis/transcription.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/analysis/utterance_statistics.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/audio.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/project.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/project_service.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/search.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/talk.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/talk_service.ts create mode 100644 src/generated/yandex/cloud/speechsense/v1/text.ts create mode 100644 src/generated/yandex/cloud/storage/v1/s3api.ts create mode 100644 src/generated/yandex/cloud/video/index.ts create mode 100644 src/generated/yandex/cloud/video/v1/channel.ts create mode 100644 src/generated/yandex/cloud/video/v1/channel_service.ts create mode 100644 src/generated/yandex/cloud/video/v1/episode.ts create mode 100644 src/generated/yandex/cloud/video/v1/episode_service.ts create mode 100644 src/generated/yandex/cloud/video/v1/manifest.ts create mode 100644 src/generated/yandex/cloud/video/v1/stream.ts create mode 100644 src/generated/yandex/cloud/video/v1/stream_line.ts create mode 100644 src/generated/yandex/cloud/video/v1/stream_line_service.ts create mode 100644 src/generated/yandex/cloud/video/v1/stream_service.ts create mode 100644 src/generated/yandex/cloud/video/v1/thumbnail.ts create mode 100644 src/generated/yandex/cloud/video/v1/thumbnail_service.ts create mode 100644 src/generated/yandex/cloud/video/v1/video.ts create mode 100644 src/generated/yandex/cloud/video/v1/video_service.ts create mode 100644 src/generated/yandex/cloud/vpc/v1/privatelink/private_endpoint.ts create mode 100644 src/generated/yandex/cloud/vpc/v1/privatelink/private_endpoint_service.ts diff --git a/cloudapi b/cloudapi index 1023048f..bb548974 160000 --- a/cloudapi +++ b/cloudapi @@ -1 +1 @@ -Subproject commit 1023048f50d4bcfc296e178b40529305ec5443e1 +Subproject commit bb548974733ad55d3cfb28171d2bda97d87fd701 diff --git a/examples/chat-with-assistant.ts b/examples/chat-with-assistant.ts new file mode 100644 index 00000000..5e05c59a --- /dev/null +++ b/examples/chat-with-assistant.ts @@ -0,0 +1,102 @@ +import { serviceClients, Session, cloudApi } from '@yandex-cloud/nodejs-sdk'; +import path from 'path'; +import dotenv from 'dotenv'; + +dotenv.config({ path: path.resolve(__dirname, '.env') }); + +const getEnv = (envName: string, defaultValue?: string): string => { + const envValue = process.env[envName] || defaultValue; + + console.log(process.env); + + if (!envValue) { + throw new Error(`Env variable ${envName} is not defined`); + } + + return envValue; +}; + +const iamToken = getEnv('YC_IAM_TOKEN'); +const folderId = getEnv('YC_FOLDER_ID'); + +(async () => { + const session = new Session({ iamToken }); + + const assistantApi = cloudApi.ai.assistants_v1_assistant_service; + const messageApi = cloudApi.ai.assistants_v1_threads_message_service; + const threadApi = cloudApi.ai.assistants_v1_threads_thread_service; + const runApi = cloudApi.ai.assistants_v1_runs_run_service; + + // const assistantClient = session.client(assistantApi.AssistantServiceClient); + const assistantClient = session.client( + serviceClients.AssistantServiceClient, + ); + + // const messageClient = session.client(messageApi.MessageServiceClient); + const messageClient = session.client( + serviceClients.AssistantMessageServiceClient, + ); + + // const threadClient = session.client(threadApi.ThreadServiceClient); + const threadClient = session.client( + serviceClients.AssistantThreadServiceClient, + ); + + // const runClient = session.client(runApi.RunServiceClient); + const runClient = session.client(serviceClients.AssistantRunServiceClient); + + const thread = await threadClient.create( + threadApi.CreateThreadRequest.fromPartial({ + name: 'qwerty', + folderId, + }), + ); + + console.log({ thread }); + + const assistant = await assistantClient.create( + assistantApi.CreateAssistantRequest.fromPartial({ + name: 'qwerty', + folderId, + modelUri: `gpt://${folderId}/yandexgpt/latest`, + }), + ); + + console.log({ assistant }); + + const assistantId = assistant.id; + const threadId = thread.id; + + const message = await messageClient.create( + messageApi.CreateMessageRequest.fromPartial({ + threadId, + content: { + content: [{ text: { content: 'qwerty' } }], + }, + }), + ); + + console.log({ message }); + + const run = await runClient.create( + runApi.CreateRunRequest.fromPartial({ + threadId, + assistantId, + }), + ); + + console.log({ run }); + + const asyncIterableForStreamEvent = runClient.listen( + runApi.ListenRunRequest.fromPartial({ runId: run.id }), + ); + + let lastStreamEvent: cloudApi.ai.assistants_v1_runs_run_service.StreamEvent | null = null; + + for await (const streamEvent of asyncIterableForStreamEvent) { + lastStreamEvent = streamEvent; + } + + console.dir({ lastStreamEvent }); + console.dir(lastStreamEvent.completedMessage.content.content); +})(); diff --git a/package.json b/package.json index 39498ec3..df737e25 100644 --- a/package.json +++ b/package.json @@ -66,9 +66,9 @@ "typescript": "^4.5.4" }, "scripts": { - "test": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" jest -c config/jest.ts --passWithNoTests '.*\\.test\\.ts$'", - "lint": "eslint src config", - "build": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" tsc -p .", + "test": "jest -c config/jest.ts --passWithNoTests '.*\\.test\\.ts$'", + "lint": "eslint src/ --quiet --fix", + "build": "tsc -p .", "generate-code": "ts-node scripts/generate-code.ts", "check-endpoints": "ts-node scripts/check-endpoints.ts", "prepare": "husky install", diff --git a/scripts/generate-code.ts b/scripts/generate-code.ts index 59cbaf89..cb11436a 100644 --- a/scripts/generate-code.ts +++ b/scripts/generate-code.ts @@ -19,7 +19,9 @@ fs.mkdirSync(GENERATED_CODE_DIR); const protoFiles = fg.sync('**/*.proto', { cwd: YA_PROTO_DIR, absolute: true }); -logger.debug(`Found ${protoFiles.length} proto files in ${YA_PROTO_DIR} directory`); +logger.debug( + `Found ${protoFiles.length} proto files in ${YA_PROTO_DIR} directory`, +); const commandArgs = [ 'npx --no-install grpc_tools_node_protoc', @@ -34,7 +36,11 @@ logger.debug(`Code generation command: \n ${command}`); cp.execSync(command); -const projectsDirs = fg.sync('*', { cwd: GENERATED_PROJECTS_DIR, onlyDirectories: true, absolute: true }); +const projectsDirs = fg.sync('*', { + cwd: GENERATED_PROJECTS_DIR, + onlyDirectories: true, + absolute: true, +}); logger.debug(`Found ${projectsDirs.length} project directories`, projectsDirs); @@ -72,19 +78,14 @@ for (const projectDir of projectsDirs) { }; const exportStatements = projectModules.map((modulePath) => { - const relativePath = path.relative(projectDir, modulePath); + const relativePath = path + .relative(projectDir, modulePath) + .replace('.ts', ''); + const relativePathSegments = relativePath.split(path.sep); - const firstPathSegment = relativePathSegments[0]; - const moduleName = path.basename(modulePath).replace('.ts', ''); - const serviceName = moduleName.replace('_service', ''); - // Do not use 'vX' as prefixes - const usePathSegmentAsPrefix = relativePathSegments.length > 1 - && firstPathSegment.length > 2 - && firstPathSegment !== serviceName; - const moduleAlias = [ - usePathSegmentAsPrefix ? firstPathSegment : undefined, - moduleName, - ].filter(Boolean).join('_'); + const moduleName = path.basename(modulePath); + + const moduleAlias = relativePathSegments.join('_'); const { ext } = path.parse(modulePath); const moduleWithoutExt = relativePath.replace(ext, ''); @@ -101,7 +102,10 @@ for (const projectDir of projectsDirs) { const indexModuleContent = exportStatements.join('\n'); - logger.debug(`Writing export statements to ${indexModulePath} module`, indexModuleContent); + logger.debug( + `Writing export statements to ${indexModulePath} module`, + indexModuleContent, + ); fs.writeFileSync(indexModulePath, indexModuleContent, 'utf8'); } @@ -110,28 +114,47 @@ for (const projectDir of projectsDirs) { logger.debug('Generating root index module'); const rootIndexModulePath = path.join(GENERATED_PROJECTS_DIR, 'index.ts'); -const serviceClientsModulePath = path.join(GENERATED_PROJECTS_DIR, 'service_clients.ts'); +const serviceClientsModulePath = path.join( + GENERATED_PROJECTS_DIR, + 'service_clients.ts', +); const rootModuleContentParts: string[] = []; const serviceClientsModuleContentParts: string[] = [ - 'import * as cloudApi from \'.\'', + "import * as cloudApi from '.'", ]; +const serviceClientsExportsSet = new Set(); + for (const [indexModulePath, projectMeta] of Object.entries(projectsMeta)) { logger.debug(`Processing ${indexModulePath} module`); - const relativePath = path.relative(GENERATED_PROJECTS_DIR, indexModulePath).replace('index.ts', ''); + const relativePath = path + .relative(GENERATED_PROJECTS_DIR, indexModulePath) + .replace('index.ts', ''); - rootModuleContentParts.push(`export * as ${projectMeta.name} from './${relativePath}'`); + rootModuleContentParts.push( + `export * as ${projectMeta.name} from './${relativePath}'`, + ); for (const serviceMeta of projectMeta.services) { const serviceConfig = servicesConfig[projectMeta.name]?.[serviceMeta.exportAlias]; if (serviceConfig) { - serviceClientsModuleContentParts.push( - // eslint-disable-next-line max-len - `export const ${serviceConfig.exportClassName || serviceConfig.importClassName} = cloudApi.${projectMeta.name}.${serviceMeta.exportAlias}.${serviceConfig.importClassName};`, - ); + delete servicesConfig[projectMeta.name]?.[serviceMeta.exportAlias]; + + const exportStr = `export const ${ + serviceConfig.exportClassName || serviceConfig.importClassName + } = cloudApi.${projectMeta.name}.${serviceMeta.exportAlias}.${ + serviceConfig.importClassName + };`; + + if (serviceClientsExportsSet.has(exportStr)) continue; + + serviceClientsModuleContentParts.push(exportStr); + serviceClientsExportsSet.add(exportStr); } else { - logger.warn(`There is no configuration for service ${serviceMeta.exportAlias} in project ${projectMeta.name}`); + logger.warn( + `There is no configuration for service ${serviceMeta.exportAlias} in project ${projectMeta.name}`, + ); } } } @@ -139,5 +162,26 @@ for (const [indexModulePath, projectMeta] of Object.entries(projectsMeta)) { logger.debug(`Writing result to ${rootIndexModulePath} module`); logger.debug(`Writing result to ${serviceClientsModulePath} module`); -fs.writeFileSync(rootIndexModulePath, rootModuleContentParts.join('\n'), 'utf8'); -fs.writeFileSync(serviceClientsModulePath, serviceClientsModuleContentParts.join('\n'), 'utf8'); +for (const serviceName of Object.keys(servicesConfig)) { + const obj = servicesConfig[serviceName]; + const keys = Object.keys(obj); + + if (keys.length > 0) { + logger.warn( + `There are unused config keys for service ${serviceName}: ${keys.join( + ', ', + )}`, + ); + } +} + +fs.writeFileSync( + rootIndexModulePath, + rootModuleContentParts.join('\n'), + 'utf8', +); +fs.writeFileSync( + serviceClientsModulePath, + serviceClientsModuleContentParts.join('\n'), + 'utf8', +); diff --git a/scripts/services.ts b/scripts/services.ts index 9a0904a8..51c4451e 100644 --- a/scripts/services.ts +++ b/scripts/services.ts @@ -3,250 +3,250 @@ type ServicesConfig = Record:users`: A special system group that represents all members of organization + * with given . It can be used only if the [type] is `system`. + * * `group:federation::users`: A special system group that represents all users of federation + * with given . It can be used only if the [type] is `system`. * * ``: An identifier that represents a user account. * It can be used only if the [type] is `userAccount`, `federatedUser` or `serviceAccount`. */ diff --git a/src/generated/yandex/cloud/ai/assistants/v1/assistant.ts b/src/generated/yandex/cloud/ai/assistants/v1/assistant.ts new file mode 100644 index 00000000..e4f50a11 --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/assistant.ts @@ -0,0 +1,503 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ExpirationConfig } from "../../../../../yandex/cloud/ai/common/common"; +import { + PromptTruncationOptions, + CompletionOptions, + Tool, +} from "../../../../../yandex/cloud/ai/assistants/v1/common"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1"; + +export interface Assistant { + $type: "yandex.cloud.ai.assistants.v1.Assistant"; + id: string; + folderId: string; + name: string; + description: string; + createdBy: string; + createdAt?: Date; + updatedBy: string; + updatedAt?: Date; + expirationConfig?: ExpirationConfig; + expiresAt?: Date; + labels: { [key: string]: string }; + modelUri: string; + instruction: string; + promptTruncationOptions?: PromptTruncationOptions; + completionOptions?: CompletionOptions; + tools: Tool[]; +} + +export interface Assistant_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.Assistant.LabelsEntry"; + key: string; + value: string; +} + +const baseAssistant: object = { + $type: "yandex.cloud.ai.assistants.v1.Assistant", + id: "", + folderId: "", + name: "", + description: "", + createdBy: "", + updatedBy: "", + modelUri: "", + instruction: "", +}; + +export const Assistant = { + $type: "yandex.cloud.ai.assistants.v1.Assistant" as const, + + encode( + message: Assistant, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.createdBy !== "") { + writer.uint32(42).string(message.createdBy); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(50).fork() + ).ldelim(); + } + if (message.updatedBy !== "") { + writer.uint32(58).string(message.updatedBy); + } + if (message.updatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.updatedAt), + writer.uint32(66).fork() + ).ldelim(); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.expiresAt !== undefined) { + Timestamp.encode( + toTimestamp(message.expiresAt), + writer.uint32(82).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + Assistant_LabelsEntry.encode( + { + $type: "yandex.cloud.ai.assistants.v1.Assistant.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(90).fork() + ).ldelim(); + }); + if (message.modelUri !== "") { + writer.uint32(98).string(message.modelUri); + } + if (message.instruction !== "") { + writer.uint32(106).string(message.instruction); + } + if (message.promptTruncationOptions !== undefined) { + PromptTruncationOptions.encode( + message.promptTruncationOptions, + writer.uint32(114).fork() + ).ldelim(); + } + if (message.completionOptions !== undefined) { + CompletionOptions.encode( + message.completionOptions, + writer.uint32(122).fork() + ).ldelim(); + } + for (const v of message.tools) { + Tool.encode(v!, writer.uint32(130).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Assistant { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAssistant } as Assistant; + message.labels = {}; + message.tools = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.createdBy = reader.string(); + break; + case 6: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 7: + message.updatedBy = reader.string(); + break; + case 8: + message.updatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 9: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 10: + message.expiresAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 11: + const entry11 = Assistant_LabelsEntry.decode(reader, reader.uint32()); + if (entry11.value !== undefined) { + message.labels[entry11.key] = entry11.value; + } + break; + case 12: + message.modelUri = reader.string(); + break; + case 13: + message.instruction = reader.string(); + break; + case 14: + message.promptTruncationOptions = PromptTruncationOptions.decode( + reader, + reader.uint32() + ); + break; + case 15: + message.completionOptions = CompletionOptions.decode( + reader, + reader.uint32() + ); + break; + case 16: + message.tools.push(Tool.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Assistant { + const message = { ...baseAssistant } as Assistant; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.updatedBy = + object.updatedBy !== undefined && object.updatedBy !== null + ? String(object.updatedBy) + : ""; + message.updatedAt = + object.updatedAt !== undefined && object.updatedAt !== null + ? fromJsonTimestamp(object.updatedAt) + : undefined; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.expiresAt = + object.expiresAt !== undefined && object.expiresAt !== null + ? fromJsonTimestamp(object.expiresAt) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.modelUri = + object.modelUri !== undefined && object.modelUri !== null + ? String(object.modelUri) + : ""; + message.instruction = + object.instruction !== undefined && object.instruction !== null + ? String(object.instruction) + : ""; + message.promptTruncationOptions = + object.promptTruncationOptions !== undefined && + object.promptTruncationOptions !== null + ? PromptTruncationOptions.fromJSON(object.promptTruncationOptions) + : undefined; + message.completionOptions = + object.completionOptions !== undefined && + object.completionOptions !== null + ? CompletionOptions.fromJSON(object.completionOptions) + : undefined; + message.tools = (object.tools ?? []).map((e: any) => Tool.fromJSON(e)); + return message; + }, + + toJSON(message: Assistant): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.updatedBy !== undefined && (obj.updatedBy = message.updatedBy); + message.updatedAt !== undefined && + (obj.updatedAt = message.updatedAt.toISOString()); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + message.expiresAt !== undefined && + (obj.expiresAt = message.expiresAt.toISOString()); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.modelUri !== undefined && (obj.modelUri = message.modelUri); + message.instruction !== undefined && + (obj.instruction = message.instruction); + message.promptTruncationOptions !== undefined && + (obj.promptTruncationOptions = message.promptTruncationOptions + ? PromptTruncationOptions.toJSON(message.promptTruncationOptions) + : undefined); + message.completionOptions !== undefined && + (obj.completionOptions = message.completionOptions + ? CompletionOptions.toJSON(message.completionOptions) + : undefined); + if (message.tools) { + obj.tools = message.tools.map((e) => (e ? Tool.toJSON(e) : undefined)); + } else { + obj.tools = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Assistant { + const message = { ...baseAssistant } as Assistant; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.createdBy = object.createdBy ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.updatedBy = object.updatedBy ?? ""; + message.updatedAt = object.updatedAt ?? undefined; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.expiresAt = object.expiresAt ?? undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.modelUri = object.modelUri ?? ""; + message.instruction = object.instruction ?? ""; + message.promptTruncationOptions = + object.promptTruncationOptions !== undefined && + object.promptTruncationOptions !== null + ? PromptTruncationOptions.fromPartial(object.promptTruncationOptions) + : undefined; + message.completionOptions = + object.completionOptions !== undefined && + object.completionOptions !== null + ? CompletionOptions.fromPartial(object.completionOptions) + : undefined; + message.tools = object.tools?.map((e) => Tool.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Assistant.$type, Assistant); + +const baseAssistant_LabelsEntry: object = { + $type: "yandex.cloud.ai.assistants.v1.Assistant.LabelsEntry", + key: "", + value: "", +}; + +export const Assistant_LabelsEntry = { + $type: "yandex.cloud.ai.assistants.v1.Assistant.LabelsEntry" as const, + + encode( + message: Assistant_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Assistant_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAssistant_LabelsEntry } as Assistant_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Assistant_LabelsEntry { + const message = { ...baseAssistant_LabelsEntry } as Assistant_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Assistant_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Assistant_LabelsEntry { + const message = { ...baseAssistant_LabelsEntry } as Assistant_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Assistant_LabelsEntry.$type, Assistant_LabelsEntry); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/assistant_service.ts b/src/generated/yandex/cloud/ai/assistants/v1/assistant_service.ts new file mode 100644 index 00000000..cda7b903 --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/assistant_service.ts @@ -0,0 +1,1730 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { ExpirationConfig } from "../../../../../yandex/cloud/ai/common/common"; +import { + PromptTruncationOptions, + CompletionOptions, + Tool, +} from "../../../../../yandex/cloud/ai/assistants/v1/common"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; +import { Assistant } from "../../../../../yandex/cloud/ai/assistants/v1/assistant"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1"; + +export interface CreateAssistantRequest { + $type: "yandex.cloud.ai.assistants.v1.CreateAssistantRequest"; + folderId: string; + name: string; + description: string; + expirationConfig?: ExpirationConfig; + labels: { [key: string]: string }; + modelUri: string; + instruction: string; + promptTruncationOptions?: PromptTruncationOptions; + completionOptions?: CompletionOptions; + tools: Tool[]; +} + +export interface CreateAssistantRequest_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.CreateAssistantRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface GetAssistantRequest { + $type: "yandex.cloud.ai.assistants.v1.GetAssistantRequest"; + assistantId: string; +} + +export interface UpdateAssistantRequest { + $type: "yandex.cloud.ai.assistants.v1.UpdateAssistantRequest"; + assistantId: string; + updateMask?: FieldMask; + name: string; + description: string; + expirationConfig?: ExpirationConfig; + labels: { [key: string]: string }; + modelUri: string; + instruction: string; + promptTruncationOptions?: PromptTruncationOptions; + completionOptions?: CompletionOptions; + tools: Tool[]; +} + +export interface UpdateAssistantRequest_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.UpdateAssistantRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface DeleteAssistantRequest { + $type: "yandex.cloud.ai.assistants.v1.DeleteAssistantRequest"; + assistantId: string; +} + +export interface DeleteAssistantResponse { + $type: "yandex.cloud.ai.assistants.v1.DeleteAssistantResponse"; +} + +export interface ListAssistantsRequest { + $type: "yandex.cloud.ai.assistants.v1.ListAssistantsRequest"; + folderId: string; + pageSize: number; + pageToken: string; +} + +export interface ListAssistantsResponse { + $type: "yandex.cloud.ai.assistants.v1.ListAssistantsResponse"; + assistants: Assistant[]; + nextPageToken: string; +} + +export interface ListAssistantVersionsRequest { + $type: "yandex.cloud.ai.assistants.v1.ListAssistantVersionsRequest"; + assistantId: string; + pageSize: number; + pageToken: string; +} + +export interface AssistantVersion { + $type: "yandex.cloud.ai.assistants.v1.AssistantVersion"; + id: string; + updateMask?: FieldMask; + assistant?: Assistant; +} + +export interface ListAssistantVersionsResponse { + $type: "yandex.cloud.ai.assistants.v1.ListAssistantVersionsResponse"; + versions: AssistantVersion[]; + nextPageToken: string; +} + +const baseCreateAssistantRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.CreateAssistantRequest", + folderId: "", + name: "", + description: "", + modelUri: "", + instruction: "", +}; + +export const CreateAssistantRequest = { + $type: "yandex.cloud.ai.assistants.v1.CreateAssistantRequest" as const, + + encode( + message: CreateAssistantRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(34).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateAssistantRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.ai.assistants.v1.CreateAssistantRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(42).fork() + ).ldelim(); + }); + if (message.modelUri !== "") { + writer.uint32(50).string(message.modelUri); + } + if (message.instruction !== "") { + writer.uint32(58).string(message.instruction); + } + if (message.promptTruncationOptions !== undefined) { + PromptTruncationOptions.encode( + message.promptTruncationOptions, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.completionOptions !== undefined) { + CompletionOptions.encode( + message.completionOptions, + writer.uint32(74).fork() + ).ldelim(); + } + for (const v of message.tools) { + Tool.encode(v!, writer.uint32(82).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateAssistantRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateAssistantRequest } as CreateAssistantRequest; + message.labels = {}; + message.tools = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 5: + const entry5 = CreateAssistantRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry5.value !== undefined) { + message.labels[entry5.key] = entry5.value; + } + break; + case 6: + message.modelUri = reader.string(); + break; + case 7: + message.instruction = reader.string(); + break; + case 8: + message.promptTruncationOptions = PromptTruncationOptions.decode( + reader, + reader.uint32() + ); + break; + case 9: + message.completionOptions = CompletionOptions.decode( + reader, + reader.uint32() + ); + break; + case 10: + message.tools.push(Tool.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateAssistantRequest { + const message = { ...baseCreateAssistantRequest } as CreateAssistantRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.modelUri = + object.modelUri !== undefined && object.modelUri !== null + ? String(object.modelUri) + : ""; + message.instruction = + object.instruction !== undefined && object.instruction !== null + ? String(object.instruction) + : ""; + message.promptTruncationOptions = + object.promptTruncationOptions !== undefined && + object.promptTruncationOptions !== null + ? PromptTruncationOptions.fromJSON(object.promptTruncationOptions) + : undefined; + message.completionOptions = + object.completionOptions !== undefined && + object.completionOptions !== null + ? CompletionOptions.fromJSON(object.completionOptions) + : undefined; + message.tools = (object.tools ?? []).map((e: any) => Tool.fromJSON(e)); + return message; + }, + + toJSON(message: CreateAssistantRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.modelUri !== undefined && (obj.modelUri = message.modelUri); + message.instruction !== undefined && + (obj.instruction = message.instruction); + message.promptTruncationOptions !== undefined && + (obj.promptTruncationOptions = message.promptTruncationOptions + ? PromptTruncationOptions.toJSON(message.promptTruncationOptions) + : undefined); + message.completionOptions !== undefined && + (obj.completionOptions = message.completionOptions + ? CompletionOptions.toJSON(message.completionOptions) + : undefined); + if (message.tools) { + obj.tools = message.tools.map((e) => (e ? Tool.toJSON(e) : undefined)); + } else { + obj.tools = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateAssistantRequest { + const message = { ...baseCreateAssistantRequest } as CreateAssistantRequest; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.modelUri = object.modelUri ?? ""; + message.instruction = object.instruction ?? ""; + message.promptTruncationOptions = + object.promptTruncationOptions !== undefined && + object.promptTruncationOptions !== null + ? PromptTruncationOptions.fromPartial(object.promptTruncationOptions) + : undefined; + message.completionOptions = + object.completionOptions !== undefined && + object.completionOptions !== null + ? CompletionOptions.fromPartial(object.completionOptions) + : undefined; + message.tools = object.tools?.map((e) => Tool.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(CreateAssistantRequest.$type, CreateAssistantRequest); + +const baseCreateAssistantRequest_LabelsEntry: object = { + $type: "yandex.cloud.ai.assistants.v1.CreateAssistantRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateAssistantRequest_LabelsEntry = { + $type: + "yandex.cloud.ai.assistants.v1.CreateAssistantRequest.LabelsEntry" as const, + + encode( + message: CreateAssistantRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateAssistantRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateAssistantRequest_LabelsEntry, + } as CreateAssistantRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateAssistantRequest_LabelsEntry { + const message = { + ...baseCreateAssistantRequest_LabelsEntry, + } as CreateAssistantRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateAssistantRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateAssistantRequest_LabelsEntry { + const message = { + ...baseCreateAssistantRequest_LabelsEntry, + } as CreateAssistantRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateAssistantRequest_LabelsEntry.$type, + CreateAssistantRequest_LabelsEntry +); + +const baseGetAssistantRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.GetAssistantRequest", + assistantId: "", +}; + +export const GetAssistantRequest = { + $type: "yandex.cloud.ai.assistants.v1.GetAssistantRequest" as const, + + encode( + message: GetAssistantRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.assistantId !== "") { + writer.uint32(10).string(message.assistantId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetAssistantRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetAssistantRequest } as GetAssistantRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assistantId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetAssistantRequest { + const message = { ...baseGetAssistantRequest } as GetAssistantRequest; + message.assistantId = + object.assistantId !== undefined && object.assistantId !== null + ? String(object.assistantId) + : ""; + return message; + }, + + toJSON(message: GetAssistantRequest): unknown { + const obj: any = {}; + message.assistantId !== undefined && + (obj.assistantId = message.assistantId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetAssistantRequest { + const message = { ...baseGetAssistantRequest } as GetAssistantRequest; + message.assistantId = object.assistantId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetAssistantRequest.$type, GetAssistantRequest); + +const baseUpdateAssistantRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.UpdateAssistantRequest", + assistantId: "", + name: "", + description: "", + modelUri: "", + instruction: "", +}; + +export const UpdateAssistantRequest = { + $type: "yandex.cloud.ai.assistants.v1.UpdateAssistantRequest" as const, + + encode( + message: UpdateAssistantRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.assistantId !== "") { + writer.uint32(10).string(message.assistantId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(42).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateAssistantRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.ai.assistants.v1.UpdateAssistantRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + if (message.modelUri !== "") { + writer.uint32(58).string(message.modelUri); + } + if (message.instruction !== "") { + writer.uint32(66).string(message.instruction); + } + if (message.promptTruncationOptions !== undefined) { + PromptTruncationOptions.encode( + message.promptTruncationOptions, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.completionOptions !== undefined) { + CompletionOptions.encode( + message.completionOptions, + writer.uint32(82).fork() + ).ldelim(); + } + for (const v of message.tools) { + Tool.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateAssistantRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateAssistantRequest } as UpdateAssistantRequest; + message.labels = {}; + message.tools = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assistantId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 6: + const entry6 = UpdateAssistantRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + case 7: + message.modelUri = reader.string(); + break; + case 8: + message.instruction = reader.string(); + break; + case 9: + message.promptTruncationOptions = PromptTruncationOptions.decode( + reader, + reader.uint32() + ); + break; + case 10: + message.completionOptions = CompletionOptions.decode( + reader, + reader.uint32() + ); + break; + case 11: + message.tools.push(Tool.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateAssistantRequest { + const message = { ...baseUpdateAssistantRequest } as UpdateAssistantRequest; + message.assistantId = + object.assistantId !== undefined && object.assistantId !== null + ? String(object.assistantId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.modelUri = + object.modelUri !== undefined && object.modelUri !== null + ? String(object.modelUri) + : ""; + message.instruction = + object.instruction !== undefined && object.instruction !== null + ? String(object.instruction) + : ""; + message.promptTruncationOptions = + object.promptTruncationOptions !== undefined && + object.promptTruncationOptions !== null + ? PromptTruncationOptions.fromJSON(object.promptTruncationOptions) + : undefined; + message.completionOptions = + object.completionOptions !== undefined && + object.completionOptions !== null + ? CompletionOptions.fromJSON(object.completionOptions) + : undefined; + message.tools = (object.tools ?? []).map((e: any) => Tool.fromJSON(e)); + return message; + }, + + toJSON(message: UpdateAssistantRequest): unknown { + const obj: any = {}; + message.assistantId !== undefined && + (obj.assistantId = message.assistantId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.modelUri !== undefined && (obj.modelUri = message.modelUri); + message.instruction !== undefined && + (obj.instruction = message.instruction); + message.promptTruncationOptions !== undefined && + (obj.promptTruncationOptions = message.promptTruncationOptions + ? PromptTruncationOptions.toJSON(message.promptTruncationOptions) + : undefined); + message.completionOptions !== undefined && + (obj.completionOptions = message.completionOptions + ? CompletionOptions.toJSON(message.completionOptions) + : undefined); + if (message.tools) { + obj.tools = message.tools.map((e) => (e ? Tool.toJSON(e) : undefined)); + } else { + obj.tools = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateAssistantRequest { + const message = { ...baseUpdateAssistantRequest } as UpdateAssistantRequest; + message.assistantId = object.assistantId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.modelUri = object.modelUri ?? ""; + message.instruction = object.instruction ?? ""; + message.promptTruncationOptions = + object.promptTruncationOptions !== undefined && + object.promptTruncationOptions !== null + ? PromptTruncationOptions.fromPartial(object.promptTruncationOptions) + : undefined; + message.completionOptions = + object.completionOptions !== undefined && + object.completionOptions !== null + ? CompletionOptions.fromPartial(object.completionOptions) + : undefined; + message.tools = object.tools?.map((e) => Tool.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(UpdateAssistantRequest.$type, UpdateAssistantRequest); + +const baseUpdateAssistantRequest_LabelsEntry: object = { + $type: "yandex.cloud.ai.assistants.v1.UpdateAssistantRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateAssistantRequest_LabelsEntry = { + $type: + "yandex.cloud.ai.assistants.v1.UpdateAssistantRequest.LabelsEntry" as const, + + encode( + message: UpdateAssistantRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateAssistantRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateAssistantRequest_LabelsEntry, + } as UpdateAssistantRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateAssistantRequest_LabelsEntry { + const message = { + ...baseUpdateAssistantRequest_LabelsEntry, + } as UpdateAssistantRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateAssistantRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateAssistantRequest_LabelsEntry { + const message = { + ...baseUpdateAssistantRequest_LabelsEntry, + } as UpdateAssistantRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateAssistantRequest_LabelsEntry.$type, + UpdateAssistantRequest_LabelsEntry +); + +const baseDeleteAssistantRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.DeleteAssistantRequest", + assistantId: "", +}; + +export const DeleteAssistantRequest = { + $type: "yandex.cloud.ai.assistants.v1.DeleteAssistantRequest" as const, + + encode( + message: DeleteAssistantRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.assistantId !== "") { + writer.uint32(10).string(message.assistantId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteAssistantRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteAssistantRequest } as DeleteAssistantRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assistantId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteAssistantRequest { + const message = { ...baseDeleteAssistantRequest } as DeleteAssistantRequest; + message.assistantId = + object.assistantId !== undefined && object.assistantId !== null + ? String(object.assistantId) + : ""; + return message; + }, + + toJSON(message: DeleteAssistantRequest): unknown { + const obj: any = {}; + message.assistantId !== undefined && + (obj.assistantId = message.assistantId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteAssistantRequest { + const message = { ...baseDeleteAssistantRequest } as DeleteAssistantRequest; + message.assistantId = object.assistantId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteAssistantRequest.$type, DeleteAssistantRequest); + +const baseDeleteAssistantResponse: object = { + $type: "yandex.cloud.ai.assistants.v1.DeleteAssistantResponse", +}; + +export const DeleteAssistantResponse = { + $type: "yandex.cloud.ai.assistants.v1.DeleteAssistantResponse" as const, + + encode( + _: DeleteAssistantResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteAssistantResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteAssistantResponse, + } as DeleteAssistantResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): DeleteAssistantResponse { + const message = { + ...baseDeleteAssistantResponse, + } as DeleteAssistantResponse; + return message; + }, + + toJSON(_: DeleteAssistantResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): DeleteAssistantResponse { + const message = { + ...baseDeleteAssistantResponse, + } as DeleteAssistantResponse; + return message; + }, +}; + +messageTypeRegistry.set(DeleteAssistantResponse.$type, DeleteAssistantResponse); + +const baseListAssistantsRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.ListAssistantsRequest", + folderId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListAssistantsRequest = { + $type: "yandex.cloud.ai.assistants.v1.ListAssistantsRequest" as const, + + encode( + message: ListAssistantsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListAssistantsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListAssistantsRequest } as ListAssistantsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListAssistantsRequest { + const message = { ...baseListAssistantsRequest } as ListAssistantsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListAssistantsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListAssistantsRequest { + const message = { ...baseListAssistantsRequest } as ListAssistantsRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListAssistantsRequest.$type, ListAssistantsRequest); + +const baseListAssistantsResponse: object = { + $type: "yandex.cloud.ai.assistants.v1.ListAssistantsResponse", + nextPageToken: "", +}; + +export const ListAssistantsResponse = { + $type: "yandex.cloud.ai.assistants.v1.ListAssistantsResponse" as const, + + encode( + message: ListAssistantsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.assistants) { + Assistant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListAssistantsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListAssistantsResponse } as ListAssistantsResponse; + message.assistants = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assistants.push(Assistant.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListAssistantsResponse { + const message = { ...baseListAssistantsResponse } as ListAssistantsResponse; + message.assistants = (object.assistants ?? []).map((e: any) => + Assistant.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListAssistantsResponse): unknown { + const obj: any = {}; + if (message.assistants) { + obj.assistants = message.assistants.map((e) => + e ? Assistant.toJSON(e) : undefined + ); + } else { + obj.assistants = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListAssistantsResponse { + const message = { ...baseListAssistantsResponse } as ListAssistantsResponse; + message.assistants = + object.assistants?.map((e) => Assistant.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListAssistantsResponse.$type, ListAssistantsResponse); + +const baseListAssistantVersionsRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.ListAssistantVersionsRequest", + assistantId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListAssistantVersionsRequest = { + $type: "yandex.cloud.ai.assistants.v1.ListAssistantVersionsRequest" as const, + + encode( + message: ListAssistantVersionsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.assistantId !== "") { + writer.uint32(10).string(message.assistantId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListAssistantVersionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListAssistantVersionsRequest, + } as ListAssistantVersionsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assistantId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListAssistantVersionsRequest { + const message = { + ...baseListAssistantVersionsRequest, + } as ListAssistantVersionsRequest; + message.assistantId = + object.assistantId !== undefined && object.assistantId !== null + ? String(object.assistantId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListAssistantVersionsRequest): unknown { + const obj: any = {}; + message.assistantId !== undefined && + (obj.assistantId = message.assistantId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListAssistantVersionsRequest { + const message = { + ...baseListAssistantVersionsRequest, + } as ListAssistantVersionsRequest; + message.assistantId = object.assistantId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListAssistantVersionsRequest.$type, + ListAssistantVersionsRequest +); + +const baseAssistantVersion: object = { + $type: "yandex.cloud.ai.assistants.v1.AssistantVersion", + id: "", +}; + +export const AssistantVersion = { + $type: "yandex.cloud.ai.assistants.v1.AssistantVersion" as const, + + encode( + message: AssistantVersion, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.assistant !== undefined) { + Assistant.encode(message.assistant, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AssistantVersion { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAssistantVersion } as AssistantVersion; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.assistant = Assistant.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AssistantVersion { + const message = { ...baseAssistantVersion } as AssistantVersion; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.assistant = + object.assistant !== undefined && object.assistant !== null + ? Assistant.fromJSON(object.assistant) + : undefined; + return message; + }, + + toJSON(message: AssistantVersion): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.assistant !== undefined && + (obj.assistant = message.assistant + ? Assistant.toJSON(message.assistant) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): AssistantVersion { + const message = { ...baseAssistantVersion } as AssistantVersion; + message.id = object.id ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.assistant = + object.assistant !== undefined && object.assistant !== null + ? Assistant.fromPartial(object.assistant) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(AssistantVersion.$type, AssistantVersion); + +const baseListAssistantVersionsResponse: object = { + $type: "yandex.cloud.ai.assistants.v1.ListAssistantVersionsResponse", + nextPageToken: "", +}; + +export const ListAssistantVersionsResponse = { + $type: "yandex.cloud.ai.assistants.v1.ListAssistantVersionsResponse" as const, + + encode( + message: ListAssistantVersionsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.versions) { + AssistantVersion.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListAssistantVersionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListAssistantVersionsResponse, + } as ListAssistantVersionsResponse; + message.versions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.versions.push( + AssistantVersion.decode(reader, reader.uint32()) + ); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListAssistantVersionsResponse { + const message = { + ...baseListAssistantVersionsResponse, + } as ListAssistantVersionsResponse; + message.versions = (object.versions ?? []).map((e: any) => + AssistantVersion.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListAssistantVersionsResponse): unknown { + const obj: any = {}; + if (message.versions) { + obj.versions = message.versions.map((e) => + e ? AssistantVersion.toJSON(e) : undefined + ); + } else { + obj.versions = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListAssistantVersionsResponse { + const message = { + ...baseListAssistantVersionsResponse, + } as ListAssistantVersionsResponse; + message.versions = + object.versions?.map((e) => AssistantVersion.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListAssistantVersionsResponse.$type, + ListAssistantVersionsResponse +); + +export const AssistantServiceService = { + create: { + path: "/yandex.cloud.ai.assistants.v1.AssistantService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateAssistantRequest) => + Buffer.from(CreateAssistantRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateAssistantRequest.decode(value), + responseSerialize: (value: Assistant) => + Buffer.from(Assistant.encode(value).finish()), + responseDeserialize: (value: Buffer) => Assistant.decode(value), + }, + get: { + path: "/yandex.cloud.ai.assistants.v1.AssistantService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetAssistantRequest) => + Buffer.from(GetAssistantRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetAssistantRequest.decode(value), + responseSerialize: (value: Assistant) => + Buffer.from(Assistant.encode(value).finish()), + responseDeserialize: (value: Buffer) => Assistant.decode(value), + }, + update: { + path: "/yandex.cloud.ai.assistants.v1.AssistantService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAssistantRequest) => + Buffer.from(UpdateAssistantRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateAssistantRequest.decode(value), + responseSerialize: (value: Assistant) => + Buffer.from(Assistant.encode(value).finish()), + responseDeserialize: (value: Buffer) => Assistant.decode(value), + }, + delete: { + path: "/yandex.cloud.ai.assistants.v1.AssistantService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteAssistantRequest) => + Buffer.from(DeleteAssistantRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteAssistantRequest.decode(value), + responseSerialize: (value: DeleteAssistantResponse) => + Buffer.from(DeleteAssistantResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + DeleteAssistantResponse.decode(value), + }, + list: { + path: "/yandex.cloud.ai.assistants.v1.AssistantService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAssistantsRequest) => + Buffer.from(ListAssistantsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListAssistantsRequest.decode(value), + responseSerialize: (value: ListAssistantsResponse) => + Buffer.from(ListAssistantsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAssistantsResponse.decode(value), + }, + listVersions: { + path: "/yandex.cloud.ai.assistants.v1.AssistantService/ListVersions", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAssistantVersionsRequest) => + Buffer.from(ListAssistantVersionsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAssistantVersionsRequest.decode(value), + responseSerialize: (value: ListAssistantVersionsResponse) => + Buffer.from(ListAssistantVersionsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAssistantVersionsResponse.decode(value), + }, +} as const; + +export interface AssistantServiceServer extends UntypedServiceImplementation { + create: handleUnaryCall; + get: handleUnaryCall; + update: handleUnaryCall; + delete: handleUnaryCall; + list: handleUnaryCall; + listVersions: handleUnaryCall< + ListAssistantVersionsRequest, + ListAssistantVersionsResponse + >; +} + +export interface AssistantServiceClient extends Client { + create( + request: CreateAssistantRequest, + callback: (error: ServiceError | null, response: Assistant) => void + ): ClientUnaryCall; + create( + request: CreateAssistantRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Assistant) => void + ): ClientUnaryCall; + create( + request: CreateAssistantRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Assistant) => void + ): ClientUnaryCall; + get( + request: GetAssistantRequest, + callback: (error: ServiceError | null, response: Assistant) => void + ): ClientUnaryCall; + get( + request: GetAssistantRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Assistant) => void + ): ClientUnaryCall; + get( + request: GetAssistantRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Assistant) => void + ): ClientUnaryCall; + update( + request: UpdateAssistantRequest, + callback: (error: ServiceError | null, response: Assistant) => void + ): ClientUnaryCall; + update( + request: UpdateAssistantRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Assistant) => void + ): ClientUnaryCall; + update( + request: UpdateAssistantRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Assistant) => void + ): ClientUnaryCall; + delete( + request: DeleteAssistantRequest, + callback: ( + error: ServiceError | null, + response: DeleteAssistantResponse + ) => void + ): ClientUnaryCall; + delete( + request: DeleteAssistantRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: DeleteAssistantResponse + ) => void + ): ClientUnaryCall; + delete( + request: DeleteAssistantRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: DeleteAssistantResponse + ) => void + ): ClientUnaryCall; + list( + request: ListAssistantsRequest, + callback: ( + error: ServiceError | null, + response: ListAssistantsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListAssistantsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAssistantsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListAssistantsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAssistantsResponse + ) => void + ): ClientUnaryCall; + listVersions( + request: ListAssistantVersionsRequest, + callback: ( + error: ServiceError | null, + response: ListAssistantVersionsResponse + ) => void + ): ClientUnaryCall; + listVersions( + request: ListAssistantVersionsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAssistantVersionsResponse + ) => void + ): ClientUnaryCall; + listVersions( + request: ListAssistantVersionsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAssistantVersionsResponse + ) => void + ): ClientUnaryCall; +} + +export const AssistantServiceClient = makeGenericClientConstructor( + AssistantServiceService, + "yandex.cloud.ai.assistants.v1.AssistantService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): AssistantServiceClient; + service: typeof AssistantServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/common.ts b/src/generated/yandex/cloud/ai/assistants/v1/common.ts new file mode 100644 index 00000000..278ccd49 --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/common.ts @@ -0,0 +1,375 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + Int64Value, + DoubleValue, +} from "../../../../../google/protobuf/wrappers"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1"; + +export interface PromptTruncationOptions { + $type: "yandex.cloud.ai.assistants.v1.PromptTruncationOptions"; + maxPromptTokens?: number; +} + +export interface CompletionOptions { + $type: "yandex.cloud.ai.assistants.v1.CompletionOptions"; + maxTokens?: number; + temperature?: number; +} + +export interface SearchIndexTool { + $type: "yandex.cloud.ai.assistants.v1.SearchIndexTool"; + searchIndexIds: string[]; + maxNumResults?: number; +} + +export interface Tool { + $type: "yandex.cloud.ai.assistants.v1.Tool"; + searchIndex?: SearchIndexTool | undefined; +} + +const basePromptTruncationOptions: object = { + $type: "yandex.cloud.ai.assistants.v1.PromptTruncationOptions", +}; + +export const PromptTruncationOptions = { + $type: "yandex.cloud.ai.assistants.v1.PromptTruncationOptions" as const, + + encode( + message: PromptTruncationOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.maxPromptTokens !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.maxPromptTokens!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PromptTruncationOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePromptTruncationOptions, + } as PromptTruncationOptions; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxPromptTokens = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PromptTruncationOptions { + const message = { + ...basePromptTruncationOptions, + } as PromptTruncationOptions; + message.maxPromptTokens = + object.maxPromptTokens !== undefined && object.maxPromptTokens !== null + ? Number(object.maxPromptTokens) + : undefined; + return message; + }, + + toJSON(message: PromptTruncationOptions): unknown { + const obj: any = {}; + message.maxPromptTokens !== undefined && + (obj.maxPromptTokens = message.maxPromptTokens); + return obj; + }, + + fromPartial, I>>( + object: I + ): PromptTruncationOptions { + const message = { + ...basePromptTruncationOptions, + } as PromptTruncationOptions; + message.maxPromptTokens = object.maxPromptTokens ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(PromptTruncationOptions.$type, PromptTruncationOptions); + +const baseCompletionOptions: object = { + $type: "yandex.cloud.ai.assistants.v1.CompletionOptions", +}; + +export const CompletionOptions = { + $type: "yandex.cloud.ai.assistants.v1.CompletionOptions" as const, + + encode( + message: CompletionOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.maxTokens !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.maxTokens! }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.temperature !== undefined) { + DoubleValue.encode( + { $type: "google.protobuf.DoubleValue", value: message.temperature! }, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CompletionOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCompletionOptions } as CompletionOptions; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.maxTokens = Int64Value.decode(reader, reader.uint32()).value; + break; + case 3: + message.temperature = DoubleValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CompletionOptions { + const message = { ...baseCompletionOptions } as CompletionOptions; + message.maxTokens = + object.maxTokens !== undefined && object.maxTokens !== null + ? Number(object.maxTokens) + : undefined; + message.temperature = + object.temperature !== undefined && object.temperature !== null + ? Number(object.temperature) + : undefined; + return message; + }, + + toJSON(message: CompletionOptions): unknown { + const obj: any = {}; + message.maxTokens !== undefined && (obj.maxTokens = message.maxTokens); + message.temperature !== undefined && + (obj.temperature = message.temperature); + return obj; + }, + + fromPartial, I>>( + object: I + ): CompletionOptions { + const message = { ...baseCompletionOptions } as CompletionOptions; + message.maxTokens = object.maxTokens ?? undefined; + message.temperature = object.temperature ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(CompletionOptions.$type, CompletionOptions); + +const baseSearchIndexTool: object = { + $type: "yandex.cloud.ai.assistants.v1.SearchIndexTool", + searchIndexIds: "", +}; + +export const SearchIndexTool = { + $type: "yandex.cloud.ai.assistants.v1.SearchIndexTool" as const, + + encode( + message: SearchIndexTool, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.searchIndexIds) { + writer.uint32(10).string(v!); + } + if (message.maxNumResults !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.maxNumResults! }, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SearchIndexTool { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSearchIndexTool } as SearchIndexTool; + message.searchIndexIds = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.searchIndexIds.push(reader.string()); + break; + case 2: + message.maxNumResults = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SearchIndexTool { + const message = { ...baseSearchIndexTool } as SearchIndexTool; + message.searchIndexIds = (object.searchIndexIds ?? []).map((e: any) => + String(e) + ); + message.maxNumResults = + object.maxNumResults !== undefined && object.maxNumResults !== null + ? Number(object.maxNumResults) + : undefined; + return message; + }, + + toJSON(message: SearchIndexTool): unknown { + const obj: any = {}; + if (message.searchIndexIds) { + obj.searchIndexIds = message.searchIndexIds.map((e) => e); + } else { + obj.searchIndexIds = []; + } + message.maxNumResults !== undefined && + (obj.maxNumResults = message.maxNumResults); + return obj; + }, + + fromPartial, I>>( + object: I + ): SearchIndexTool { + const message = { ...baseSearchIndexTool } as SearchIndexTool; + message.searchIndexIds = object.searchIndexIds?.map((e) => e) || []; + message.maxNumResults = object.maxNumResults ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(SearchIndexTool.$type, SearchIndexTool); + +const baseTool: object = { $type: "yandex.cloud.ai.assistants.v1.Tool" }; + +export const Tool = { + $type: "yandex.cloud.ai.assistants.v1.Tool" as const, + + encode(message: Tool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.searchIndex !== undefined) { + SearchIndexTool.encode( + message.searchIndex, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Tool { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTool } as Tool; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.searchIndex = SearchIndexTool.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Tool { + const message = { ...baseTool } as Tool; + message.searchIndex = + object.searchIndex !== undefined && object.searchIndex !== null + ? SearchIndexTool.fromJSON(object.searchIndex) + : undefined; + return message; + }, + + toJSON(message: Tool): unknown { + const obj: any = {}; + message.searchIndex !== undefined && + (obj.searchIndex = message.searchIndex + ? SearchIndexTool.toJSON(message.searchIndex) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Tool { + const message = { ...baseTool } as Tool; + message.searchIndex = + object.searchIndex !== undefined && object.searchIndex !== null + ? SearchIndexTool.fromPartial(object.searchIndex) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Tool.$type, Tool); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/runs/run.ts b/src/generated/yandex/cloud/ai/assistants/v1/runs/run.ts new file mode 100644 index 00000000..2f5ab484 --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/runs/run.ts @@ -0,0 +1,667 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + PromptTruncationOptions, + CompletionOptions, +} from "../../../../../../yandex/cloud/ai/assistants/v1/common"; +import { Timestamp } from "../../../../../../google/protobuf/timestamp"; +import { Error } from "../../../../../../yandex/cloud/ai/common/common"; +import { Message } from "../../../../../../yandex/cloud/ai/assistants/v1/threads/message"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1.runs"; + +export interface Run { + $type: "yandex.cloud.ai.assistants.v1.runs.Run"; + id: string; + assistantId: string; + threadId: string; + createdBy: string; + createdAt?: Date; + labels: { [key: string]: string }; + state?: RunState; + usage?: ContentUsage; + customPromptTruncationOptions?: PromptTruncationOptions; + customCompletionOptions?: CompletionOptions; +} + +export interface Run_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.runs.Run.LabelsEntry"; + key: string; + value: string; +} + +export interface RunState { + $type: "yandex.cloud.ai.assistants.v1.runs.RunState"; + status: RunState_RunStatus; + error?: Error | undefined; + completedMessage?: Message | undefined; +} + +export enum RunState_RunStatus { + RUN_STATUS_UNSPECIFIED = 0, + PENDING = 1, + IN_PROGRESS = 2, + FAILED = 3, + COMPLETED = 4, + UNRECOGNIZED = -1, +} + +export function runState_RunStatusFromJSON(object: any): RunState_RunStatus { + switch (object) { + case 0: + case "RUN_STATUS_UNSPECIFIED": + return RunState_RunStatus.RUN_STATUS_UNSPECIFIED; + case 1: + case "PENDING": + return RunState_RunStatus.PENDING; + case 2: + case "IN_PROGRESS": + return RunState_RunStatus.IN_PROGRESS; + case 3: + case "FAILED": + return RunState_RunStatus.FAILED; + case 4: + case "COMPLETED": + return RunState_RunStatus.COMPLETED; + case -1: + case "UNRECOGNIZED": + default: + return RunState_RunStatus.UNRECOGNIZED; + } +} + +export function runState_RunStatusToJSON(object: RunState_RunStatus): string { + switch (object) { + case RunState_RunStatus.RUN_STATUS_UNSPECIFIED: + return "RUN_STATUS_UNSPECIFIED"; + case RunState_RunStatus.PENDING: + return "PENDING"; + case RunState_RunStatus.IN_PROGRESS: + return "IN_PROGRESS"; + case RunState_RunStatus.FAILED: + return "FAILED"; + case RunState_RunStatus.COMPLETED: + return "COMPLETED"; + default: + return "UNKNOWN"; + } +} + +export interface ContentUsage { + $type: "yandex.cloud.ai.assistants.v1.runs.ContentUsage"; + promptTokens: number; + completionTokens: number; + totalTokens: number; +} + +const baseRun: object = { + $type: "yandex.cloud.ai.assistants.v1.runs.Run", + id: "", + assistantId: "", + threadId: "", + createdBy: "", +}; + +export const Run = { + $type: "yandex.cloud.ai.assistants.v1.runs.Run" as const, + + encode(message: Run, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.assistantId !== "") { + writer.uint32(18).string(message.assistantId); + } + if (message.threadId !== "") { + writer.uint32(26).string(message.threadId); + } + if (message.createdBy !== "") { + writer.uint32(34).string(message.createdBy); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(42).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + Run_LabelsEntry.encode( + { + $type: "yandex.cloud.ai.assistants.v1.runs.Run.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + if (message.state !== undefined) { + RunState.encode(message.state, writer.uint32(58).fork()).ldelim(); + } + if (message.usage !== undefined) { + ContentUsage.encode(message.usage, writer.uint32(66).fork()).ldelim(); + } + if (message.customPromptTruncationOptions !== undefined) { + PromptTruncationOptions.encode( + message.customPromptTruncationOptions, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.customCompletionOptions !== undefined) { + CompletionOptions.encode( + message.customCompletionOptions, + writer.uint32(82).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Run { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRun } as Run; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.assistantId = reader.string(); + break; + case 3: + message.threadId = reader.string(); + break; + case 4: + message.createdBy = reader.string(); + break; + case 5: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + const entry6 = Run_LabelsEntry.decode(reader, reader.uint32()); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + case 7: + message.state = RunState.decode(reader, reader.uint32()); + break; + case 8: + message.usage = ContentUsage.decode(reader, reader.uint32()); + break; + case 9: + message.customPromptTruncationOptions = + PromptTruncationOptions.decode(reader, reader.uint32()); + break; + case 10: + message.customCompletionOptions = CompletionOptions.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Run { + const message = { ...baseRun } as Run; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.assistantId = + object.assistantId !== undefined && object.assistantId !== null + ? String(object.assistantId) + : ""; + message.threadId = + object.threadId !== undefined && object.threadId !== null + ? String(object.threadId) + : ""; + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.state = + object.state !== undefined && object.state !== null + ? RunState.fromJSON(object.state) + : undefined; + message.usage = + object.usage !== undefined && object.usage !== null + ? ContentUsage.fromJSON(object.usage) + : undefined; + message.customPromptTruncationOptions = + object.customPromptTruncationOptions !== undefined && + object.customPromptTruncationOptions !== null + ? PromptTruncationOptions.fromJSON(object.customPromptTruncationOptions) + : undefined; + message.customCompletionOptions = + object.customCompletionOptions !== undefined && + object.customCompletionOptions !== null + ? CompletionOptions.fromJSON(object.customCompletionOptions) + : undefined; + return message; + }, + + toJSON(message: Run): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.assistantId !== undefined && + (obj.assistantId = message.assistantId); + message.threadId !== undefined && (obj.threadId = message.threadId); + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.state !== undefined && + (obj.state = message.state ? RunState.toJSON(message.state) : undefined); + message.usage !== undefined && + (obj.usage = message.usage + ? ContentUsage.toJSON(message.usage) + : undefined); + message.customPromptTruncationOptions !== undefined && + (obj.customPromptTruncationOptions = message.customPromptTruncationOptions + ? PromptTruncationOptions.toJSON(message.customPromptTruncationOptions) + : undefined); + message.customCompletionOptions !== undefined && + (obj.customCompletionOptions = message.customCompletionOptions + ? CompletionOptions.toJSON(message.customCompletionOptions) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Run { + const message = { ...baseRun } as Run; + message.id = object.id ?? ""; + message.assistantId = object.assistantId ?? ""; + message.threadId = object.threadId ?? ""; + message.createdBy = object.createdBy ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.state = + object.state !== undefined && object.state !== null + ? RunState.fromPartial(object.state) + : undefined; + message.usage = + object.usage !== undefined && object.usage !== null + ? ContentUsage.fromPartial(object.usage) + : undefined; + message.customPromptTruncationOptions = + object.customPromptTruncationOptions !== undefined && + object.customPromptTruncationOptions !== null + ? PromptTruncationOptions.fromPartial( + object.customPromptTruncationOptions + ) + : undefined; + message.customCompletionOptions = + object.customCompletionOptions !== undefined && + object.customCompletionOptions !== null + ? CompletionOptions.fromPartial(object.customCompletionOptions) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Run.$type, Run); + +const baseRun_LabelsEntry: object = { + $type: "yandex.cloud.ai.assistants.v1.runs.Run.LabelsEntry", + key: "", + value: "", +}; + +export const Run_LabelsEntry = { + $type: "yandex.cloud.ai.assistants.v1.runs.Run.LabelsEntry" as const, + + encode( + message: Run_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Run_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRun_LabelsEntry } as Run_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Run_LabelsEntry { + const message = { ...baseRun_LabelsEntry } as Run_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Run_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Run_LabelsEntry { + const message = { ...baseRun_LabelsEntry } as Run_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Run_LabelsEntry.$type, Run_LabelsEntry); + +const baseRunState: object = { + $type: "yandex.cloud.ai.assistants.v1.runs.RunState", + status: 0, +}; + +export const RunState = { + $type: "yandex.cloud.ai.assistants.v1.runs.RunState" as const, + + encode( + message: RunState, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + if (message.error !== undefined) { + Error.encode(message.error, writer.uint32(18).fork()).ldelim(); + } + if (message.completedMessage !== undefined) { + Message.encode( + message.completedMessage, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RunState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRunState } as RunState; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.int32() as any; + break; + case 2: + message.error = Error.decode(reader, reader.uint32()); + break; + case 3: + message.completedMessage = Message.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RunState { + const message = { ...baseRunState } as RunState; + message.status = + object.status !== undefined && object.status !== null + ? runState_RunStatusFromJSON(object.status) + : 0; + message.error = + object.error !== undefined && object.error !== null + ? Error.fromJSON(object.error) + : undefined; + message.completedMessage = + object.completedMessage !== undefined && object.completedMessage !== null + ? Message.fromJSON(object.completedMessage) + : undefined; + return message; + }, + + toJSON(message: RunState): unknown { + const obj: any = {}; + message.status !== undefined && + (obj.status = runState_RunStatusToJSON(message.status)); + message.error !== undefined && + (obj.error = message.error ? Error.toJSON(message.error) : undefined); + message.completedMessage !== undefined && + (obj.completedMessage = message.completedMessage + ? Message.toJSON(message.completedMessage) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): RunState { + const message = { ...baseRunState } as RunState; + message.status = object.status ?? 0; + message.error = + object.error !== undefined && object.error !== null + ? Error.fromPartial(object.error) + : undefined; + message.completedMessage = + object.completedMessage !== undefined && object.completedMessage !== null + ? Message.fromPartial(object.completedMessage) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(RunState.$type, RunState); + +const baseContentUsage: object = { + $type: "yandex.cloud.ai.assistants.v1.runs.ContentUsage", + promptTokens: 0, + completionTokens: 0, + totalTokens: 0, +}; + +export const ContentUsage = { + $type: "yandex.cloud.ai.assistants.v1.runs.ContentUsage" as const, + + encode( + message: ContentUsage, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.promptTokens !== 0) { + writer.uint32(8).int64(message.promptTokens); + } + if (message.completionTokens !== 0) { + writer.uint32(16).int64(message.completionTokens); + } + if (message.totalTokens !== 0) { + writer.uint32(24).int64(message.totalTokens); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ContentUsage { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseContentUsage } as ContentUsage; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.promptTokens = longToNumber(reader.int64() as Long); + break; + case 2: + message.completionTokens = longToNumber(reader.int64() as Long); + break; + case 3: + message.totalTokens = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ContentUsage { + const message = { ...baseContentUsage } as ContentUsage; + message.promptTokens = + object.promptTokens !== undefined && object.promptTokens !== null + ? Number(object.promptTokens) + : 0; + message.completionTokens = + object.completionTokens !== undefined && object.completionTokens !== null + ? Number(object.completionTokens) + : 0; + message.totalTokens = + object.totalTokens !== undefined && object.totalTokens !== null + ? Number(object.totalTokens) + : 0; + return message; + }, + + toJSON(message: ContentUsage): unknown { + const obj: any = {}; + message.promptTokens !== undefined && + (obj.promptTokens = Math.round(message.promptTokens)); + message.completionTokens !== undefined && + (obj.completionTokens = Math.round(message.completionTokens)); + message.totalTokens !== undefined && + (obj.totalTokens = Math.round(message.totalTokens)); + return obj; + }, + + fromPartial, I>>( + object: I + ): ContentUsage { + const message = { ...baseContentUsage } as ContentUsage; + message.promptTokens = object.promptTokens ?? 0; + message.completionTokens = object.completionTokens ?? 0; + message.totalTokens = object.totalTokens ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(ContentUsage.$type, ContentUsage); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/runs/run_service.ts b/src/generated/yandex/cloud/ai/assistants/v1/runs/run_service.ts new file mode 100644 index 00000000..6073e108 --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/runs/run_service.ts @@ -0,0 +1,1235 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + handleServerStreamingCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ClientReadableStream, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + PromptTruncationOptions, + CompletionOptions, +} from "../../../../../../yandex/cloud/ai/assistants/v1/common"; +import { + MessageData, + MessageContent, + Message, +} from "../../../../../../yandex/cloud/ai/assistants/v1/threads/message"; +import { Run } from "../../../../../../yandex/cloud/ai/assistants/v1/runs/run"; +import { Error } from "../../../../../../yandex/cloud/ai/common/common"; +import { Int64Value } from "../../../../../../google/protobuf/wrappers"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1.runs"; + +export interface CreateRunRequest { + $type: "yandex.cloud.ai.assistants.v1.runs.CreateRunRequest"; + assistantId: string; + threadId: string; + labels: { [key: string]: string }; + additionalMessages: MessageData[]; + customPromptTruncationOptions?: PromptTruncationOptions; + customCompletionOptions?: CompletionOptions; + stream: boolean; +} + +export interface CreateRunRequest_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.runs.CreateRunRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface ListenRunRequest { + $type: "yandex.cloud.ai.assistants.v1.runs.ListenRunRequest"; + runId: string; + eventsStartIdx?: number; +} + +export interface GetRunRequest { + $type: "yandex.cloud.ai.assistants.v1.runs.GetRunRequest"; + runId: string; +} + +export interface GetLastRunByThreadRequest { + $type: "yandex.cloud.ai.assistants.v1.runs.GetLastRunByThreadRequest"; + threadId: string; +} + +export interface ListRunsRequest { + $type: "yandex.cloud.ai.assistants.v1.runs.ListRunsRequest"; + folderId: string; + pageSize: number; + pageToken: string; +} + +export interface ListRunsResponse { + $type: "yandex.cloud.ai.assistants.v1.runs.ListRunsResponse"; + runs: Run[]; + nextPageToken: string; +} + +export interface StreamCursor { + $type: "yandex.cloud.ai.assistants.v1.runs.StreamCursor"; + currentEventIdx: number; + numUserEventsReceived: number; +} + +export interface StreamEvent { + $type: "yandex.cloud.ai.assistants.v1.runs.StreamEvent"; + eventType: StreamEvent_EventType; + streamCursor?: StreamCursor; + error?: Error | undefined; + partialMessage?: MessageContent | undefined; + completedMessage?: Message | undefined; +} + +export enum StreamEvent_EventType { + EVENT_TYPE_UNSPECIFIED = 0, + PARTIAL_MESSAGE = 1, + ERROR = 2, + DONE = 3, + UNRECOGNIZED = -1, +} + +export function streamEvent_EventTypeFromJSON( + object: any +): StreamEvent_EventType { + switch (object) { + case 0: + case "EVENT_TYPE_UNSPECIFIED": + return StreamEvent_EventType.EVENT_TYPE_UNSPECIFIED; + case 1: + case "PARTIAL_MESSAGE": + return StreamEvent_EventType.PARTIAL_MESSAGE; + case 2: + case "ERROR": + return StreamEvent_EventType.ERROR; + case 3: + case "DONE": + return StreamEvent_EventType.DONE; + case -1: + case "UNRECOGNIZED": + default: + return StreamEvent_EventType.UNRECOGNIZED; + } +} + +export function streamEvent_EventTypeToJSON( + object: StreamEvent_EventType +): string { + switch (object) { + case StreamEvent_EventType.EVENT_TYPE_UNSPECIFIED: + return "EVENT_TYPE_UNSPECIFIED"; + case StreamEvent_EventType.PARTIAL_MESSAGE: + return "PARTIAL_MESSAGE"; + case StreamEvent_EventType.ERROR: + return "ERROR"; + case StreamEvent_EventType.DONE: + return "DONE"; + default: + return "UNKNOWN"; + } +} + +const baseCreateRunRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.runs.CreateRunRequest", + assistantId: "", + threadId: "", + stream: false, +}; + +export const CreateRunRequest = { + $type: "yandex.cloud.ai.assistants.v1.runs.CreateRunRequest" as const, + + encode( + message: CreateRunRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.assistantId !== "") { + writer.uint32(10).string(message.assistantId); + } + if (message.threadId !== "") { + writer.uint32(18).string(message.threadId); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateRunRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.ai.assistants.v1.runs.CreateRunRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(26).fork() + ).ldelim(); + }); + for (const v of message.additionalMessages) { + MessageData.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.customPromptTruncationOptions !== undefined) { + PromptTruncationOptions.encode( + message.customPromptTruncationOptions, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.customCompletionOptions !== undefined) { + CompletionOptions.encode( + message.customCompletionOptions, + writer.uint32(50).fork() + ).ldelim(); + } + if (message.stream === true) { + writer.uint32(56).bool(message.stream); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateRunRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateRunRequest } as CreateRunRequest; + message.labels = {}; + message.additionalMessages = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assistantId = reader.string(); + break; + case 2: + message.threadId = reader.string(); + break; + case 3: + const entry3 = CreateRunRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry3.value !== undefined) { + message.labels[entry3.key] = entry3.value; + } + break; + case 4: + message.additionalMessages.push( + MessageData.decode(reader, reader.uint32()) + ); + break; + case 5: + message.customPromptTruncationOptions = + PromptTruncationOptions.decode(reader, reader.uint32()); + break; + case 6: + message.customCompletionOptions = CompletionOptions.decode( + reader, + reader.uint32() + ); + break; + case 7: + message.stream = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateRunRequest { + const message = { ...baseCreateRunRequest } as CreateRunRequest; + message.assistantId = + object.assistantId !== undefined && object.assistantId !== null + ? String(object.assistantId) + : ""; + message.threadId = + object.threadId !== undefined && object.threadId !== null + ? String(object.threadId) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.additionalMessages = (object.additionalMessages ?? []).map( + (e: any) => MessageData.fromJSON(e) + ); + message.customPromptTruncationOptions = + object.customPromptTruncationOptions !== undefined && + object.customPromptTruncationOptions !== null + ? PromptTruncationOptions.fromJSON(object.customPromptTruncationOptions) + : undefined; + message.customCompletionOptions = + object.customCompletionOptions !== undefined && + object.customCompletionOptions !== null + ? CompletionOptions.fromJSON(object.customCompletionOptions) + : undefined; + message.stream = + object.stream !== undefined && object.stream !== null + ? Boolean(object.stream) + : false; + return message; + }, + + toJSON(message: CreateRunRequest): unknown { + const obj: any = {}; + message.assistantId !== undefined && + (obj.assistantId = message.assistantId); + message.threadId !== undefined && (obj.threadId = message.threadId); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + if (message.additionalMessages) { + obj.additionalMessages = message.additionalMessages.map((e) => + e ? MessageData.toJSON(e) : undefined + ); + } else { + obj.additionalMessages = []; + } + message.customPromptTruncationOptions !== undefined && + (obj.customPromptTruncationOptions = message.customPromptTruncationOptions + ? PromptTruncationOptions.toJSON(message.customPromptTruncationOptions) + : undefined); + message.customCompletionOptions !== undefined && + (obj.customCompletionOptions = message.customCompletionOptions + ? CompletionOptions.toJSON(message.customCompletionOptions) + : undefined); + message.stream !== undefined && (obj.stream = message.stream); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateRunRequest { + const message = { ...baseCreateRunRequest } as CreateRunRequest; + message.assistantId = object.assistantId ?? ""; + message.threadId = object.threadId ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.additionalMessages = + object.additionalMessages?.map((e) => MessageData.fromPartial(e)) || []; + message.customPromptTruncationOptions = + object.customPromptTruncationOptions !== undefined && + object.customPromptTruncationOptions !== null + ? PromptTruncationOptions.fromPartial( + object.customPromptTruncationOptions + ) + : undefined; + message.customCompletionOptions = + object.customCompletionOptions !== undefined && + object.customCompletionOptions !== null + ? CompletionOptions.fromPartial(object.customCompletionOptions) + : undefined; + message.stream = object.stream ?? false; + return message; + }, +}; + +messageTypeRegistry.set(CreateRunRequest.$type, CreateRunRequest); + +const baseCreateRunRequest_LabelsEntry: object = { + $type: "yandex.cloud.ai.assistants.v1.runs.CreateRunRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateRunRequest_LabelsEntry = { + $type: + "yandex.cloud.ai.assistants.v1.runs.CreateRunRequest.LabelsEntry" as const, + + encode( + message: CreateRunRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateRunRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateRunRequest_LabelsEntry, + } as CreateRunRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateRunRequest_LabelsEntry { + const message = { + ...baseCreateRunRequest_LabelsEntry, + } as CreateRunRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateRunRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateRunRequest_LabelsEntry { + const message = { + ...baseCreateRunRequest_LabelsEntry, + } as CreateRunRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateRunRequest_LabelsEntry.$type, + CreateRunRequest_LabelsEntry +); + +const baseListenRunRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.runs.ListenRunRequest", + runId: "", +}; + +export const ListenRunRequest = { + $type: "yandex.cloud.ai.assistants.v1.runs.ListenRunRequest" as const, + + encode( + message: ListenRunRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.runId !== "") { + writer.uint32(10).string(message.runId); + } + if (message.eventsStartIdx !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.eventsStartIdx! }, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListenRunRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListenRunRequest } as ListenRunRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.runId = reader.string(); + break; + case 2: + message.eventsStartIdx = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListenRunRequest { + const message = { ...baseListenRunRequest } as ListenRunRequest; + message.runId = + object.runId !== undefined && object.runId !== null + ? String(object.runId) + : ""; + message.eventsStartIdx = + object.eventsStartIdx !== undefined && object.eventsStartIdx !== null + ? Number(object.eventsStartIdx) + : undefined; + return message; + }, + + toJSON(message: ListenRunRequest): unknown { + const obj: any = {}; + message.runId !== undefined && (obj.runId = message.runId); + message.eventsStartIdx !== undefined && + (obj.eventsStartIdx = message.eventsStartIdx); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListenRunRequest { + const message = { ...baseListenRunRequest } as ListenRunRequest; + message.runId = object.runId ?? ""; + message.eventsStartIdx = object.eventsStartIdx ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(ListenRunRequest.$type, ListenRunRequest); + +const baseGetRunRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.runs.GetRunRequest", + runId: "", +}; + +export const GetRunRequest = { + $type: "yandex.cloud.ai.assistants.v1.runs.GetRunRequest" as const, + + encode( + message: GetRunRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.runId !== "") { + writer.uint32(10).string(message.runId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetRunRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetRunRequest } as GetRunRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.runId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetRunRequest { + const message = { ...baseGetRunRequest } as GetRunRequest; + message.runId = + object.runId !== undefined && object.runId !== null + ? String(object.runId) + : ""; + return message; + }, + + toJSON(message: GetRunRequest): unknown { + const obj: any = {}; + message.runId !== undefined && (obj.runId = message.runId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetRunRequest { + const message = { ...baseGetRunRequest } as GetRunRequest; + message.runId = object.runId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetRunRequest.$type, GetRunRequest); + +const baseGetLastRunByThreadRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.runs.GetLastRunByThreadRequest", + threadId: "", +}; + +export const GetLastRunByThreadRequest = { + $type: + "yandex.cloud.ai.assistants.v1.runs.GetLastRunByThreadRequest" as const, + + encode( + message: GetLastRunByThreadRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.threadId !== "") { + writer.uint32(10).string(message.threadId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetLastRunByThreadRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetLastRunByThreadRequest, + } as GetLastRunByThreadRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threadId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetLastRunByThreadRequest { + const message = { + ...baseGetLastRunByThreadRequest, + } as GetLastRunByThreadRequest; + message.threadId = + object.threadId !== undefined && object.threadId !== null + ? String(object.threadId) + : ""; + return message; + }, + + toJSON(message: GetLastRunByThreadRequest): unknown { + const obj: any = {}; + message.threadId !== undefined && (obj.threadId = message.threadId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetLastRunByThreadRequest { + const message = { + ...baseGetLastRunByThreadRequest, + } as GetLastRunByThreadRequest; + message.threadId = object.threadId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetLastRunByThreadRequest.$type, + GetLastRunByThreadRequest +); + +const baseListRunsRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.runs.ListRunsRequest", + folderId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListRunsRequest = { + $type: "yandex.cloud.ai.assistants.v1.runs.ListRunsRequest" as const, + + encode( + message: ListRunsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListRunsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListRunsRequest } as ListRunsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListRunsRequest { + const message = { ...baseListRunsRequest } as ListRunsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListRunsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListRunsRequest { + const message = { ...baseListRunsRequest } as ListRunsRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListRunsRequest.$type, ListRunsRequest); + +const baseListRunsResponse: object = { + $type: "yandex.cloud.ai.assistants.v1.runs.ListRunsResponse", + nextPageToken: "", +}; + +export const ListRunsResponse = { + $type: "yandex.cloud.ai.assistants.v1.runs.ListRunsResponse" as const, + + encode( + message: ListRunsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.runs) { + Run.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListRunsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListRunsResponse } as ListRunsResponse; + message.runs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.runs.push(Run.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListRunsResponse { + const message = { ...baseListRunsResponse } as ListRunsResponse; + message.runs = (object.runs ?? []).map((e: any) => Run.fromJSON(e)); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListRunsResponse): unknown { + const obj: any = {}; + if (message.runs) { + obj.runs = message.runs.map((e) => (e ? Run.toJSON(e) : undefined)); + } else { + obj.runs = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListRunsResponse { + const message = { ...baseListRunsResponse } as ListRunsResponse; + message.runs = object.runs?.map((e) => Run.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListRunsResponse.$type, ListRunsResponse); + +const baseStreamCursor: object = { + $type: "yandex.cloud.ai.assistants.v1.runs.StreamCursor", + currentEventIdx: 0, + numUserEventsReceived: 0, +}; + +export const StreamCursor = { + $type: "yandex.cloud.ai.assistants.v1.runs.StreamCursor" as const, + + encode( + message: StreamCursor, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.currentEventIdx !== 0) { + writer.uint32(8).int64(message.currentEventIdx); + } + if (message.numUserEventsReceived !== 0) { + writer.uint32(16).int64(message.numUserEventsReceived); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StreamCursor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStreamCursor } as StreamCursor; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.currentEventIdx = longToNumber(reader.int64() as Long); + break; + case 2: + message.numUserEventsReceived = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StreamCursor { + const message = { ...baseStreamCursor } as StreamCursor; + message.currentEventIdx = + object.currentEventIdx !== undefined && object.currentEventIdx !== null + ? Number(object.currentEventIdx) + : 0; + message.numUserEventsReceived = + object.numUserEventsReceived !== undefined && + object.numUserEventsReceived !== null + ? Number(object.numUserEventsReceived) + : 0; + return message; + }, + + toJSON(message: StreamCursor): unknown { + const obj: any = {}; + message.currentEventIdx !== undefined && + (obj.currentEventIdx = Math.round(message.currentEventIdx)); + message.numUserEventsReceived !== undefined && + (obj.numUserEventsReceived = Math.round(message.numUserEventsReceived)); + return obj; + }, + + fromPartial, I>>( + object: I + ): StreamCursor { + const message = { ...baseStreamCursor } as StreamCursor; + message.currentEventIdx = object.currentEventIdx ?? 0; + message.numUserEventsReceived = object.numUserEventsReceived ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(StreamCursor.$type, StreamCursor); + +const baseStreamEvent: object = { + $type: "yandex.cloud.ai.assistants.v1.runs.StreamEvent", + eventType: 0, +}; + +export const StreamEvent = { + $type: "yandex.cloud.ai.assistants.v1.runs.StreamEvent" as const, + + encode( + message: StreamEvent, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.eventType !== 0) { + writer.uint32(8).int32(message.eventType); + } + if (message.streamCursor !== undefined) { + StreamCursor.encode( + message.streamCursor, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.error !== undefined) { + Error.encode(message.error, writer.uint32(26).fork()).ldelim(); + } + if (message.partialMessage !== undefined) { + MessageContent.encode( + message.partialMessage, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.completedMessage !== undefined) { + Message.encode( + message.completedMessage, + writer.uint32(42).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StreamEvent { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStreamEvent } as StreamEvent; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventType = reader.int32() as any; + break; + case 2: + message.streamCursor = StreamCursor.decode(reader, reader.uint32()); + break; + case 3: + message.error = Error.decode(reader, reader.uint32()); + break; + case 4: + message.partialMessage = MessageContent.decode( + reader, + reader.uint32() + ); + break; + case 5: + message.completedMessage = Message.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StreamEvent { + const message = { ...baseStreamEvent } as StreamEvent; + message.eventType = + object.eventType !== undefined && object.eventType !== null + ? streamEvent_EventTypeFromJSON(object.eventType) + : 0; + message.streamCursor = + object.streamCursor !== undefined && object.streamCursor !== null + ? StreamCursor.fromJSON(object.streamCursor) + : undefined; + message.error = + object.error !== undefined && object.error !== null + ? Error.fromJSON(object.error) + : undefined; + message.partialMessage = + object.partialMessage !== undefined && object.partialMessage !== null + ? MessageContent.fromJSON(object.partialMessage) + : undefined; + message.completedMessage = + object.completedMessage !== undefined && object.completedMessage !== null + ? Message.fromJSON(object.completedMessage) + : undefined; + return message; + }, + + toJSON(message: StreamEvent): unknown { + const obj: any = {}; + message.eventType !== undefined && + (obj.eventType = streamEvent_EventTypeToJSON(message.eventType)); + message.streamCursor !== undefined && + (obj.streamCursor = message.streamCursor + ? StreamCursor.toJSON(message.streamCursor) + : undefined); + message.error !== undefined && + (obj.error = message.error ? Error.toJSON(message.error) : undefined); + message.partialMessage !== undefined && + (obj.partialMessage = message.partialMessage + ? MessageContent.toJSON(message.partialMessage) + : undefined); + message.completedMessage !== undefined && + (obj.completedMessage = message.completedMessage + ? Message.toJSON(message.completedMessage) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): StreamEvent { + const message = { ...baseStreamEvent } as StreamEvent; + message.eventType = object.eventType ?? 0; + message.streamCursor = + object.streamCursor !== undefined && object.streamCursor !== null + ? StreamCursor.fromPartial(object.streamCursor) + : undefined; + message.error = + object.error !== undefined && object.error !== null + ? Error.fromPartial(object.error) + : undefined; + message.partialMessage = + object.partialMessage !== undefined && object.partialMessage !== null + ? MessageContent.fromPartial(object.partialMessage) + : undefined; + message.completedMessage = + object.completedMessage !== undefined && object.completedMessage !== null + ? Message.fromPartial(object.completedMessage) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(StreamEvent.$type, StreamEvent); + +export const RunServiceService = { + create: { + path: "/yandex.cloud.ai.assistants.v1.runs.RunService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateRunRequest) => + Buffer.from(CreateRunRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateRunRequest.decode(value), + responseSerialize: (value: Run) => Buffer.from(Run.encode(value).finish()), + responseDeserialize: (value: Buffer) => Run.decode(value), + }, + listen: { + path: "/yandex.cloud.ai.assistants.v1.runs.RunService/Listen", + requestStream: false, + responseStream: true, + requestSerialize: (value: ListenRunRequest) => + Buffer.from(ListenRunRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListenRunRequest.decode(value), + responseSerialize: (value: StreamEvent) => + Buffer.from(StreamEvent.encode(value).finish()), + responseDeserialize: (value: Buffer) => StreamEvent.decode(value), + }, + get: { + path: "/yandex.cloud.ai.assistants.v1.runs.RunService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetRunRequest) => + Buffer.from(GetRunRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetRunRequest.decode(value), + responseSerialize: (value: Run) => Buffer.from(Run.encode(value).finish()), + responseDeserialize: (value: Buffer) => Run.decode(value), + }, + getLastByThread: { + path: "/yandex.cloud.ai.assistants.v1.runs.RunService/GetLastByThread", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetLastRunByThreadRequest) => + Buffer.from(GetLastRunByThreadRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetLastRunByThreadRequest.decode(value), + responseSerialize: (value: Run) => Buffer.from(Run.encode(value).finish()), + responseDeserialize: (value: Buffer) => Run.decode(value), + }, + list: { + path: "/yandex.cloud.ai.assistants.v1.runs.RunService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListRunsRequest) => + Buffer.from(ListRunsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListRunsRequest.decode(value), + responseSerialize: (value: ListRunsResponse) => + Buffer.from(ListRunsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListRunsResponse.decode(value), + }, +} as const; + +export interface RunServiceServer extends UntypedServiceImplementation { + create: handleUnaryCall; + listen: handleServerStreamingCall; + get: handleUnaryCall; + getLastByThread: handleUnaryCall; + list: handleUnaryCall; +} + +export interface RunServiceClient extends Client { + create( + request: CreateRunRequest, + callback: (error: ServiceError | null, response: Run) => void + ): ClientUnaryCall; + create( + request: CreateRunRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Run) => void + ): ClientUnaryCall; + create( + request: CreateRunRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Run) => void + ): ClientUnaryCall; + listen( + request: ListenRunRequest, + options?: Partial + ): ClientReadableStream; + listen( + request: ListenRunRequest, + metadata?: Metadata, + options?: Partial + ): ClientReadableStream; + get( + request: GetRunRequest, + callback: (error: ServiceError | null, response: Run) => void + ): ClientUnaryCall; + get( + request: GetRunRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Run) => void + ): ClientUnaryCall; + get( + request: GetRunRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Run) => void + ): ClientUnaryCall; + getLastByThread( + request: GetLastRunByThreadRequest, + callback: (error: ServiceError | null, response: Run) => void + ): ClientUnaryCall; + getLastByThread( + request: GetLastRunByThreadRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Run) => void + ): ClientUnaryCall; + getLastByThread( + request: GetLastRunByThreadRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Run) => void + ): ClientUnaryCall; + list( + request: ListRunsRequest, + callback: (error: ServiceError | null, response: ListRunsResponse) => void + ): ClientUnaryCall; + list( + request: ListRunsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: ListRunsResponse) => void + ): ClientUnaryCall; + list( + request: ListRunsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: ListRunsResponse) => void + ): ClientUnaryCall; +} + +export const RunServiceClient = makeGenericClientConstructor( + RunServiceService, + "yandex.cloud.ai.assistants.v1.runs.RunService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): RunServiceClient; + service: typeof RunServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/searchindex/common.ts b/src/generated/yandex/cloud/ai/assistants/v1/searchindex/common.ts new file mode 100644 index 00000000..4a6d86d7 --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/searchindex/common.ts @@ -0,0 +1,223 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1.searchindex"; + +export interface StaticChunkingStrategy { + $type: "yandex.cloud.ai.assistants.v1.searchindex.StaticChunkingStrategy"; + maxChunkSizeTokens: number; + chunkOverlapTokens: number; +} + +export interface ChunkingStrategy { + $type: "yandex.cloud.ai.assistants.v1.searchindex.ChunkingStrategy"; + staticStrategy?: StaticChunkingStrategy | undefined; +} + +const baseStaticChunkingStrategy: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.StaticChunkingStrategy", + maxChunkSizeTokens: 0, + chunkOverlapTokens: 0, +}; + +export const StaticChunkingStrategy = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.StaticChunkingStrategy" as const, + + encode( + message: StaticChunkingStrategy, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.maxChunkSizeTokens !== 0) { + writer.uint32(8).int64(message.maxChunkSizeTokens); + } + if (message.chunkOverlapTokens !== 0) { + writer.uint32(16).int64(message.chunkOverlapTokens); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): StaticChunkingStrategy { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStaticChunkingStrategy } as StaticChunkingStrategy; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxChunkSizeTokens = longToNumber(reader.int64() as Long); + break; + case 2: + message.chunkOverlapTokens = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StaticChunkingStrategy { + const message = { ...baseStaticChunkingStrategy } as StaticChunkingStrategy; + message.maxChunkSizeTokens = + object.maxChunkSizeTokens !== undefined && + object.maxChunkSizeTokens !== null + ? Number(object.maxChunkSizeTokens) + : 0; + message.chunkOverlapTokens = + object.chunkOverlapTokens !== undefined && + object.chunkOverlapTokens !== null + ? Number(object.chunkOverlapTokens) + : 0; + return message; + }, + + toJSON(message: StaticChunkingStrategy): unknown { + const obj: any = {}; + message.maxChunkSizeTokens !== undefined && + (obj.maxChunkSizeTokens = Math.round(message.maxChunkSizeTokens)); + message.chunkOverlapTokens !== undefined && + (obj.chunkOverlapTokens = Math.round(message.chunkOverlapTokens)); + return obj; + }, + + fromPartial, I>>( + object: I + ): StaticChunkingStrategy { + const message = { ...baseStaticChunkingStrategy } as StaticChunkingStrategy; + message.maxChunkSizeTokens = object.maxChunkSizeTokens ?? 0; + message.chunkOverlapTokens = object.chunkOverlapTokens ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(StaticChunkingStrategy.$type, StaticChunkingStrategy); + +const baseChunkingStrategy: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.ChunkingStrategy", +}; + +export const ChunkingStrategy = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.ChunkingStrategy" as const, + + encode( + message: ChunkingStrategy, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.staticStrategy !== undefined) { + StaticChunkingStrategy.encode( + message.staticStrategy, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ChunkingStrategy { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseChunkingStrategy } as ChunkingStrategy; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.staticStrategy = StaticChunkingStrategy.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ChunkingStrategy { + const message = { ...baseChunkingStrategy } as ChunkingStrategy; + message.staticStrategy = + object.staticStrategy !== undefined && object.staticStrategy !== null + ? StaticChunkingStrategy.fromJSON(object.staticStrategy) + : undefined; + return message; + }, + + toJSON(message: ChunkingStrategy): unknown { + const obj: any = {}; + message.staticStrategy !== undefined && + (obj.staticStrategy = message.staticStrategy + ? StaticChunkingStrategy.toJSON(message.staticStrategy) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ChunkingStrategy { + const message = { ...baseChunkingStrategy } as ChunkingStrategy; + message.staticStrategy = + object.staticStrategy !== undefined && object.staticStrategy !== null + ? StaticChunkingStrategy.fromPartial(object.staticStrategy) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ChunkingStrategy.$type, ChunkingStrategy); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index.ts b/src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index.ts new file mode 100644 index 00000000..468a6db0 --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index.ts @@ -0,0 +1,650 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ExpirationConfig } from "../../../../../../yandex/cloud/ai/common/common"; +import { ChunkingStrategy } from "../../../../../../yandex/cloud/ai/assistants/v1/searchindex/common"; +import { Timestamp } from "../../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1.searchindex"; + +export interface SearchIndex { + $type: "yandex.cloud.ai.assistants.v1.searchindex.SearchIndex"; + id: string; + folderId: string; + name: string; + description: string; + createdBy: string; + createdAt?: Date; + updatedBy: string; + updatedAt?: Date; + expirationConfig?: ExpirationConfig; + expiresAt?: Date; + labels: { [key: string]: string }; + textSearchIndex?: TextSearchIndex | undefined; + vectorSearchIndex?: VectorSearchIndex | undefined; +} + +export interface SearchIndex_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.searchindex.SearchIndex.LabelsEntry"; + key: string; + value: string; +} + +export interface TextSearchIndex { + $type: "yandex.cloud.ai.assistants.v1.searchindex.TextSearchIndex"; + chunkingStrategy?: ChunkingStrategy; +} + +export interface VectorSearchIndex { + $type: "yandex.cloud.ai.assistants.v1.searchindex.VectorSearchIndex"; + docEmbedderUri: string; + queryEmbedderUri: string; + chunkingStrategy?: ChunkingStrategy; +} + +const baseSearchIndex: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.SearchIndex", + id: "", + folderId: "", + name: "", + description: "", + createdBy: "", + updatedBy: "", +}; + +export const SearchIndex = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.SearchIndex" as const, + + encode( + message: SearchIndex, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.createdBy !== "") { + writer.uint32(42).string(message.createdBy); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(50).fork() + ).ldelim(); + } + if (message.updatedBy !== "") { + writer.uint32(58).string(message.updatedBy); + } + if (message.updatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.updatedAt), + writer.uint32(66).fork() + ).ldelim(); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.expiresAt !== undefined) { + Timestamp.encode( + toTimestamp(message.expiresAt), + writer.uint32(82).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + SearchIndex_LabelsEntry.encode( + { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.SearchIndex.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(90).fork() + ).ldelim(); + }); + if (message.textSearchIndex !== undefined) { + TextSearchIndex.encode( + message.textSearchIndex, + writer.uint32(98).fork() + ).ldelim(); + } + if (message.vectorSearchIndex !== undefined) { + VectorSearchIndex.encode( + message.vectorSearchIndex, + writer.uint32(106).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SearchIndex { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSearchIndex } as SearchIndex; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.createdBy = reader.string(); + break; + case 6: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 7: + message.updatedBy = reader.string(); + break; + case 8: + message.updatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 9: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 10: + message.expiresAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 11: + const entry11 = SearchIndex_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry11.value !== undefined) { + message.labels[entry11.key] = entry11.value; + } + break; + case 12: + message.textSearchIndex = TextSearchIndex.decode( + reader, + reader.uint32() + ); + break; + case 13: + message.vectorSearchIndex = VectorSearchIndex.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SearchIndex { + const message = { ...baseSearchIndex } as SearchIndex; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.updatedBy = + object.updatedBy !== undefined && object.updatedBy !== null + ? String(object.updatedBy) + : ""; + message.updatedAt = + object.updatedAt !== undefined && object.updatedAt !== null + ? fromJsonTimestamp(object.updatedAt) + : undefined; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.expiresAt = + object.expiresAt !== undefined && object.expiresAt !== null + ? fromJsonTimestamp(object.expiresAt) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.textSearchIndex = + object.textSearchIndex !== undefined && object.textSearchIndex !== null + ? TextSearchIndex.fromJSON(object.textSearchIndex) + : undefined; + message.vectorSearchIndex = + object.vectorSearchIndex !== undefined && + object.vectorSearchIndex !== null + ? VectorSearchIndex.fromJSON(object.vectorSearchIndex) + : undefined; + return message; + }, + + toJSON(message: SearchIndex): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.updatedBy !== undefined && (obj.updatedBy = message.updatedBy); + message.updatedAt !== undefined && + (obj.updatedAt = message.updatedAt.toISOString()); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + message.expiresAt !== undefined && + (obj.expiresAt = message.expiresAt.toISOString()); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.textSearchIndex !== undefined && + (obj.textSearchIndex = message.textSearchIndex + ? TextSearchIndex.toJSON(message.textSearchIndex) + : undefined); + message.vectorSearchIndex !== undefined && + (obj.vectorSearchIndex = message.vectorSearchIndex + ? VectorSearchIndex.toJSON(message.vectorSearchIndex) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): SearchIndex { + const message = { ...baseSearchIndex } as SearchIndex; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.createdBy = object.createdBy ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.updatedBy = object.updatedBy ?? ""; + message.updatedAt = object.updatedAt ?? undefined; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.expiresAt = object.expiresAt ?? undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.textSearchIndex = + object.textSearchIndex !== undefined && object.textSearchIndex !== null + ? TextSearchIndex.fromPartial(object.textSearchIndex) + : undefined; + message.vectorSearchIndex = + object.vectorSearchIndex !== undefined && + object.vectorSearchIndex !== null + ? VectorSearchIndex.fromPartial(object.vectorSearchIndex) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(SearchIndex.$type, SearchIndex); + +const baseSearchIndex_LabelsEntry: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.SearchIndex.LabelsEntry", + key: "", + value: "", +}; + +export const SearchIndex_LabelsEntry = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.SearchIndex.LabelsEntry" as const, + + encode( + message: SearchIndex_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SearchIndex_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSearchIndex_LabelsEntry, + } as SearchIndex_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SearchIndex_LabelsEntry { + const message = { + ...baseSearchIndex_LabelsEntry, + } as SearchIndex_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: SearchIndex_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): SearchIndex_LabelsEntry { + const message = { + ...baseSearchIndex_LabelsEntry, + } as SearchIndex_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(SearchIndex_LabelsEntry.$type, SearchIndex_LabelsEntry); + +const baseTextSearchIndex: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.TextSearchIndex", +}; + +export const TextSearchIndex = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.TextSearchIndex" as const, + + encode( + message: TextSearchIndex, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.chunkingStrategy !== undefined) { + ChunkingStrategy.encode( + message.chunkingStrategy, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TextSearchIndex { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTextSearchIndex } as TextSearchIndex; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chunkingStrategy = ChunkingStrategy.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TextSearchIndex { + const message = { ...baseTextSearchIndex } as TextSearchIndex; + message.chunkingStrategy = + object.chunkingStrategy !== undefined && object.chunkingStrategy !== null + ? ChunkingStrategy.fromJSON(object.chunkingStrategy) + : undefined; + return message; + }, + + toJSON(message: TextSearchIndex): unknown { + const obj: any = {}; + message.chunkingStrategy !== undefined && + (obj.chunkingStrategy = message.chunkingStrategy + ? ChunkingStrategy.toJSON(message.chunkingStrategy) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): TextSearchIndex { + const message = { ...baseTextSearchIndex } as TextSearchIndex; + message.chunkingStrategy = + object.chunkingStrategy !== undefined && object.chunkingStrategy !== null + ? ChunkingStrategy.fromPartial(object.chunkingStrategy) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(TextSearchIndex.$type, TextSearchIndex); + +const baseVectorSearchIndex: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.VectorSearchIndex", + docEmbedderUri: "", + queryEmbedderUri: "", +}; + +export const VectorSearchIndex = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.VectorSearchIndex" as const, + + encode( + message: VectorSearchIndex, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.docEmbedderUri !== "") { + writer.uint32(10).string(message.docEmbedderUri); + } + if (message.queryEmbedderUri !== "") { + writer.uint32(18).string(message.queryEmbedderUri); + } + if (message.chunkingStrategy !== undefined) { + ChunkingStrategy.encode( + message.chunkingStrategy, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): VectorSearchIndex { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVectorSearchIndex } as VectorSearchIndex; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.docEmbedderUri = reader.string(); + break; + case 2: + message.queryEmbedderUri = reader.string(); + break; + case 3: + message.chunkingStrategy = ChunkingStrategy.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): VectorSearchIndex { + const message = { ...baseVectorSearchIndex } as VectorSearchIndex; + message.docEmbedderUri = + object.docEmbedderUri !== undefined && object.docEmbedderUri !== null + ? String(object.docEmbedderUri) + : ""; + message.queryEmbedderUri = + object.queryEmbedderUri !== undefined && object.queryEmbedderUri !== null + ? String(object.queryEmbedderUri) + : ""; + message.chunkingStrategy = + object.chunkingStrategy !== undefined && object.chunkingStrategy !== null + ? ChunkingStrategy.fromJSON(object.chunkingStrategy) + : undefined; + return message; + }, + + toJSON(message: VectorSearchIndex): unknown { + const obj: any = {}; + message.docEmbedderUri !== undefined && + (obj.docEmbedderUri = message.docEmbedderUri); + message.queryEmbedderUri !== undefined && + (obj.queryEmbedderUri = message.queryEmbedderUri); + message.chunkingStrategy !== undefined && + (obj.chunkingStrategy = message.chunkingStrategy + ? ChunkingStrategy.toJSON(message.chunkingStrategy) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): VectorSearchIndex { + const message = { ...baseVectorSearchIndex } as VectorSearchIndex; + message.docEmbedderUri = object.docEmbedderUri ?? ""; + message.queryEmbedderUri = object.queryEmbedderUri ?? ""; + message.chunkingStrategy = + object.chunkingStrategy !== undefined && object.chunkingStrategy !== null + ? ChunkingStrategy.fromPartial(object.chunkingStrategy) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(VectorSearchIndex.$type, VectorSearchIndex); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index_file.ts b/src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index_file.ts new file mode 100644 index 00000000..957e7099 --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index_file.ts @@ -0,0 +1,200 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ChunkingStrategy } from "../../../../../../yandex/cloud/ai/assistants/v1/searchindex/common"; +import { Timestamp } from "../../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1.searchindex"; + +export interface SearchIndexFile { + $type: "yandex.cloud.ai.assistants.v1.searchindex.SearchIndexFile"; + id: string; + searchIndexId: string; + createdBy: string; + createdAt?: Date; + chunkingStrategy?: ChunkingStrategy; +} + +const baseSearchIndexFile: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.SearchIndexFile", + id: "", + searchIndexId: "", + createdBy: "", +}; + +export const SearchIndexFile = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.SearchIndexFile" as const, + + encode( + message: SearchIndexFile, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.searchIndexId !== "") { + writer.uint32(18).string(message.searchIndexId); + } + if (message.createdBy !== "") { + writer.uint32(26).string(message.createdBy); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(34).fork() + ).ldelim(); + } + if (message.chunkingStrategy !== undefined) { + ChunkingStrategy.encode( + message.chunkingStrategy, + writer.uint32(42).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SearchIndexFile { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSearchIndexFile } as SearchIndexFile; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.searchIndexId = reader.string(); + break; + case 3: + message.createdBy = reader.string(); + break; + case 4: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 5: + message.chunkingStrategy = ChunkingStrategy.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SearchIndexFile { + const message = { ...baseSearchIndexFile } as SearchIndexFile; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.searchIndexId = + object.searchIndexId !== undefined && object.searchIndexId !== null + ? String(object.searchIndexId) + : ""; + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.chunkingStrategy = + object.chunkingStrategy !== undefined && object.chunkingStrategy !== null + ? ChunkingStrategy.fromJSON(object.chunkingStrategy) + : undefined; + return message; + }, + + toJSON(message: SearchIndexFile): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.searchIndexId !== undefined && + (obj.searchIndexId = message.searchIndexId); + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.chunkingStrategy !== undefined && + (obj.chunkingStrategy = message.chunkingStrategy + ? ChunkingStrategy.toJSON(message.chunkingStrategy) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): SearchIndexFile { + const message = { ...baseSearchIndexFile } as SearchIndexFile; + message.id = object.id ?? ""; + message.searchIndexId = object.searchIndexId ?? ""; + message.createdBy = object.createdBy ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.chunkingStrategy = + object.chunkingStrategy !== undefined && object.chunkingStrategy !== null + ? ChunkingStrategy.fromPartial(object.chunkingStrategy) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(SearchIndexFile.$type, SearchIndexFile); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index_file_service.ts b/src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index_file_service.ts new file mode 100644 index 00000000..8556ae7e --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index_file_service.ts @@ -0,0 +1,468 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { SearchIndexFile } from "../../../../../../yandex/cloud/ai/assistants/v1/searchindex/search_index_file"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1.searchindex"; + +export interface GetSearchIndexFileRequest { + $type: "yandex.cloud.ai.assistants.v1.searchindex.GetSearchIndexFileRequest"; + fileId: string; + searchIndexId: string; +} + +export interface ListSearchIndexFilesRequest { + $type: "yandex.cloud.ai.assistants.v1.searchindex.ListSearchIndexFilesRequest"; + searchIndexId: string; + pageSize: number; + pageToken: string; +} + +export interface ListSearchIndexFilesResponse { + $type: "yandex.cloud.ai.assistants.v1.searchindex.ListSearchIndexFilesResponse"; + files: SearchIndexFile[]; + nextPageToken: string; +} + +const baseGetSearchIndexFileRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.GetSearchIndexFileRequest", + fileId: "", + searchIndexId: "", +}; + +export const GetSearchIndexFileRequest = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.GetSearchIndexFileRequest" as const, + + encode( + message: GetSearchIndexFileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.fileId !== "") { + writer.uint32(10).string(message.fileId); + } + if (message.searchIndexId !== "") { + writer.uint32(18).string(message.searchIndexId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetSearchIndexFileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetSearchIndexFileRequest, + } as GetSearchIndexFileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fileId = reader.string(); + break; + case 2: + message.searchIndexId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetSearchIndexFileRequest { + const message = { + ...baseGetSearchIndexFileRequest, + } as GetSearchIndexFileRequest; + message.fileId = + object.fileId !== undefined && object.fileId !== null + ? String(object.fileId) + : ""; + message.searchIndexId = + object.searchIndexId !== undefined && object.searchIndexId !== null + ? String(object.searchIndexId) + : ""; + return message; + }, + + toJSON(message: GetSearchIndexFileRequest): unknown { + const obj: any = {}; + message.fileId !== undefined && (obj.fileId = message.fileId); + message.searchIndexId !== undefined && + (obj.searchIndexId = message.searchIndexId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetSearchIndexFileRequest { + const message = { + ...baseGetSearchIndexFileRequest, + } as GetSearchIndexFileRequest; + message.fileId = object.fileId ?? ""; + message.searchIndexId = object.searchIndexId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetSearchIndexFileRequest.$type, + GetSearchIndexFileRequest +); + +const baseListSearchIndexFilesRequest: object = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.ListSearchIndexFilesRequest", + searchIndexId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListSearchIndexFilesRequest = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.ListSearchIndexFilesRequest" as const, + + encode( + message: ListSearchIndexFilesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.searchIndexId !== "") { + writer.uint32(10).string(message.searchIndexId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListSearchIndexFilesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListSearchIndexFilesRequest, + } as ListSearchIndexFilesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.searchIndexId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListSearchIndexFilesRequest { + const message = { + ...baseListSearchIndexFilesRequest, + } as ListSearchIndexFilesRequest; + message.searchIndexId = + object.searchIndexId !== undefined && object.searchIndexId !== null + ? String(object.searchIndexId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListSearchIndexFilesRequest): unknown { + const obj: any = {}; + message.searchIndexId !== undefined && + (obj.searchIndexId = message.searchIndexId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListSearchIndexFilesRequest { + const message = { + ...baseListSearchIndexFilesRequest, + } as ListSearchIndexFilesRequest; + message.searchIndexId = object.searchIndexId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListSearchIndexFilesRequest.$type, + ListSearchIndexFilesRequest +); + +const baseListSearchIndexFilesResponse: object = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.ListSearchIndexFilesResponse", + nextPageToken: "", +}; + +export const ListSearchIndexFilesResponse = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.ListSearchIndexFilesResponse" as const, + + encode( + message: ListSearchIndexFilesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.files) { + SearchIndexFile.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListSearchIndexFilesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListSearchIndexFilesResponse, + } as ListSearchIndexFilesResponse; + message.files = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.files.push(SearchIndexFile.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListSearchIndexFilesResponse { + const message = { + ...baseListSearchIndexFilesResponse, + } as ListSearchIndexFilesResponse; + message.files = (object.files ?? []).map((e: any) => + SearchIndexFile.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListSearchIndexFilesResponse): unknown { + const obj: any = {}; + if (message.files) { + obj.files = message.files.map((e) => + e ? SearchIndexFile.toJSON(e) : undefined + ); + } else { + obj.files = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListSearchIndexFilesResponse { + const message = { + ...baseListSearchIndexFilesResponse, + } as ListSearchIndexFilesResponse; + message.files = + object.files?.map((e) => SearchIndexFile.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListSearchIndexFilesResponse.$type, + ListSearchIndexFilesResponse +); + +export const SearchIndexFileServiceService = { + get: { + path: "/yandex.cloud.ai.assistants.v1.searchindex.SearchIndexFileService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetSearchIndexFileRequest) => + Buffer.from(GetSearchIndexFileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetSearchIndexFileRequest.decode(value), + responseSerialize: (value: SearchIndexFile) => + Buffer.from(SearchIndexFile.encode(value).finish()), + responseDeserialize: (value: Buffer) => SearchIndexFile.decode(value), + }, + list: { + path: "/yandex.cloud.ai.assistants.v1.searchindex.SearchIndexFileService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListSearchIndexFilesRequest) => + Buffer.from(ListSearchIndexFilesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListSearchIndexFilesRequest.decode(value), + responseSerialize: (value: ListSearchIndexFilesResponse) => + Buffer.from(ListSearchIndexFilesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListSearchIndexFilesResponse.decode(value), + }, +} as const; + +export interface SearchIndexFileServiceServer + extends UntypedServiceImplementation { + get: handleUnaryCall; + list: handleUnaryCall< + ListSearchIndexFilesRequest, + ListSearchIndexFilesResponse + >; +} + +export interface SearchIndexFileServiceClient extends Client { + get( + request: GetSearchIndexFileRequest, + callback: (error: ServiceError | null, response: SearchIndexFile) => void + ): ClientUnaryCall; + get( + request: GetSearchIndexFileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: SearchIndexFile) => void + ): ClientUnaryCall; + get( + request: GetSearchIndexFileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: SearchIndexFile) => void + ): ClientUnaryCall; + list( + request: ListSearchIndexFilesRequest, + callback: ( + error: ServiceError | null, + response: ListSearchIndexFilesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListSearchIndexFilesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListSearchIndexFilesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListSearchIndexFilesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListSearchIndexFilesResponse + ) => void + ): ClientUnaryCall; +} + +export const SearchIndexFileServiceClient = makeGenericClientConstructor( + SearchIndexFileServiceService, + "yandex.cloud.ai.assistants.v1.searchindex.SearchIndexFileService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): SearchIndexFileServiceClient; + service: typeof SearchIndexFileServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index_service.ts b/src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index_service.ts new file mode 100644 index 00000000..1058930a --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/searchindex/search_index_service.ts @@ -0,0 +1,1311 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { ExpirationConfig } from "../../../../../../yandex/cloud/ai/common/common"; +import { FieldMask } from "../../../../../../google/protobuf/field_mask"; +import { + TextSearchIndex, + VectorSearchIndex, + SearchIndex, +} from "../../../../../../yandex/cloud/ai/assistants/v1/searchindex/search_index"; +import { Operation } from "../../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1.searchindex"; + +export interface CreateSearchIndexRequest { + $type: "yandex.cloud.ai.assistants.v1.searchindex.CreateSearchIndexRequest"; + folderId: string; + fileIds: string[]; + name: string; + description: string; + expirationConfig?: ExpirationConfig; + labels: { [key: string]: string }; + textSearchIndex?: TextSearchIndex | undefined; + vectorSearchIndex?: VectorSearchIndex | undefined; +} + +export interface CreateSearchIndexRequest_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.searchindex.CreateSearchIndexRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface GetSearchIndexRequest { + $type: "yandex.cloud.ai.assistants.v1.searchindex.GetSearchIndexRequest"; + searchIndexId: string; +} + +export interface UpdateSearchIndexRequest { + $type: "yandex.cloud.ai.assistants.v1.searchindex.UpdateSearchIndexRequest"; + searchIndexId: string; + updateMask?: FieldMask; + name: string; + description: string; + expirationConfig?: ExpirationConfig; + labels: { [key: string]: string }; +} + +export interface UpdateSearchIndexRequest_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.searchindex.UpdateSearchIndexRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface DeleteSearchIndexRequest { + $type: "yandex.cloud.ai.assistants.v1.searchindex.DeleteSearchIndexRequest"; + searchIndexId: string; +} + +export interface DeleteSearchIndexResponse { + $type: "yandex.cloud.ai.assistants.v1.searchindex.DeleteSearchIndexResponse"; +} + +export interface ListSearchIndicesRequest { + $type: "yandex.cloud.ai.assistants.v1.searchindex.ListSearchIndicesRequest"; + folderId: string; + pageSize: number; + pageToken: string; +} + +export interface ListSearchIndicesResponse { + $type: "yandex.cloud.ai.assistants.v1.searchindex.ListSearchIndicesResponse"; + indices: SearchIndex[]; + nextPageToken: string; +} + +const baseCreateSearchIndexRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.CreateSearchIndexRequest", + folderId: "", + fileIds: "", + name: "", + description: "", +}; + +export const CreateSearchIndexRequest = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.CreateSearchIndexRequest" as const, + + encode( + message: CreateSearchIndexRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + for (const v of message.fileIds) { + writer.uint32(18).string(v!); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(42).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateSearchIndexRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.CreateSearchIndexRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + if (message.textSearchIndex !== undefined) { + TextSearchIndex.encode( + message.textSearchIndex, + writer.uint32(58).fork() + ).ldelim(); + } + if (message.vectorSearchIndex !== undefined) { + VectorSearchIndex.encode( + message.vectorSearchIndex, + writer.uint32(66).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateSearchIndexRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateSearchIndexRequest, + } as CreateSearchIndexRequest; + message.fileIds = []; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.fileIds.push(reader.string()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 6: + const entry6 = CreateSearchIndexRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + case 7: + message.textSearchIndex = TextSearchIndex.decode( + reader, + reader.uint32() + ); + break; + case 8: + message.vectorSearchIndex = VectorSearchIndex.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateSearchIndexRequest { + const message = { + ...baseCreateSearchIndexRequest, + } as CreateSearchIndexRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.fileIds = (object.fileIds ?? []).map((e: any) => String(e)); + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.textSearchIndex = + object.textSearchIndex !== undefined && object.textSearchIndex !== null + ? TextSearchIndex.fromJSON(object.textSearchIndex) + : undefined; + message.vectorSearchIndex = + object.vectorSearchIndex !== undefined && + object.vectorSearchIndex !== null + ? VectorSearchIndex.fromJSON(object.vectorSearchIndex) + : undefined; + return message; + }, + + toJSON(message: CreateSearchIndexRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + if (message.fileIds) { + obj.fileIds = message.fileIds.map((e) => e); + } else { + obj.fileIds = []; + } + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.textSearchIndex !== undefined && + (obj.textSearchIndex = message.textSearchIndex + ? TextSearchIndex.toJSON(message.textSearchIndex) + : undefined); + message.vectorSearchIndex !== undefined && + (obj.vectorSearchIndex = message.vectorSearchIndex + ? VectorSearchIndex.toJSON(message.vectorSearchIndex) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateSearchIndexRequest { + const message = { + ...baseCreateSearchIndexRequest, + } as CreateSearchIndexRequest; + message.folderId = object.folderId ?? ""; + message.fileIds = object.fileIds?.map((e) => e) || []; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.textSearchIndex = + object.textSearchIndex !== undefined && object.textSearchIndex !== null + ? TextSearchIndex.fromPartial(object.textSearchIndex) + : undefined; + message.vectorSearchIndex = + object.vectorSearchIndex !== undefined && + object.vectorSearchIndex !== null + ? VectorSearchIndex.fromPartial(object.vectorSearchIndex) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + CreateSearchIndexRequest.$type, + CreateSearchIndexRequest +); + +const baseCreateSearchIndexRequest_LabelsEntry: object = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.CreateSearchIndexRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateSearchIndexRequest_LabelsEntry = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.CreateSearchIndexRequest.LabelsEntry" as const, + + encode( + message: CreateSearchIndexRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateSearchIndexRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateSearchIndexRequest_LabelsEntry, + } as CreateSearchIndexRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateSearchIndexRequest_LabelsEntry { + const message = { + ...baseCreateSearchIndexRequest_LabelsEntry, + } as CreateSearchIndexRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateSearchIndexRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateSearchIndexRequest_LabelsEntry { + const message = { + ...baseCreateSearchIndexRequest_LabelsEntry, + } as CreateSearchIndexRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateSearchIndexRequest_LabelsEntry.$type, + CreateSearchIndexRequest_LabelsEntry +); + +const baseGetSearchIndexRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.GetSearchIndexRequest", + searchIndexId: "", +}; + +export const GetSearchIndexRequest = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.GetSearchIndexRequest" as const, + + encode( + message: GetSearchIndexRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.searchIndexId !== "") { + writer.uint32(10).string(message.searchIndexId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetSearchIndexRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetSearchIndexRequest } as GetSearchIndexRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.searchIndexId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetSearchIndexRequest { + const message = { ...baseGetSearchIndexRequest } as GetSearchIndexRequest; + message.searchIndexId = + object.searchIndexId !== undefined && object.searchIndexId !== null + ? String(object.searchIndexId) + : ""; + return message; + }, + + toJSON(message: GetSearchIndexRequest): unknown { + const obj: any = {}; + message.searchIndexId !== undefined && + (obj.searchIndexId = message.searchIndexId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetSearchIndexRequest { + const message = { ...baseGetSearchIndexRequest } as GetSearchIndexRequest; + message.searchIndexId = object.searchIndexId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetSearchIndexRequest.$type, GetSearchIndexRequest); + +const baseUpdateSearchIndexRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.UpdateSearchIndexRequest", + searchIndexId: "", + name: "", + description: "", +}; + +export const UpdateSearchIndexRequest = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.UpdateSearchIndexRequest" as const, + + encode( + message: UpdateSearchIndexRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.searchIndexId !== "") { + writer.uint32(10).string(message.searchIndexId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(42).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateSearchIndexRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.UpdateSearchIndexRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateSearchIndexRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateSearchIndexRequest, + } as UpdateSearchIndexRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.searchIndexId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 6: + const entry6 = UpdateSearchIndexRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateSearchIndexRequest { + const message = { + ...baseUpdateSearchIndexRequest, + } as UpdateSearchIndexRequest; + message.searchIndexId = + object.searchIndexId !== undefined && object.searchIndexId !== null + ? String(object.searchIndexId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: UpdateSearchIndexRequest): unknown { + const obj: any = {}; + message.searchIndexId !== undefined && + (obj.searchIndexId = message.searchIndexId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateSearchIndexRequest { + const message = { + ...baseUpdateSearchIndexRequest, + } as UpdateSearchIndexRequest; + message.searchIndexId = object.searchIndexId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set( + UpdateSearchIndexRequest.$type, + UpdateSearchIndexRequest +); + +const baseUpdateSearchIndexRequest_LabelsEntry: object = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.UpdateSearchIndexRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateSearchIndexRequest_LabelsEntry = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.UpdateSearchIndexRequest.LabelsEntry" as const, + + encode( + message: UpdateSearchIndexRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateSearchIndexRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateSearchIndexRequest_LabelsEntry, + } as UpdateSearchIndexRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateSearchIndexRequest_LabelsEntry { + const message = { + ...baseUpdateSearchIndexRequest_LabelsEntry, + } as UpdateSearchIndexRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateSearchIndexRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateSearchIndexRequest_LabelsEntry { + const message = { + ...baseUpdateSearchIndexRequest_LabelsEntry, + } as UpdateSearchIndexRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateSearchIndexRequest_LabelsEntry.$type, + UpdateSearchIndexRequest_LabelsEntry +); + +const baseDeleteSearchIndexRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.DeleteSearchIndexRequest", + searchIndexId: "", +}; + +export const DeleteSearchIndexRequest = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.DeleteSearchIndexRequest" as const, + + encode( + message: DeleteSearchIndexRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.searchIndexId !== "") { + writer.uint32(10).string(message.searchIndexId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteSearchIndexRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteSearchIndexRequest, + } as DeleteSearchIndexRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.searchIndexId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteSearchIndexRequest { + const message = { + ...baseDeleteSearchIndexRequest, + } as DeleteSearchIndexRequest; + message.searchIndexId = + object.searchIndexId !== undefined && object.searchIndexId !== null + ? String(object.searchIndexId) + : ""; + return message; + }, + + toJSON(message: DeleteSearchIndexRequest): unknown { + const obj: any = {}; + message.searchIndexId !== undefined && + (obj.searchIndexId = message.searchIndexId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteSearchIndexRequest { + const message = { + ...baseDeleteSearchIndexRequest, + } as DeleteSearchIndexRequest; + message.searchIndexId = object.searchIndexId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteSearchIndexRequest.$type, + DeleteSearchIndexRequest +); + +const baseDeleteSearchIndexResponse: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.DeleteSearchIndexResponse", +}; + +export const DeleteSearchIndexResponse = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.DeleteSearchIndexResponse" as const, + + encode( + _: DeleteSearchIndexResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteSearchIndexResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteSearchIndexResponse, + } as DeleteSearchIndexResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): DeleteSearchIndexResponse { + const message = { + ...baseDeleteSearchIndexResponse, + } as DeleteSearchIndexResponse; + return message; + }, + + toJSON(_: DeleteSearchIndexResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): DeleteSearchIndexResponse { + const message = { + ...baseDeleteSearchIndexResponse, + } as DeleteSearchIndexResponse; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteSearchIndexResponse.$type, + DeleteSearchIndexResponse +); + +const baseListSearchIndicesRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.ListSearchIndicesRequest", + folderId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListSearchIndicesRequest = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.ListSearchIndicesRequest" as const, + + encode( + message: ListSearchIndicesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListSearchIndicesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListSearchIndicesRequest, + } as ListSearchIndicesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListSearchIndicesRequest { + const message = { + ...baseListSearchIndicesRequest, + } as ListSearchIndicesRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListSearchIndicesRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListSearchIndicesRequest { + const message = { + ...baseListSearchIndicesRequest, + } as ListSearchIndicesRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListSearchIndicesRequest.$type, + ListSearchIndicesRequest +); + +const baseListSearchIndicesResponse: object = { + $type: "yandex.cloud.ai.assistants.v1.searchindex.ListSearchIndicesResponse", + nextPageToken: "", +}; + +export const ListSearchIndicesResponse = { + $type: + "yandex.cloud.ai.assistants.v1.searchindex.ListSearchIndicesResponse" as const, + + encode( + message: ListSearchIndicesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.indices) { + SearchIndex.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListSearchIndicesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListSearchIndicesResponse, + } as ListSearchIndicesResponse; + message.indices = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.indices.push(SearchIndex.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListSearchIndicesResponse { + const message = { + ...baseListSearchIndicesResponse, + } as ListSearchIndicesResponse; + message.indices = (object.indices ?? []).map((e: any) => + SearchIndex.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListSearchIndicesResponse): unknown { + const obj: any = {}; + if (message.indices) { + obj.indices = message.indices.map((e) => + e ? SearchIndex.toJSON(e) : undefined + ); + } else { + obj.indices = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListSearchIndicesResponse { + const message = { + ...baseListSearchIndicesResponse, + } as ListSearchIndicesResponse; + message.indices = + object.indices?.map((e) => SearchIndex.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListSearchIndicesResponse.$type, + ListSearchIndicesResponse +); + +export const SearchIndexServiceService = { + create: { + path: "/yandex.cloud.ai.assistants.v1.searchindex.SearchIndexService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateSearchIndexRequest) => + Buffer.from(CreateSearchIndexRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CreateSearchIndexRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + get: { + path: "/yandex.cloud.ai.assistants.v1.searchindex.SearchIndexService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetSearchIndexRequest) => + Buffer.from(GetSearchIndexRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetSearchIndexRequest.decode(value), + responseSerialize: (value: SearchIndex) => + Buffer.from(SearchIndex.encode(value).finish()), + responseDeserialize: (value: Buffer) => SearchIndex.decode(value), + }, + update: { + path: "/yandex.cloud.ai.assistants.v1.searchindex.SearchIndexService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateSearchIndexRequest) => + Buffer.from(UpdateSearchIndexRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateSearchIndexRequest.decode(value), + responseSerialize: (value: SearchIndex) => + Buffer.from(SearchIndex.encode(value).finish()), + responseDeserialize: (value: Buffer) => SearchIndex.decode(value), + }, + delete: { + path: "/yandex.cloud.ai.assistants.v1.searchindex.SearchIndexService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteSearchIndexRequest) => + Buffer.from(DeleteSearchIndexRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteSearchIndexRequest.decode(value), + responseSerialize: (value: DeleteSearchIndexResponse) => + Buffer.from(DeleteSearchIndexResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + DeleteSearchIndexResponse.decode(value), + }, + list: { + path: "/yandex.cloud.ai.assistants.v1.searchindex.SearchIndexService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListSearchIndicesRequest) => + Buffer.from(ListSearchIndicesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListSearchIndicesRequest.decode(value), + responseSerialize: (value: ListSearchIndicesResponse) => + Buffer.from(ListSearchIndicesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListSearchIndicesResponse.decode(value), + }, +} as const; + +export interface SearchIndexServiceServer extends UntypedServiceImplementation { + create: handleUnaryCall; + get: handleUnaryCall; + update: handleUnaryCall; + delete: handleUnaryCall; + list: handleUnaryCall; +} + +export interface SearchIndexServiceClient extends Client { + create( + request: CreateSearchIndexRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateSearchIndexRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateSearchIndexRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + get( + request: GetSearchIndexRequest, + callback: (error: ServiceError | null, response: SearchIndex) => void + ): ClientUnaryCall; + get( + request: GetSearchIndexRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: SearchIndex) => void + ): ClientUnaryCall; + get( + request: GetSearchIndexRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: SearchIndex) => void + ): ClientUnaryCall; + update( + request: UpdateSearchIndexRequest, + callback: (error: ServiceError | null, response: SearchIndex) => void + ): ClientUnaryCall; + update( + request: UpdateSearchIndexRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: SearchIndex) => void + ): ClientUnaryCall; + update( + request: UpdateSearchIndexRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: SearchIndex) => void + ): ClientUnaryCall; + delete( + request: DeleteSearchIndexRequest, + callback: ( + error: ServiceError | null, + response: DeleteSearchIndexResponse + ) => void + ): ClientUnaryCall; + delete( + request: DeleteSearchIndexRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: DeleteSearchIndexResponse + ) => void + ): ClientUnaryCall; + delete( + request: DeleteSearchIndexRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: DeleteSearchIndexResponse + ) => void + ): ClientUnaryCall; + list( + request: ListSearchIndicesRequest, + callback: ( + error: ServiceError | null, + response: ListSearchIndicesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListSearchIndicesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListSearchIndicesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListSearchIndicesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListSearchIndicesResponse + ) => void + ): ClientUnaryCall; +} + +export const SearchIndexServiceClient = makeGenericClientConstructor( + SearchIndexServiceService, + "yandex.cloud.ai.assistants.v1.searchindex.SearchIndexService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): SearchIndexServiceClient; + service: typeof SearchIndexServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/threads/message.ts b/src/generated/yandex/cloud/ai/assistants/v1/threads/message.ts new file mode 100644 index 00000000..92bfba84 --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/threads/message.ts @@ -0,0 +1,826 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1.threads"; + +export interface Message { + $type: "yandex.cloud.ai.assistants.v1.threads.Message"; + id: string; + threadId: string; + createdBy: string; + createdAt?: Date; + author?: Author; + labels: { [key: string]: string }; + content?: MessageContent; +} + +export interface Message_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.threads.Message.LabelsEntry"; + key: string; + value: string; +} + +export interface MessageContent { + $type: "yandex.cloud.ai.assistants.v1.threads.MessageContent"; + content: ContentPart[]; +} + +export interface MessageData { + $type: "yandex.cloud.ai.assistants.v1.threads.MessageData"; + author?: Author; + labels: { [key: string]: string }; + content?: MessageContent; +} + +export interface MessageData_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.threads.MessageData.LabelsEntry"; + key: string; + value: string; +} + +export interface Text { + $type: "yandex.cloud.ai.assistants.v1.threads.Text"; + content: string; +} + +export interface ContentPart { + $type: "yandex.cloud.ai.assistants.v1.threads.ContentPart"; + text?: Text | undefined; +} + +export interface Author { + $type: "yandex.cloud.ai.assistants.v1.threads.Author"; + id: string; + role: string; +} + +const baseMessage: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.Message", + id: "", + threadId: "", + createdBy: "", +}; + +export const Message = { + $type: "yandex.cloud.ai.assistants.v1.threads.Message" as const, + + encode( + message: Message, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.threadId !== "") { + writer.uint32(18).string(message.threadId); + } + if (message.createdBy !== "") { + writer.uint32(26).string(message.createdBy); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(34).fork() + ).ldelim(); + } + if (message.author !== undefined) { + Author.encode(message.author, writer.uint32(42).fork()).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + Message_LabelsEntry.encode( + { + $type: "yandex.cloud.ai.assistants.v1.threads.Message.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + if (message.content !== undefined) { + MessageContent.encode(message.content, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Message { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessage } as Message; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.threadId = reader.string(); + break; + case 3: + message.createdBy = reader.string(); + break; + case 4: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 5: + message.author = Author.decode(reader, reader.uint32()); + break; + case 6: + const entry6 = Message_LabelsEntry.decode(reader, reader.uint32()); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + case 7: + message.content = MessageContent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Message { + const message = { ...baseMessage } as Message; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.threadId = + object.threadId !== undefined && object.threadId !== null + ? String(object.threadId) + : ""; + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.author = + object.author !== undefined && object.author !== null + ? Author.fromJSON(object.author) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.content = + object.content !== undefined && object.content !== null + ? MessageContent.fromJSON(object.content) + : undefined; + return message; + }, + + toJSON(message: Message): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.threadId !== undefined && (obj.threadId = message.threadId); + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.author !== undefined && + (obj.author = message.author ? Author.toJSON(message.author) : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.content !== undefined && + (obj.content = message.content + ? MessageContent.toJSON(message.content) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Message { + const message = { ...baseMessage } as Message; + message.id = object.id ?? ""; + message.threadId = object.threadId ?? ""; + message.createdBy = object.createdBy ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.author = + object.author !== undefined && object.author !== null + ? Author.fromPartial(object.author) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.content = + object.content !== undefined && object.content !== null + ? MessageContent.fromPartial(object.content) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Message.$type, Message); + +const baseMessage_LabelsEntry: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.Message.LabelsEntry", + key: "", + value: "", +}; + +export const Message_LabelsEntry = { + $type: "yandex.cloud.ai.assistants.v1.threads.Message.LabelsEntry" as const, + + encode( + message: Message_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Message_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessage_LabelsEntry } as Message_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Message_LabelsEntry { + const message = { ...baseMessage_LabelsEntry } as Message_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Message_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Message_LabelsEntry { + const message = { ...baseMessage_LabelsEntry } as Message_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Message_LabelsEntry.$type, Message_LabelsEntry); + +const baseMessageContent: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.MessageContent", +}; + +export const MessageContent = { + $type: "yandex.cloud.ai.assistants.v1.threads.MessageContent" as const, + + encode( + message: MessageContent, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.content) { + ContentPart.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MessageContent { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessageContent } as MessageContent; + message.content = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content.push(ContentPart.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MessageContent { + const message = { ...baseMessageContent } as MessageContent; + message.content = (object.content ?? []).map((e: any) => + ContentPart.fromJSON(e) + ); + return message; + }, + + toJSON(message: MessageContent): unknown { + const obj: any = {}; + if (message.content) { + obj.content = message.content.map((e) => + e ? ContentPart.toJSON(e) : undefined + ); + } else { + obj.content = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): MessageContent { + const message = { ...baseMessageContent } as MessageContent; + message.content = + object.content?.map((e) => ContentPart.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(MessageContent.$type, MessageContent); + +const baseMessageData: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.MessageData", +}; + +export const MessageData = { + $type: "yandex.cloud.ai.assistants.v1.threads.MessageData" as const, + + encode( + message: MessageData, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.author !== undefined) { + Author.encode(message.author, writer.uint32(10).fork()).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + MessageData_LabelsEntry.encode( + { + $type: + "yandex.cloud.ai.assistants.v1.threads.MessageData.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(18).fork() + ).ldelim(); + }); + if (message.content !== undefined) { + MessageContent.encode(message.content, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MessageData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessageData } as MessageData; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.author = Author.decode(reader, reader.uint32()); + break; + case 2: + const entry2 = MessageData_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry2.value !== undefined) { + message.labels[entry2.key] = entry2.value; + } + break; + case 3: + message.content = MessageContent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MessageData { + const message = { ...baseMessageData } as MessageData; + message.author = + object.author !== undefined && object.author !== null + ? Author.fromJSON(object.author) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.content = + object.content !== undefined && object.content !== null + ? MessageContent.fromJSON(object.content) + : undefined; + return message; + }, + + toJSON(message: MessageData): unknown { + const obj: any = {}; + message.author !== undefined && + (obj.author = message.author ? Author.toJSON(message.author) : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.content !== undefined && + (obj.content = message.content + ? MessageContent.toJSON(message.content) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MessageData { + const message = { ...baseMessageData } as MessageData; + message.author = + object.author !== undefined && object.author !== null + ? Author.fromPartial(object.author) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.content = + object.content !== undefined && object.content !== null + ? MessageContent.fromPartial(object.content) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MessageData.$type, MessageData); + +const baseMessageData_LabelsEntry: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.MessageData.LabelsEntry", + key: "", + value: "", +}; + +export const MessageData_LabelsEntry = { + $type: + "yandex.cloud.ai.assistants.v1.threads.MessageData.LabelsEntry" as const, + + encode( + message: MessageData_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MessageData_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMessageData_LabelsEntry, + } as MessageData_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MessageData_LabelsEntry { + const message = { + ...baseMessageData_LabelsEntry, + } as MessageData_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: MessageData_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): MessageData_LabelsEntry { + const message = { + ...baseMessageData_LabelsEntry, + } as MessageData_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(MessageData_LabelsEntry.$type, MessageData_LabelsEntry); + +const baseText: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.Text", + content: "", +}; + +export const Text = { + $type: "yandex.cloud.ai.assistants.v1.threads.Text" as const, + + encode(message: Text, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.content !== "") { + writer.uint32(10).string(message.content); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Text { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseText } as Text; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Text { + const message = { ...baseText } as Text; + message.content = + object.content !== undefined && object.content !== null + ? String(object.content) + : ""; + return message; + }, + + toJSON(message: Text): unknown { + const obj: any = {}; + message.content !== undefined && (obj.content = message.content); + return obj; + }, + + fromPartial, I>>(object: I): Text { + const message = { ...baseText } as Text; + message.content = object.content ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Text.$type, Text); + +const baseContentPart: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.ContentPart", +}; + +export const ContentPart = { + $type: "yandex.cloud.ai.assistants.v1.threads.ContentPart" as const, + + encode( + message: ContentPart, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.text !== undefined) { + Text.encode(message.text, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ContentPart { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseContentPart } as ContentPart; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = Text.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ContentPart { + const message = { ...baseContentPart } as ContentPart; + message.text = + object.text !== undefined && object.text !== null + ? Text.fromJSON(object.text) + : undefined; + return message; + }, + + toJSON(message: ContentPart): unknown { + const obj: any = {}; + message.text !== undefined && + (obj.text = message.text ? Text.toJSON(message.text) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ContentPart { + const message = { ...baseContentPart } as ContentPart; + message.text = + object.text !== undefined && object.text !== null + ? Text.fromPartial(object.text) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ContentPart.$type, ContentPart); + +const baseAuthor: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.Author", + id: "", + role: "", +}; + +export const Author = { + $type: "yandex.cloud.ai.assistants.v1.threads.Author" as const, + + encode( + message: Author, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.role !== "") { + writer.uint32(18).string(message.role); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Author { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAuthor } as Author; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.role = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Author { + const message = { ...baseAuthor } as Author; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.role = + object.role !== undefined && object.role !== null + ? String(object.role) + : ""; + return message; + }, + + toJSON(message: Author): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.role !== undefined && (obj.role = message.role); + return obj; + }, + + fromPartial, I>>(object: I): Author { + const message = { ...baseAuthor } as Author; + message.id = object.id ?? ""; + message.role = object.role ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Author.$type, Author); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/threads/message_service.ts b/src/generated/yandex/cloud/ai/assistants/v1/threads/message_service.ts new file mode 100644 index 00000000..e4da4aa6 --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/threads/message_service.ts @@ -0,0 +1,542 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + handleServerStreamingCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ClientReadableStream, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + Author, + MessageContent, + Message, +} from "../../../../../../yandex/cloud/ai/assistants/v1/threads/message"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1.threads"; + +export interface CreateMessageRequest { + $type: "yandex.cloud.ai.assistants.v1.threads.CreateMessageRequest"; + threadId: string; + author?: Author; + labels: { [key: string]: string }; + content?: MessageContent; +} + +export interface CreateMessageRequest_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.threads.CreateMessageRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface GetMessageRequest { + $type: "yandex.cloud.ai.assistants.v1.threads.GetMessageRequest"; + threadId: string; + messageId: string; +} + +export interface ListMessagesRequest { + $type: "yandex.cloud.ai.assistants.v1.threads.ListMessagesRequest"; + threadId: string; +} + +const baseCreateMessageRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.CreateMessageRequest", + threadId: "", +}; + +export const CreateMessageRequest = { + $type: "yandex.cloud.ai.assistants.v1.threads.CreateMessageRequest" as const, + + encode( + message: CreateMessageRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.threadId !== "") { + writer.uint32(10).string(message.threadId); + } + if (message.author !== undefined) { + Author.encode(message.author, writer.uint32(18).fork()).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateMessageRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.ai.assistants.v1.threads.CreateMessageRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(26).fork() + ).ldelim(); + }); + if (message.content !== undefined) { + MessageContent.encode(message.content, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateMessageRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateMessageRequest } as CreateMessageRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threadId = reader.string(); + break; + case 2: + message.author = Author.decode(reader, reader.uint32()); + break; + case 3: + const entry3 = CreateMessageRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry3.value !== undefined) { + message.labels[entry3.key] = entry3.value; + } + break; + case 4: + message.content = MessageContent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateMessageRequest { + const message = { ...baseCreateMessageRequest } as CreateMessageRequest; + message.threadId = + object.threadId !== undefined && object.threadId !== null + ? String(object.threadId) + : ""; + message.author = + object.author !== undefined && object.author !== null + ? Author.fromJSON(object.author) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.content = + object.content !== undefined && object.content !== null + ? MessageContent.fromJSON(object.content) + : undefined; + return message; + }, + + toJSON(message: CreateMessageRequest): unknown { + const obj: any = {}; + message.threadId !== undefined && (obj.threadId = message.threadId); + message.author !== undefined && + (obj.author = message.author ? Author.toJSON(message.author) : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.content !== undefined && + (obj.content = message.content + ? MessageContent.toJSON(message.content) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateMessageRequest { + const message = { ...baseCreateMessageRequest } as CreateMessageRequest; + message.threadId = object.threadId ?? ""; + message.author = + object.author !== undefined && object.author !== null + ? Author.fromPartial(object.author) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.content = + object.content !== undefined && object.content !== null + ? MessageContent.fromPartial(object.content) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CreateMessageRequest.$type, CreateMessageRequest); + +const baseCreateMessageRequest_LabelsEntry: object = { + $type: + "yandex.cloud.ai.assistants.v1.threads.CreateMessageRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateMessageRequest_LabelsEntry = { + $type: + "yandex.cloud.ai.assistants.v1.threads.CreateMessageRequest.LabelsEntry" as const, + + encode( + message: CreateMessageRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateMessageRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateMessageRequest_LabelsEntry, + } as CreateMessageRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateMessageRequest_LabelsEntry { + const message = { + ...baseCreateMessageRequest_LabelsEntry, + } as CreateMessageRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateMessageRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateMessageRequest_LabelsEntry { + const message = { + ...baseCreateMessageRequest_LabelsEntry, + } as CreateMessageRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateMessageRequest_LabelsEntry.$type, + CreateMessageRequest_LabelsEntry +); + +const baseGetMessageRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.GetMessageRequest", + threadId: "", + messageId: "", +}; + +export const GetMessageRequest = { + $type: "yandex.cloud.ai.assistants.v1.threads.GetMessageRequest" as const, + + encode( + message: GetMessageRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.threadId !== "") { + writer.uint32(10).string(message.threadId); + } + if (message.messageId !== "") { + writer.uint32(18).string(message.messageId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetMessageRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetMessageRequest } as GetMessageRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threadId = reader.string(); + break; + case 2: + message.messageId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetMessageRequest { + const message = { ...baseGetMessageRequest } as GetMessageRequest; + message.threadId = + object.threadId !== undefined && object.threadId !== null + ? String(object.threadId) + : ""; + message.messageId = + object.messageId !== undefined && object.messageId !== null + ? String(object.messageId) + : ""; + return message; + }, + + toJSON(message: GetMessageRequest): unknown { + const obj: any = {}; + message.threadId !== undefined && (obj.threadId = message.threadId); + message.messageId !== undefined && (obj.messageId = message.messageId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetMessageRequest { + const message = { ...baseGetMessageRequest } as GetMessageRequest; + message.threadId = object.threadId ?? ""; + message.messageId = object.messageId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetMessageRequest.$type, GetMessageRequest); + +const baseListMessagesRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.ListMessagesRequest", + threadId: "", +}; + +export const ListMessagesRequest = { + $type: "yandex.cloud.ai.assistants.v1.threads.ListMessagesRequest" as const, + + encode( + message: ListMessagesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.threadId !== "") { + writer.uint32(10).string(message.threadId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListMessagesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListMessagesRequest } as ListMessagesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threadId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListMessagesRequest { + const message = { ...baseListMessagesRequest } as ListMessagesRequest; + message.threadId = + object.threadId !== undefined && object.threadId !== null + ? String(object.threadId) + : ""; + return message; + }, + + toJSON(message: ListMessagesRequest): unknown { + const obj: any = {}; + message.threadId !== undefined && (obj.threadId = message.threadId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListMessagesRequest { + const message = { ...baseListMessagesRequest } as ListMessagesRequest; + message.threadId = object.threadId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListMessagesRequest.$type, ListMessagesRequest); + +export const MessageServiceService = { + create: { + path: "/yandex.cloud.ai.assistants.v1.threads.MessageService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateMessageRequest) => + Buffer.from(CreateMessageRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateMessageRequest.decode(value), + responseSerialize: (value: Message) => + Buffer.from(Message.encode(value).finish()), + responseDeserialize: (value: Buffer) => Message.decode(value), + }, + get: { + path: "/yandex.cloud.ai.assistants.v1.threads.MessageService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetMessageRequest) => + Buffer.from(GetMessageRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetMessageRequest.decode(value), + responseSerialize: (value: Message) => + Buffer.from(Message.encode(value).finish()), + responseDeserialize: (value: Buffer) => Message.decode(value), + }, + list: { + path: "/yandex.cloud.ai.assistants.v1.threads.MessageService/List", + requestStream: false, + responseStream: true, + requestSerialize: (value: ListMessagesRequest) => + Buffer.from(ListMessagesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListMessagesRequest.decode(value), + responseSerialize: (value: Message) => + Buffer.from(Message.encode(value).finish()), + responseDeserialize: (value: Buffer) => Message.decode(value), + }, +} as const; + +export interface MessageServiceServer extends UntypedServiceImplementation { + create: handleUnaryCall; + get: handleUnaryCall; + list: handleServerStreamingCall; +} + +export interface MessageServiceClient extends Client { + create( + request: CreateMessageRequest, + callback: (error: ServiceError | null, response: Message) => void + ): ClientUnaryCall; + create( + request: CreateMessageRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Message) => void + ): ClientUnaryCall; + create( + request: CreateMessageRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Message) => void + ): ClientUnaryCall; + get( + request: GetMessageRequest, + callback: (error: ServiceError | null, response: Message) => void + ): ClientUnaryCall; + get( + request: GetMessageRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Message) => void + ): ClientUnaryCall; + get( + request: GetMessageRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Message) => void + ): ClientUnaryCall; + list( + request: ListMessagesRequest, + options?: Partial + ): ClientReadableStream; + list( + request: ListMessagesRequest, + metadata?: Metadata, + options?: Partial + ): ClientReadableStream; +} + +export const MessageServiceClient = makeGenericClientConstructor( + MessageServiceService, + "yandex.cloud.ai.assistants.v1.threads.MessageService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): MessageServiceClient; + service: typeof MessageServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/threads/thread.ts b/src/generated/yandex/cloud/ai/assistants/v1/threads/thread.ts new file mode 100644 index 00000000..51cf3b6d --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/threads/thread.ts @@ -0,0 +1,411 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ExpirationConfig } from "../../../../../../yandex/cloud/ai/common/common"; +import { Timestamp } from "../../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1.threads"; + +export interface Thread { + $type: "yandex.cloud.ai.assistants.v1.threads.Thread"; + id: string; + folderId: string; + name: string; + description: string; + defaultMessageAuthorId: string; + createdBy: string; + createdAt?: Date; + updatedBy: string; + updatedAt?: Date; + expirationConfig?: ExpirationConfig; + expiresAt?: Date; + labels: { [key: string]: string }; +} + +export interface Thread_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.threads.Thread.LabelsEntry"; + key: string; + value: string; +} + +const baseThread: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.Thread", + id: "", + folderId: "", + name: "", + description: "", + defaultMessageAuthorId: "", + createdBy: "", + updatedBy: "", +}; + +export const Thread = { + $type: "yandex.cloud.ai.assistants.v1.threads.Thread" as const, + + encode( + message: Thread, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.defaultMessageAuthorId !== "") { + writer.uint32(42).string(message.defaultMessageAuthorId); + } + if (message.createdBy !== "") { + writer.uint32(50).string(message.createdBy); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(58).fork() + ).ldelim(); + } + if (message.updatedBy !== "") { + writer.uint32(66).string(message.updatedBy); + } + if (message.updatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.updatedAt), + writer.uint32(74).fork() + ).ldelim(); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(82).fork() + ).ldelim(); + } + if (message.expiresAt !== undefined) { + Timestamp.encode( + toTimestamp(message.expiresAt), + writer.uint32(90).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + Thread_LabelsEntry.encode( + { + $type: "yandex.cloud.ai.assistants.v1.threads.Thread.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(98).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Thread { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseThread } as Thread; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.defaultMessageAuthorId = reader.string(); + break; + case 6: + message.createdBy = reader.string(); + break; + case 7: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 8: + message.updatedBy = reader.string(); + break; + case 9: + message.updatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 10: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 11: + message.expiresAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 12: + const entry12 = Thread_LabelsEntry.decode(reader, reader.uint32()); + if (entry12.value !== undefined) { + message.labels[entry12.key] = entry12.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Thread { + const message = { ...baseThread } as Thread; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.defaultMessageAuthorId = + object.defaultMessageAuthorId !== undefined && + object.defaultMessageAuthorId !== null + ? String(object.defaultMessageAuthorId) + : ""; + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.updatedBy = + object.updatedBy !== undefined && object.updatedBy !== null + ? String(object.updatedBy) + : ""; + message.updatedAt = + object.updatedAt !== undefined && object.updatedAt !== null + ? fromJsonTimestamp(object.updatedAt) + : undefined; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.expiresAt = + object.expiresAt !== undefined && object.expiresAt !== null + ? fromJsonTimestamp(object.expiresAt) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: Thread): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.defaultMessageAuthorId !== undefined && + (obj.defaultMessageAuthorId = message.defaultMessageAuthorId); + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.updatedBy !== undefined && (obj.updatedBy = message.updatedBy); + message.updatedAt !== undefined && + (obj.updatedAt = message.updatedAt.toISOString()); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + message.expiresAt !== undefined && + (obj.expiresAt = message.expiresAt.toISOString()); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>(object: I): Thread { + const message = { ...baseThread } as Thread; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.defaultMessageAuthorId = object.defaultMessageAuthorId ?? ""; + message.createdBy = object.createdBy ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.updatedBy = object.updatedBy ?? ""; + message.updatedAt = object.updatedAt ?? undefined; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.expiresAt = object.expiresAt ?? undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(Thread.$type, Thread); + +const baseThread_LabelsEntry: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.Thread.LabelsEntry", + key: "", + value: "", +}; + +export const Thread_LabelsEntry = { + $type: "yandex.cloud.ai.assistants.v1.threads.Thread.LabelsEntry" as const, + + encode( + message: Thread_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Thread_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseThread_LabelsEntry } as Thread_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Thread_LabelsEntry { + const message = { ...baseThread_LabelsEntry } as Thread_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Thread_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Thread_LabelsEntry { + const message = { ...baseThread_LabelsEntry } as Thread_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Thread_LabelsEntry.$type, Thread_LabelsEntry); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/threads/thread_service.ts b/src/generated/yandex/cloud/ai/assistants/v1/threads/thread_service.ts new file mode 100644 index 00000000..1682aa24 --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/threads/thread_service.ts @@ -0,0 +1,1186 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { ExpirationConfig } from "../../../../../../yandex/cloud/ai/common/common"; +import { FieldMask } from "../../../../../../google/protobuf/field_mask"; +import { MessageData } from "../../../../../../yandex/cloud/ai/assistants/v1/threads/message"; +import { Thread } from "../../../../../../yandex/cloud/ai/assistants/v1/threads/thread"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1.threads"; + +export interface CreateThreadRequest { + $type: "yandex.cloud.ai.assistants.v1.threads.CreateThreadRequest"; + folderId: string; + messages: MessageData[]; + name: string; + description: string; + defaultMessageAuthorId: string; + expirationConfig?: ExpirationConfig; + labels: { [key: string]: string }; +} + +export interface CreateThreadRequest_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.threads.CreateThreadRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface GetThreadRequest { + $type: "yandex.cloud.ai.assistants.v1.threads.GetThreadRequest"; + threadId: string; +} + +export interface UpdateThreadRequest { + $type: "yandex.cloud.ai.assistants.v1.threads.UpdateThreadRequest"; + threadId: string; + updateMask?: FieldMask; + name: string; + description: string; + expirationConfig?: ExpirationConfig; + labels: { [key: string]: string }; +} + +export interface UpdateThreadRequest_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.threads.UpdateThreadRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface DeleteThreadRequest { + $type: "yandex.cloud.ai.assistants.v1.threads.DeleteThreadRequest"; + threadId: string; +} + +export interface DeleteThreadResponse { + $type: "yandex.cloud.ai.assistants.v1.threads.DeleteThreadResponse"; +} + +export interface ListThreadsRequest { + $type: "yandex.cloud.ai.assistants.v1.threads.ListThreadsRequest"; + folderId: string; + pageSize: number; + pageToken: string; +} + +export interface ListThreadsResponse { + $type: "yandex.cloud.ai.assistants.v1.threads.ListThreadsResponse"; + threads: Thread[]; + nextPageToken: string; +} + +const baseCreateThreadRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.CreateThreadRequest", + folderId: "", + name: "", + description: "", + defaultMessageAuthorId: "", +}; + +export const CreateThreadRequest = { + $type: "yandex.cloud.ai.assistants.v1.threads.CreateThreadRequest" as const, + + encode( + message: CreateThreadRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + for (const v of message.messages) { + MessageData.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.defaultMessageAuthorId !== "") { + writer.uint32(42).string(message.defaultMessageAuthorId); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(50).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateThreadRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.ai.assistants.v1.threads.CreateThreadRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(58).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateThreadRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateThreadRequest } as CreateThreadRequest; + message.messages = []; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.messages.push(MessageData.decode(reader, reader.uint32())); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.defaultMessageAuthorId = reader.string(); + break; + case 6: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 7: + const entry7 = CreateThreadRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry7.value !== undefined) { + message.labels[entry7.key] = entry7.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateThreadRequest { + const message = { ...baseCreateThreadRequest } as CreateThreadRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.messages = (object.messages ?? []).map((e: any) => + MessageData.fromJSON(e) + ); + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.defaultMessageAuthorId = + object.defaultMessageAuthorId !== undefined && + object.defaultMessageAuthorId !== null + ? String(object.defaultMessageAuthorId) + : ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: CreateThreadRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + if (message.messages) { + obj.messages = message.messages.map((e) => + e ? MessageData.toJSON(e) : undefined + ); + } else { + obj.messages = []; + } + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.defaultMessageAuthorId !== undefined && + (obj.defaultMessageAuthorId = message.defaultMessageAuthorId); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateThreadRequest { + const message = { ...baseCreateThreadRequest } as CreateThreadRequest; + message.folderId = object.folderId ?? ""; + message.messages = + object.messages?.map((e) => MessageData.fromPartial(e)) || []; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.defaultMessageAuthorId = object.defaultMessageAuthorId ?? ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(CreateThreadRequest.$type, CreateThreadRequest); + +const baseCreateThreadRequest_LabelsEntry: object = { + $type: + "yandex.cloud.ai.assistants.v1.threads.CreateThreadRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateThreadRequest_LabelsEntry = { + $type: + "yandex.cloud.ai.assistants.v1.threads.CreateThreadRequest.LabelsEntry" as const, + + encode( + message: CreateThreadRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateThreadRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateThreadRequest_LabelsEntry, + } as CreateThreadRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateThreadRequest_LabelsEntry { + const message = { + ...baseCreateThreadRequest_LabelsEntry, + } as CreateThreadRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateThreadRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateThreadRequest_LabelsEntry { + const message = { + ...baseCreateThreadRequest_LabelsEntry, + } as CreateThreadRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateThreadRequest_LabelsEntry.$type, + CreateThreadRequest_LabelsEntry +); + +const baseGetThreadRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.GetThreadRequest", + threadId: "", +}; + +export const GetThreadRequest = { + $type: "yandex.cloud.ai.assistants.v1.threads.GetThreadRequest" as const, + + encode( + message: GetThreadRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.threadId !== "") { + writer.uint32(10).string(message.threadId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetThreadRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetThreadRequest } as GetThreadRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threadId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetThreadRequest { + const message = { ...baseGetThreadRequest } as GetThreadRequest; + message.threadId = + object.threadId !== undefined && object.threadId !== null + ? String(object.threadId) + : ""; + return message; + }, + + toJSON(message: GetThreadRequest): unknown { + const obj: any = {}; + message.threadId !== undefined && (obj.threadId = message.threadId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetThreadRequest { + const message = { ...baseGetThreadRequest } as GetThreadRequest; + message.threadId = object.threadId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetThreadRequest.$type, GetThreadRequest); + +const baseUpdateThreadRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.UpdateThreadRequest", + threadId: "", + name: "", + description: "", +}; + +export const UpdateThreadRequest = { + $type: "yandex.cloud.ai.assistants.v1.threads.UpdateThreadRequest" as const, + + encode( + message: UpdateThreadRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.threadId !== "") { + writer.uint32(10).string(message.threadId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(42).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateThreadRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.ai.assistants.v1.threads.UpdateThreadRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateThreadRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateThreadRequest } as UpdateThreadRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threadId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 6: + const entry6 = UpdateThreadRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateThreadRequest { + const message = { ...baseUpdateThreadRequest } as UpdateThreadRequest; + message.threadId = + object.threadId !== undefined && object.threadId !== null + ? String(object.threadId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: UpdateThreadRequest): unknown { + const obj: any = {}; + message.threadId !== undefined && (obj.threadId = message.threadId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateThreadRequest { + const message = { ...baseUpdateThreadRequest } as UpdateThreadRequest; + message.threadId = object.threadId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(UpdateThreadRequest.$type, UpdateThreadRequest); + +const baseUpdateThreadRequest_LabelsEntry: object = { + $type: + "yandex.cloud.ai.assistants.v1.threads.UpdateThreadRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateThreadRequest_LabelsEntry = { + $type: + "yandex.cloud.ai.assistants.v1.threads.UpdateThreadRequest.LabelsEntry" as const, + + encode( + message: UpdateThreadRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateThreadRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateThreadRequest_LabelsEntry, + } as UpdateThreadRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateThreadRequest_LabelsEntry { + const message = { + ...baseUpdateThreadRequest_LabelsEntry, + } as UpdateThreadRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateThreadRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateThreadRequest_LabelsEntry { + const message = { + ...baseUpdateThreadRequest_LabelsEntry, + } as UpdateThreadRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateThreadRequest_LabelsEntry.$type, + UpdateThreadRequest_LabelsEntry +); + +const baseDeleteThreadRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.DeleteThreadRequest", + threadId: "", +}; + +export const DeleteThreadRequest = { + $type: "yandex.cloud.ai.assistants.v1.threads.DeleteThreadRequest" as const, + + encode( + message: DeleteThreadRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.threadId !== "") { + writer.uint32(10).string(message.threadId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteThreadRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteThreadRequest } as DeleteThreadRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threadId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteThreadRequest { + const message = { ...baseDeleteThreadRequest } as DeleteThreadRequest; + message.threadId = + object.threadId !== undefined && object.threadId !== null + ? String(object.threadId) + : ""; + return message; + }, + + toJSON(message: DeleteThreadRequest): unknown { + const obj: any = {}; + message.threadId !== undefined && (obj.threadId = message.threadId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteThreadRequest { + const message = { ...baseDeleteThreadRequest } as DeleteThreadRequest; + message.threadId = object.threadId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteThreadRequest.$type, DeleteThreadRequest); + +const baseDeleteThreadResponse: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.DeleteThreadResponse", +}; + +export const DeleteThreadResponse = { + $type: "yandex.cloud.ai.assistants.v1.threads.DeleteThreadResponse" as const, + + encode( + _: DeleteThreadResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteThreadResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteThreadResponse } as DeleteThreadResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): DeleteThreadResponse { + const message = { ...baseDeleteThreadResponse } as DeleteThreadResponse; + return message; + }, + + toJSON(_: DeleteThreadResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): DeleteThreadResponse { + const message = { ...baseDeleteThreadResponse } as DeleteThreadResponse; + return message; + }, +}; + +messageTypeRegistry.set(DeleteThreadResponse.$type, DeleteThreadResponse); + +const baseListThreadsRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.ListThreadsRequest", + folderId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListThreadsRequest = { + $type: "yandex.cloud.ai.assistants.v1.threads.ListThreadsRequest" as const, + + encode( + message: ListThreadsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListThreadsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListThreadsRequest } as ListThreadsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListThreadsRequest { + const message = { ...baseListThreadsRequest } as ListThreadsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListThreadsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListThreadsRequest { + const message = { ...baseListThreadsRequest } as ListThreadsRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListThreadsRequest.$type, ListThreadsRequest); + +const baseListThreadsResponse: object = { + $type: "yandex.cloud.ai.assistants.v1.threads.ListThreadsResponse", + nextPageToken: "", +}; + +export const ListThreadsResponse = { + $type: "yandex.cloud.ai.assistants.v1.threads.ListThreadsResponse" as const, + + encode( + message: ListThreadsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.threads) { + Thread.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListThreadsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListThreadsResponse } as ListThreadsResponse; + message.threads = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threads.push(Thread.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListThreadsResponse { + const message = { ...baseListThreadsResponse } as ListThreadsResponse; + message.threads = (object.threads ?? []).map((e: any) => + Thread.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListThreadsResponse): unknown { + const obj: any = {}; + if (message.threads) { + obj.threads = message.threads.map((e) => + e ? Thread.toJSON(e) : undefined + ); + } else { + obj.threads = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListThreadsResponse { + const message = { ...baseListThreadsResponse } as ListThreadsResponse; + message.threads = object.threads?.map((e) => Thread.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListThreadsResponse.$type, ListThreadsResponse); + +export const ThreadServiceService = { + create: { + path: "/yandex.cloud.ai.assistants.v1.threads.ThreadService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateThreadRequest) => + Buffer.from(CreateThreadRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateThreadRequest.decode(value), + responseSerialize: (value: Thread) => + Buffer.from(Thread.encode(value).finish()), + responseDeserialize: (value: Buffer) => Thread.decode(value), + }, + get: { + path: "/yandex.cloud.ai.assistants.v1.threads.ThreadService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetThreadRequest) => + Buffer.from(GetThreadRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetThreadRequest.decode(value), + responseSerialize: (value: Thread) => + Buffer.from(Thread.encode(value).finish()), + responseDeserialize: (value: Buffer) => Thread.decode(value), + }, + update: { + path: "/yandex.cloud.ai.assistants.v1.threads.ThreadService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateThreadRequest) => + Buffer.from(UpdateThreadRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateThreadRequest.decode(value), + responseSerialize: (value: Thread) => + Buffer.from(Thread.encode(value).finish()), + responseDeserialize: (value: Buffer) => Thread.decode(value), + }, + delete: { + path: "/yandex.cloud.ai.assistants.v1.threads.ThreadService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteThreadRequest) => + Buffer.from(DeleteThreadRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteThreadRequest.decode(value), + responseSerialize: (value: DeleteThreadResponse) => + Buffer.from(DeleteThreadResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => DeleteThreadResponse.decode(value), + }, + list: { + path: "/yandex.cloud.ai.assistants.v1.threads.ThreadService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListThreadsRequest) => + Buffer.from(ListThreadsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListThreadsRequest.decode(value), + responseSerialize: (value: ListThreadsResponse) => + Buffer.from(ListThreadsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListThreadsResponse.decode(value), + }, +} as const; + +export interface ThreadServiceServer extends UntypedServiceImplementation { + create: handleUnaryCall; + get: handleUnaryCall; + update: handleUnaryCall; + delete: handleUnaryCall; + list: handleUnaryCall; +} + +export interface ThreadServiceClient extends Client { + create( + request: CreateThreadRequest, + callback: (error: ServiceError | null, response: Thread) => void + ): ClientUnaryCall; + create( + request: CreateThreadRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Thread) => void + ): ClientUnaryCall; + create( + request: CreateThreadRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Thread) => void + ): ClientUnaryCall; + get( + request: GetThreadRequest, + callback: (error: ServiceError | null, response: Thread) => void + ): ClientUnaryCall; + get( + request: GetThreadRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Thread) => void + ): ClientUnaryCall; + get( + request: GetThreadRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Thread) => void + ): ClientUnaryCall; + update( + request: UpdateThreadRequest, + callback: (error: ServiceError | null, response: Thread) => void + ): ClientUnaryCall; + update( + request: UpdateThreadRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Thread) => void + ): ClientUnaryCall; + update( + request: UpdateThreadRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Thread) => void + ): ClientUnaryCall; + delete( + request: DeleteThreadRequest, + callback: ( + error: ServiceError | null, + response: DeleteThreadResponse + ) => void + ): ClientUnaryCall; + delete( + request: DeleteThreadRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: DeleteThreadResponse + ) => void + ): ClientUnaryCall; + delete( + request: DeleteThreadRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: DeleteThreadResponse + ) => void + ): ClientUnaryCall; + list( + request: ListThreadsRequest, + callback: ( + error: ServiceError | null, + response: ListThreadsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListThreadsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListThreadsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListThreadsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListThreadsResponse + ) => void + ): ClientUnaryCall; +} + +export const ThreadServiceClient = makeGenericClientConstructor( + ThreadServiceService, + "yandex.cloud.ai.assistants.v1.threads.ThreadService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ThreadServiceClient; + service: typeof ThreadServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/users/user.ts b/src/generated/yandex/cloud/ai/assistants/v1/users/user.ts new file mode 100644 index 00000000..16572d66 --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/users/user.ts @@ -0,0 +1,406 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ExpirationConfig } from "../../../../../../yandex/cloud/ai/common/common"; +import { Timestamp } from "../../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1.users"; + +export interface User { + $type: "yandex.cloud.ai.assistants.v1.users.User"; + id: string; + folderId: string; + name: string; + description: string; + source: string; + createdBy: string; + createdAt?: Date; + updatedBy: string; + updatedAt?: Date; + expirationConfig?: ExpirationConfig; + expiresAt?: Date; + labels: { [key: string]: string }; +} + +export interface User_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.users.User.LabelsEntry"; + key: string; + value: string; +} + +const baseUser: object = { + $type: "yandex.cloud.ai.assistants.v1.users.User", + id: "", + folderId: "", + name: "", + description: "", + source: "", + createdBy: "", + updatedBy: "", +}; + +export const User = { + $type: "yandex.cloud.ai.assistants.v1.users.User" as const, + + encode(message: User, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.source !== "") { + writer.uint32(42).string(message.source); + } + if (message.createdBy !== "") { + writer.uint32(50).string(message.createdBy); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(58).fork() + ).ldelim(); + } + if (message.updatedBy !== "") { + writer.uint32(66).string(message.updatedBy); + } + if (message.updatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.updatedAt), + writer.uint32(74).fork() + ).ldelim(); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(82).fork() + ).ldelim(); + } + if (message.expiresAt !== undefined) { + Timestamp.encode( + toTimestamp(message.expiresAt), + writer.uint32(90).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + User_LabelsEntry.encode( + { + $type: "yandex.cloud.ai.assistants.v1.users.User.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(98).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): User { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUser } as User; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.source = reader.string(); + break; + case 6: + message.createdBy = reader.string(); + break; + case 7: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 8: + message.updatedBy = reader.string(); + break; + case 9: + message.updatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 10: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 11: + message.expiresAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 12: + const entry12 = User_LabelsEntry.decode(reader, reader.uint32()); + if (entry12.value !== undefined) { + message.labels[entry12.key] = entry12.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): User { + const message = { ...baseUser } as User; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.source = + object.source !== undefined && object.source !== null + ? String(object.source) + : ""; + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.updatedBy = + object.updatedBy !== undefined && object.updatedBy !== null + ? String(object.updatedBy) + : ""; + message.updatedAt = + object.updatedAt !== undefined && object.updatedAt !== null + ? fromJsonTimestamp(object.updatedAt) + : undefined; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.expiresAt = + object.expiresAt !== undefined && object.expiresAt !== null + ? fromJsonTimestamp(object.expiresAt) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: User): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.source !== undefined && (obj.source = message.source); + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.updatedBy !== undefined && (obj.updatedBy = message.updatedBy); + message.updatedAt !== undefined && + (obj.updatedAt = message.updatedAt.toISOString()); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + message.expiresAt !== undefined && + (obj.expiresAt = message.expiresAt.toISOString()); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>(object: I): User { + const message = { ...baseUser } as User; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.source = object.source ?? ""; + message.createdBy = object.createdBy ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.updatedBy = object.updatedBy ?? ""; + message.updatedAt = object.updatedAt ?? undefined; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.expiresAt = object.expiresAt ?? undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(User.$type, User); + +const baseUser_LabelsEntry: object = { + $type: "yandex.cloud.ai.assistants.v1.users.User.LabelsEntry", + key: "", + value: "", +}; + +export const User_LabelsEntry = { + $type: "yandex.cloud.ai.assistants.v1.users.User.LabelsEntry" as const, + + encode( + message: User_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): User_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUser_LabelsEntry } as User_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): User_LabelsEntry { + const message = { ...baseUser_LabelsEntry } as User_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: User_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): User_LabelsEntry { + const message = { ...baseUser_LabelsEntry } as User_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(User_LabelsEntry.$type, User_LabelsEntry); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/assistants/v1/users/user_service.ts b/src/generated/yandex/cloud/ai/assistants/v1/users/user_service.ts new file mode 100644 index 00000000..ad0f2217 --- /dev/null +++ b/src/generated/yandex/cloud/ai/assistants/v1/users/user_service.ts @@ -0,0 +1,1136 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { ExpirationConfig } from "../../../../../../yandex/cloud/ai/common/common"; +import { FieldMask } from "../../../../../../google/protobuf/field_mask"; +import { User } from "../../../../../../yandex/cloud/ai/assistants/v1/users/user"; + +export const protobufPackage = "yandex.cloud.ai.assistants.v1.users"; + +export interface CreateUserRequest { + $type: "yandex.cloud.ai.assistants.v1.users.CreateUserRequest"; + folderId: string; + name: string; + description: string; + source: string; + expirationConfig?: ExpirationConfig; + labels: { [key: string]: string }; +} + +export interface CreateUserRequest_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.users.CreateUserRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface GetUserRequest { + $type: "yandex.cloud.ai.assistants.v1.users.GetUserRequest"; + userId: string; +} + +export interface UpdateUserRequest { + $type: "yandex.cloud.ai.assistants.v1.users.UpdateUserRequest"; + userId: string; + updateMask?: FieldMask; + name: string; + description: string; + expirationConfig?: ExpirationConfig; + labels: { [key: string]: string }; +} + +export interface UpdateUserRequest_LabelsEntry { + $type: "yandex.cloud.ai.assistants.v1.users.UpdateUserRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface DeleteUserRequest { + $type: "yandex.cloud.ai.assistants.v1.users.DeleteUserRequest"; + userId: string; +} + +export interface DeleteUserResponse { + $type: "yandex.cloud.ai.assistants.v1.users.DeleteUserResponse"; +} + +export interface ListUsersRequest { + $type: "yandex.cloud.ai.assistants.v1.users.ListUsersRequest"; + folderId: string; + pageSize: number; + pageToken: string; +} + +export interface ListUsersResponse { + $type: "yandex.cloud.ai.assistants.v1.users.ListUsersResponse"; + users: User[]; + nextPageToken: string; +} + +const baseCreateUserRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.users.CreateUserRequest", + folderId: "", + name: "", + description: "", + source: "", +}; + +export const CreateUserRequest = { + $type: "yandex.cloud.ai.assistants.v1.users.CreateUserRequest" as const, + + encode( + message: CreateUserRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.source !== "") { + writer.uint32(34).string(message.source); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(42).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateUserRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.ai.assistants.v1.users.CreateUserRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateUserRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateUserRequest } as CreateUserRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.source = reader.string(); + break; + case 5: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 6: + const entry6 = CreateUserRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateUserRequest { + const message = { ...baseCreateUserRequest } as CreateUserRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.source = + object.source !== undefined && object.source !== null + ? String(object.source) + : ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: CreateUserRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.source !== undefined && (obj.source = message.source); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateUserRequest { + const message = { ...baseCreateUserRequest } as CreateUserRequest; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.source = object.source ?? ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(CreateUserRequest.$type, CreateUserRequest); + +const baseCreateUserRequest_LabelsEntry: object = { + $type: "yandex.cloud.ai.assistants.v1.users.CreateUserRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateUserRequest_LabelsEntry = { + $type: + "yandex.cloud.ai.assistants.v1.users.CreateUserRequest.LabelsEntry" as const, + + encode( + message: CreateUserRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateUserRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateUserRequest_LabelsEntry, + } as CreateUserRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateUserRequest_LabelsEntry { + const message = { + ...baseCreateUserRequest_LabelsEntry, + } as CreateUserRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateUserRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateUserRequest_LabelsEntry { + const message = { + ...baseCreateUserRequest_LabelsEntry, + } as CreateUserRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateUserRequest_LabelsEntry.$type, + CreateUserRequest_LabelsEntry +); + +const baseGetUserRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.users.GetUserRequest", + userId: "", +}; + +export const GetUserRequest = { + $type: "yandex.cloud.ai.assistants.v1.users.GetUserRequest" as const, + + encode( + message: GetUserRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.userId !== "") { + writer.uint32(10).string(message.userId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetUserRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetUserRequest } as GetUserRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetUserRequest { + const message = { ...baseGetUserRequest } as GetUserRequest; + message.userId = + object.userId !== undefined && object.userId !== null + ? String(object.userId) + : ""; + return message; + }, + + toJSON(message: GetUserRequest): unknown { + const obj: any = {}; + message.userId !== undefined && (obj.userId = message.userId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetUserRequest { + const message = { ...baseGetUserRequest } as GetUserRequest; + message.userId = object.userId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetUserRequest.$type, GetUserRequest); + +const baseUpdateUserRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.users.UpdateUserRequest", + userId: "", + name: "", + description: "", +}; + +export const UpdateUserRequest = { + $type: "yandex.cloud.ai.assistants.v1.users.UpdateUserRequest" as const, + + encode( + message: UpdateUserRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.userId !== "") { + writer.uint32(10).string(message.userId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(42).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateUserRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.ai.assistants.v1.users.UpdateUserRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateUserRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateUserRequest } as UpdateUserRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 6: + const entry6 = UpdateUserRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateUserRequest { + const message = { ...baseUpdateUserRequest } as UpdateUserRequest; + message.userId = + object.userId !== undefined && object.userId !== null + ? String(object.userId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: UpdateUserRequest): unknown { + const obj: any = {}; + message.userId !== undefined && (obj.userId = message.userId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateUserRequest { + const message = { ...baseUpdateUserRequest } as UpdateUserRequest; + message.userId = object.userId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(UpdateUserRequest.$type, UpdateUserRequest); + +const baseUpdateUserRequest_LabelsEntry: object = { + $type: "yandex.cloud.ai.assistants.v1.users.UpdateUserRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateUserRequest_LabelsEntry = { + $type: + "yandex.cloud.ai.assistants.v1.users.UpdateUserRequest.LabelsEntry" as const, + + encode( + message: UpdateUserRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateUserRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateUserRequest_LabelsEntry, + } as UpdateUserRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateUserRequest_LabelsEntry { + const message = { + ...baseUpdateUserRequest_LabelsEntry, + } as UpdateUserRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateUserRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateUserRequest_LabelsEntry { + const message = { + ...baseUpdateUserRequest_LabelsEntry, + } as UpdateUserRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateUserRequest_LabelsEntry.$type, + UpdateUserRequest_LabelsEntry +); + +const baseDeleteUserRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.users.DeleteUserRequest", + userId: "", +}; + +export const DeleteUserRequest = { + $type: "yandex.cloud.ai.assistants.v1.users.DeleteUserRequest" as const, + + encode( + message: DeleteUserRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.userId !== "") { + writer.uint32(10).string(message.userId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteUserRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteUserRequest } as DeleteUserRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteUserRequest { + const message = { ...baseDeleteUserRequest } as DeleteUserRequest; + message.userId = + object.userId !== undefined && object.userId !== null + ? String(object.userId) + : ""; + return message; + }, + + toJSON(message: DeleteUserRequest): unknown { + const obj: any = {}; + message.userId !== undefined && (obj.userId = message.userId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteUserRequest { + const message = { ...baseDeleteUserRequest } as DeleteUserRequest; + message.userId = object.userId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteUserRequest.$type, DeleteUserRequest); + +const baseDeleteUserResponse: object = { + $type: "yandex.cloud.ai.assistants.v1.users.DeleteUserResponse", +}; + +export const DeleteUserResponse = { + $type: "yandex.cloud.ai.assistants.v1.users.DeleteUserResponse" as const, + + encode( + _: DeleteUserResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteUserResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteUserResponse } as DeleteUserResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): DeleteUserResponse { + const message = { ...baseDeleteUserResponse } as DeleteUserResponse; + return message; + }, + + toJSON(_: DeleteUserResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): DeleteUserResponse { + const message = { ...baseDeleteUserResponse } as DeleteUserResponse; + return message; + }, +}; + +messageTypeRegistry.set(DeleteUserResponse.$type, DeleteUserResponse); + +const baseListUsersRequest: object = { + $type: "yandex.cloud.ai.assistants.v1.users.ListUsersRequest", + folderId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListUsersRequest = { + $type: "yandex.cloud.ai.assistants.v1.users.ListUsersRequest" as const, + + encode( + message: ListUsersRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListUsersRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListUsersRequest } as ListUsersRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListUsersRequest { + const message = { ...baseListUsersRequest } as ListUsersRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListUsersRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListUsersRequest { + const message = { ...baseListUsersRequest } as ListUsersRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListUsersRequest.$type, ListUsersRequest); + +const baseListUsersResponse: object = { + $type: "yandex.cloud.ai.assistants.v1.users.ListUsersResponse", + nextPageToken: "", +}; + +export const ListUsersResponse = { + $type: "yandex.cloud.ai.assistants.v1.users.ListUsersResponse" as const, + + encode( + message: ListUsersResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.users) { + User.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListUsersResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListUsersResponse } as ListUsersResponse; + message.users = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.users.push(User.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListUsersResponse { + const message = { ...baseListUsersResponse } as ListUsersResponse; + message.users = (object.users ?? []).map((e: any) => User.fromJSON(e)); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListUsersResponse): unknown { + const obj: any = {}; + if (message.users) { + obj.users = message.users.map((e) => (e ? User.toJSON(e) : undefined)); + } else { + obj.users = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListUsersResponse { + const message = { ...baseListUsersResponse } as ListUsersResponse; + message.users = object.users?.map((e) => User.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListUsersResponse.$type, ListUsersResponse); + +export const UserServiceService = { + create: { + path: "/yandex.cloud.ai.assistants.v1.users.UserService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateUserRequest) => + Buffer.from(CreateUserRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateUserRequest.decode(value), + responseSerialize: (value: User) => + Buffer.from(User.encode(value).finish()), + responseDeserialize: (value: Buffer) => User.decode(value), + }, + get: { + path: "/yandex.cloud.ai.assistants.v1.users.UserService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetUserRequest) => + Buffer.from(GetUserRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetUserRequest.decode(value), + responseSerialize: (value: User) => + Buffer.from(User.encode(value).finish()), + responseDeserialize: (value: Buffer) => User.decode(value), + }, + update: { + path: "/yandex.cloud.ai.assistants.v1.users.UserService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateUserRequest) => + Buffer.from(UpdateUserRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateUserRequest.decode(value), + responseSerialize: (value: User) => + Buffer.from(User.encode(value).finish()), + responseDeserialize: (value: Buffer) => User.decode(value), + }, + delete: { + path: "/yandex.cloud.ai.assistants.v1.users.UserService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteUserRequest) => + Buffer.from(DeleteUserRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteUserRequest.decode(value), + responseSerialize: (value: DeleteUserResponse) => + Buffer.from(DeleteUserResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => DeleteUserResponse.decode(value), + }, + list: { + path: "/yandex.cloud.ai.assistants.v1.users.UserService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListUsersRequest) => + Buffer.from(ListUsersRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListUsersRequest.decode(value), + responseSerialize: (value: ListUsersResponse) => + Buffer.from(ListUsersResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListUsersResponse.decode(value), + }, +} as const; + +export interface UserServiceServer extends UntypedServiceImplementation { + create: handleUnaryCall; + get: handleUnaryCall; + update: handleUnaryCall; + delete: handleUnaryCall; + list: handleUnaryCall; +} + +export interface UserServiceClient extends Client { + create( + request: CreateUserRequest, + callback: (error: ServiceError | null, response: User) => void + ): ClientUnaryCall; + create( + request: CreateUserRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: User) => void + ): ClientUnaryCall; + create( + request: CreateUserRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: User) => void + ): ClientUnaryCall; + get( + request: GetUserRequest, + callback: (error: ServiceError | null, response: User) => void + ): ClientUnaryCall; + get( + request: GetUserRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: User) => void + ): ClientUnaryCall; + get( + request: GetUserRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: User) => void + ): ClientUnaryCall; + update( + request: UpdateUserRequest, + callback: (error: ServiceError | null, response: User) => void + ): ClientUnaryCall; + update( + request: UpdateUserRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: User) => void + ): ClientUnaryCall; + update( + request: UpdateUserRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: User) => void + ): ClientUnaryCall; + delete( + request: DeleteUserRequest, + callback: (error: ServiceError | null, response: DeleteUserResponse) => void + ): ClientUnaryCall; + delete( + request: DeleteUserRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: DeleteUserResponse) => void + ): ClientUnaryCall; + delete( + request: DeleteUserRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: DeleteUserResponse) => void + ): ClientUnaryCall; + list( + request: ListUsersRequest, + callback: (error: ServiceError | null, response: ListUsersResponse) => void + ): ClientUnaryCall; + list( + request: ListUsersRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: ListUsersResponse) => void + ): ClientUnaryCall; + list( + request: ListUsersRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: ListUsersResponse) => void + ): ClientUnaryCall; +} + +export const UserServiceClient = makeGenericClientConstructor( + UserServiceService, + "yandex.cloud.ai.assistants.v1.users.UserService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): UserServiceClient; + service: typeof UserServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/common/common.ts b/src/generated/yandex/cloud/ai/common/common.ts new file mode 100644 index 00000000..d9bf8dd0 --- /dev/null +++ b/src/generated/yandex/cloud/ai/common/common.ts @@ -0,0 +1,259 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.ai.common"; + +export interface ExpirationConfig { + $type: "yandex.cloud.ai.common.ExpirationConfig"; + expirationPolicy: ExpirationConfig_ExpirationPolicy; + ttlDays: number; +} + +export enum ExpirationConfig_ExpirationPolicy { + EXPIRATION_POLICY_UNSPECIFIED = 0, + STATIC = 1, + SINCE_LAST_ACTIVE = 2, + UNRECOGNIZED = -1, +} + +export function expirationConfig_ExpirationPolicyFromJSON( + object: any +): ExpirationConfig_ExpirationPolicy { + switch (object) { + case 0: + case "EXPIRATION_POLICY_UNSPECIFIED": + return ExpirationConfig_ExpirationPolicy.EXPIRATION_POLICY_UNSPECIFIED; + case 1: + case "STATIC": + return ExpirationConfig_ExpirationPolicy.STATIC; + case 2: + case "SINCE_LAST_ACTIVE": + return ExpirationConfig_ExpirationPolicy.SINCE_LAST_ACTIVE; + case -1: + case "UNRECOGNIZED": + default: + return ExpirationConfig_ExpirationPolicy.UNRECOGNIZED; + } +} + +export function expirationConfig_ExpirationPolicyToJSON( + object: ExpirationConfig_ExpirationPolicy +): string { + switch (object) { + case ExpirationConfig_ExpirationPolicy.EXPIRATION_POLICY_UNSPECIFIED: + return "EXPIRATION_POLICY_UNSPECIFIED"; + case ExpirationConfig_ExpirationPolicy.STATIC: + return "STATIC"; + case ExpirationConfig_ExpirationPolicy.SINCE_LAST_ACTIVE: + return "SINCE_LAST_ACTIVE"; + default: + return "UNKNOWN"; + } +} + +export interface Error { + $type: "yandex.cloud.ai.common.Error"; + code: number; + message: string; +} + +const baseExpirationConfig: object = { + $type: "yandex.cloud.ai.common.ExpirationConfig", + expirationPolicy: 0, + ttlDays: 0, +}; + +export const ExpirationConfig = { + $type: "yandex.cloud.ai.common.ExpirationConfig" as const, + + encode( + message: ExpirationConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.expirationPolicy !== 0) { + writer.uint32(8).int32(message.expirationPolicy); + } + if (message.ttlDays !== 0) { + writer.uint32(16).int64(message.ttlDays); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ExpirationConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExpirationConfig } as ExpirationConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expirationPolicy = reader.int32() as any; + break; + case 2: + message.ttlDays = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExpirationConfig { + const message = { ...baseExpirationConfig } as ExpirationConfig; + message.expirationPolicy = + object.expirationPolicy !== undefined && object.expirationPolicy !== null + ? expirationConfig_ExpirationPolicyFromJSON(object.expirationPolicy) + : 0; + message.ttlDays = + object.ttlDays !== undefined && object.ttlDays !== null + ? Number(object.ttlDays) + : 0; + return message; + }, + + toJSON(message: ExpirationConfig): unknown { + const obj: any = {}; + message.expirationPolicy !== undefined && + (obj.expirationPolicy = expirationConfig_ExpirationPolicyToJSON( + message.expirationPolicy + )); + message.ttlDays !== undefined && + (obj.ttlDays = Math.round(message.ttlDays)); + return obj; + }, + + fromPartial, I>>( + object: I + ): ExpirationConfig { + const message = { ...baseExpirationConfig } as ExpirationConfig; + message.expirationPolicy = object.expirationPolicy ?? 0; + message.ttlDays = object.ttlDays ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(ExpirationConfig.$type, ExpirationConfig); + +const baseError: object = { + $type: "yandex.cloud.ai.common.Error", + code: 0, + message: "", +}; + +export const Error = { + $type: "yandex.cloud.ai.common.Error" as const, + + encode(message: Error, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).int64(message.code); + } + if (message.message !== "") { + writer.uint32(18).string(message.message); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Error { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseError } as Error; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = longToNumber(reader.int64() as Long); + break; + case 2: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Error { + const message = { ...baseError } as Error; + message.code = + object.code !== undefined && object.code !== null + ? Number(object.code) + : 0; + message.message = + object.message !== undefined && object.message !== null + ? String(object.message) + : ""; + return message; + }, + + toJSON(message: Error): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = Math.round(message.code)); + message.message !== undefined && (obj.message = message.message); + return obj; + }, + + fromPartial, I>>(object: I): Error { + const message = { ...baseError } as Error; + message.code = object.code ?? 0; + message.message = object.message ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Error.$type, Error); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/files/v1/file.ts b/src/generated/yandex/cloud/ai/files/v1/file.ts new file mode 100644 index 00000000..4d547632 --- /dev/null +++ b/src/generated/yandex/cloud/ai/files/v1/file.ts @@ -0,0 +1,406 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ExpirationConfig } from "../../../../../yandex/cloud/ai/common/common"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.ai.files.v1"; + +export interface File { + $type: "yandex.cloud.ai.files.v1.File"; + id: string; + folderId: string; + name: string; + description: string; + mimeType: string; + createdBy: string; + createdAt?: Date; + updatedBy: string; + updatedAt?: Date; + expirationConfig?: ExpirationConfig; + expiresAt?: Date; + labels: { [key: string]: string }; +} + +export interface File_LabelsEntry { + $type: "yandex.cloud.ai.files.v1.File.LabelsEntry"; + key: string; + value: string; +} + +const baseFile: object = { + $type: "yandex.cloud.ai.files.v1.File", + id: "", + folderId: "", + name: "", + description: "", + mimeType: "", + createdBy: "", + updatedBy: "", +}; + +export const File = { + $type: "yandex.cloud.ai.files.v1.File" as const, + + encode(message: File, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.mimeType !== "") { + writer.uint32(42).string(message.mimeType); + } + if (message.createdBy !== "") { + writer.uint32(50).string(message.createdBy); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(58).fork() + ).ldelim(); + } + if (message.updatedBy !== "") { + writer.uint32(66).string(message.updatedBy); + } + if (message.updatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.updatedAt), + writer.uint32(74).fork() + ).ldelim(); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(82).fork() + ).ldelim(); + } + if (message.expiresAt !== undefined) { + Timestamp.encode( + toTimestamp(message.expiresAt), + writer.uint32(90).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + File_LabelsEntry.encode( + { + $type: "yandex.cloud.ai.files.v1.File.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(98).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): File { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFile } as File; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.mimeType = reader.string(); + break; + case 6: + message.createdBy = reader.string(); + break; + case 7: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 8: + message.updatedBy = reader.string(); + break; + case 9: + message.updatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 10: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 11: + message.expiresAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 12: + const entry12 = File_LabelsEntry.decode(reader, reader.uint32()); + if (entry12.value !== undefined) { + message.labels[entry12.key] = entry12.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): File { + const message = { ...baseFile } as File; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.mimeType = + object.mimeType !== undefined && object.mimeType !== null + ? String(object.mimeType) + : ""; + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.updatedBy = + object.updatedBy !== undefined && object.updatedBy !== null + ? String(object.updatedBy) + : ""; + message.updatedAt = + object.updatedAt !== undefined && object.updatedAt !== null + ? fromJsonTimestamp(object.updatedAt) + : undefined; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.expiresAt = + object.expiresAt !== undefined && object.expiresAt !== null + ? fromJsonTimestamp(object.expiresAt) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: File): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.mimeType !== undefined && (obj.mimeType = message.mimeType); + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.updatedBy !== undefined && (obj.updatedBy = message.updatedBy); + message.updatedAt !== undefined && + (obj.updatedAt = message.updatedAt.toISOString()); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + message.expiresAt !== undefined && + (obj.expiresAt = message.expiresAt.toISOString()); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>(object: I): File { + const message = { ...baseFile } as File; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.mimeType = object.mimeType ?? ""; + message.createdBy = object.createdBy ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.updatedBy = object.updatedBy ?? ""; + message.updatedAt = object.updatedAt ?? undefined; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.expiresAt = object.expiresAt ?? undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(File.$type, File); + +const baseFile_LabelsEntry: object = { + $type: "yandex.cloud.ai.files.v1.File.LabelsEntry", + key: "", + value: "", +}; + +export const File_LabelsEntry = { + $type: "yandex.cloud.ai.files.v1.File.LabelsEntry" as const, + + encode( + message: File_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): File_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFile_LabelsEntry } as File_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): File_LabelsEntry { + const message = { ...baseFile_LabelsEntry } as File_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: File_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): File_LabelsEntry { + const message = { ...baseFile_LabelsEntry } as File_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(File_LabelsEntry.$type, File_LabelsEntry); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/files/v1/file_service.ts b/src/generated/yandex/cloud/ai/files/v1/file_service.ts new file mode 100644 index 00000000..7080ebb5 --- /dev/null +++ b/src/generated/yandex/cloud/ai/files/v1/file_service.ts @@ -0,0 +1,1331 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { ExpirationConfig } from "../../../../../yandex/cloud/ai/common/common"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; +import { File } from "../../../../../yandex/cloud/ai/files/v1/file"; + +export const protobufPackage = "yandex.cloud.ai.files.v1"; + +export interface CreateFileRequest { + $type: "yandex.cloud.ai.files.v1.CreateFileRequest"; + folderId: string; + name: string; + description: string; + mimeType: string; + content: Buffer; + labels: { [key: string]: string }; + expirationConfig?: ExpirationConfig; +} + +export interface CreateFileRequest_LabelsEntry { + $type: "yandex.cloud.ai.files.v1.CreateFileRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface GetFileRequest { + $type: "yandex.cloud.ai.files.v1.GetFileRequest"; + fileId: string; +} + +export interface GetFileUrlRequest { + $type: "yandex.cloud.ai.files.v1.GetFileUrlRequest"; + fileId: string; +} + +export interface GetFileUrlResponse { + $type: "yandex.cloud.ai.files.v1.GetFileUrlResponse"; + url: string; +} + +export interface UpdateFileRequest { + $type: "yandex.cloud.ai.files.v1.UpdateFileRequest"; + fileId: string; + updateMask?: FieldMask; + name: string; + description: string; + expirationConfig?: ExpirationConfig; + labels: { [key: string]: string }; +} + +export interface UpdateFileRequest_LabelsEntry { + $type: "yandex.cloud.ai.files.v1.UpdateFileRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface DeleteFileRequest { + $type: "yandex.cloud.ai.files.v1.DeleteFileRequest"; + fileId: string; +} + +export interface DeleteFileResponse { + $type: "yandex.cloud.ai.files.v1.DeleteFileResponse"; +} + +export interface ListFilesRequest { + $type: "yandex.cloud.ai.files.v1.ListFilesRequest"; + folderId: string; + pageSize: number; + pageToken: string; +} + +export interface ListFilesResponse { + $type: "yandex.cloud.ai.files.v1.ListFilesResponse"; + files: File[]; + nextPageToken: string; +} + +const baseCreateFileRequest: object = { + $type: "yandex.cloud.ai.files.v1.CreateFileRequest", + folderId: "", + name: "", + description: "", + mimeType: "", +}; + +export const CreateFileRequest = { + $type: "yandex.cloud.ai.files.v1.CreateFileRequest" as const, + + encode( + message: CreateFileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.mimeType !== "") { + writer.uint32(34).string(message.mimeType); + } + if (message.content.length !== 0) { + writer.uint32(42).bytes(message.content); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateFileRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.ai.files.v1.CreateFileRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(58).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateFileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateFileRequest } as CreateFileRequest; + message.labels = {}; + message.content = Buffer.alloc(0); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.mimeType = reader.string(); + break; + case 5: + message.content = reader.bytes() as Buffer; + break; + case 6: + const entry6 = CreateFileRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + case 7: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateFileRequest { + const message = { ...baseCreateFileRequest } as CreateFileRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.mimeType = + object.mimeType !== undefined && object.mimeType !== null + ? String(object.mimeType) + : ""; + message.content = + object.content !== undefined && object.content !== null + ? Buffer.from(bytesFromBase64(object.content)) + : Buffer.alloc(0); + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + return message; + }, + + toJSON(message: CreateFileRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.mimeType !== undefined && (obj.mimeType = message.mimeType); + message.content !== undefined && + (obj.content = base64FromBytes( + message.content !== undefined ? message.content : Buffer.alloc(0) + )); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateFileRequest { + const message = { ...baseCreateFileRequest } as CreateFileRequest; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.mimeType = object.mimeType ?? ""; + message.content = object.content ?? Buffer.alloc(0); + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CreateFileRequest.$type, CreateFileRequest); + +const baseCreateFileRequest_LabelsEntry: object = { + $type: "yandex.cloud.ai.files.v1.CreateFileRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateFileRequest_LabelsEntry = { + $type: "yandex.cloud.ai.files.v1.CreateFileRequest.LabelsEntry" as const, + + encode( + message: CreateFileRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateFileRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateFileRequest_LabelsEntry, + } as CreateFileRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateFileRequest_LabelsEntry { + const message = { + ...baseCreateFileRequest_LabelsEntry, + } as CreateFileRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateFileRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateFileRequest_LabelsEntry { + const message = { + ...baseCreateFileRequest_LabelsEntry, + } as CreateFileRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateFileRequest_LabelsEntry.$type, + CreateFileRequest_LabelsEntry +); + +const baseGetFileRequest: object = { + $type: "yandex.cloud.ai.files.v1.GetFileRequest", + fileId: "", +}; + +export const GetFileRequest = { + $type: "yandex.cloud.ai.files.v1.GetFileRequest" as const, + + encode( + message: GetFileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.fileId !== "") { + writer.uint32(10).string(message.fileId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetFileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetFileRequest } as GetFileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetFileRequest { + const message = { ...baseGetFileRequest } as GetFileRequest; + message.fileId = + object.fileId !== undefined && object.fileId !== null + ? String(object.fileId) + : ""; + return message; + }, + + toJSON(message: GetFileRequest): unknown { + const obj: any = {}; + message.fileId !== undefined && (obj.fileId = message.fileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetFileRequest { + const message = { ...baseGetFileRequest } as GetFileRequest; + message.fileId = object.fileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetFileRequest.$type, GetFileRequest); + +const baseGetFileUrlRequest: object = { + $type: "yandex.cloud.ai.files.v1.GetFileUrlRequest", + fileId: "", +}; + +export const GetFileUrlRequest = { + $type: "yandex.cloud.ai.files.v1.GetFileUrlRequest" as const, + + encode( + message: GetFileUrlRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.fileId !== "") { + writer.uint32(10).string(message.fileId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetFileUrlRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetFileUrlRequest } as GetFileUrlRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetFileUrlRequest { + const message = { ...baseGetFileUrlRequest } as GetFileUrlRequest; + message.fileId = + object.fileId !== undefined && object.fileId !== null + ? String(object.fileId) + : ""; + return message; + }, + + toJSON(message: GetFileUrlRequest): unknown { + const obj: any = {}; + message.fileId !== undefined && (obj.fileId = message.fileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetFileUrlRequest { + const message = { ...baseGetFileUrlRequest } as GetFileUrlRequest; + message.fileId = object.fileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetFileUrlRequest.$type, GetFileUrlRequest); + +const baseGetFileUrlResponse: object = { + $type: "yandex.cloud.ai.files.v1.GetFileUrlResponse", + url: "", +}; + +export const GetFileUrlResponse = { + $type: "yandex.cloud.ai.files.v1.GetFileUrlResponse" as const, + + encode( + message: GetFileUrlResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(10).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetFileUrlResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetFileUrlResponse } as GetFileUrlResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetFileUrlResponse { + const message = { ...baseGetFileUrlResponse } as GetFileUrlResponse; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: GetFileUrlResponse): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetFileUrlResponse { + const message = { ...baseGetFileUrlResponse } as GetFileUrlResponse; + message.url = object.url ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetFileUrlResponse.$type, GetFileUrlResponse); + +const baseUpdateFileRequest: object = { + $type: "yandex.cloud.ai.files.v1.UpdateFileRequest", + fileId: "", + name: "", + description: "", +}; + +export const UpdateFileRequest = { + $type: "yandex.cloud.ai.files.v1.UpdateFileRequest" as const, + + encode( + message: UpdateFileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.fileId !== "") { + writer.uint32(10).string(message.fileId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.expirationConfig !== undefined) { + ExpirationConfig.encode( + message.expirationConfig, + writer.uint32(42).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateFileRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.ai.files.v1.UpdateFileRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateFileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateFileRequest } as UpdateFileRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fileId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.expirationConfig = ExpirationConfig.decode( + reader, + reader.uint32() + ); + break; + case 6: + const entry6 = UpdateFileRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateFileRequest { + const message = { ...baseUpdateFileRequest } as UpdateFileRequest; + message.fileId = + object.fileId !== undefined && object.fileId !== null + ? String(object.fileId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromJSON(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: UpdateFileRequest): unknown { + const obj: any = {}; + message.fileId !== undefined && (obj.fileId = message.fileId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.expirationConfig !== undefined && + (obj.expirationConfig = message.expirationConfig + ? ExpirationConfig.toJSON(message.expirationConfig) + : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateFileRequest { + const message = { ...baseUpdateFileRequest } as UpdateFileRequest; + message.fileId = object.fileId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.expirationConfig = + object.expirationConfig !== undefined && object.expirationConfig !== null + ? ExpirationConfig.fromPartial(object.expirationConfig) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(UpdateFileRequest.$type, UpdateFileRequest); + +const baseUpdateFileRequest_LabelsEntry: object = { + $type: "yandex.cloud.ai.files.v1.UpdateFileRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateFileRequest_LabelsEntry = { + $type: "yandex.cloud.ai.files.v1.UpdateFileRequest.LabelsEntry" as const, + + encode( + message: UpdateFileRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateFileRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateFileRequest_LabelsEntry, + } as UpdateFileRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateFileRequest_LabelsEntry { + const message = { + ...baseUpdateFileRequest_LabelsEntry, + } as UpdateFileRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateFileRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateFileRequest_LabelsEntry { + const message = { + ...baseUpdateFileRequest_LabelsEntry, + } as UpdateFileRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateFileRequest_LabelsEntry.$type, + UpdateFileRequest_LabelsEntry +); + +const baseDeleteFileRequest: object = { + $type: "yandex.cloud.ai.files.v1.DeleteFileRequest", + fileId: "", +}; + +export const DeleteFileRequest = { + $type: "yandex.cloud.ai.files.v1.DeleteFileRequest" as const, + + encode( + message: DeleteFileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.fileId !== "") { + writer.uint32(10).string(message.fileId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteFileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteFileRequest } as DeleteFileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteFileRequest { + const message = { ...baseDeleteFileRequest } as DeleteFileRequest; + message.fileId = + object.fileId !== undefined && object.fileId !== null + ? String(object.fileId) + : ""; + return message; + }, + + toJSON(message: DeleteFileRequest): unknown { + const obj: any = {}; + message.fileId !== undefined && (obj.fileId = message.fileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteFileRequest { + const message = { ...baseDeleteFileRequest } as DeleteFileRequest; + message.fileId = object.fileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteFileRequest.$type, DeleteFileRequest); + +const baseDeleteFileResponse: object = { + $type: "yandex.cloud.ai.files.v1.DeleteFileResponse", +}; + +export const DeleteFileResponse = { + $type: "yandex.cloud.ai.files.v1.DeleteFileResponse" as const, + + encode( + _: DeleteFileResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteFileResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteFileResponse } as DeleteFileResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): DeleteFileResponse { + const message = { ...baseDeleteFileResponse } as DeleteFileResponse; + return message; + }, + + toJSON(_: DeleteFileResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): DeleteFileResponse { + const message = { ...baseDeleteFileResponse } as DeleteFileResponse; + return message; + }, +}; + +messageTypeRegistry.set(DeleteFileResponse.$type, DeleteFileResponse); + +const baseListFilesRequest: object = { + $type: "yandex.cloud.ai.files.v1.ListFilesRequest", + folderId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListFilesRequest = { + $type: "yandex.cloud.ai.files.v1.ListFilesRequest" as const, + + encode( + message: ListFilesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListFilesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListFilesRequest } as ListFilesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListFilesRequest { + const message = { ...baseListFilesRequest } as ListFilesRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListFilesRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListFilesRequest { + const message = { ...baseListFilesRequest } as ListFilesRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListFilesRequest.$type, ListFilesRequest); + +const baseListFilesResponse: object = { + $type: "yandex.cloud.ai.files.v1.ListFilesResponse", + nextPageToken: "", +}; + +export const ListFilesResponse = { + $type: "yandex.cloud.ai.files.v1.ListFilesResponse" as const, + + encode( + message: ListFilesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.files) { + File.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListFilesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListFilesResponse } as ListFilesResponse; + message.files = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.files.push(File.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListFilesResponse { + const message = { ...baseListFilesResponse } as ListFilesResponse; + message.files = (object.files ?? []).map((e: any) => File.fromJSON(e)); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListFilesResponse): unknown { + const obj: any = {}; + if (message.files) { + obj.files = message.files.map((e) => (e ? File.toJSON(e) : undefined)); + } else { + obj.files = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListFilesResponse { + const message = { ...baseListFilesResponse } as ListFilesResponse; + message.files = object.files?.map((e) => File.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListFilesResponse.$type, ListFilesResponse); + +export const FileServiceService = { + create: { + path: "/yandex.cloud.ai.files.v1.FileService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateFileRequest) => + Buffer.from(CreateFileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateFileRequest.decode(value), + responseSerialize: (value: File) => + Buffer.from(File.encode(value).finish()), + responseDeserialize: (value: Buffer) => File.decode(value), + }, + get: { + path: "/yandex.cloud.ai.files.v1.FileService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetFileRequest) => + Buffer.from(GetFileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetFileRequest.decode(value), + responseSerialize: (value: File) => + Buffer.from(File.encode(value).finish()), + responseDeserialize: (value: Buffer) => File.decode(value), + }, + getUrl: { + path: "/yandex.cloud.ai.files.v1.FileService/GetUrl", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetFileUrlRequest) => + Buffer.from(GetFileUrlRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetFileUrlRequest.decode(value), + responseSerialize: (value: GetFileUrlResponse) => + Buffer.from(GetFileUrlResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => GetFileUrlResponse.decode(value), + }, + update: { + path: "/yandex.cloud.ai.files.v1.FileService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateFileRequest) => + Buffer.from(UpdateFileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateFileRequest.decode(value), + responseSerialize: (value: File) => + Buffer.from(File.encode(value).finish()), + responseDeserialize: (value: Buffer) => File.decode(value), + }, + delete: { + path: "/yandex.cloud.ai.files.v1.FileService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteFileRequest) => + Buffer.from(DeleteFileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteFileRequest.decode(value), + responseSerialize: (value: DeleteFileResponse) => + Buffer.from(DeleteFileResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => DeleteFileResponse.decode(value), + }, + list: { + path: "/yandex.cloud.ai.files.v1.FileService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListFilesRequest) => + Buffer.from(ListFilesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListFilesRequest.decode(value), + responseSerialize: (value: ListFilesResponse) => + Buffer.from(ListFilesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListFilesResponse.decode(value), + }, +} as const; + +export interface FileServiceServer extends UntypedServiceImplementation { + create: handleUnaryCall; + get: handleUnaryCall; + getUrl: handleUnaryCall; + update: handleUnaryCall; + delete: handleUnaryCall; + list: handleUnaryCall; +} + +export interface FileServiceClient extends Client { + create( + request: CreateFileRequest, + callback: (error: ServiceError | null, response: File) => void + ): ClientUnaryCall; + create( + request: CreateFileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: File) => void + ): ClientUnaryCall; + create( + request: CreateFileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: File) => void + ): ClientUnaryCall; + get( + request: GetFileRequest, + callback: (error: ServiceError | null, response: File) => void + ): ClientUnaryCall; + get( + request: GetFileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: File) => void + ): ClientUnaryCall; + get( + request: GetFileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: File) => void + ): ClientUnaryCall; + getUrl( + request: GetFileUrlRequest, + callback: (error: ServiceError | null, response: GetFileUrlResponse) => void + ): ClientUnaryCall; + getUrl( + request: GetFileUrlRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: GetFileUrlResponse) => void + ): ClientUnaryCall; + getUrl( + request: GetFileUrlRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: GetFileUrlResponse) => void + ): ClientUnaryCall; + update( + request: UpdateFileRequest, + callback: (error: ServiceError | null, response: File) => void + ): ClientUnaryCall; + update( + request: UpdateFileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: File) => void + ): ClientUnaryCall; + update( + request: UpdateFileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: File) => void + ): ClientUnaryCall; + delete( + request: DeleteFileRequest, + callback: (error: ServiceError | null, response: DeleteFileResponse) => void + ): ClientUnaryCall; + delete( + request: DeleteFileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: DeleteFileResponse) => void + ): ClientUnaryCall; + delete( + request: DeleteFileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: DeleteFileResponse) => void + ): ClientUnaryCall; + list( + request: ListFilesRequest, + callback: (error: ServiceError | null, response: ListFilesResponse) => void + ): ClientUnaryCall; + list( + request: ListFilesRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: ListFilesResponse) => void + ): ClientUnaryCall; + list( + request: ListFilesRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: ListFilesResponse) => void + ): ClientUnaryCall; +} + +export const FileServiceClient = makeGenericClientConstructor( + FileServiceService, + "yandex.cloud.ai.files.v1.FileService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): FileServiceClient; + service: typeof FileServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (const byte of arr) { + bin.push(String.fromCharCode(byte)); + } + return btoa(bin.join("")); +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/foundation_models/v1/embedding/embedding_service.ts b/src/generated/yandex/cloud/ai/foundation_models/v1/embedding/embedding_service.ts new file mode 100644 index 00000000..923cacd0 --- /dev/null +++ b/src/generated/yandex/cloud/ai/foundation_models/v1/embedding/embedding_service.ts @@ -0,0 +1,331 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.ai.foundation_models.v1"; + +/** Request for the service to obtain text embeddings. */ +export interface TextEmbeddingRequest { + $type: "yandex.cloud.ai.foundation_models.v1.TextEmbeddingRequest"; + /** The [ID of the model](/docs/foundation-models/concepts/embeddings) to be used for obtaining text embeddings. */ + modelUri: string; + /** The input text for which the embedding is requested. */ + text: string; +} + +/** Response containing generated text embedding. */ +export interface TextEmbeddingResponse { + $type: "yandex.cloud.ai.foundation_models.v1.TextEmbeddingResponse"; + /** A repeated list of double values representing the embedding. */ + embedding: number[]; + /** The number of tokens in the input text. */ + numTokens: number; + /** The model version changes with each new releases. */ + modelVersion: string; +} + +const baseTextEmbeddingRequest: object = { + $type: "yandex.cloud.ai.foundation_models.v1.TextEmbeddingRequest", + modelUri: "", + text: "", +}; + +export const TextEmbeddingRequest = { + $type: "yandex.cloud.ai.foundation_models.v1.TextEmbeddingRequest" as const, + + encode( + message: TextEmbeddingRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.modelUri !== "") { + writer.uint32(10).string(message.modelUri); + } + if (message.text !== "") { + writer.uint32(18).string(message.text); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): TextEmbeddingRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTextEmbeddingRequest } as TextEmbeddingRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.modelUri = reader.string(); + break; + case 2: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TextEmbeddingRequest { + const message = { ...baseTextEmbeddingRequest } as TextEmbeddingRequest; + message.modelUri = + object.modelUri !== undefined && object.modelUri !== null + ? String(object.modelUri) + : ""; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + return message; + }, + + toJSON(message: TextEmbeddingRequest): unknown { + const obj: any = {}; + message.modelUri !== undefined && (obj.modelUri = message.modelUri); + message.text !== undefined && (obj.text = message.text); + return obj; + }, + + fromPartial, I>>( + object: I + ): TextEmbeddingRequest { + const message = { ...baseTextEmbeddingRequest } as TextEmbeddingRequest; + message.modelUri = object.modelUri ?? ""; + message.text = object.text ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(TextEmbeddingRequest.$type, TextEmbeddingRequest); + +const baseTextEmbeddingResponse: object = { + $type: "yandex.cloud.ai.foundation_models.v1.TextEmbeddingResponse", + embedding: 0, + numTokens: 0, + modelVersion: "", +}; + +export const TextEmbeddingResponse = { + $type: "yandex.cloud.ai.foundation_models.v1.TextEmbeddingResponse" as const, + + encode( + message: TextEmbeddingResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.embedding) { + writer.double(v); + } + writer.ldelim(); + if (message.numTokens !== 0) { + writer.uint32(16).int64(message.numTokens); + } + if (message.modelVersion !== "") { + writer.uint32(26).string(message.modelVersion); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): TextEmbeddingResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTextEmbeddingResponse } as TextEmbeddingResponse; + message.embedding = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.embedding.push(reader.double()); + } + } else { + message.embedding.push(reader.double()); + } + break; + case 2: + message.numTokens = longToNumber(reader.int64() as Long); + break; + case 3: + message.modelVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TextEmbeddingResponse { + const message = { ...baseTextEmbeddingResponse } as TextEmbeddingResponse; + message.embedding = (object.embedding ?? []).map((e: any) => Number(e)); + message.numTokens = + object.numTokens !== undefined && object.numTokens !== null + ? Number(object.numTokens) + : 0; + message.modelVersion = + object.modelVersion !== undefined && object.modelVersion !== null + ? String(object.modelVersion) + : ""; + return message; + }, + + toJSON(message: TextEmbeddingResponse): unknown { + const obj: any = {}; + if (message.embedding) { + obj.embedding = message.embedding.map((e) => e); + } else { + obj.embedding = []; + } + message.numTokens !== undefined && + (obj.numTokens = Math.round(message.numTokens)); + message.modelVersion !== undefined && + (obj.modelVersion = message.modelVersion); + return obj; + }, + + fromPartial, I>>( + object: I + ): TextEmbeddingResponse { + const message = { ...baseTextEmbeddingResponse } as TextEmbeddingResponse; + message.embedding = object.embedding?.map((e) => e) || []; + message.numTokens = object.numTokens ?? 0; + message.modelVersion = object.modelVersion ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(TextEmbeddingResponse.$type, TextEmbeddingResponse); + +/** Service for obtaining embeddings from input data. */ +export const EmbeddingsServiceService = { + /** A method for obtaining embeddings from text data. */ + textEmbedding: { + path: "/yandex.cloud.ai.foundation_models.v1.EmbeddingsService/TextEmbedding", + requestStream: false, + responseStream: false, + requestSerialize: (value: TextEmbeddingRequest) => + Buffer.from(TextEmbeddingRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => TextEmbeddingRequest.decode(value), + responseSerialize: (value: TextEmbeddingResponse) => + Buffer.from(TextEmbeddingResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => TextEmbeddingResponse.decode(value), + }, +} as const; + +export interface EmbeddingsServiceServer extends UntypedServiceImplementation { + /** A method for obtaining embeddings from text data. */ + textEmbedding: handleUnaryCall; +} + +export interface EmbeddingsServiceClient extends Client { + /** A method for obtaining embeddings from text data. */ + textEmbedding( + request: TextEmbeddingRequest, + callback: ( + error: ServiceError | null, + response: TextEmbeddingResponse + ) => void + ): ClientUnaryCall; + textEmbedding( + request: TextEmbeddingRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: TextEmbeddingResponse + ) => void + ): ClientUnaryCall; + textEmbedding( + request: TextEmbeddingRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: TextEmbeddingResponse + ) => void + ): ClientUnaryCall; +} + +export const EmbeddingsServiceClient = makeGenericClientConstructor( + EmbeddingsServiceService, + "yandex.cloud.ai.foundation_models.v1.EmbeddingsService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): EmbeddingsServiceClient; + service: typeof EmbeddingsServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/foundation_models/v1/image_generation/image_generation.ts b/src/generated/yandex/cloud/ai/foundation_models/v1/image_generation/image_generation.ts new file mode 100644 index 00000000..3b1504ca --- /dev/null +++ b/src/generated/yandex/cloud/ai/foundation_models/v1/image_generation/image_generation.ts @@ -0,0 +1,337 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = + "yandex.cloud.ai.foundation_models.v1.image_generation"; + +/** The text descriptions and weights that the model uses to generate an image. */ +export interface Message { + $type: "yandex.cloud.ai.foundation_models.v1.image_generation.Message"; + /** Text describing the image. */ + text: string; + /** Message weight. Negative values indicate negative messages. */ + weight: number; +} + +export interface AspectRatio { + $type: "yandex.cloud.ai.foundation_models.v1.image_generation.AspectRatio"; + /** Weight of width in image. */ + widthRatio: number; + /** Weight of height in image. */ + heightRatio: number; +} + +export interface ImageGenerationOptions { + $type: "yandex.cloud.ai.foundation_models.v1.image_generation.ImageGenerationOptions"; + /** MIME type of generated image format. */ + mimeType: string; + /** Seed for image generation. */ + seed: number; + /** Aspect ratio of generated image. */ + aspectRatio?: AspectRatio; +} + +const baseMessage: object = { + $type: "yandex.cloud.ai.foundation_models.v1.image_generation.Message", + text: "", + weight: 0, +}; + +export const Message = { + $type: + "yandex.cloud.ai.foundation_models.v1.image_generation.Message" as const, + + encode( + message: Message, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.text !== "") { + writer.uint32(10).string(message.text); + } + if (message.weight !== 0) { + writer.uint32(17).double(message.weight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Message { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessage } as Message; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.weight = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Message { + const message = { ...baseMessage } as Message; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + message.weight = + object.weight !== undefined && object.weight !== null + ? Number(object.weight) + : 0; + return message; + }, + + toJSON(message: Message): unknown { + const obj: any = {}; + message.text !== undefined && (obj.text = message.text); + message.weight !== undefined && (obj.weight = message.weight); + return obj; + }, + + fromPartial, I>>(object: I): Message { + const message = { ...baseMessage } as Message; + message.text = object.text ?? ""; + message.weight = object.weight ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Message.$type, Message); + +const baseAspectRatio: object = { + $type: "yandex.cloud.ai.foundation_models.v1.image_generation.AspectRatio", + widthRatio: 0, + heightRatio: 0, +}; + +export const AspectRatio = { + $type: + "yandex.cloud.ai.foundation_models.v1.image_generation.AspectRatio" as const, + + encode( + message: AspectRatio, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.widthRatio !== 0) { + writer.uint32(8).int64(message.widthRatio); + } + if (message.heightRatio !== 0) { + writer.uint32(16).int64(message.heightRatio); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AspectRatio { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAspectRatio } as AspectRatio; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.widthRatio = longToNumber(reader.int64() as Long); + break; + case 2: + message.heightRatio = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AspectRatio { + const message = { ...baseAspectRatio } as AspectRatio; + message.widthRatio = + object.widthRatio !== undefined && object.widthRatio !== null + ? Number(object.widthRatio) + : 0; + message.heightRatio = + object.heightRatio !== undefined && object.heightRatio !== null + ? Number(object.heightRatio) + : 0; + return message; + }, + + toJSON(message: AspectRatio): unknown { + const obj: any = {}; + message.widthRatio !== undefined && + (obj.widthRatio = Math.round(message.widthRatio)); + message.heightRatio !== undefined && + (obj.heightRatio = Math.round(message.heightRatio)); + return obj; + }, + + fromPartial, I>>( + object: I + ): AspectRatio { + const message = { ...baseAspectRatio } as AspectRatio; + message.widthRatio = object.widthRatio ?? 0; + message.heightRatio = object.heightRatio ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(AspectRatio.$type, AspectRatio); + +const baseImageGenerationOptions: object = { + $type: + "yandex.cloud.ai.foundation_models.v1.image_generation.ImageGenerationOptions", + mimeType: "", + seed: 0, +}; + +export const ImageGenerationOptions = { + $type: + "yandex.cloud.ai.foundation_models.v1.image_generation.ImageGenerationOptions" as const, + + encode( + message: ImageGenerationOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.mimeType !== "") { + writer.uint32(10).string(message.mimeType); + } + if (message.seed !== 0) { + writer.uint32(16).int64(message.seed); + } + if (message.aspectRatio !== undefined) { + AspectRatio.encode( + message.aspectRatio, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ImageGenerationOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseImageGenerationOptions } as ImageGenerationOptions; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mimeType = reader.string(); + break; + case 2: + message.seed = longToNumber(reader.int64() as Long); + break; + case 3: + message.aspectRatio = AspectRatio.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ImageGenerationOptions { + const message = { ...baseImageGenerationOptions } as ImageGenerationOptions; + message.mimeType = + object.mimeType !== undefined && object.mimeType !== null + ? String(object.mimeType) + : ""; + message.seed = + object.seed !== undefined && object.seed !== null + ? Number(object.seed) + : 0; + message.aspectRatio = + object.aspectRatio !== undefined && object.aspectRatio !== null + ? AspectRatio.fromJSON(object.aspectRatio) + : undefined; + return message; + }, + + toJSON(message: ImageGenerationOptions): unknown { + const obj: any = {}; + message.mimeType !== undefined && (obj.mimeType = message.mimeType); + message.seed !== undefined && (obj.seed = Math.round(message.seed)); + message.aspectRatio !== undefined && + (obj.aspectRatio = message.aspectRatio + ? AspectRatio.toJSON(message.aspectRatio) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ImageGenerationOptions { + const message = { ...baseImageGenerationOptions } as ImageGenerationOptions; + message.mimeType = object.mimeType ?? ""; + message.seed = object.seed ?? 0; + message.aspectRatio = + object.aspectRatio !== undefined && object.aspectRatio !== null + ? AspectRatio.fromPartial(object.aspectRatio) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ImageGenerationOptions.$type, ImageGenerationOptions); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/foundation_models/v1/image_generation/image_generation_service.ts b/src/generated/yandex/cloud/ai/foundation_models/v1/image_generation/image_generation_service.ts new file mode 100644 index 00000000..dcb522af --- /dev/null +++ b/src/generated/yandex/cloud/ai/foundation_models/v1/image_generation/image_generation_service.ts @@ -0,0 +1,365 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + ImageGenerationOptions, + Message, +} from "../../../../../../yandex/cloud/ai/foundation_models/v1/image_generation/image_generation"; +import { Operation } from "../../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = + "yandex.cloud.ai.foundation_models.v1.image_generation"; + +/** Request for the service to generate an image. */ +export interface ImageGenerationRequest { + $type: "yandex.cloud.ai.foundation_models.v1.image_generation.ImageGenerationRequest"; + /** The [ID of the model](/docs/foundation-models/concepts/yandexart/models) to be used for image generation. */ + modelUri: string; + /** A list of messages representing the context for the image generation model. */ + messages: Message[]; + /** Image generation options. */ + generationOptions?: ImageGenerationOptions; +} + +/** Response containing generated image. */ +export interface ImageGenerationResponse { + $type: "yandex.cloud.ai.foundation_models.v1.image_generation.ImageGenerationResponse"; + /** The image is serialized as an array of bytes encoded in base64. */ + image: Buffer; + /** The model version changes with each new releases. */ + modelVersion: string; +} + +const baseImageGenerationRequest: object = { + $type: + "yandex.cloud.ai.foundation_models.v1.image_generation.ImageGenerationRequest", + modelUri: "", +}; + +export const ImageGenerationRequest = { + $type: + "yandex.cloud.ai.foundation_models.v1.image_generation.ImageGenerationRequest" as const, + + encode( + message: ImageGenerationRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.modelUri !== "") { + writer.uint32(10).string(message.modelUri); + } + for (const v of message.messages) { + Message.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.generationOptions !== undefined) { + ImageGenerationOptions.encode( + message.generationOptions, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ImageGenerationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseImageGenerationRequest } as ImageGenerationRequest; + message.messages = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.modelUri = reader.string(); + break; + case 2: + message.messages.push(Message.decode(reader, reader.uint32())); + break; + case 3: + message.generationOptions = ImageGenerationOptions.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ImageGenerationRequest { + const message = { ...baseImageGenerationRequest } as ImageGenerationRequest; + message.modelUri = + object.modelUri !== undefined && object.modelUri !== null + ? String(object.modelUri) + : ""; + message.messages = (object.messages ?? []).map((e: any) => + Message.fromJSON(e) + ); + message.generationOptions = + object.generationOptions !== undefined && + object.generationOptions !== null + ? ImageGenerationOptions.fromJSON(object.generationOptions) + : undefined; + return message; + }, + + toJSON(message: ImageGenerationRequest): unknown { + const obj: any = {}; + message.modelUri !== undefined && (obj.modelUri = message.modelUri); + if (message.messages) { + obj.messages = message.messages.map((e) => + e ? Message.toJSON(e) : undefined + ); + } else { + obj.messages = []; + } + message.generationOptions !== undefined && + (obj.generationOptions = message.generationOptions + ? ImageGenerationOptions.toJSON(message.generationOptions) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ImageGenerationRequest { + const message = { ...baseImageGenerationRequest } as ImageGenerationRequest; + message.modelUri = object.modelUri ?? ""; + message.messages = + object.messages?.map((e) => Message.fromPartial(e)) || []; + message.generationOptions = + object.generationOptions !== undefined && + object.generationOptions !== null + ? ImageGenerationOptions.fromPartial(object.generationOptions) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ImageGenerationRequest.$type, ImageGenerationRequest); + +const baseImageGenerationResponse: object = { + $type: + "yandex.cloud.ai.foundation_models.v1.image_generation.ImageGenerationResponse", + modelVersion: "", +}; + +export const ImageGenerationResponse = { + $type: + "yandex.cloud.ai.foundation_models.v1.image_generation.ImageGenerationResponse" as const, + + encode( + message: ImageGenerationResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.image.length !== 0) { + writer.uint32(10).bytes(message.image); + } + if (message.modelVersion !== "") { + writer.uint32(18).string(message.modelVersion); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ImageGenerationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseImageGenerationResponse, + } as ImageGenerationResponse; + message.image = Buffer.alloc(0); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.image = reader.bytes() as Buffer; + break; + case 2: + message.modelVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ImageGenerationResponse { + const message = { + ...baseImageGenerationResponse, + } as ImageGenerationResponse; + message.image = + object.image !== undefined && object.image !== null + ? Buffer.from(bytesFromBase64(object.image)) + : Buffer.alloc(0); + message.modelVersion = + object.modelVersion !== undefined && object.modelVersion !== null + ? String(object.modelVersion) + : ""; + return message; + }, + + toJSON(message: ImageGenerationResponse): unknown { + const obj: any = {}; + message.image !== undefined && + (obj.image = base64FromBytes( + message.image !== undefined ? message.image : Buffer.alloc(0) + )); + message.modelVersion !== undefined && + (obj.modelVersion = message.modelVersion); + return obj; + }, + + fromPartial, I>>( + object: I + ): ImageGenerationResponse { + const message = { + ...baseImageGenerationResponse, + } as ImageGenerationResponse; + message.image = object.image ?? Buffer.alloc(0); + message.modelVersion = object.modelVersion ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ImageGenerationResponse.$type, ImageGenerationResponse); + +/** Service for obtaining images from input data. */ +export const ImageGenerationAsyncServiceService = { + /** A method for generating an image based on a textual description. */ + generate: { + path: "/yandex.cloud.ai.foundation_models.v1.image_generation.ImageGenerationAsyncService/Generate", + requestStream: false, + responseStream: false, + requestSerialize: (value: ImageGenerationRequest) => + Buffer.from(ImageGenerationRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ImageGenerationRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface ImageGenerationAsyncServiceServer + extends UntypedServiceImplementation { + /** A method for generating an image based on a textual description. */ + generate: handleUnaryCall; +} + +export interface ImageGenerationAsyncServiceClient extends Client { + /** A method for generating an image based on a textual description. */ + generate( + request: ImageGenerationRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + generate( + request: ImageGenerationRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + generate( + request: ImageGenerationRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const ImageGenerationAsyncServiceClient = makeGenericClientConstructor( + ImageGenerationAsyncServiceService, + "yandex.cloud.ai.foundation_models.v1.image_generation.ImageGenerationAsyncService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ImageGenerationAsyncServiceClient; + service: typeof ImageGenerationAsyncServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (const byte of arr) { + bin.push(String.fromCharCode(byte)); + } + return btoa(bin.join("")); +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/foundation_models/v1/text_classification/text_classification.ts b/src/generated/yandex/cloud/ai/foundation_models/v1/text_classification/text_classification.ts new file mode 100644 index 00000000..ee5f733c --- /dev/null +++ b/src/generated/yandex/cloud/ai/foundation_models/v1/text_classification/text_classification.ts @@ -0,0 +1,214 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = + "yandex.cloud.ai.foundation_models.v1.text_classification"; + +/** A pair of text label and corresponding confidence used in classification problems. */ +export interface ClassificationLabel { + $type: "yandex.cloud.ai.foundation_models.v1.text_classification.ClassificationLabel"; + /** A label with a class name. */ + label: string; + /** Confidence of item's belonging to a class. */ + confidence: number; +} + +/** Description of a sample for the classification task. */ +export interface ClassificationSample { + $type: "yandex.cloud.ai.foundation_models.v1.text_classification.ClassificationSample"; + /** Text sample. */ + text: string; + /** Expected label for a given text. */ + label: string; +} + +const baseClassificationLabel: object = { + $type: + "yandex.cloud.ai.foundation_models.v1.text_classification.ClassificationLabel", + label: "", + confidence: 0, +}; + +export const ClassificationLabel = { + $type: + "yandex.cloud.ai.foundation_models.v1.text_classification.ClassificationLabel" as const, + + encode( + message: ClassificationLabel, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.label !== "") { + writer.uint32(10).string(message.label); + } + if (message.confidence !== 0) { + writer.uint32(17).double(message.confidence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClassificationLabel { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseClassificationLabel } as ClassificationLabel; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.label = reader.string(); + break; + case 2: + message.confidence = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClassificationLabel { + const message = { ...baseClassificationLabel } as ClassificationLabel; + message.label = + object.label !== undefined && object.label !== null + ? String(object.label) + : ""; + message.confidence = + object.confidence !== undefined && object.confidence !== null + ? Number(object.confidence) + : 0; + return message; + }, + + toJSON(message: ClassificationLabel): unknown { + const obj: any = {}; + message.label !== undefined && (obj.label = message.label); + message.confidence !== undefined && (obj.confidence = message.confidence); + return obj; + }, + + fromPartial, I>>( + object: I + ): ClassificationLabel { + const message = { ...baseClassificationLabel } as ClassificationLabel; + message.label = object.label ?? ""; + message.confidence = object.confidence ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(ClassificationLabel.$type, ClassificationLabel); + +const baseClassificationSample: object = { + $type: + "yandex.cloud.ai.foundation_models.v1.text_classification.ClassificationSample", + text: "", + label: "", +}; + +export const ClassificationSample = { + $type: + "yandex.cloud.ai.foundation_models.v1.text_classification.ClassificationSample" as const, + + encode( + message: ClassificationSample, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.text !== "") { + writer.uint32(10).string(message.text); + } + if (message.label !== "") { + writer.uint32(18).string(message.label); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ClassificationSample { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseClassificationSample } as ClassificationSample; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.label = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClassificationSample { + const message = { ...baseClassificationSample } as ClassificationSample; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + message.label = + object.label !== undefined && object.label !== null + ? String(object.label) + : ""; + return message; + }, + + toJSON(message: ClassificationSample): unknown { + const obj: any = {}; + message.text !== undefined && (obj.text = message.text); + message.label !== undefined && (obj.label = message.label); + return obj; + }, + + fromPartial, I>>( + object: I + ): ClassificationSample { + const message = { ...baseClassificationSample } as ClassificationSample; + message.text = object.text ?? ""; + message.label = object.label ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ClassificationSample.$type, ClassificationSample); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/foundation_models/v1/text_classification/text_classification_service.ts b/src/generated/yandex/cloud/ai/foundation_models/v1/text_classification/text_classification_service.ts new file mode 100644 index 00000000..7aa8d540 --- /dev/null +++ b/src/generated/yandex/cloud/ai/foundation_models/v1/text_classification/text_classification_service.ts @@ -0,0 +1,632 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + ClassificationLabel, + ClassificationSample, +} from "../../../../../../yandex/cloud/ai/foundation_models/v1/text_classification/text_classification"; + +export const protobufPackage = + "yandex.cloud.ai.foundation_models.v1.text_classification"; + +/** Request for the service to classify text. */ +export interface TextClassificationRequest { + $type: "yandex.cloud.ai.foundation_models.v1.text_classification.TextClassificationRequest"; + /** The identifier of the classification model. */ + modelUri: string; + /** Text for classification. */ + text: string; +} + +/** Response containing classifier predictions. */ +export interface TextClassificationResponse { + $type: "yandex.cloud.ai.foundation_models.v1.text_classification.TextClassificationResponse"; + /** Result of classification - a list of label-confidence pairs. */ + predictions: ClassificationLabel[]; + /** Model version (changes with model releases). */ + modelVersion: string; +} + +/** Request for the service to classify text. */ +export interface FewShotTextClassificationRequest { + $type: "yandex.cloud.ai.foundation_models.v1.text_classification.FewShotTextClassificationRequest"; + /** The identifier of the classification model. */ + modelUri: string; + /** Text description of the classification task. */ + taskDescription: string; + /** List of available labels for the classification result. */ + labels: string[]; + /** Text for classification. */ + text: string; + /** Optional set of text samples with expected labels that may be used as an additional hint for the classifier. */ + samples: ClassificationSample[]; +} + +/** Response containing classifier predictions. */ +export interface FewShotTextClassificationResponse { + $type: "yandex.cloud.ai.foundation_models.v1.text_classification.FewShotTextClassificationResponse"; + /** Result of classification - a list of label-confidence pairs. */ + predictions: ClassificationLabel[]; + /** Model version (changes with model releases). */ + modelVersion: string; +} + +const baseTextClassificationRequest: object = { + $type: + "yandex.cloud.ai.foundation_models.v1.text_classification.TextClassificationRequest", + modelUri: "", + text: "", +}; + +export const TextClassificationRequest = { + $type: + "yandex.cloud.ai.foundation_models.v1.text_classification.TextClassificationRequest" as const, + + encode( + message: TextClassificationRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.modelUri !== "") { + writer.uint32(10).string(message.modelUri); + } + if (message.text !== "") { + writer.uint32(18).string(message.text); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): TextClassificationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTextClassificationRequest, + } as TextClassificationRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.modelUri = reader.string(); + break; + case 2: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TextClassificationRequest { + const message = { + ...baseTextClassificationRequest, + } as TextClassificationRequest; + message.modelUri = + object.modelUri !== undefined && object.modelUri !== null + ? String(object.modelUri) + : ""; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + return message; + }, + + toJSON(message: TextClassificationRequest): unknown { + const obj: any = {}; + message.modelUri !== undefined && (obj.modelUri = message.modelUri); + message.text !== undefined && (obj.text = message.text); + return obj; + }, + + fromPartial, I>>( + object: I + ): TextClassificationRequest { + const message = { + ...baseTextClassificationRequest, + } as TextClassificationRequest; + message.modelUri = object.modelUri ?? ""; + message.text = object.text ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + TextClassificationRequest.$type, + TextClassificationRequest +); + +const baseTextClassificationResponse: object = { + $type: + "yandex.cloud.ai.foundation_models.v1.text_classification.TextClassificationResponse", + modelVersion: "", +}; + +export const TextClassificationResponse = { + $type: + "yandex.cloud.ai.foundation_models.v1.text_classification.TextClassificationResponse" as const, + + encode( + message: TextClassificationResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.predictions) { + ClassificationLabel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.modelVersion !== "") { + writer.uint32(18).string(message.modelVersion); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): TextClassificationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTextClassificationResponse, + } as TextClassificationResponse; + message.predictions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.predictions.push( + ClassificationLabel.decode(reader, reader.uint32()) + ); + break; + case 2: + message.modelVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TextClassificationResponse { + const message = { + ...baseTextClassificationResponse, + } as TextClassificationResponse; + message.predictions = (object.predictions ?? []).map((e: any) => + ClassificationLabel.fromJSON(e) + ); + message.modelVersion = + object.modelVersion !== undefined && object.modelVersion !== null + ? String(object.modelVersion) + : ""; + return message; + }, + + toJSON(message: TextClassificationResponse): unknown { + const obj: any = {}; + if (message.predictions) { + obj.predictions = message.predictions.map((e) => + e ? ClassificationLabel.toJSON(e) : undefined + ); + } else { + obj.predictions = []; + } + message.modelVersion !== undefined && + (obj.modelVersion = message.modelVersion); + return obj; + }, + + fromPartial, I>>( + object: I + ): TextClassificationResponse { + const message = { + ...baseTextClassificationResponse, + } as TextClassificationResponse; + message.predictions = + object.predictions?.map((e) => ClassificationLabel.fromPartial(e)) || []; + message.modelVersion = object.modelVersion ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + TextClassificationResponse.$type, + TextClassificationResponse +); + +const baseFewShotTextClassificationRequest: object = { + $type: + "yandex.cloud.ai.foundation_models.v1.text_classification.FewShotTextClassificationRequest", + modelUri: "", + taskDescription: "", + labels: "", + text: "", +}; + +export const FewShotTextClassificationRequest = { + $type: + "yandex.cloud.ai.foundation_models.v1.text_classification.FewShotTextClassificationRequest" as const, + + encode( + message: FewShotTextClassificationRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.modelUri !== "") { + writer.uint32(10).string(message.modelUri); + } + if (message.taskDescription !== "") { + writer.uint32(18).string(message.taskDescription); + } + for (const v of message.labels) { + writer.uint32(26).string(v!); + } + if (message.text !== "") { + writer.uint32(34).string(message.text); + } + for (const v of message.samples) { + ClassificationSample.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): FewShotTextClassificationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseFewShotTextClassificationRequest, + } as FewShotTextClassificationRequest; + message.labels = []; + message.samples = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.modelUri = reader.string(); + break; + case 2: + message.taskDescription = reader.string(); + break; + case 3: + message.labels.push(reader.string()); + break; + case 4: + message.text = reader.string(); + break; + case 5: + message.samples.push( + ClassificationSample.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FewShotTextClassificationRequest { + const message = { + ...baseFewShotTextClassificationRequest, + } as FewShotTextClassificationRequest; + message.modelUri = + object.modelUri !== undefined && object.modelUri !== null + ? String(object.modelUri) + : ""; + message.taskDescription = + object.taskDescription !== undefined && object.taskDescription !== null + ? String(object.taskDescription) + : ""; + message.labels = (object.labels ?? []).map((e: any) => String(e)); + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + message.samples = (object.samples ?? []).map((e: any) => + ClassificationSample.fromJSON(e) + ); + return message; + }, + + toJSON(message: FewShotTextClassificationRequest): unknown { + const obj: any = {}; + message.modelUri !== undefined && (obj.modelUri = message.modelUri); + message.taskDescription !== undefined && + (obj.taskDescription = message.taskDescription); + if (message.labels) { + obj.labels = message.labels.map((e) => e); + } else { + obj.labels = []; + } + message.text !== undefined && (obj.text = message.text); + if (message.samples) { + obj.samples = message.samples.map((e) => + e ? ClassificationSample.toJSON(e) : undefined + ); + } else { + obj.samples = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): FewShotTextClassificationRequest { + const message = { + ...baseFewShotTextClassificationRequest, + } as FewShotTextClassificationRequest; + message.modelUri = object.modelUri ?? ""; + message.taskDescription = object.taskDescription ?? ""; + message.labels = object.labels?.map((e) => e) || []; + message.text = object.text ?? ""; + message.samples = + object.samples?.map((e) => ClassificationSample.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + FewShotTextClassificationRequest.$type, + FewShotTextClassificationRequest +); + +const baseFewShotTextClassificationResponse: object = { + $type: + "yandex.cloud.ai.foundation_models.v1.text_classification.FewShotTextClassificationResponse", + modelVersion: "", +}; + +export const FewShotTextClassificationResponse = { + $type: + "yandex.cloud.ai.foundation_models.v1.text_classification.FewShotTextClassificationResponse" as const, + + encode( + message: FewShotTextClassificationResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.predictions) { + ClassificationLabel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.modelVersion !== "") { + writer.uint32(18).string(message.modelVersion); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): FewShotTextClassificationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseFewShotTextClassificationResponse, + } as FewShotTextClassificationResponse; + message.predictions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.predictions.push( + ClassificationLabel.decode(reader, reader.uint32()) + ); + break; + case 2: + message.modelVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FewShotTextClassificationResponse { + const message = { + ...baseFewShotTextClassificationResponse, + } as FewShotTextClassificationResponse; + message.predictions = (object.predictions ?? []).map((e: any) => + ClassificationLabel.fromJSON(e) + ); + message.modelVersion = + object.modelVersion !== undefined && object.modelVersion !== null + ? String(object.modelVersion) + : ""; + return message; + }, + + toJSON(message: FewShotTextClassificationResponse): unknown { + const obj: any = {}; + if (message.predictions) { + obj.predictions = message.predictions.map((e) => + e ? ClassificationLabel.toJSON(e) : undefined + ); + } else { + obj.predictions = []; + } + message.modelVersion !== undefined && + (obj.modelVersion = message.modelVersion); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): FewShotTextClassificationResponse { + const message = { + ...baseFewShotTextClassificationResponse, + } as FewShotTextClassificationResponse; + message.predictions = + object.predictions?.map((e) => ClassificationLabel.fromPartial(e)) || []; + message.modelVersion = object.modelVersion ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + FewShotTextClassificationResponse.$type, + FewShotTextClassificationResponse +); + +/** Service for classifying text from input text. */ +export const TextClassificationServiceService = { + /** RPC method for text classification. */ + classify: { + path: "/yandex.cloud.ai.foundation_models.v1.text_classification.TextClassificationService/Classify", + requestStream: false, + responseStream: false, + requestSerialize: (value: TextClassificationRequest) => + Buffer.from(TextClassificationRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + TextClassificationRequest.decode(value), + responseSerialize: (value: TextClassificationResponse) => + Buffer.from(TextClassificationResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + TextClassificationResponse.decode(value), + }, + /** RPC method for few-shot text classification. */ + fewShotClassify: { + path: "/yandex.cloud.ai.foundation_models.v1.text_classification.TextClassificationService/FewShotClassify", + requestStream: false, + responseStream: false, + requestSerialize: (value: FewShotTextClassificationRequest) => + Buffer.from(FewShotTextClassificationRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + FewShotTextClassificationRequest.decode(value), + responseSerialize: (value: FewShotTextClassificationResponse) => + Buffer.from(FewShotTextClassificationResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + FewShotTextClassificationResponse.decode(value), + }, +} as const; + +export interface TextClassificationServiceServer + extends UntypedServiceImplementation { + /** RPC method for text classification. */ + classify: handleUnaryCall< + TextClassificationRequest, + TextClassificationResponse + >; + /** RPC method for few-shot text classification. */ + fewShotClassify: handleUnaryCall< + FewShotTextClassificationRequest, + FewShotTextClassificationResponse + >; +} + +export interface TextClassificationServiceClient extends Client { + /** RPC method for text classification. */ + classify( + request: TextClassificationRequest, + callback: ( + error: ServiceError | null, + response: TextClassificationResponse + ) => void + ): ClientUnaryCall; + classify( + request: TextClassificationRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: TextClassificationResponse + ) => void + ): ClientUnaryCall; + classify( + request: TextClassificationRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: TextClassificationResponse + ) => void + ): ClientUnaryCall; + /** RPC method for few-shot text classification. */ + fewShotClassify( + request: FewShotTextClassificationRequest, + callback: ( + error: ServiceError | null, + response: FewShotTextClassificationResponse + ) => void + ): ClientUnaryCall; + fewShotClassify( + request: FewShotTextClassificationRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: FewShotTextClassificationResponse + ) => void + ): ClientUnaryCall; + fewShotClassify( + request: FewShotTextClassificationRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: FewShotTextClassificationResponse + ) => void + ): ClientUnaryCall; +} + +export const TextClassificationServiceClient = makeGenericClientConstructor( + TextClassificationServiceService, + "yandex.cloud.ai.foundation_models.v1.text_classification.TextClassificationService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): TextClassificationServiceClient; + service: typeof TextClassificationServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/foundation_models/v1/text_common.ts b/src/generated/yandex/cloud/ai/foundation_models/v1/text_common.ts new file mode 100644 index 00000000..24b86166 --- /dev/null +++ b/src/generated/yandex/cloud/ai/foundation_models/v1/text_common.ts @@ -0,0 +1,607 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + DoubleValue, + Int64Value, +} from "../../../../../google/protobuf/wrappers"; + +export const protobufPackage = "yandex.cloud.ai.foundation_models.v1"; + +/** Defines the options for completion generation. */ +export interface CompletionOptions { + $type: "yandex.cloud.ai.foundation_models.v1.CompletionOptions"; + /** Enables streaming of partially generated text. */ + stream: boolean; + /** + * Affects creativity and randomness of responses. Should be a double number between 0 (inclusive) and 1 (inclusive). + * Lower values produce more straightforward responses while higher values lead to increased creativity and randomness. + * Default temperature: 0.3 + */ + temperature?: number; + /** + * The limit on the number of tokens used for single completion generation. + * Must be greater than zero. This maximum allowed parameter value may depend on the model being used. + */ + maxTokens?: number; +} + +/** A message object representing a wrapper over the inputs and outputs of the completion model. */ +export interface Message { + $type: "yandex.cloud.ai.foundation_models.v1.Message"; + /** + * The ID of the message sender. Supported roles: + * * `system`: Special role used to define the behaviour of the completion model. + * * `assistant`: A role used by the model to generate responses. + * * `user`: A role used by the user to describe requests to the model. + */ + role: string; + /** Textual content of the message. */ + text: string | undefined; +} + +/** An object representing the number of content [tokens](/docs/foundation-models/concepts/yandexgpt/tokens) used by the completion model. */ +export interface ContentUsage { + $type: "yandex.cloud.ai.foundation_models.v1.ContentUsage"; + /** The number of tokens in the textual part of the model input. */ + inputTextTokens: number; + /** The total number of tokens in the generated completions. */ + completionTokens: number; + /** The total number of tokens, including all input tokens and all generated tokens. */ + totalTokens: number; +} + +/** Represents a generated completion alternative, including its content and generation status. */ +export interface Alternative { + $type: "yandex.cloud.ai.foundation_models.v1.Alternative"; + /** A message containing the content of the alternative. */ + message?: Message; + /** The generation status of the alternative */ + status: Alternative_AlternativeStatus; +} + +/** Enum representing the generation status of the alternative. */ +export enum Alternative_AlternativeStatus { + /** ALTERNATIVE_STATUS_UNSPECIFIED - Unspecified generation status. */ + ALTERNATIVE_STATUS_UNSPECIFIED = 0, + /** ALTERNATIVE_STATUS_PARTIAL - Partially generated alternative. */ + ALTERNATIVE_STATUS_PARTIAL = 1, + /** ALTERNATIVE_STATUS_TRUNCATED_FINAL - Incomplete final alternative resulting from reaching the maximum allowed number of tokens. */ + ALTERNATIVE_STATUS_TRUNCATED_FINAL = 2, + /** ALTERNATIVE_STATUS_FINAL - Final alternative generated without running into any limits. */ + ALTERNATIVE_STATUS_FINAL = 3, + /** + * ALTERNATIVE_STATUS_CONTENT_FILTER - Generation was stopped due to the discovery of potentially sensitive content in the prompt or generated response. + * To fix, modify the prompt and restart generation. + */ + ALTERNATIVE_STATUS_CONTENT_FILTER = 4, + UNRECOGNIZED = -1, +} + +export function alternative_AlternativeStatusFromJSON( + object: any +): Alternative_AlternativeStatus { + switch (object) { + case 0: + case "ALTERNATIVE_STATUS_UNSPECIFIED": + return Alternative_AlternativeStatus.ALTERNATIVE_STATUS_UNSPECIFIED; + case 1: + case "ALTERNATIVE_STATUS_PARTIAL": + return Alternative_AlternativeStatus.ALTERNATIVE_STATUS_PARTIAL; + case 2: + case "ALTERNATIVE_STATUS_TRUNCATED_FINAL": + return Alternative_AlternativeStatus.ALTERNATIVE_STATUS_TRUNCATED_FINAL; + case 3: + case "ALTERNATIVE_STATUS_FINAL": + return Alternative_AlternativeStatus.ALTERNATIVE_STATUS_FINAL; + case 4: + case "ALTERNATIVE_STATUS_CONTENT_FILTER": + return Alternative_AlternativeStatus.ALTERNATIVE_STATUS_CONTENT_FILTER; + case -1: + case "UNRECOGNIZED": + default: + return Alternative_AlternativeStatus.UNRECOGNIZED; + } +} + +export function alternative_AlternativeStatusToJSON( + object: Alternative_AlternativeStatus +): string { + switch (object) { + case Alternative_AlternativeStatus.ALTERNATIVE_STATUS_UNSPECIFIED: + return "ALTERNATIVE_STATUS_UNSPECIFIED"; + case Alternative_AlternativeStatus.ALTERNATIVE_STATUS_PARTIAL: + return "ALTERNATIVE_STATUS_PARTIAL"; + case Alternative_AlternativeStatus.ALTERNATIVE_STATUS_TRUNCATED_FINAL: + return "ALTERNATIVE_STATUS_TRUNCATED_FINAL"; + case Alternative_AlternativeStatus.ALTERNATIVE_STATUS_FINAL: + return "ALTERNATIVE_STATUS_FINAL"; + case Alternative_AlternativeStatus.ALTERNATIVE_STATUS_CONTENT_FILTER: + return "ALTERNATIVE_STATUS_CONTENT_FILTER"; + default: + return "UNKNOWN"; + } +} + +/** Represents a token, the basic unit of content, used by the foundation model. */ +export interface Token { + $type: "yandex.cloud.ai.foundation_models.v1.Token"; + /** An internal token identifier. */ + id: number; + /** The textual representation of the token. */ + text: string; + /** Indicates whether the token is special or not. Special tokens may define the model's behavior and are not visible to users. */ + special: boolean; +} + +const baseCompletionOptions: object = { + $type: "yandex.cloud.ai.foundation_models.v1.CompletionOptions", + stream: false, +}; + +export const CompletionOptions = { + $type: "yandex.cloud.ai.foundation_models.v1.CompletionOptions" as const, + + encode( + message: CompletionOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.stream === true) { + writer.uint32(8).bool(message.stream); + } + if (message.temperature !== undefined) { + DoubleValue.encode( + { $type: "google.protobuf.DoubleValue", value: message.temperature! }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.maxTokens !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.maxTokens! }, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CompletionOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCompletionOptions } as CompletionOptions; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stream = reader.bool(); + break; + case 2: + message.temperature = DoubleValue.decode( + reader, + reader.uint32() + ).value; + break; + case 3: + message.maxTokens = Int64Value.decode(reader, reader.uint32()).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CompletionOptions { + const message = { ...baseCompletionOptions } as CompletionOptions; + message.stream = + object.stream !== undefined && object.stream !== null + ? Boolean(object.stream) + : false; + message.temperature = + object.temperature !== undefined && object.temperature !== null + ? Number(object.temperature) + : undefined; + message.maxTokens = + object.maxTokens !== undefined && object.maxTokens !== null + ? Number(object.maxTokens) + : undefined; + return message; + }, + + toJSON(message: CompletionOptions): unknown { + const obj: any = {}; + message.stream !== undefined && (obj.stream = message.stream); + message.temperature !== undefined && + (obj.temperature = message.temperature); + message.maxTokens !== undefined && (obj.maxTokens = message.maxTokens); + return obj; + }, + + fromPartial, I>>( + object: I + ): CompletionOptions { + const message = { ...baseCompletionOptions } as CompletionOptions; + message.stream = object.stream ?? false; + message.temperature = object.temperature ?? undefined; + message.maxTokens = object.maxTokens ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(CompletionOptions.$type, CompletionOptions); + +const baseMessage: object = { + $type: "yandex.cloud.ai.foundation_models.v1.Message", + role: "", +}; + +export const Message = { + $type: "yandex.cloud.ai.foundation_models.v1.Message" as const, + + encode( + message: Message, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.role !== "") { + writer.uint32(10).string(message.role); + } + if (message.text !== undefined) { + writer.uint32(18).string(message.text); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Message { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessage } as Message; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.role = reader.string(); + break; + case 2: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Message { + const message = { ...baseMessage } as Message; + message.role = + object.role !== undefined && object.role !== null + ? String(object.role) + : ""; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : undefined; + return message; + }, + + toJSON(message: Message): unknown { + const obj: any = {}; + message.role !== undefined && (obj.role = message.role); + message.text !== undefined && (obj.text = message.text); + return obj; + }, + + fromPartial, I>>(object: I): Message { + const message = { ...baseMessage } as Message; + message.role = object.role ?? ""; + message.text = object.text ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Message.$type, Message); + +const baseContentUsage: object = { + $type: "yandex.cloud.ai.foundation_models.v1.ContentUsage", + inputTextTokens: 0, + completionTokens: 0, + totalTokens: 0, +}; + +export const ContentUsage = { + $type: "yandex.cloud.ai.foundation_models.v1.ContentUsage" as const, + + encode( + message: ContentUsage, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.inputTextTokens !== 0) { + writer.uint32(8).int64(message.inputTextTokens); + } + if (message.completionTokens !== 0) { + writer.uint32(16).int64(message.completionTokens); + } + if (message.totalTokens !== 0) { + writer.uint32(24).int64(message.totalTokens); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ContentUsage { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseContentUsage } as ContentUsage; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputTextTokens = longToNumber(reader.int64() as Long); + break; + case 2: + message.completionTokens = longToNumber(reader.int64() as Long); + break; + case 3: + message.totalTokens = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ContentUsage { + const message = { ...baseContentUsage } as ContentUsage; + message.inputTextTokens = + object.inputTextTokens !== undefined && object.inputTextTokens !== null + ? Number(object.inputTextTokens) + : 0; + message.completionTokens = + object.completionTokens !== undefined && object.completionTokens !== null + ? Number(object.completionTokens) + : 0; + message.totalTokens = + object.totalTokens !== undefined && object.totalTokens !== null + ? Number(object.totalTokens) + : 0; + return message; + }, + + toJSON(message: ContentUsage): unknown { + const obj: any = {}; + message.inputTextTokens !== undefined && + (obj.inputTextTokens = Math.round(message.inputTextTokens)); + message.completionTokens !== undefined && + (obj.completionTokens = Math.round(message.completionTokens)); + message.totalTokens !== undefined && + (obj.totalTokens = Math.round(message.totalTokens)); + return obj; + }, + + fromPartial, I>>( + object: I + ): ContentUsage { + const message = { ...baseContentUsage } as ContentUsage; + message.inputTextTokens = object.inputTextTokens ?? 0; + message.completionTokens = object.completionTokens ?? 0; + message.totalTokens = object.totalTokens ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(ContentUsage.$type, ContentUsage); + +const baseAlternative: object = { + $type: "yandex.cloud.ai.foundation_models.v1.Alternative", + status: 0, +}; + +export const Alternative = { + $type: "yandex.cloud.ai.foundation_models.v1.Alternative" as const, + + encode( + message: Alternative, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.message !== undefined) { + Message.encode(message.message, writer.uint32(10).fork()).ldelim(); + } + if (message.status !== 0) { + writer.uint32(16).int32(message.status); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Alternative { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAlternative } as Alternative; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = Message.decode(reader, reader.uint32()); + break; + case 2: + message.status = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Alternative { + const message = { ...baseAlternative } as Alternative; + message.message = + object.message !== undefined && object.message !== null + ? Message.fromJSON(object.message) + : undefined; + message.status = + object.status !== undefined && object.status !== null + ? alternative_AlternativeStatusFromJSON(object.status) + : 0; + return message; + }, + + toJSON(message: Alternative): unknown { + const obj: any = {}; + message.message !== undefined && + (obj.message = message.message + ? Message.toJSON(message.message) + : undefined); + message.status !== undefined && + (obj.status = alternative_AlternativeStatusToJSON(message.status)); + return obj; + }, + + fromPartial, I>>( + object: I + ): Alternative { + const message = { ...baseAlternative } as Alternative; + message.message = + object.message !== undefined && object.message !== null + ? Message.fromPartial(object.message) + : undefined; + message.status = object.status ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Alternative.$type, Alternative); + +const baseToken: object = { + $type: "yandex.cloud.ai.foundation_models.v1.Token", + id: 0, + text: "", + special: false, +}; + +export const Token = { + $type: "yandex.cloud.ai.foundation_models.v1.Token" as const, + + encode(message: Token, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== 0) { + writer.uint32(8).int64(message.id); + } + if (message.text !== "") { + writer.uint32(18).string(message.text); + } + if (message.special === true) { + writer.uint32(24).bool(message.special); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Token { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseToken } as Token; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = longToNumber(reader.int64() as Long); + break; + case 2: + message.text = reader.string(); + break; + case 3: + message.special = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Token { + const message = { ...baseToken } as Token; + message.id = + object.id !== undefined && object.id !== null ? Number(object.id) : 0; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + message.special = + object.special !== undefined && object.special !== null + ? Boolean(object.special) + : false; + return message; + }, + + toJSON(message: Token): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = Math.round(message.id)); + message.text !== undefined && (obj.text = message.text); + message.special !== undefined && (obj.special = message.special); + return obj; + }, + + fromPartial, I>>(object: I): Token { + const message = { ...baseToken } as Token; + message.id = object.id ?? 0; + message.text = object.text ?? ""; + message.special = object.special ?? false; + return message; + }, +}; + +messageTypeRegistry.set(Token.$type, Token); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/foundation_models/v1/text_generation/text_generation_service.ts b/src/generated/yandex/cloud/ai/foundation_models/v1/text_generation/text_generation_service.ts new file mode 100644 index 00000000..e5649cad --- /dev/null +++ b/src/generated/yandex/cloud/ai/foundation_models/v1/text_generation/text_generation_service.ts @@ -0,0 +1,643 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleServerStreamingCall, + Client, + CallOptions, + ClientReadableStream, + Metadata, + handleUnaryCall, + ClientUnaryCall, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + CompletionOptions, + ContentUsage, + Message, + Alternative, + Token, +} from "../../../../../../yandex/cloud/ai/foundation_models/v1/text_common"; +import { Operation } from "../../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.ai.foundation_models.v1"; + +/** Request for the service to generate text completion. */ +export interface CompletionRequest { + $type: "yandex.cloud.ai.foundation_models.v1.CompletionRequest"; + /** The [ID of the model](/docs/foundation-models/concepts/yandexgpt/models) to be used for completion generation. */ + modelUri: string; + /** Configuration options for completion generation. */ + completionOptions?: CompletionOptions; + /** A list of messages representing the context for the completion model. */ + messages: Message[]; +} + +/** Response containing generated text completions. */ +export interface CompletionResponse { + $type: "yandex.cloud.ai.foundation_models.v1.CompletionResponse"; + /** A list of generated completion alternatives. */ + alternatives: Alternative[]; + /** A set of statistics describing the number of content tokens used by the completion model. */ + usage?: ContentUsage; + /** The model version changes with each new releases. */ + modelVersion: string; +} + +/** Request for the service to tokenize input text. */ +export interface TokenizeRequest { + $type: "yandex.cloud.ai.foundation_models.v1.TokenizeRequest"; + /** The identifier of the model to be used for tokenization. */ + modelUri: string; + /** Text to be tokenized. */ + text: string; +} + +/** Response containing tokenized content from request. */ +export interface TokenizeResponse { + $type: "yandex.cloud.ai.foundation_models.v1.TokenizeResponse"; + /** A list of tokens obtained from tokenization. */ + tokens: Token[]; + /** Model version (changes with model releases). */ + modelVersion: string; +} + +const baseCompletionRequest: object = { + $type: "yandex.cloud.ai.foundation_models.v1.CompletionRequest", + modelUri: "", +}; + +export const CompletionRequest = { + $type: "yandex.cloud.ai.foundation_models.v1.CompletionRequest" as const, + + encode( + message: CompletionRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.modelUri !== "") { + writer.uint32(10).string(message.modelUri); + } + if (message.completionOptions !== undefined) { + CompletionOptions.encode( + message.completionOptions, + writer.uint32(18).fork() + ).ldelim(); + } + for (const v of message.messages) { + Message.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CompletionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCompletionRequest } as CompletionRequest; + message.messages = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.modelUri = reader.string(); + break; + case 2: + message.completionOptions = CompletionOptions.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.messages.push(Message.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CompletionRequest { + const message = { ...baseCompletionRequest } as CompletionRequest; + message.modelUri = + object.modelUri !== undefined && object.modelUri !== null + ? String(object.modelUri) + : ""; + message.completionOptions = + object.completionOptions !== undefined && + object.completionOptions !== null + ? CompletionOptions.fromJSON(object.completionOptions) + : undefined; + message.messages = (object.messages ?? []).map((e: any) => + Message.fromJSON(e) + ); + return message; + }, + + toJSON(message: CompletionRequest): unknown { + const obj: any = {}; + message.modelUri !== undefined && (obj.modelUri = message.modelUri); + message.completionOptions !== undefined && + (obj.completionOptions = message.completionOptions + ? CompletionOptions.toJSON(message.completionOptions) + : undefined); + if (message.messages) { + obj.messages = message.messages.map((e) => + e ? Message.toJSON(e) : undefined + ); + } else { + obj.messages = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): CompletionRequest { + const message = { ...baseCompletionRequest } as CompletionRequest; + message.modelUri = object.modelUri ?? ""; + message.completionOptions = + object.completionOptions !== undefined && + object.completionOptions !== null + ? CompletionOptions.fromPartial(object.completionOptions) + : undefined; + message.messages = + object.messages?.map((e) => Message.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(CompletionRequest.$type, CompletionRequest); + +const baseCompletionResponse: object = { + $type: "yandex.cloud.ai.foundation_models.v1.CompletionResponse", + modelVersion: "", +}; + +export const CompletionResponse = { + $type: "yandex.cloud.ai.foundation_models.v1.CompletionResponse" as const, + + encode( + message: CompletionResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.alternatives) { + Alternative.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.usage !== undefined) { + ContentUsage.encode(message.usage, writer.uint32(18).fork()).ldelim(); + } + if (message.modelVersion !== "") { + writer.uint32(26).string(message.modelVersion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CompletionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCompletionResponse } as CompletionResponse; + message.alternatives = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.alternatives.push( + Alternative.decode(reader, reader.uint32()) + ); + break; + case 2: + message.usage = ContentUsage.decode(reader, reader.uint32()); + break; + case 3: + message.modelVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CompletionResponse { + const message = { ...baseCompletionResponse } as CompletionResponse; + message.alternatives = (object.alternatives ?? []).map((e: any) => + Alternative.fromJSON(e) + ); + message.usage = + object.usage !== undefined && object.usage !== null + ? ContentUsage.fromJSON(object.usage) + : undefined; + message.modelVersion = + object.modelVersion !== undefined && object.modelVersion !== null + ? String(object.modelVersion) + : ""; + return message; + }, + + toJSON(message: CompletionResponse): unknown { + const obj: any = {}; + if (message.alternatives) { + obj.alternatives = message.alternatives.map((e) => + e ? Alternative.toJSON(e) : undefined + ); + } else { + obj.alternatives = []; + } + message.usage !== undefined && + (obj.usage = message.usage + ? ContentUsage.toJSON(message.usage) + : undefined); + message.modelVersion !== undefined && + (obj.modelVersion = message.modelVersion); + return obj; + }, + + fromPartial, I>>( + object: I + ): CompletionResponse { + const message = { ...baseCompletionResponse } as CompletionResponse; + message.alternatives = + object.alternatives?.map((e) => Alternative.fromPartial(e)) || []; + message.usage = + object.usage !== undefined && object.usage !== null + ? ContentUsage.fromPartial(object.usage) + : undefined; + message.modelVersion = object.modelVersion ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CompletionResponse.$type, CompletionResponse); + +const baseTokenizeRequest: object = { + $type: "yandex.cloud.ai.foundation_models.v1.TokenizeRequest", + modelUri: "", + text: "", +}; + +export const TokenizeRequest = { + $type: "yandex.cloud.ai.foundation_models.v1.TokenizeRequest" as const, + + encode( + message: TokenizeRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.modelUri !== "") { + writer.uint32(10).string(message.modelUri); + } + if (message.text !== "") { + writer.uint32(18).string(message.text); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TokenizeRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTokenizeRequest } as TokenizeRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.modelUri = reader.string(); + break; + case 2: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TokenizeRequest { + const message = { ...baseTokenizeRequest } as TokenizeRequest; + message.modelUri = + object.modelUri !== undefined && object.modelUri !== null + ? String(object.modelUri) + : ""; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + return message; + }, + + toJSON(message: TokenizeRequest): unknown { + const obj: any = {}; + message.modelUri !== undefined && (obj.modelUri = message.modelUri); + message.text !== undefined && (obj.text = message.text); + return obj; + }, + + fromPartial, I>>( + object: I + ): TokenizeRequest { + const message = { ...baseTokenizeRequest } as TokenizeRequest; + message.modelUri = object.modelUri ?? ""; + message.text = object.text ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(TokenizeRequest.$type, TokenizeRequest); + +const baseTokenizeResponse: object = { + $type: "yandex.cloud.ai.foundation_models.v1.TokenizeResponse", + modelVersion: "", +}; + +export const TokenizeResponse = { + $type: "yandex.cloud.ai.foundation_models.v1.TokenizeResponse" as const, + + encode( + message: TokenizeResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.tokens) { + Token.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.modelVersion !== "") { + writer.uint32(18).string(message.modelVersion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TokenizeResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTokenizeResponse } as TokenizeResponse; + message.tokens = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tokens.push(Token.decode(reader, reader.uint32())); + break; + case 2: + message.modelVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TokenizeResponse { + const message = { ...baseTokenizeResponse } as TokenizeResponse; + message.tokens = (object.tokens ?? []).map((e: any) => Token.fromJSON(e)); + message.modelVersion = + object.modelVersion !== undefined && object.modelVersion !== null + ? String(object.modelVersion) + : ""; + return message; + }, + + toJSON(message: TokenizeResponse): unknown { + const obj: any = {}; + if (message.tokens) { + obj.tokens = message.tokens.map((e) => (e ? Token.toJSON(e) : undefined)); + } else { + obj.tokens = []; + } + message.modelVersion !== undefined && + (obj.modelVersion = message.modelVersion); + return obj; + }, + + fromPartial, I>>( + object: I + ): TokenizeResponse { + const message = { ...baseTokenizeResponse } as TokenizeResponse; + message.tokens = object.tokens?.map((e) => Token.fromPartial(e)) || []; + message.modelVersion = object.modelVersion ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(TokenizeResponse.$type, TokenizeResponse); + +/** Service for text generation. */ +export const TextGenerationServiceService = { + /** A method for generating text completions in [synchronous mode](/docs/foundation-models/concepts/#working-mode). */ + completion: { + path: "/yandex.cloud.ai.foundation_models.v1.TextGenerationService/Completion", + requestStream: false, + responseStream: true, + requestSerialize: (value: CompletionRequest) => + Buffer.from(CompletionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CompletionRequest.decode(value), + responseSerialize: (value: CompletionResponse) => + Buffer.from(CompletionResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => CompletionResponse.decode(value), + }, +} as const; + +export interface TextGenerationServiceServer + extends UntypedServiceImplementation { + /** A method for generating text completions in [synchronous mode](/docs/foundation-models/concepts/#working-mode). */ + completion: handleServerStreamingCall; +} + +export interface TextGenerationServiceClient extends Client { + /** A method for generating text completions in [synchronous mode](/docs/foundation-models/concepts/#working-mode). */ + completion( + request: CompletionRequest, + options?: Partial + ): ClientReadableStream; + completion( + request: CompletionRequest, + metadata?: Metadata, + options?: Partial + ): ClientReadableStream; +} + +export const TextGenerationServiceClient = makeGenericClientConstructor( + TextGenerationServiceService, + "yandex.cloud.ai.foundation_models.v1.TextGenerationService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): TextGenerationServiceClient; + service: typeof TextGenerationServiceService; +}; + +/** Service for asynchronous text generation. */ +export const TextGenerationAsyncServiceService = { + /** A method for generating text completions in [asynchronous mode](/docs/foundation-models/concepts/#working-mode). */ + completion: { + path: "/yandex.cloud.ai.foundation_models.v1.TextGenerationAsyncService/Completion", + requestStream: false, + responseStream: false, + requestSerialize: (value: CompletionRequest) => + Buffer.from(CompletionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CompletionRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface TextGenerationAsyncServiceServer + extends UntypedServiceImplementation { + /** A method for generating text completions in [asynchronous mode](/docs/foundation-models/concepts/#working-mode). */ + completion: handleUnaryCall; +} + +export interface TextGenerationAsyncServiceClient extends Client { + /** A method for generating text completions in [asynchronous mode](/docs/foundation-models/concepts/#working-mode). */ + completion( + request: CompletionRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + completion( + request: CompletionRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + completion( + request: CompletionRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const TextGenerationAsyncServiceClient = makeGenericClientConstructor( + TextGenerationAsyncServiceService, + "yandex.cloud.ai.foundation_models.v1.TextGenerationAsyncService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): TextGenerationAsyncServiceClient; + service: typeof TextGenerationAsyncServiceService; +}; + +/** Service for tokenizing input content. */ +export const TokenizerServiceService = { + /** RPC method for tokenizing text. */ + tokenize: { + path: "/yandex.cloud.ai.foundation_models.v1.TokenizerService/Tokenize", + requestStream: false, + responseStream: false, + requestSerialize: (value: TokenizeRequest) => + Buffer.from(TokenizeRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => TokenizeRequest.decode(value), + responseSerialize: (value: TokenizeResponse) => + Buffer.from(TokenizeResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => TokenizeResponse.decode(value), + }, + /** RPC method for tokenizing content of CompletionRequest */ + tokenizeCompletion: { + path: "/yandex.cloud.ai.foundation_models.v1.TokenizerService/TokenizeCompletion", + requestStream: false, + responseStream: false, + requestSerialize: (value: CompletionRequest) => + Buffer.from(CompletionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CompletionRequest.decode(value), + responseSerialize: (value: TokenizeResponse) => + Buffer.from(TokenizeResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => TokenizeResponse.decode(value), + }, +} as const; + +export interface TokenizerServiceServer extends UntypedServiceImplementation { + /** RPC method for tokenizing text. */ + tokenize: handleUnaryCall; + /** RPC method for tokenizing content of CompletionRequest */ + tokenizeCompletion: handleUnaryCall; +} + +export interface TokenizerServiceClient extends Client { + /** RPC method for tokenizing text. */ + tokenize( + request: TokenizeRequest, + callback: (error: ServiceError | null, response: TokenizeResponse) => void + ): ClientUnaryCall; + tokenize( + request: TokenizeRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: TokenizeResponse) => void + ): ClientUnaryCall; + tokenize( + request: TokenizeRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: TokenizeResponse) => void + ): ClientUnaryCall; + /** RPC method for tokenizing content of CompletionRequest */ + tokenizeCompletion( + request: CompletionRequest, + callback: (error: ServiceError | null, response: TokenizeResponse) => void + ): ClientUnaryCall; + tokenizeCompletion( + request: CompletionRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: TokenizeResponse) => void + ): ClientUnaryCall; + tokenizeCompletion( + request: CompletionRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: TokenizeResponse) => void + ): ClientUnaryCall; +} + +export const TokenizerServiceClient = makeGenericClientConstructor( + TokenizerServiceService, + "yandex.cloud.ai.foundation_models.v1.TokenizerService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): TokenizerServiceClient; + service: typeof TokenizerServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/ai/index.ts b/src/generated/yandex/cloud/ai/index.ts index 6d0e8bb5..2810b1b3 100644 --- a/src/generated/yandex/cloud/ai/index.ts +++ b/src/generated/yandex/cloud/ai/index.ts @@ -1,16 +1,44 @@ -export * as ocr from './ocr/v1/ocr' -export * as ocr_service from './ocr/v1/ocr_service' -export * as stt_service from './stt/v2/stt_service' -export * as translate_translation from './translate/v2/translation' -export * as translate_translation_service from './translate/v2/translation_service' -export * as tts from './tts/v3/tts' -export * as tts_service from './tts/v3/tts_service' -export * as vision_classification from './vision/v1/classification' -export * as vision_face_detection from './vision/v1/face_detection' -export * as vision_image_copy_search from './vision/v1/image_copy_search' -export * as vision_primitives from './vision/v1/primitives' -export * as vision_text_detection from './vision/v1/text_detection' -export * as vision_service from './vision/v1/vision_service' -export * as vision_image from './vision/v2/image' -export * as vision_image_classifier from './vision/v2/image_classifier' -export * as vision_image_classifier_service from './vision/v2/image_classifier_service' +export * as common_common from './common/common' +export * as assistants_v1_assistant from './assistants/v1/assistant' +export * as assistants_v1_assistant_service from './assistants/v1/assistant_service' +export * as assistants_v1_common from './assistants/v1/common' +export * as files_v1_file from './files/v1/file' +export * as files_v1_file_service from './files/v1/file_service' +export * as foundation_models_v1_text_common from './foundation_models/v1/text_common' +export * as ocr_v1_ocr from './ocr/v1/ocr' +export * as ocr_v1_ocr_service from './ocr/v1/ocr_service' +export * as stt_v2_stt_service from './stt/v2/stt_service' +export * as stt_v3_stt from './stt/v3/stt' +export * as stt_v3_stt_service from './stt/v3/stt_service' +export * as translate_v2_translation from './translate/v2/translation' +export * as translate_v2_translation_service from './translate/v2/translation_service' +export * as tts_v3_tts from './tts/v3/tts' +export * as tts_v3_tts_service from './tts/v3/tts_service' +export * as vision_v1_classification from './vision/v1/classification' +export * as vision_v1_face_detection from './vision/v1/face_detection' +export * as vision_v1_image_copy_search from './vision/v1/image_copy_search' +export * as vision_v1_primitives from './vision/v1/primitives' +export * as vision_v1_text_detection from './vision/v1/text_detection' +export * as vision_v1_vision_service from './vision/v1/vision_service' +export * as vision_v2_image from './vision/v2/image' +export * as vision_v2_image_classifier from './vision/v2/image_classifier' +export * as vision_v2_image_classifier_service from './vision/v2/image_classifier_service' +export * as assistants_v1_runs_run from './assistants/v1/runs/run' +export * as assistants_v1_runs_run_service from './assistants/v1/runs/run_service' +export * as assistants_v1_searchindex_common from './assistants/v1/searchindex/common' +export * as assistants_v1_searchindex_search_index from './assistants/v1/searchindex/search_index' +export * as assistants_v1_searchindex_search_index_file from './assistants/v1/searchindex/search_index_file' +export * as assistants_v1_searchindex_search_index_file_service from './assistants/v1/searchindex/search_index_file_service' +export * as assistants_v1_searchindex_search_index_service from './assistants/v1/searchindex/search_index_service' +export * as assistants_v1_threads_message from './assistants/v1/threads/message' +export * as assistants_v1_threads_message_service from './assistants/v1/threads/message_service' +export * as assistants_v1_threads_thread from './assistants/v1/threads/thread' +export * as assistants_v1_threads_thread_service from './assistants/v1/threads/thread_service' +export * as assistants_v1_users_user from './assistants/v1/users/user' +export * as assistants_v1_users_user_service from './assistants/v1/users/user_service' +export * as foundation_models_v1_embedding_embedding_service from './foundation_models/v1/embedding/embedding_service' +export * as foundation_models_v1_image_generation_image_generation from './foundation_models/v1/image_generation/image_generation' +export * as foundation_models_v1_image_generation_image_generation_service from './foundation_models/v1/image_generation/image_generation_service' +export * as foundation_models_v1_text_classification_text_classification from './foundation_models/v1/text_classification/text_classification' +export * as foundation_models_v1_text_classification_text_classification_service from './foundation_models/v1/text_classification/text_classification_service' +export * as foundation_models_v1_text_generation_text_generation_service from './foundation_models/v1/text_generation/text_generation_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/ai/llm/v1alpha/llm.ts b/src/generated/yandex/cloud/ai/llm/v1alpha/llm.ts index ddf35ab2..b07a8f4a 100644 --- a/src/generated/yandex/cloud/ai/llm/v1alpha/llm.ts +++ b/src/generated/yandex/cloud/ai/llm/v1alpha/llm.ts @@ -15,7 +15,7 @@ export interface GenerationOptions { /** Enables streaming of partially generated text. */ partialResults: boolean; /** - * Affects creativity and randomness of responses. Should be a double number between 0 (inclusive) and infinity. + * Affects creativity and randomness of responses. Should be a double number between 0 (inclusive) and 1 (inclusive). * Lower values produce more straightforward responses, while higher values lead to increased creativity and randomness. */ temperature?: number; diff --git a/src/generated/yandex/cloud/ai/ocr/v1/ocr.ts b/src/generated/yandex/cloud/ai/ocr/v1/ocr.ts index 65d2c509..669a22e8 100644 --- a/src/generated/yandex/cloud/ai/ocr/v1/ocr.ts +++ b/src/generated/yandex/cloud/ai/ocr/v1/ocr.ts @@ -5,6 +5,56 @@ import _m0 from "protobufjs/minimal"; export const protobufPackage = "yandex.cloud.ai.ocr.v1"; +export enum Angle { + ANGLE_UNSPECIFIED = 0, + ANGLE_0 = 1, + ANGLE_90 = 2, + ANGLE_180 = 3, + ANGLE_270 = 4, + UNRECOGNIZED = -1, +} + +export function angleFromJSON(object: any): Angle { + switch (object) { + case 0: + case "ANGLE_UNSPECIFIED": + return Angle.ANGLE_UNSPECIFIED; + case 1: + case "ANGLE_0": + return Angle.ANGLE_0; + case 2: + case "ANGLE_90": + return Angle.ANGLE_90; + case 3: + case "ANGLE_180": + return Angle.ANGLE_180; + case 4: + case "ANGLE_270": + return Angle.ANGLE_270; + case -1: + case "UNRECOGNIZED": + default: + return Angle.UNRECOGNIZED; + } +} + +export function angleToJSON(object: Angle): string { + switch (object) { + case Angle.ANGLE_UNSPECIFIED: + return "ANGLE_UNSPECIFIED"; + case Angle.ANGLE_0: + return "ANGLE_0"; + case Angle.ANGLE_90: + return "ANGLE_90"; + case Angle.ANGLE_180: + return "ANGLE_180"; + case Angle.ANGLE_270: + return "ANGLE_270"; + default: + return "UNKNOWN"; + } +} + export interface Polygon { $type: "yandex.cloud.ai.ocr.v1.Polygon"; /** The bounding polygon vertices. */ @@ -29,6 +79,11 @@ export interface TextAnnotation { blocks: Block[]; /** Recognized entities. */ entities: Entity[]; + tables: Table[]; + /** Full text recognized from image. */ + fullText: string; + /** Angle of image rotation. */ + rotate: Angle; } export interface Entity { @@ -47,6 +102,8 @@ export interface Block { lines: Line[]; /** A list of detected languages */ languages: Block_DetectedLanguage[]; + /** Block position from full_text string. */ + textSegments: TextSegments[]; } export interface Block_DetectedLanguage { @@ -61,8 +118,12 @@ export interface Line { boundingBox?: Polygon; /** Recognized text. */ text: string; - /** Recognized words */ + /** Recognized words. */ words: Word[]; + /** Line position from full_text string. */ + textSegments: TextSegments[]; + /** Angle of line rotation. */ + orientation: Angle; } export interface Word { @@ -73,6 +134,46 @@ export interface Word { text: string; /** ID of the recognized word in entities array. */ entityIndex: number; + /** Word position from full_text string. */ + textSegments: TextSegments[]; +} + +export interface TextSegments { + $type: "yandex.cloud.ai.ocr.v1.TextSegments"; + /** Start character position from full_text string. */ + startIndex: number; + /** Text segment length. */ + length: number; +} + +export interface Table { + $type: "yandex.cloud.ai.ocr.v1.Table"; + /** Area on the page where the table is located. */ + boundingBox?: Polygon; + /** Number of rows in table. */ + rowCount: number; + /** Number of columns in table. */ + columnCount: number; + /** Table cells. */ + cells: TableCell[]; +} + +export interface TableCell { + $type: "yandex.cloud.ai.ocr.v1.TableCell"; + /** Area on the page where the table cell is located. */ + boundingBox?: Polygon; + /** Row index. */ + rowIndex: number; + /** Column index. */ + columnIndex: number; + /** Column span. */ + columnSpan: number; + /** Row span. */ + rowSpan: number; + /** Text in cell. */ + text: string; + /** Table cell position from full_text string. */ + textSegments: TextSegments[]; } const basePolygon: object = { $type: "yandex.cloud.ai.ocr.v1.Polygon" }; @@ -211,6 +312,8 @@ const baseTextAnnotation: object = { $type: "yandex.cloud.ai.ocr.v1.TextAnnotation", width: 0, height: 0, + fullText: "", + rotate: 0, }; export const TextAnnotation = { @@ -232,6 +335,15 @@ export const TextAnnotation = { for (const v of message.entities) { Entity.encode(v!, writer.uint32(34).fork()).ldelim(); } + for (const v of message.tables) { + Table.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.fullText !== "") { + writer.uint32(50).string(message.fullText); + } + if (message.rotate !== 0) { + writer.uint32(56).int32(message.rotate); + } return writer; }, @@ -241,6 +353,7 @@ export const TextAnnotation = { const message = { ...baseTextAnnotation } as TextAnnotation; message.blocks = []; message.entities = []; + message.tables = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -256,6 +369,15 @@ export const TextAnnotation = { case 4: message.entities.push(Entity.decode(reader, reader.uint32())); break; + case 5: + message.tables.push(Table.decode(reader, reader.uint32())); + break; + case 6: + message.fullText = reader.string(); + break; + case 7: + message.rotate = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -278,6 +400,15 @@ export const TextAnnotation = { message.entities = (object.entities ?? []).map((e: any) => Entity.fromJSON(e) ); + message.tables = (object.tables ?? []).map((e: any) => Table.fromJSON(e)); + message.fullText = + object.fullText !== undefined && object.fullText !== null + ? String(object.fullText) + : ""; + message.rotate = + object.rotate !== undefined && object.rotate !== null + ? angleFromJSON(object.rotate) + : 0; return message; }, @@ -297,6 +428,13 @@ export const TextAnnotation = { } else { obj.entities = []; } + if (message.tables) { + obj.tables = message.tables.map((e) => (e ? Table.toJSON(e) : undefined)); + } else { + obj.tables = []; + } + message.fullText !== undefined && (obj.fullText = message.fullText); + message.rotate !== undefined && (obj.rotate = angleToJSON(message.rotate)); return obj; }, @@ -308,6 +446,9 @@ export const TextAnnotation = { message.height = object.height ?? 0; message.blocks = object.blocks?.map((e) => Block.fromPartial(e)) || []; message.entities = object.entities?.map((e) => Entity.fromPartial(e)) || []; + message.tables = object.tables?.map((e) => Table.fromPartial(e)) || []; + message.fullText = object.fullText ?? ""; + message.rotate = object.rotate ?? 0; return message; }, }; @@ -402,6 +543,9 @@ export const Block = { for (const v of message.languages) { Block_DetectedLanguage.encode(v!, writer.uint32(26).fork()).ldelim(); } + for (const v of message.textSegments) { + TextSegments.encode(v!, writer.uint32(34).fork()).ldelim(); + } return writer; }, @@ -411,6 +555,7 @@ export const Block = { const message = { ...baseBlock } as Block; message.lines = []; message.languages = []; + message.textSegments = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -425,6 +570,11 @@ export const Block = { Block_DetectedLanguage.decode(reader, reader.uint32()) ); break; + case 4: + message.textSegments.push( + TextSegments.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -443,6 +593,9 @@ export const Block = { message.languages = (object.languages ?? []).map((e: any) => Block_DetectedLanguage.fromJSON(e) ); + message.textSegments = (object.textSegments ?? []).map((e: any) => + TextSegments.fromJSON(e) + ); return message; }, @@ -464,6 +617,13 @@ export const Block = { } else { obj.languages = []; } + if (message.textSegments) { + obj.textSegments = message.textSegments.map((e) => + e ? TextSegments.toJSON(e) : undefined + ); + } else { + obj.textSegments = []; + } return obj; }, @@ -476,6 +636,8 @@ export const Block = { message.lines = object.lines?.map((e) => Line.fromPartial(e)) || []; message.languages = object.languages?.map((e) => Block_DetectedLanguage.fromPartial(e)) || []; + message.textSegments = + object.textSegments?.map((e) => TextSegments.fromPartial(e)) || []; return message; }, }; @@ -548,7 +710,11 @@ export const Block_DetectedLanguage = { messageTypeRegistry.set(Block_DetectedLanguage.$type, Block_DetectedLanguage); -const baseLine: object = { $type: "yandex.cloud.ai.ocr.v1.Line", text: "" }; +const baseLine: object = { + $type: "yandex.cloud.ai.ocr.v1.Line", + text: "", + orientation: 0, +}; export const Line = { $type: "yandex.cloud.ai.ocr.v1.Line" as const, @@ -563,6 +729,12 @@ export const Line = { for (const v of message.words) { Word.encode(v!, writer.uint32(26).fork()).ldelim(); } + for (const v of message.textSegments) { + TextSegments.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.orientation !== 0) { + writer.uint32(40).int32(message.orientation); + } return writer; }, @@ -571,6 +743,7 @@ export const Line = { let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseLine } as Line; message.words = []; + message.textSegments = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -583,6 +756,14 @@ export const Line = { case 3: message.words.push(Word.decode(reader, reader.uint32())); break; + case 4: + message.textSegments.push( + TextSegments.decode(reader, reader.uint32()) + ); + break; + case 5: + message.orientation = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -602,6 +783,13 @@ export const Line = { ? String(object.text) : ""; message.words = (object.words ?? []).map((e: any) => Word.fromJSON(e)); + message.textSegments = (object.textSegments ?? []).map((e: any) => + TextSegments.fromJSON(e) + ); + message.orientation = + object.orientation !== undefined && object.orientation !== null + ? angleFromJSON(object.orientation) + : 0; return message; }, @@ -617,6 +805,15 @@ export const Line = { } else { obj.words = []; } + if (message.textSegments) { + obj.textSegments = message.textSegments.map((e) => + e ? TextSegments.toJSON(e) : undefined + ); + } else { + obj.textSegments = []; + } + message.orientation !== undefined && + (obj.orientation = angleToJSON(message.orientation)); return obj; }, @@ -628,6 +825,9 @@ export const Line = { : undefined; message.text = object.text ?? ""; message.words = object.words?.map((e) => Word.fromPartial(e)) || []; + message.textSegments = + object.textSegments?.map((e) => TextSegments.fromPartial(e)) || []; + message.orientation = object.orientation ?? 0; return message; }, }; @@ -653,6 +853,9 @@ export const Word = { if (message.entityIndex !== 0) { writer.uint32(24).int64(message.entityIndex); } + for (const v of message.textSegments) { + TextSegments.encode(v!, writer.uint32(34).fork()).ldelim(); + } return writer; }, @@ -660,6 +863,7 @@ export const Word = { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseWord } as Word; + message.textSegments = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -672,6 +876,11 @@ export const Word = { case 3: message.entityIndex = longToNumber(reader.int64() as Long); break; + case 4: + message.textSegments.push( + TextSegments.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -694,6 +903,9 @@ export const Word = { object.entityIndex !== undefined && object.entityIndex !== null ? Number(object.entityIndex) : 0; + message.textSegments = (object.textSegments ?? []).map((e: any) => + TextSegments.fromJSON(e) + ); return message; }, @@ -706,6 +918,13 @@ export const Word = { message.text !== undefined && (obj.text = message.text); message.entityIndex !== undefined && (obj.entityIndex = Math.round(message.entityIndex)); + if (message.textSegments) { + obj.textSegments = message.textSegments.map((e) => + e ? TextSegments.toJSON(e) : undefined + ); + } else { + obj.textSegments = []; + } return obj; }, @@ -717,12 +936,353 @@ export const Word = { : undefined; message.text = object.text ?? ""; message.entityIndex = object.entityIndex ?? 0; + message.textSegments = + object.textSegments?.map((e) => TextSegments.fromPartial(e)) || []; return message; }, }; messageTypeRegistry.set(Word.$type, Word); +const baseTextSegments: object = { + $type: "yandex.cloud.ai.ocr.v1.TextSegments", + startIndex: 0, + length: 0, +}; + +export const TextSegments = { + $type: "yandex.cloud.ai.ocr.v1.TextSegments" as const, + + encode( + message: TextSegments, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.startIndex !== 0) { + writer.uint32(8).int64(message.startIndex); + } + if (message.length !== 0) { + writer.uint32(16).int64(message.length); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TextSegments { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTextSegments } as TextSegments; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startIndex = longToNumber(reader.int64() as Long); + break; + case 2: + message.length = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TextSegments { + const message = { ...baseTextSegments } as TextSegments; + message.startIndex = + object.startIndex !== undefined && object.startIndex !== null + ? Number(object.startIndex) + : 0; + message.length = + object.length !== undefined && object.length !== null + ? Number(object.length) + : 0; + return message; + }, + + toJSON(message: TextSegments): unknown { + const obj: any = {}; + message.startIndex !== undefined && + (obj.startIndex = Math.round(message.startIndex)); + message.length !== undefined && (obj.length = Math.round(message.length)); + return obj; + }, + + fromPartial, I>>( + object: I + ): TextSegments { + const message = { ...baseTextSegments } as TextSegments; + message.startIndex = object.startIndex ?? 0; + message.length = object.length ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(TextSegments.$type, TextSegments); + +const baseTable: object = { + $type: "yandex.cloud.ai.ocr.v1.Table", + rowCount: 0, + columnCount: 0, +}; + +export const Table = { + $type: "yandex.cloud.ai.ocr.v1.Table" as const, + + encode(message: Table, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.boundingBox !== undefined) { + Polygon.encode(message.boundingBox, writer.uint32(10).fork()).ldelim(); + } + if (message.rowCount !== 0) { + writer.uint32(16).int64(message.rowCount); + } + if (message.columnCount !== 0) { + writer.uint32(24).int64(message.columnCount); + } + for (const v of message.cells) { + TableCell.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Table { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTable } as Table; + message.cells = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingBox = Polygon.decode(reader, reader.uint32()); + break; + case 2: + message.rowCount = longToNumber(reader.int64() as Long); + break; + case 3: + message.columnCount = longToNumber(reader.int64() as Long); + break; + case 4: + message.cells.push(TableCell.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Table { + const message = { ...baseTable } as Table; + message.boundingBox = + object.boundingBox !== undefined && object.boundingBox !== null + ? Polygon.fromJSON(object.boundingBox) + : undefined; + message.rowCount = + object.rowCount !== undefined && object.rowCount !== null + ? Number(object.rowCount) + : 0; + message.columnCount = + object.columnCount !== undefined && object.columnCount !== null + ? Number(object.columnCount) + : 0; + message.cells = (object.cells ?? []).map((e: any) => TableCell.fromJSON(e)); + return message; + }, + + toJSON(message: Table): unknown { + const obj: any = {}; + message.boundingBox !== undefined && + (obj.boundingBox = message.boundingBox + ? Polygon.toJSON(message.boundingBox) + : undefined); + message.rowCount !== undefined && + (obj.rowCount = Math.round(message.rowCount)); + message.columnCount !== undefined && + (obj.columnCount = Math.round(message.columnCount)); + if (message.cells) { + obj.cells = message.cells.map((e) => + e ? TableCell.toJSON(e) : undefined + ); + } else { + obj.cells = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Table { + const message = { ...baseTable } as Table; + message.boundingBox = + object.boundingBox !== undefined && object.boundingBox !== null + ? Polygon.fromPartial(object.boundingBox) + : undefined; + message.rowCount = object.rowCount ?? 0; + message.columnCount = object.columnCount ?? 0; + message.cells = object.cells?.map((e) => TableCell.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Table.$type, Table); + +const baseTableCell: object = { + $type: "yandex.cloud.ai.ocr.v1.TableCell", + rowIndex: 0, + columnIndex: 0, + columnSpan: 0, + rowSpan: 0, + text: "", +}; + +export const TableCell = { + $type: "yandex.cloud.ai.ocr.v1.TableCell" as const, + + encode( + message: TableCell, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.boundingBox !== undefined) { + Polygon.encode(message.boundingBox, writer.uint32(10).fork()).ldelim(); + } + if (message.rowIndex !== 0) { + writer.uint32(16).int64(message.rowIndex); + } + if (message.columnIndex !== 0) { + writer.uint32(24).int64(message.columnIndex); + } + if (message.columnSpan !== 0) { + writer.uint32(32).int64(message.columnSpan); + } + if (message.rowSpan !== 0) { + writer.uint32(40).int64(message.rowSpan); + } + if (message.text !== "") { + writer.uint32(50).string(message.text); + } + for (const v of message.textSegments) { + TextSegments.encode(v!, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TableCell { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTableCell } as TableCell; + message.textSegments = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingBox = Polygon.decode(reader, reader.uint32()); + break; + case 2: + message.rowIndex = longToNumber(reader.int64() as Long); + break; + case 3: + message.columnIndex = longToNumber(reader.int64() as Long); + break; + case 4: + message.columnSpan = longToNumber(reader.int64() as Long); + break; + case 5: + message.rowSpan = longToNumber(reader.int64() as Long); + break; + case 6: + message.text = reader.string(); + break; + case 7: + message.textSegments.push( + TextSegments.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TableCell { + const message = { ...baseTableCell } as TableCell; + message.boundingBox = + object.boundingBox !== undefined && object.boundingBox !== null + ? Polygon.fromJSON(object.boundingBox) + : undefined; + message.rowIndex = + object.rowIndex !== undefined && object.rowIndex !== null + ? Number(object.rowIndex) + : 0; + message.columnIndex = + object.columnIndex !== undefined && object.columnIndex !== null + ? Number(object.columnIndex) + : 0; + message.columnSpan = + object.columnSpan !== undefined && object.columnSpan !== null + ? Number(object.columnSpan) + : 0; + message.rowSpan = + object.rowSpan !== undefined && object.rowSpan !== null + ? Number(object.rowSpan) + : 0; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + message.textSegments = (object.textSegments ?? []).map((e: any) => + TextSegments.fromJSON(e) + ); + return message; + }, + + toJSON(message: TableCell): unknown { + const obj: any = {}; + message.boundingBox !== undefined && + (obj.boundingBox = message.boundingBox + ? Polygon.toJSON(message.boundingBox) + : undefined); + message.rowIndex !== undefined && + (obj.rowIndex = Math.round(message.rowIndex)); + message.columnIndex !== undefined && + (obj.columnIndex = Math.round(message.columnIndex)); + message.columnSpan !== undefined && + (obj.columnSpan = Math.round(message.columnSpan)); + message.rowSpan !== undefined && + (obj.rowSpan = Math.round(message.rowSpan)); + message.text !== undefined && (obj.text = message.text); + if (message.textSegments) { + obj.textSegments = message.textSegments.map((e) => + e ? TextSegments.toJSON(e) : undefined + ); + } else { + obj.textSegments = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): TableCell { + const message = { ...baseTableCell } as TableCell; + message.boundingBox = + object.boundingBox !== undefined && object.boundingBox !== null + ? Polygon.fromPartial(object.boundingBox) + : undefined; + message.rowIndex = object.rowIndex ?? 0; + message.columnIndex = object.columnIndex ?? 0; + message.columnSpan = object.columnSpan ?? 0; + message.rowSpan = object.rowSpan ?? 0; + message.text = object.text ?? ""; + message.textSegments = + object.textSegments?.map((e) => TextSegments.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(TableCell.$type, TableCell); + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/generated/yandex/cloud/ai/ocr/v1/ocr_service.ts b/src/generated/yandex/cloud/ai/ocr/v1/ocr_service.ts index c168fc39..1bb7b10d 100644 --- a/src/generated/yandex/cloud/ai/ocr/v1/ocr_service.ts +++ b/src/generated/yandex/cloud/ai/ocr/v1/ocr_service.ts @@ -27,32 +27,24 @@ export interface RecognizeTextRequest { content: Buffer | undefined; /** * Specifications of the ([MIME type](https://en.wikipedia.org/wiki/Media_type)). Each specification contains the file to analyze and features to use for analysis. Restrictions: - * * Supported file formats: `JPEG`, `PNG`, `WEBP`, `PDF`. - * * Maximum file size: 20 MB. + * * Supported file formats: `JPEG`, `PNG`, `PDF`. + * * Maximum file size: see [documentation](/docs/vision/concepts/limits). * * Image size should not exceed 20M pixels (length x width). - * * The number of pages in a PDF file should not exceed 200 (each page counts as 1 request). + * * The number of pages in a PDF file should not exceed 1. */ mimeType: string; /** - * List of the languages to recognize text. + * [List of the languages](/docs/vision/concepts/ocr/supported-languages) to recognize text. * Specified in [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format (for example, `ru`). */ languageCodes: string[]; - /** - * Model to use for text detection. The maximum string length is 50 characters. Possible values: - * * `page` (default): this model is suitable for detecting multiple text entries in an image. - * * `passport`: passport, the main double-page spread. - * * `driver-license-front`: driver's license, the front side. - * * `driver-license-back`: driver's license, the reverse side. - * * `vehicle-registration-front`: front side of the vehicle registration certificate. - * * `vehicle-registration-back`: back side of the vehicle registration certificate. - */ + /** [Model](/docs/vision/concepts/ocr/template-recognition#models) to use for text detection. */ model: string; } export interface RecognizeTextResponse { $type: "yandex.cloud.ai.ocr.v1.RecognizeTextResponse"; - /** Recognized text blocks in this page or text from entities. */ + /** Recognized text blocks in page or text from entities. */ textAnnotation?: TextAnnotation; /** Page number in PDF file. */ page: number; diff --git a/src/generated/yandex/cloud/ai/stt/v3/stt.ts b/src/generated/yandex/cloud/ai/stt/v3/stt.ts index ba57c3cf..3ebe3ded 100644 --- a/src/generated/yandex/cloud/ai/stt/v3/stt.ts +++ b/src/generated/yandex/cloud/ai/stt/v3/stt.ts @@ -6,12 +6,13 @@ import _m0 from "protobufjs/minimal"; export const protobufPackage = "speechkit.stt.v3"; export enum CodeType { + /** @deprecated */ CODE_TYPE_UNSPECIFIED = 0, - /** WORKING - all good */ + /** WORKING - All good. */ WORKING = 1, - /** WARNING - for example, if speech is sent not in real time. or unknown context (and we've made fallback). */ + /** WARNING - For example, if speech is sent not in real time or context is unknown and we've made fallback. */ WARNING = 2, - /** CLOSED - after session was closed. */ + /** CLOSED - After session was closed. */ CLOSED = 3, UNRECOGNIZED = -1, } @@ -217,13 +218,16 @@ export interface RecognitionClassifier { triggers: RecognitionClassifier_TriggerType[]; } +/** Type of recognition classifier trigger. */ export enum RecognitionClassifier_TriggerType { - /** TRIGGER_TYPE_UNSPECIFIED - Do not use */ + /** @deprecated */ TRIGGER_TYPE_UNSPECIFIED = 0, /** ON_UTTERANCE - Apply classifier to utterance responses */ ON_UTTERANCE = 1, /** ON_FINAL - Apply classifier to final responses */ ON_FINAL = 2, + /** ON_PARTIAL - Apply classifier to partial responses */ + ON_PARTIAL = 3, UNRECOGNIZED = -1, } @@ -240,6 +244,9 @@ export function recognitionClassifier_TriggerTypeFromJSON( case 2: case "ON_FINAL": return RecognitionClassifier_TriggerType.ON_FINAL; + case 3: + case "ON_PARTIAL": + return RecognitionClassifier_TriggerType.ON_PARTIAL; case -1: case "UNRECOGNIZED": default: @@ -257,6 +264,8 @@ export function recognitionClassifier_TriggerTypeToJSON( return "ON_UTTERANCE"; case RecognitionClassifier_TriggerType.ON_FINAL: return "ON_FINAL"; + case RecognitionClassifier_TriggerType.ON_PARTIAL: + return "ON_PARTIAL"; default: return "UNKNOWN"; } @@ -507,6 +516,56 @@ export function recognitionModelOptions_AudioProcessingTypeToJSON( } } +export interface SpeakerLabelingOptions { + $type: "speechkit.stt.v3.SpeakerLabelingOptions"; + /** Specifies the execution of speaker labeling. Default is SPEAKER_LABELING_DISABLED. */ + speakerLabeling: SpeakerLabelingOptions_SpeakerLabeling; +} + +export enum SpeakerLabelingOptions_SpeakerLabeling { + SPEAKER_LABELING_UNSPECIFIED = 0, + /** SPEAKER_LABELING_ENABLED - Enable speaker labeling */ + SPEAKER_LABELING_ENABLED = 1, + /** SPEAKER_LABELING_DISABLED - Disable speaker labeling */ + SPEAKER_LABELING_DISABLED = 2, + UNRECOGNIZED = -1, +} + +export function speakerLabelingOptions_SpeakerLabelingFromJSON( + object: any +): SpeakerLabelingOptions_SpeakerLabeling { + switch (object) { + case 0: + case "SPEAKER_LABELING_UNSPECIFIED": + return SpeakerLabelingOptions_SpeakerLabeling.SPEAKER_LABELING_UNSPECIFIED; + case 1: + case "SPEAKER_LABELING_ENABLED": + return SpeakerLabelingOptions_SpeakerLabeling.SPEAKER_LABELING_ENABLED; + case 2: + case "SPEAKER_LABELING_DISABLED": + return SpeakerLabelingOptions_SpeakerLabeling.SPEAKER_LABELING_DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return SpeakerLabelingOptions_SpeakerLabeling.UNRECOGNIZED; + } +} + +export function speakerLabelingOptions_SpeakerLabelingToJSON( + object: SpeakerLabelingOptions_SpeakerLabeling +): string { + switch (object) { + case SpeakerLabelingOptions_SpeakerLabeling.SPEAKER_LABELING_UNSPECIFIED: + return "SPEAKER_LABELING_UNSPECIFIED"; + case SpeakerLabelingOptions_SpeakerLabeling.SPEAKER_LABELING_ENABLED: + return "SPEAKER_LABELING_ENABLED"; + case SpeakerLabelingOptions_SpeakerLabeling.SPEAKER_LABELING_DISABLED: + return "SPEAKER_LABELING_DISABLED"; + default: + return "UNKNOWN"; + } +} + export interface StreamingOptions { $type: "speechkit.stt.v3.StreamingOptions"; /** Configuration for speech recognition model. */ @@ -517,6 +576,8 @@ export interface StreamingOptions { recognitionClassifier?: RecognitionClassifierOptions; /** Configuration for speech analysis over speech recognition. */ speechAnalysis?: SpeechAnalysisOptions; + /** Configuration for speaker labeling */ + speakerLabeling?: SpeakerLabelingOptions; } /** Data chunk with audio. */ @@ -568,6 +629,8 @@ export interface RecognizeFileRequest { recognitionClassifier?: RecognitionClassifierOptions; /** Configuration for speech analysis over speech recognition. */ speechAnalysis?: SpeechAnalysisOptions; + /** Configuration for speaker labeling */ + speakerLabeling?: SpeakerLabelingOptions; } /** Recognized word. */ @@ -718,12 +781,14 @@ export interface RecognitionClassifierUpdate { } export enum RecognitionClassifierUpdate_WindowType { - /** WINDOW_TYPE_UNSPECIFIED - Never used */ + /** @deprecated */ WINDOW_TYPE_UNSPECIFIED = 0, /** LAST_UTTERANCE - The result of applying the classifier to the last utterance response */ LAST_UTTERANCE = 1, /** LAST_FINAL - The result of applying the classifier to the last final response */ LAST_FINAL = 2, + /** LAST_PARTIAL - The result of applying the classifier to the last partial response */ + LAST_PARTIAL = 3, UNRECOGNIZED = -1, } @@ -740,6 +805,9 @@ export function recognitionClassifierUpdate_WindowTypeFromJSON( case 2: case "LAST_FINAL": return RecognitionClassifierUpdate_WindowType.LAST_FINAL; + case 3: + case "LAST_PARTIAL": + return RecognitionClassifierUpdate_WindowType.LAST_PARTIAL; case -1: case "UNRECOGNIZED": default: @@ -757,6 +825,8 @@ export function recognitionClassifierUpdate_WindowTypeToJSON( return "LAST_UTTERANCE"; case RecognitionClassifierUpdate_WindowType.LAST_FINAL: return "LAST_FINAL"; + case RecognitionClassifierUpdate_WindowType.LAST_PARTIAL: + return "LAST_PARTIAL"; default: return "UNKNOWN"; } @@ -827,10 +897,11 @@ export interface SpeakerAnalysis { } export enum SpeakerAnalysis_WindowType { + /** @deprecated */ WINDOW_TYPE_UNSPECIFIED = 0, - /** TOTAL - Stats for all received audio */ + /** TOTAL - Stats for all received audio. */ TOTAL = 1, - /** LAST_UTTERANCE - Stats for last utterance */ + /** LAST_UTTERANCE - Stats for last utterance. */ LAST_UTTERANCE = 2, UNRECOGNIZED = -1, } @@ -888,6 +959,10 @@ export interface ConversationAnalysis { simultaneousSpeechDurationEstimation?: DescriptiveStatistics; /** Interrupts description for every speaker */ speakerInterrupts: ConversationAnalysis_InterruptsEvaluation[]; + /** Total speech duration, including both simultaneous and separate speech */ + totalSpeechDurationMs: number; + /** Total speech ratio within audio segment */ + totalSpeechRatio: number; } export interface ConversationAnalysis_InterruptsEvaluation { @@ -2112,6 +2187,74 @@ export const RecognitionModelOptions = { messageTypeRegistry.set(RecognitionModelOptions.$type, RecognitionModelOptions); +const baseSpeakerLabelingOptions: object = { + $type: "speechkit.stt.v3.SpeakerLabelingOptions", + speakerLabeling: 0, +}; + +export const SpeakerLabelingOptions = { + $type: "speechkit.stt.v3.SpeakerLabelingOptions" as const, + + encode( + message: SpeakerLabelingOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.speakerLabeling !== 0) { + writer.uint32(8).int32(message.speakerLabeling); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SpeakerLabelingOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSpeakerLabelingOptions } as SpeakerLabelingOptions; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.speakerLabeling = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SpeakerLabelingOptions { + const message = { ...baseSpeakerLabelingOptions } as SpeakerLabelingOptions; + message.speakerLabeling = + object.speakerLabeling !== undefined && object.speakerLabeling !== null + ? speakerLabelingOptions_SpeakerLabelingFromJSON(object.speakerLabeling) + : 0; + return message; + }, + + toJSON(message: SpeakerLabelingOptions): unknown { + const obj: any = {}; + message.speakerLabeling !== undefined && + (obj.speakerLabeling = speakerLabelingOptions_SpeakerLabelingToJSON( + message.speakerLabeling + )); + return obj; + }, + + fromPartial, I>>( + object: I + ): SpeakerLabelingOptions { + const message = { ...baseSpeakerLabelingOptions } as SpeakerLabelingOptions; + message.speakerLabeling = object.speakerLabeling ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(SpeakerLabelingOptions.$type, SpeakerLabelingOptions); + const baseStreamingOptions: object = { $type: "speechkit.stt.v3.StreamingOptions", }; @@ -2147,6 +2290,12 @@ export const StreamingOptions = { writer.uint32(34).fork() ).ldelim(); } + if (message.speakerLabeling !== undefined) { + SpeakerLabelingOptions.encode( + message.speakerLabeling, + writer.uint32(42).fork() + ).ldelim(); + } return writer; }, @@ -2181,6 +2330,12 @@ export const StreamingOptions = { reader.uint32() ); break; + case 5: + message.speakerLabeling = SpeakerLabelingOptions.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2208,6 +2363,10 @@ export const StreamingOptions = { object.speechAnalysis !== undefined && object.speechAnalysis !== null ? SpeechAnalysisOptions.fromJSON(object.speechAnalysis) : undefined; + message.speakerLabeling = + object.speakerLabeling !== undefined && object.speakerLabeling !== null + ? SpeakerLabelingOptions.fromJSON(object.speakerLabeling) + : undefined; return message; }, @@ -2229,6 +2388,10 @@ export const StreamingOptions = { (obj.speechAnalysis = message.speechAnalysis ? SpeechAnalysisOptions.toJSON(message.speechAnalysis) : undefined); + message.speakerLabeling !== undefined && + (obj.speakerLabeling = message.speakerLabeling + ? SpeakerLabelingOptions.toJSON(message.speakerLabeling) + : undefined); return obj; }, @@ -2253,6 +2416,10 @@ export const StreamingOptions = { object.speechAnalysis !== undefined && object.speechAnalysis !== null ? SpeechAnalysisOptions.fromPartial(object.speechAnalysis) : undefined; + message.speakerLabeling = + object.speakerLabeling !== undefined && object.speakerLabeling !== null + ? SpeakerLabelingOptions.fromPartial(object.speakerLabeling) + : undefined; return message; }, }; @@ -2590,6 +2757,12 @@ export const RecognizeFileRequest = { writer.uint32(42).fork() ).ldelim(); } + if (message.speakerLabeling !== undefined) { + SpeakerLabelingOptions.encode( + message.speakerLabeling, + writer.uint32(50).fork() + ).ldelim(); + } return writer; }, @@ -2627,6 +2800,12 @@ export const RecognizeFileRequest = { reader.uint32() ); break; + case 6: + message.speakerLabeling = SpeakerLabelingOptions.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2658,6 +2837,10 @@ export const RecognizeFileRequest = { object.speechAnalysis !== undefined && object.speechAnalysis !== null ? SpeechAnalysisOptions.fromJSON(object.speechAnalysis) : undefined; + message.speakerLabeling = + object.speakerLabeling !== undefined && object.speakerLabeling !== null + ? SpeakerLabelingOptions.fromJSON(object.speakerLabeling) + : undefined; return message; }, @@ -2681,6 +2864,10 @@ export const RecognizeFileRequest = { (obj.speechAnalysis = message.speechAnalysis ? SpeechAnalysisOptions.toJSON(message.speechAnalysis) : undefined); + message.speakerLabeling !== undefined && + (obj.speakerLabeling = message.speakerLabeling + ? SpeakerLabelingOptions.toJSON(message.speakerLabeling) + : undefined); return obj; }, @@ -2703,6 +2890,10 @@ export const RecognizeFileRequest = { object.speechAnalysis !== undefined && object.speechAnalysis !== null ? SpeechAnalysisOptions.fromPartial(object.speechAnalysis) : undefined; + message.speakerLabeling = + object.speakerLabeling !== undefined && object.speakerLabeling !== null + ? SpeakerLabelingOptions.fromPartial(object.speakerLabeling) + : undefined; return message; }, }; @@ -4570,6 +4761,8 @@ const baseConversationAnalysis: object = { totalSimultaneousSilenceRatio: 0, totalSimultaneousSpeechDurationMs: 0, totalSimultaneousSpeechRatio: 0, + totalSpeechDurationMs: 0, + totalSpeechRatio: 0, }; export const ConversationAnalysis = { @@ -4615,6 +4808,12 @@ export const ConversationAnalysis = { writer.uint32(66).fork() ).ldelim(); } + if (message.totalSpeechDurationMs !== 0) { + writer.uint32(72).int64(message.totalSpeechDurationMs); + } + if (message.totalSpeechRatio !== 0) { + writer.uint32(81).double(message.totalSpeechRatio); + } return writer; }, @@ -4667,6 +4866,12 @@ export const ConversationAnalysis = { ) ); break; + case 9: + message.totalSpeechDurationMs = longToNumber(reader.int64() as Long); + break; + case 10: + message.totalSpeechRatio = reader.double(); + break; default: reader.skipType(tag & 7); break; @@ -4719,6 +4924,15 @@ export const ConversationAnalysis = { message.speakerInterrupts = (object.speakerInterrupts ?? []).map((e: any) => ConversationAnalysis_InterruptsEvaluation.fromJSON(e) ); + message.totalSpeechDurationMs = + object.totalSpeechDurationMs !== undefined && + object.totalSpeechDurationMs !== null + ? Number(object.totalSpeechDurationMs) + : 0; + message.totalSpeechRatio = + object.totalSpeechRatio !== undefined && object.totalSpeechRatio !== null + ? Number(object.totalSpeechRatio) + : 0; return message; }, @@ -4762,6 +4976,10 @@ export const ConversationAnalysis = { } else { obj.speakerInterrupts = []; } + message.totalSpeechDurationMs !== undefined && + (obj.totalSpeechDurationMs = Math.round(message.totalSpeechDurationMs)); + message.totalSpeechRatio !== undefined && + (obj.totalSpeechRatio = message.totalSpeechRatio); return obj; }, @@ -4800,6 +5018,8 @@ export const ConversationAnalysis = { object.speakerInterrupts?.map((e) => ConversationAnalysis_InterruptsEvaluation.fromPartial(e) ) || []; + message.totalSpeechDurationMs = object.totalSpeechDurationMs ?? 0; + message.totalSpeechRatio = object.totalSpeechRatio ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/ai/translate/v2/translation_service.ts b/src/generated/yandex/cloud/ai/translate/v2/translation_service.ts index 9be4c6be..a4225835 100644 --- a/src/generated/yandex/cloud/ai/translate/v2/translation_service.ts +++ b/src/generated/yandex/cloud/ai/translate/v2/translation_service.ts @@ -953,7 +953,11 @@ export const ListLanguagesResponse = { messageTypeRegistry.set(ListLanguagesResponse.$type, ListLanguagesResponse); -/** A set of methods for the Translate service. */ +/** + * A set of methods for the Translate service. + * + * Make sure you send your [authentication](/docs/translate/api-ref/authentication) credentials in the `Authorization` header of each request. + */ export const TranslationServiceService = { /** Translates the text to the specified language. */ translate: { diff --git a/src/generated/yandex/cloud/ai/tts/v3/tts.ts b/src/generated/yandex/cloud/ai/tts/v3/tts.ts index 0af2be42..27cc3678 100644 --- a/src/generated/yandex/cloud/ai/tts/v3/tts.ts +++ b/src/generated/yandex/cloud/ai/tts/v3/tts.ts @@ -144,6 +144,12 @@ export interface UtteranceSynthesisResponse { $type: "speechkit.tts.v3.UtteranceSynthesisResponse"; /** Part of synthesized audio. */ audioChunk?: AudioChunk; + /** Part of synthesized text. */ + textChunk?: TextChunk; + /** Start time of the audio chunk in milliseconds. */ + startMs: number; + /** Length of the audio chunk in milliseconds. */ + lengthMs: number; } export interface AudioTemplate { @@ -162,6 +168,12 @@ export interface AudioChunk { data: Buffer; } +export interface TextChunk { + $type: "speechkit.tts.v3.TextChunk"; + /** Synthesized text. */ + text: string; +} + export interface TextTemplate { $type: "speechkit.tts.v3.TextTemplate"; /** @@ -178,6 +190,65 @@ export interface TextTemplate { variables: TextVariable[]; } +export interface DurationHint { + $type: "speechkit.tts.v3.DurationHint"; + /** Type of duration constraint. */ + policy: DurationHint_DurationHintPolicy; + /** Constraint on audio duration in milliseconds. */ + durationMs: number; +} + +export enum DurationHint_DurationHintPolicy { + DURATION_HINT_POLICY_UNSPECIFIED = 0, + /** EXACT_DURATION - Limit audio duration to exact value. */ + EXACT_DURATION = 1, + /** MIN_DURATION - Limit the minimum audio duration. */ + MIN_DURATION = 2, + /** MAX_DURATION - Limit the maximum audio duration. */ + MAX_DURATION = 3, + UNRECOGNIZED = -1, +} + +export function durationHint_DurationHintPolicyFromJSON( + object: any +): DurationHint_DurationHintPolicy { + switch (object) { + case 0: + case "DURATION_HINT_POLICY_UNSPECIFIED": + return DurationHint_DurationHintPolicy.DURATION_HINT_POLICY_UNSPECIFIED; + case 1: + case "EXACT_DURATION": + return DurationHint_DurationHintPolicy.EXACT_DURATION; + case 2: + case "MIN_DURATION": + return DurationHint_DurationHintPolicy.MIN_DURATION; + case 3: + case "MAX_DURATION": + return DurationHint_DurationHintPolicy.MAX_DURATION; + case -1: + case "UNRECOGNIZED": + default: + return DurationHint_DurationHintPolicy.UNRECOGNIZED; + } +} + +export function durationHint_DurationHintPolicyToJSON( + object: DurationHint_DurationHintPolicy +): string { + switch (object) { + case DurationHint_DurationHintPolicy.DURATION_HINT_POLICY_UNSPECIFIED: + return "DURATION_HINT_POLICY_UNSPECIFIED"; + case DurationHint_DurationHintPolicy.EXACT_DURATION: + return "EXACT_DURATION"; + case DurationHint_DurationHintPolicy.MIN_DURATION: + return "MIN_DURATION"; + case DurationHint_DurationHintPolicy.MAX_DURATION: + return "MAX_DURATION"; + default: + return "UNKNOWN"; + } +} + export interface Hints { $type: "speechkit.tts.v3.Hints"; /** Name of speaker to use. */ @@ -196,6 +267,8 @@ export interface Hints { role: string | undefined; /** Hint to increase (or decrease) speaker's pitch, measured in Hz. Valid values are in range [-1000;1000], default value is 0. */ pitchShift: number | undefined; + /** Hint to limit both minimum and maximum audio duration. */ + duration?: DurationHint | undefined; } export interface UtteranceSynthesisRequest { @@ -755,6 +828,8 @@ messageTypeRegistry.set(AudioVariable.$type, AudioVariable); const baseUtteranceSynthesisResponse: object = { $type: "speechkit.tts.v3.UtteranceSynthesisResponse", + startMs: 0, + lengthMs: 0, }; export const UtteranceSynthesisResponse = { @@ -767,6 +842,15 @@ export const UtteranceSynthesisResponse = { if (message.audioChunk !== undefined) { AudioChunk.encode(message.audioChunk, writer.uint32(10).fork()).ldelim(); } + if (message.textChunk !== undefined) { + TextChunk.encode(message.textChunk, writer.uint32(18).fork()).ldelim(); + } + if (message.startMs !== 0) { + writer.uint32(24).int64(message.startMs); + } + if (message.lengthMs !== 0) { + writer.uint32(32).int64(message.lengthMs); + } return writer; }, @@ -785,6 +869,15 @@ export const UtteranceSynthesisResponse = { case 1: message.audioChunk = AudioChunk.decode(reader, reader.uint32()); break; + case 2: + message.textChunk = TextChunk.decode(reader, reader.uint32()); + break; + case 3: + message.startMs = longToNumber(reader.int64() as Long); + break; + case 4: + message.lengthMs = longToNumber(reader.int64() as Long); + break; default: reader.skipType(tag & 7); break; @@ -801,6 +894,18 @@ export const UtteranceSynthesisResponse = { object.audioChunk !== undefined && object.audioChunk !== null ? AudioChunk.fromJSON(object.audioChunk) : undefined; + message.textChunk = + object.textChunk !== undefined && object.textChunk !== null + ? TextChunk.fromJSON(object.textChunk) + : undefined; + message.startMs = + object.startMs !== undefined && object.startMs !== null + ? Number(object.startMs) + : 0; + message.lengthMs = + object.lengthMs !== undefined && object.lengthMs !== null + ? Number(object.lengthMs) + : 0; return message; }, @@ -810,6 +915,14 @@ export const UtteranceSynthesisResponse = { (obj.audioChunk = message.audioChunk ? AudioChunk.toJSON(message.audioChunk) : undefined); + message.textChunk !== undefined && + (obj.textChunk = message.textChunk + ? TextChunk.toJSON(message.textChunk) + : undefined); + message.startMs !== undefined && + (obj.startMs = Math.round(message.startMs)); + message.lengthMs !== undefined && + (obj.lengthMs = Math.round(message.lengthMs)); return obj; }, @@ -823,6 +936,12 @@ export const UtteranceSynthesisResponse = { object.audioChunk !== undefined && object.audioChunk !== null ? AudioChunk.fromPartial(object.audioChunk) : undefined; + message.textChunk = + object.textChunk !== undefined && object.textChunk !== null + ? TextChunk.fromPartial(object.textChunk) + : undefined; + message.startMs = object.startMs ?? 0; + message.lengthMs = object.lengthMs ?? 0; return message; }, }; @@ -1000,6 +1119,65 @@ export const AudioChunk = { messageTypeRegistry.set(AudioChunk.$type, AudioChunk); +const baseTextChunk: object = { $type: "speechkit.tts.v3.TextChunk", text: "" }; + +export const TextChunk = { + $type: "speechkit.tts.v3.TextChunk" as const, + + encode( + message: TextChunk, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.text !== "") { + writer.uint32(10).string(message.text); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TextChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTextChunk } as TextChunk; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TextChunk { + const message = { ...baseTextChunk } as TextChunk; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + return message; + }, + + toJSON(message: TextChunk): unknown { + const obj: any = {}; + message.text !== undefined && (obj.text = message.text); + return obj; + }, + + fromPartial, I>>( + object: I + ): TextChunk { + const message = { ...baseTextChunk } as TextChunk; + message.text = object.text ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(TextChunk.$type, TextChunk); + const baseTextTemplate: object = { $type: "speechkit.tts.v3.TextTemplate", textTemplate: "", @@ -1082,6 +1260,83 @@ export const TextTemplate = { messageTypeRegistry.set(TextTemplate.$type, TextTemplate); +const baseDurationHint: object = { + $type: "speechkit.tts.v3.DurationHint", + policy: 0, + durationMs: 0, +}; + +export const DurationHint = { + $type: "speechkit.tts.v3.DurationHint" as const, + + encode( + message: DurationHint, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.policy !== 0) { + writer.uint32(8).int32(message.policy); + } + if (message.durationMs !== 0) { + writer.uint32(16).int64(message.durationMs); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DurationHint { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDurationHint } as DurationHint; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.policy = reader.int32() as any; + break; + case 2: + message.durationMs = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DurationHint { + const message = { ...baseDurationHint } as DurationHint; + message.policy = + object.policy !== undefined && object.policy !== null + ? durationHint_DurationHintPolicyFromJSON(object.policy) + : 0; + message.durationMs = + object.durationMs !== undefined && object.durationMs !== null + ? Number(object.durationMs) + : 0; + return message; + }, + + toJSON(message: DurationHint): unknown { + const obj: any = {}; + message.policy !== undefined && + (obj.policy = durationHint_DurationHintPolicyToJSON(message.policy)); + message.durationMs !== undefined && + (obj.durationMs = Math.round(message.durationMs)); + return obj; + }, + + fromPartial, I>>( + object: I + ): DurationHint { + const message = { ...baseDurationHint } as DurationHint; + message.policy = object.policy ?? 0; + message.durationMs = object.durationMs ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(DurationHint.$type, DurationHint); + const baseHints: object = { $type: "speechkit.tts.v3.Hints" }; export const Hints = { @@ -1109,6 +1364,9 @@ export const Hints = { if (message.pitchShift !== undefined) { writer.uint32(49).double(message.pitchShift); } + if (message.duration !== undefined) { + DurationHint.encode(message.duration, writer.uint32(58).fork()).ldelim(); + } return writer; }, @@ -1137,6 +1395,9 @@ export const Hints = { case 6: message.pitchShift = reader.double(); break; + case 7: + message.duration = DurationHint.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1171,6 +1432,10 @@ export const Hints = { object.pitchShift !== undefined && object.pitchShift !== null ? Number(object.pitchShift) : undefined; + message.duration = + object.duration !== undefined && object.duration !== null + ? DurationHint.fromJSON(object.duration) + : undefined; return message; }, @@ -1185,6 +1450,10 @@ export const Hints = { message.volume !== undefined && (obj.volume = message.volume); message.role !== undefined && (obj.role = message.role); message.pitchShift !== undefined && (obj.pitchShift = message.pitchShift); + message.duration !== undefined && + (obj.duration = message.duration + ? DurationHint.toJSON(message.duration) + : undefined); return obj; }, @@ -1199,6 +1468,10 @@ export const Hints = { message.volume = object.volume ?? undefined; message.role = object.role ?? undefined; message.pitchShift = object.pitchShift ?? undefined; + message.duration = + object.duration !== undefined && object.duration !== null + ? DurationHint.fromPartial(object.duration) + : undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/airflow/index.ts b/src/generated/yandex/cloud/airflow/index.ts new file mode 100644 index 00000000..62a779ed --- /dev/null +++ b/src/generated/yandex/cloud/airflow/index.ts @@ -0,0 +1,3 @@ +export * as v1_cluster from './v1/cluster' +export * as v1_cluster_service from './v1/cluster_service' +export * as v1_common from './v1/common' \ No newline at end of file diff --git a/src/generated/yandex/cloud/airflow/v1/cluster.ts b/src/generated/yandex/cloud/airflow/v1/cluster.ts new file mode 100644 index 00000000..b61af3b5 --- /dev/null +++ b/src/generated/yandex/cloud/airflow/v1/cluster.ts @@ -0,0 +1,1979 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + Health, + Resources, + healthFromJSON, + healthToJSON, +} from "../../../../yandex/cloud/airflow/v1/common"; +import { + LogLevel_Level, + logLevel_LevelFromJSON, + logLevel_LevelToJSON, +} from "../../../../yandex/cloud/logging/v1/log_entry"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.airflow.v1"; + +/** Apache Airflow cluster. */ +export interface Cluster { + $type: "yandex.cloud.airflow.v1.Cluster"; + /** + * Unique ID of the Apache Airflow cluster. + * This ID is assigned by Cloud during cluster creation. + */ + id: string; + /** ID of the folder that the Apache Airflow cluster belongs to. */ + folderId: string; + /** The time when the Apache Airflow cluster was created. */ + createdAt?: Date; + /** + * Name of the Apache Airflow cluster. + * The name is unique within the folder. 1-64 characters long. + */ + name: string; + /** Description of the Apache Airflow cluster. 0-256 characters long. */ + description: string; + /** Resource labels as `key:value` pairs. Maximum of 64 per resource. */ + labels: { [key: string]: string }; + /** Monitoring systems relevant to the Apache Airflow cluster. */ + monitoring: Monitoring[]; + /** Configuration of Apache Airflow components. */ + config?: ClusterConfig; + /** Aggregated cluster health. */ + health: Health; + /** Cluster status. */ + status: Cluster_Status; + /** Network related configuration options. */ + network?: NetworkConfig; + /** Parameters of the location and access to the code that will be executed in the cluster. */ + codeSync?: CodeSyncConfig; + /** Deletion Protection inhibits deletion of the cluster. */ + deletionProtection: boolean; + /** Address of Apache Airflow web UI. */ + webserverUrl: string; + /** + * Service account used to access Cloud resources. + * For more information, see [documentation](/docs/managed-airflow/concepts/impersonation). + */ + serviceAccountId: string; + /** Cloud Logging configuration. */ + logging?: LoggingConfig; +} + +export enum Cluster_Status { + /** STATUS_UNKNOWN - Cluster state is unknown. */ + STATUS_UNKNOWN = 0, + /** CREATING - Cluster is being created. */ + CREATING = 1, + /** RUNNING - Cluster is running normally. */ + RUNNING = 2, + /** ERROR - Cluster encountered a problem and cannot operate. */ + ERROR = 3, + /** STOPPING - Cluster is stopping. */ + STOPPING = 4, + /** STOPPED - Cluster is stopped. */ + STOPPED = 5, + /** STARTING - Cluster is starting. */ + STARTING = 6, + /** UPDATING - Cluster is being updated. */ + UPDATING = 7, + UNRECOGNIZED = -1, +} + +export function cluster_StatusFromJSON(object: any): Cluster_Status { + switch (object) { + case 0: + case "STATUS_UNKNOWN": + return Cluster_Status.STATUS_UNKNOWN; + case 1: + case "CREATING": + return Cluster_Status.CREATING; + case 2: + case "RUNNING": + return Cluster_Status.RUNNING; + case 3: + case "ERROR": + return Cluster_Status.ERROR; + case 4: + case "STOPPING": + return Cluster_Status.STOPPING; + case 5: + case "STOPPED": + return Cluster_Status.STOPPED; + case 6: + case "STARTING": + return Cluster_Status.STARTING; + case 7: + case "UPDATING": + return Cluster_Status.UPDATING; + case -1: + case "UNRECOGNIZED": + default: + return Cluster_Status.UNRECOGNIZED; + } +} + +export function cluster_StatusToJSON(object: Cluster_Status): string { + switch (object) { + case Cluster_Status.STATUS_UNKNOWN: + return "STATUS_UNKNOWN"; + case Cluster_Status.CREATING: + return "CREATING"; + case Cluster_Status.RUNNING: + return "RUNNING"; + case Cluster_Status.ERROR: + return "ERROR"; + case Cluster_Status.STOPPING: + return "STOPPING"; + case Cluster_Status.STOPPED: + return "STOPPED"; + case Cluster_Status.STARTING: + return "STARTING"; + case Cluster_Status.UPDATING: + return "UPDATING"; + default: + return "UNKNOWN"; + } +} + +export interface Cluster_LabelsEntry { + $type: "yandex.cloud.airflow.v1.Cluster.LabelsEntry"; + key: string; + value: string; +} + +/** Monitoring system. */ +export interface Monitoring { + $type: "yandex.cloud.airflow.v1.Monitoring"; + /** Name of the monitoring system. */ + name: string; + /** Description of the monitoring system. */ + description: string; + /** Link to the monitoring system. */ + link: string; +} + +export interface ClusterConfig { + $type: "yandex.cloud.airflow.v1.ClusterConfig"; + /** Version of Apache that runs on the cluster. */ + versionId: string; + /** Configuration of the Apache Airflow application itself. */ + airflow?: AirflowConfig; + /** Configuration of webserver instances. */ + webserver?: WebserverConfig; + /** Configuration of scheduler instances. */ + scheduler?: SchedulerConfig; + /** Configuration of triggerer instances. */ + triggerer?: TriggererConfig; + /** Configuration of worker instances. */ + worker?: WorkerConfig; + /** The list of additional packages installed in the cluster. */ + dependencies?: Dependencies; + /** Configuration of Lockbox Secret Backend. */ + lockbox?: LockboxConfig; +} + +export interface AirflowConfig { + $type: "yandex.cloud.airflow.v1.AirflowConfig"; + /** Properties to be passed to Apache Airflow configuration file. */ + config: { [key: string]: string }; +} + +export interface AirflowConfig_ConfigEntry { + $type: "yandex.cloud.airflow.v1.AirflowConfig.ConfigEntry"; + key: string; + value: string; +} + +export interface WebserverConfig { + $type: "yandex.cloud.airflow.v1.WebserverConfig"; + /** The number of webserver instances in the cluster. */ + count: number; + /** Resources allocated to webserver instances. */ + resources?: Resources; +} + +export interface SchedulerConfig { + $type: "yandex.cloud.airflow.v1.SchedulerConfig"; + /** The number of scheduler instances in the cluster. */ + count: number; + /** Resources allocated to scheduler instances. */ + resources?: Resources; +} + +export interface TriggererConfig { + $type: "yandex.cloud.airflow.v1.TriggererConfig"; + /** The number of triggerer instances in the cluster. */ + count: number; + /** Resources allocated to triggerer instances. */ + resources?: Resources; +} + +export interface WorkerConfig { + $type: "yandex.cloud.airflow.v1.WorkerConfig"; + /** The minimum number of worker instances in the cluster. */ + minCount: number; + /** The maximum number of worker instances in the cluster. */ + maxCount: number; + /** Resources allocated to worker instances. */ + resources?: Resources; +} + +export interface Dependencies { + $type: "yandex.cloud.airflow.v1.Dependencies"; + /** Python packages that are installed in the cluster. */ + pipPackages: string[]; + /** System packages that are installed in the cluster. */ + debPackages: string[]; +} + +export interface NetworkConfig { + $type: "yandex.cloud.airflow.v1.NetworkConfig"; + /** IDs of VPC network subnets where instances of the cluster are attached. */ + subnetIds: string[]; + /** User security groups. */ + securityGroupIds: string[]; +} + +export interface S3Config { + $type: "yandex.cloud.airflow.v1.S3Config"; + /** The name of the Object Storage bucket that stores DAG files used in the cluster. */ + bucket: string; +} + +export interface CodeSyncConfig { + $type: "yandex.cloud.airflow.v1.CodeSyncConfig"; + s3?: S3Config | undefined; +} + +export interface LoggingConfig { + $type: "yandex.cloud.airflow.v1.LoggingConfig"; + /** Logs generated by the Airflow components are delivered to Cloud Logging. */ + enabled: boolean; + /** Logs should be written to default log group for specified folder. */ + folderId: string | undefined; + /** Logs should be written to log group resolved by ID. */ + logGroupId: string | undefined; + /** + * Minimum log entry level. + * + * See [LogLevel.Level] for details. + */ + minLevel: LogLevel_Level; +} + +export interface LockboxConfig { + $type: "yandex.cloud.airflow.v1.LockboxConfig"; + /** The setting allows to enable Lockbox Secret Backend. */ + enabled: boolean; +} + +const baseCluster: object = { + $type: "yandex.cloud.airflow.v1.Cluster", + id: "", + folderId: "", + name: "", + description: "", + health: 0, + status: 0, + deletionProtection: false, + webserverUrl: "", + serviceAccountId: "", +}; + +export const Cluster = { + $type: "yandex.cloud.airflow.v1.Cluster" as const, + + encode( + message: Cluster, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(26).fork() + ).ldelim(); + } + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + Cluster_LabelsEntry.encode( + { + $type: "yandex.cloud.airflow.v1.Cluster.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + for (const v of message.monitoring) { + Monitoring.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.config !== undefined) { + ClusterConfig.encode(message.config, writer.uint32(74).fork()).ldelim(); + } + if (message.health !== 0) { + writer.uint32(80).int32(message.health); + } + if (message.status !== 0) { + writer.uint32(88).int32(message.status); + } + if (message.network !== undefined) { + NetworkConfig.encode(message.network, writer.uint32(98).fork()).ldelim(); + } + if (message.codeSync !== undefined) { + CodeSyncConfig.encode( + message.codeSync, + writer.uint32(106).fork() + ).ldelim(); + } + if (message.deletionProtection === true) { + writer.uint32(112).bool(message.deletionProtection); + } + if (message.webserverUrl !== "") { + writer.uint32(122).string(message.webserverUrl); + } + if (message.serviceAccountId !== "") { + writer.uint32(130).string(message.serviceAccountId); + } + if (message.logging !== undefined) { + LoggingConfig.encode(message.logging, writer.uint32(138).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Cluster { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCluster } as Cluster; + message.labels = {}; + message.monitoring = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 4: + message.name = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + const entry6 = Cluster_LabelsEntry.decode(reader, reader.uint32()); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + case 8: + message.monitoring.push(Monitoring.decode(reader, reader.uint32())); + break; + case 9: + message.config = ClusterConfig.decode(reader, reader.uint32()); + break; + case 10: + message.health = reader.int32() as any; + break; + case 11: + message.status = reader.int32() as any; + break; + case 12: + message.network = NetworkConfig.decode(reader, reader.uint32()); + break; + case 13: + message.codeSync = CodeSyncConfig.decode(reader, reader.uint32()); + break; + case 14: + message.deletionProtection = reader.bool(); + break; + case 15: + message.webserverUrl = reader.string(); + break; + case 16: + message.serviceAccountId = reader.string(); + break; + case 17: + message.logging = LoggingConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Cluster { + const message = { ...baseCluster } as Cluster; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.monitoring = (object.monitoring ?? []).map((e: any) => + Monitoring.fromJSON(e) + ); + message.config = + object.config !== undefined && object.config !== null + ? ClusterConfig.fromJSON(object.config) + : undefined; + message.health = + object.health !== undefined && object.health !== null + ? healthFromJSON(object.health) + : 0; + message.status = + object.status !== undefined && object.status !== null + ? cluster_StatusFromJSON(object.status) + : 0; + message.network = + object.network !== undefined && object.network !== null + ? NetworkConfig.fromJSON(object.network) + : undefined; + message.codeSync = + object.codeSync !== undefined && object.codeSync !== null + ? CodeSyncConfig.fromJSON(object.codeSync) + : undefined; + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + message.webserverUrl = + object.webserverUrl !== undefined && object.webserverUrl !== null + ? String(object.webserverUrl) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.logging = + object.logging !== undefined && object.logging !== null + ? LoggingConfig.fromJSON(object.logging) + : undefined; + return message; + }, + + toJSON(message: Cluster): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + if (message.monitoring) { + obj.monitoring = message.monitoring.map((e) => + e ? Monitoring.toJSON(e) : undefined + ); + } else { + obj.monitoring = []; + } + message.config !== undefined && + (obj.config = message.config + ? ClusterConfig.toJSON(message.config) + : undefined); + message.health !== undefined && (obj.health = healthToJSON(message.health)); + message.status !== undefined && + (obj.status = cluster_StatusToJSON(message.status)); + message.network !== undefined && + (obj.network = message.network + ? NetworkConfig.toJSON(message.network) + : undefined); + message.codeSync !== undefined && + (obj.codeSync = message.codeSync + ? CodeSyncConfig.toJSON(message.codeSync) + : undefined); + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + message.webserverUrl !== undefined && + (obj.webserverUrl = message.webserverUrl); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.logging !== undefined && + (obj.logging = message.logging + ? LoggingConfig.toJSON(message.logging) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Cluster { + const message = { ...baseCluster } as Cluster; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.monitoring = + object.monitoring?.map((e) => Monitoring.fromPartial(e)) || []; + message.config = + object.config !== undefined && object.config !== null + ? ClusterConfig.fromPartial(object.config) + : undefined; + message.health = object.health ?? 0; + message.status = object.status ?? 0; + message.network = + object.network !== undefined && object.network !== null + ? NetworkConfig.fromPartial(object.network) + : undefined; + message.codeSync = + object.codeSync !== undefined && object.codeSync !== null + ? CodeSyncConfig.fromPartial(object.codeSync) + : undefined; + message.deletionProtection = object.deletionProtection ?? false; + message.webserverUrl = object.webserverUrl ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.logging = + object.logging !== undefined && object.logging !== null + ? LoggingConfig.fromPartial(object.logging) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Cluster.$type, Cluster); + +const baseCluster_LabelsEntry: object = { + $type: "yandex.cloud.airflow.v1.Cluster.LabelsEntry", + key: "", + value: "", +}; + +export const Cluster_LabelsEntry = { + $type: "yandex.cloud.airflow.v1.Cluster.LabelsEntry" as const, + + encode( + message: Cluster_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Cluster_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCluster_LabelsEntry } as Cluster_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Cluster_LabelsEntry { + const message = { ...baseCluster_LabelsEntry } as Cluster_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Cluster_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Cluster_LabelsEntry { + const message = { ...baseCluster_LabelsEntry } as Cluster_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Cluster_LabelsEntry.$type, Cluster_LabelsEntry); + +const baseMonitoring: object = { + $type: "yandex.cloud.airflow.v1.Monitoring", + name: "", + description: "", + link: "", +}; + +export const Monitoring = { + $type: "yandex.cloud.airflow.v1.Monitoring" as const, + + encode( + message: Monitoring, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.link !== "") { + writer.uint32(26).string(message.link); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Monitoring { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMonitoring } as Monitoring; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.link = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Monitoring { + const message = { ...baseMonitoring } as Monitoring; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.link = + object.link !== undefined && object.link !== null + ? String(object.link) + : ""; + return message; + }, + + toJSON(message: Monitoring): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.link !== undefined && (obj.link = message.link); + return obj; + }, + + fromPartial, I>>( + object: I + ): Monitoring { + const message = { ...baseMonitoring } as Monitoring; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.link = object.link ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Monitoring.$type, Monitoring); + +const baseClusterConfig: object = { + $type: "yandex.cloud.airflow.v1.ClusterConfig", + versionId: "", +}; + +export const ClusterConfig = { + $type: "yandex.cloud.airflow.v1.ClusterConfig" as const, + + encode( + message: ClusterConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.versionId !== "") { + writer.uint32(10).string(message.versionId); + } + if (message.airflow !== undefined) { + AirflowConfig.encode(message.airflow, writer.uint32(18).fork()).ldelim(); + } + if (message.webserver !== undefined) { + WebserverConfig.encode( + message.webserver, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.scheduler !== undefined) { + SchedulerConfig.encode( + message.scheduler, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.triggerer !== undefined) { + TriggererConfig.encode( + message.triggerer, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.worker !== undefined) { + WorkerConfig.encode(message.worker, writer.uint32(50).fork()).ldelim(); + } + if (message.dependencies !== undefined) { + Dependencies.encode( + message.dependencies, + writer.uint32(58).fork() + ).ldelim(); + } + if (message.lockbox !== undefined) { + LockboxConfig.encode(message.lockbox, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClusterConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseClusterConfig } as ClusterConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.versionId = reader.string(); + break; + case 2: + message.airflow = AirflowConfig.decode(reader, reader.uint32()); + break; + case 3: + message.webserver = WebserverConfig.decode(reader, reader.uint32()); + break; + case 4: + message.scheduler = SchedulerConfig.decode(reader, reader.uint32()); + break; + case 5: + message.triggerer = TriggererConfig.decode(reader, reader.uint32()); + break; + case 6: + message.worker = WorkerConfig.decode(reader, reader.uint32()); + break; + case 7: + message.dependencies = Dependencies.decode(reader, reader.uint32()); + break; + case 8: + message.lockbox = LockboxConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClusterConfig { + const message = { ...baseClusterConfig } as ClusterConfig; + message.versionId = + object.versionId !== undefined && object.versionId !== null + ? String(object.versionId) + : ""; + message.airflow = + object.airflow !== undefined && object.airflow !== null + ? AirflowConfig.fromJSON(object.airflow) + : undefined; + message.webserver = + object.webserver !== undefined && object.webserver !== null + ? WebserverConfig.fromJSON(object.webserver) + : undefined; + message.scheduler = + object.scheduler !== undefined && object.scheduler !== null + ? SchedulerConfig.fromJSON(object.scheduler) + : undefined; + message.triggerer = + object.triggerer !== undefined && object.triggerer !== null + ? TriggererConfig.fromJSON(object.triggerer) + : undefined; + message.worker = + object.worker !== undefined && object.worker !== null + ? WorkerConfig.fromJSON(object.worker) + : undefined; + message.dependencies = + object.dependencies !== undefined && object.dependencies !== null + ? Dependencies.fromJSON(object.dependencies) + : undefined; + message.lockbox = + object.lockbox !== undefined && object.lockbox !== null + ? LockboxConfig.fromJSON(object.lockbox) + : undefined; + return message; + }, + + toJSON(message: ClusterConfig): unknown { + const obj: any = {}; + message.versionId !== undefined && (obj.versionId = message.versionId); + message.airflow !== undefined && + (obj.airflow = message.airflow + ? AirflowConfig.toJSON(message.airflow) + : undefined); + message.webserver !== undefined && + (obj.webserver = message.webserver + ? WebserverConfig.toJSON(message.webserver) + : undefined); + message.scheduler !== undefined && + (obj.scheduler = message.scheduler + ? SchedulerConfig.toJSON(message.scheduler) + : undefined); + message.triggerer !== undefined && + (obj.triggerer = message.triggerer + ? TriggererConfig.toJSON(message.triggerer) + : undefined); + message.worker !== undefined && + (obj.worker = message.worker + ? WorkerConfig.toJSON(message.worker) + : undefined); + message.dependencies !== undefined && + (obj.dependencies = message.dependencies + ? Dependencies.toJSON(message.dependencies) + : undefined); + message.lockbox !== undefined && + (obj.lockbox = message.lockbox + ? LockboxConfig.toJSON(message.lockbox) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ClusterConfig { + const message = { ...baseClusterConfig } as ClusterConfig; + message.versionId = object.versionId ?? ""; + message.airflow = + object.airflow !== undefined && object.airflow !== null + ? AirflowConfig.fromPartial(object.airflow) + : undefined; + message.webserver = + object.webserver !== undefined && object.webserver !== null + ? WebserverConfig.fromPartial(object.webserver) + : undefined; + message.scheduler = + object.scheduler !== undefined && object.scheduler !== null + ? SchedulerConfig.fromPartial(object.scheduler) + : undefined; + message.triggerer = + object.triggerer !== undefined && object.triggerer !== null + ? TriggererConfig.fromPartial(object.triggerer) + : undefined; + message.worker = + object.worker !== undefined && object.worker !== null + ? WorkerConfig.fromPartial(object.worker) + : undefined; + message.dependencies = + object.dependencies !== undefined && object.dependencies !== null + ? Dependencies.fromPartial(object.dependencies) + : undefined; + message.lockbox = + object.lockbox !== undefined && object.lockbox !== null + ? LockboxConfig.fromPartial(object.lockbox) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ClusterConfig.$type, ClusterConfig); + +const baseAirflowConfig: object = { + $type: "yandex.cloud.airflow.v1.AirflowConfig", +}; + +export const AirflowConfig = { + $type: "yandex.cloud.airflow.v1.AirflowConfig" as const, + + encode( + message: AirflowConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + Object.entries(message.config).forEach(([key, value]) => { + AirflowConfig_ConfigEntry.encode( + { + $type: "yandex.cloud.airflow.v1.AirflowConfig.ConfigEntry", + key: key as any, + value, + }, + writer.uint32(10).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AirflowConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAirflowConfig } as AirflowConfig; + message.config = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + const entry1 = AirflowConfig_ConfigEntry.decode( + reader, + reader.uint32() + ); + if (entry1.value !== undefined) { + message.config[entry1.key] = entry1.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AirflowConfig { + const message = { ...baseAirflowConfig } as AirflowConfig; + message.config = Object.entries(object.config ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: AirflowConfig): unknown { + const obj: any = {}; + obj.config = {}; + if (message.config) { + Object.entries(message.config).forEach(([k, v]) => { + obj.config[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): AirflowConfig { + const message = { ...baseAirflowConfig } as AirflowConfig; + message.config = Object.entries(object.config ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(AirflowConfig.$type, AirflowConfig); + +const baseAirflowConfig_ConfigEntry: object = { + $type: "yandex.cloud.airflow.v1.AirflowConfig.ConfigEntry", + key: "", + value: "", +}; + +export const AirflowConfig_ConfigEntry = { + $type: "yandex.cloud.airflow.v1.AirflowConfig.ConfigEntry" as const, + + encode( + message: AirflowConfig_ConfigEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AirflowConfig_ConfigEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAirflowConfig_ConfigEntry, + } as AirflowConfig_ConfigEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AirflowConfig_ConfigEntry { + const message = { + ...baseAirflowConfig_ConfigEntry, + } as AirflowConfig_ConfigEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: AirflowConfig_ConfigEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): AirflowConfig_ConfigEntry { + const message = { + ...baseAirflowConfig_ConfigEntry, + } as AirflowConfig_ConfigEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + AirflowConfig_ConfigEntry.$type, + AirflowConfig_ConfigEntry +); + +const baseWebserverConfig: object = { + $type: "yandex.cloud.airflow.v1.WebserverConfig", + count: 0, +}; + +export const WebserverConfig = { + $type: "yandex.cloud.airflow.v1.WebserverConfig" as const, + + encode( + message: WebserverConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.count !== 0) { + writer.uint32(8).int64(message.count); + } + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): WebserverConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWebserverConfig } as WebserverConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.count = longToNumber(reader.int64() as Long); + break; + case 2: + message.resources = Resources.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WebserverConfig { + const message = { ...baseWebserverConfig } as WebserverConfig; + message.count = + object.count !== undefined && object.count !== null + ? Number(object.count) + : 0; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; + return message; + }, + + toJSON(message: WebserverConfig): unknown { + const obj: any = {}; + message.count !== undefined && (obj.count = Math.round(message.count)); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): WebserverConfig { + const message = { ...baseWebserverConfig } as WebserverConfig; + message.count = object.count ?? 0; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(WebserverConfig.$type, WebserverConfig); + +const baseSchedulerConfig: object = { + $type: "yandex.cloud.airflow.v1.SchedulerConfig", + count: 0, +}; + +export const SchedulerConfig = { + $type: "yandex.cloud.airflow.v1.SchedulerConfig" as const, + + encode( + message: SchedulerConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.count !== 0) { + writer.uint32(8).int64(message.count); + } + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SchedulerConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSchedulerConfig } as SchedulerConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.count = longToNumber(reader.int64() as Long); + break; + case 2: + message.resources = Resources.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SchedulerConfig { + const message = { ...baseSchedulerConfig } as SchedulerConfig; + message.count = + object.count !== undefined && object.count !== null + ? Number(object.count) + : 0; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; + return message; + }, + + toJSON(message: SchedulerConfig): unknown { + const obj: any = {}; + message.count !== undefined && (obj.count = Math.round(message.count)); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): SchedulerConfig { + const message = { ...baseSchedulerConfig } as SchedulerConfig; + message.count = object.count ?? 0; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(SchedulerConfig.$type, SchedulerConfig); + +const baseTriggererConfig: object = { + $type: "yandex.cloud.airflow.v1.TriggererConfig", + count: 0, +}; + +export const TriggererConfig = { + $type: "yandex.cloud.airflow.v1.TriggererConfig" as const, + + encode( + message: TriggererConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.count !== 0) { + writer.uint32(8).int64(message.count); + } + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TriggererConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTriggererConfig } as TriggererConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.count = longToNumber(reader.int64() as Long); + break; + case 2: + message.resources = Resources.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TriggererConfig { + const message = { ...baseTriggererConfig } as TriggererConfig; + message.count = + object.count !== undefined && object.count !== null + ? Number(object.count) + : 0; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; + return message; + }, + + toJSON(message: TriggererConfig): unknown { + const obj: any = {}; + message.count !== undefined && (obj.count = Math.round(message.count)); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): TriggererConfig { + const message = { ...baseTriggererConfig } as TriggererConfig; + message.count = object.count ?? 0; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(TriggererConfig.$type, TriggererConfig); + +const baseWorkerConfig: object = { + $type: "yandex.cloud.airflow.v1.WorkerConfig", + minCount: 0, + maxCount: 0, +}; + +export const WorkerConfig = { + $type: "yandex.cloud.airflow.v1.WorkerConfig" as const, + + encode( + message: WorkerConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.minCount !== 0) { + writer.uint32(8).int64(message.minCount); + } + if (message.maxCount !== 0) { + writer.uint32(16).int64(message.maxCount); + } + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): WorkerConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWorkerConfig } as WorkerConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minCount = longToNumber(reader.int64() as Long); + break; + case 2: + message.maxCount = longToNumber(reader.int64() as Long); + break; + case 3: + message.resources = Resources.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WorkerConfig { + const message = { ...baseWorkerConfig } as WorkerConfig; + message.minCount = + object.minCount !== undefined && object.minCount !== null + ? Number(object.minCount) + : 0; + message.maxCount = + object.maxCount !== undefined && object.maxCount !== null + ? Number(object.maxCount) + : 0; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; + return message; + }, + + toJSON(message: WorkerConfig): unknown { + const obj: any = {}; + message.minCount !== undefined && + (obj.minCount = Math.round(message.minCount)); + message.maxCount !== undefined && + (obj.maxCount = Math.round(message.maxCount)); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): WorkerConfig { + const message = { ...baseWorkerConfig } as WorkerConfig; + message.minCount = object.minCount ?? 0; + message.maxCount = object.maxCount ?? 0; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(WorkerConfig.$type, WorkerConfig); + +const baseDependencies: object = { + $type: "yandex.cloud.airflow.v1.Dependencies", + pipPackages: "", + debPackages: "", +}; + +export const Dependencies = { + $type: "yandex.cloud.airflow.v1.Dependencies" as const, + + encode( + message: Dependencies, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.pipPackages) { + writer.uint32(10).string(v!); + } + for (const v of message.debPackages) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Dependencies { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDependencies } as Dependencies; + message.pipPackages = []; + message.debPackages = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pipPackages.push(reader.string()); + break; + case 2: + message.debPackages.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Dependencies { + const message = { ...baseDependencies } as Dependencies; + message.pipPackages = (object.pipPackages ?? []).map((e: any) => String(e)); + message.debPackages = (object.debPackages ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: Dependencies): unknown { + const obj: any = {}; + if (message.pipPackages) { + obj.pipPackages = message.pipPackages.map((e) => e); + } else { + obj.pipPackages = []; + } + if (message.debPackages) { + obj.debPackages = message.debPackages.map((e) => e); + } else { + obj.debPackages = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Dependencies { + const message = { ...baseDependencies } as Dependencies; + message.pipPackages = object.pipPackages?.map((e) => e) || []; + message.debPackages = object.debPackages?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(Dependencies.$type, Dependencies); + +const baseNetworkConfig: object = { + $type: "yandex.cloud.airflow.v1.NetworkConfig", + subnetIds: "", + securityGroupIds: "", +}; + +export const NetworkConfig = { + $type: "yandex.cloud.airflow.v1.NetworkConfig" as const, + + encode( + message: NetworkConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.subnetIds) { + writer.uint32(10).string(v!); + } + for (const v of message.securityGroupIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NetworkConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseNetworkConfig } as NetworkConfig; + message.subnetIds = []; + message.securityGroupIds = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subnetIds.push(reader.string()); + break; + case 2: + message.securityGroupIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): NetworkConfig { + const message = { ...baseNetworkConfig } as NetworkConfig; + message.subnetIds = (object.subnetIds ?? []).map((e: any) => String(e)); + message.securityGroupIds = (object.securityGroupIds ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: NetworkConfig): unknown { + const obj: any = {}; + if (message.subnetIds) { + obj.subnetIds = message.subnetIds.map((e) => e); + } else { + obj.subnetIds = []; + } + if (message.securityGroupIds) { + obj.securityGroupIds = message.securityGroupIds.map((e) => e); + } else { + obj.securityGroupIds = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): NetworkConfig { + const message = { ...baseNetworkConfig } as NetworkConfig; + message.subnetIds = object.subnetIds?.map((e) => e) || []; + message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(NetworkConfig.$type, NetworkConfig); + +const baseS3Config: object = { + $type: "yandex.cloud.airflow.v1.S3Config", + bucket: "", +}; + +export const S3Config = { + $type: "yandex.cloud.airflow.v1.S3Config" as const, + + encode( + message: S3Config, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.bucket !== "") { + writer.uint32(26).string(message.bucket); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): S3Config { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseS3Config } as S3Config; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.bucket = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3Config { + const message = { ...baseS3Config } as S3Config; + message.bucket = + object.bucket !== undefined && object.bucket !== null + ? String(object.bucket) + : ""; + return message; + }, + + toJSON(message: S3Config): unknown { + const obj: any = {}; + message.bucket !== undefined && (obj.bucket = message.bucket); + return obj; + }, + + fromPartial, I>>(object: I): S3Config { + const message = { ...baseS3Config } as S3Config; + message.bucket = object.bucket ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(S3Config.$type, S3Config); + +const baseCodeSyncConfig: object = { + $type: "yandex.cloud.airflow.v1.CodeSyncConfig", +}; + +export const CodeSyncConfig = { + $type: "yandex.cloud.airflow.v1.CodeSyncConfig" as const, + + encode( + message: CodeSyncConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.s3 !== undefined) { + S3Config.encode(message.s3, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CodeSyncConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCodeSyncConfig } as CodeSyncConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.s3 = S3Config.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CodeSyncConfig { + const message = { ...baseCodeSyncConfig } as CodeSyncConfig; + message.s3 = + object.s3 !== undefined && object.s3 !== null + ? S3Config.fromJSON(object.s3) + : undefined; + return message; + }, + + toJSON(message: CodeSyncConfig): unknown { + const obj: any = {}; + message.s3 !== undefined && + (obj.s3 = message.s3 ? S3Config.toJSON(message.s3) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CodeSyncConfig { + const message = { ...baseCodeSyncConfig } as CodeSyncConfig; + message.s3 = + object.s3 !== undefined && object.s3 !== null + ? S3Config.fromPartial(object.s3) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CodeSyncConfig.$type, CodeSyncConfig); + +const baseLoggingConfig: object = { + $type: "yandex.cloud.airflow.v1.LoggingConfig", + enabled: false, + minLevel: 0, +}; + +export const LoggingConfig = { + $type: "yandex.cloud.airflow.v1.LoggingConfig" as const, + + encode( + message: LoggingConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + if (message.folderId !== undefined) { + writer.uint32(18).string(message.folderId); + } + if (message.logGroupId !== undefined) { + writer.uint32(26).string(message.logGroupId); + } + if (message.minLevel !== 0) { + writer.uint32(32).int32(message.minLevel); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LoggingConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLoggingConfig } as LoggingConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.logGroupId = reader.string(); + break; + case 4: + message.minLevel = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LoggingConfig { + const message = { ...baseLoggingConfig } as LoggingConfig; + message.enabled = + object.enabled !== undefined && object.enabled !== null + ? Boolean(object.enabled) + : false; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : undefined; + message.logGroupId = + object.logGroupId !== undefined && object.logGroupId !== null + ? String(object.logGroupId) + : undefined; + message.minLevel = + object.minLevel !== undefined && object.minLevel !== null + ? logLevel_LevelFromJSON(object.minLevel) + : 0; + return message; + }, + + toJSON(message: LoggingConfig): unknown { + const obj: any = {}; + message.enabled !== undefined && (obj.enabled = message.enabled); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.logGroupId !== undefined && (obj.logGroupId = message.logGroupId); + message.minLevel !== undefined && + (obj.minLevel = logLevel_LevelToJSON(message.minLevel)); + return obj; + }, + + fromPartial, I>>( + object: I + ): LoggingConfig { + const message = { ...baseLoggingConfig } as LoggingConfig; + message.enabled = object.enabled ?? false; + message.folderId = object.folderId ?? undefined; + message.logGroupId = object.logGroupId ?? undefined; + message.minLevel = object.minLevel ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(LoggingConfig.$type, LoggingConfig); + +const baseLockboxConfig: object = { + $type: "yandex.cloud.airflow.v1.LockboxConfig", + enabled: false, +}; + +export const LockboxConfig = { + $type: "yandex.cloud.airflow.v1.LockboxConfig" as const, + + encode( + message: LockboxConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LockboxConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLockboxConfig } as LockboxConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LockboxConfig { + const message = { ...baseLockboxConfig } as LockboxConfig; + message.enabled = + object.enabled !== undefined && object.enabled !== null + ? Boolean(object.enabled) + : false; + return message; + }, + + toJSON(message: LockboxConfig): unknown { + const obj: any = {}; + message.enabled !== undefined && (obj.enabled = message.enabled); + return obj; + }, + + fromPartial, I>>( + object: I + ): LockboxConfig { + const message = { ...baseLockboxConfig } as LockboxConfig; + message.enabled = object.enabled ?? false; + return message; + }, +}; + +messageTypeRegistry.set(LockboxConfig.$type, LockboxConfig); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/airflow/v1/cluster_service.ts b/src/generated/yandex/cloud/airflow/v1/cluster_service.ts new file mode 100644 index 00000000..edbfa9e6 --- /dev/null +++ b/src/generated/yandex/cloud/airflow/v1/cluster_service.ts @@ -0,0 +1,2502 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + ClusterConfig, + NetworkConfig, + CodeSyncConfig, + LoggingConfig, + AirflowConfig, + WebserverConfig, + SchedulerConfig, + TriggererConfig, + WorkerConfig, + Dependencies, + LockboxConfig, + Cluster, +} from "../../../../yandex/cloud/airflow/v1/cluster"; +import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.airflow.v1"; + +export interface GetClusterRequest { + $type: "yandex.cloud.airflow.v1.GetClusterRequest"; + /** ID of the Apache Airflow Cluster resource to return. */ + clusterId: string; +} + +export interface ListClustersRequest { + $type: "yandex.cloud.airflow.v1.ListClustersRequest"; + /** ID of the folder to list Apache Airflow clusters in. */ + folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], the service returns a [ListClustersResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] to the [ListClustersResponse.next_page_token] + * returned by the previous list request. + */ + pageToken: string; + /** + * A filter expression that filters resources listed in the response. + * The expression must specify: + * 1. The field name. Currently you can only use filtering with the [Cluster.name] field. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). Must be 1-63 characters long and match the regular expression `[a-zA-Z0-9_-]+`. + */ + filter: string; +} + +export interface ListClustersResponse { + $type: "yandex.cloud.airflow.v1.ListClustersResponse"; + /** List of Apache Airflow Cluster resources. */ + clusters: Cluster[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListClustersRequest.page_size], use the [next_page_token] as the value + * for the [ListClustersRequest.page_token] parameter in the next list request. Each subsequent + * list request will have its own [next_page_token] to continue paging through the results. + */ + nextPageToken: string; +} + +export interface CreateClusterRequest { + $type: "yandex.cloud.airflow.v1.CreateClusterRequest"; + /** ID of the folder to create Apache Airflow cluster in. */ + folderId: string; + /** Name of the Apache Airflow cluster. The name must be unique within the folder. */ + name: string; + /** Description of the Apache Airflow cluster. */ + description: string; + /** Custom labels for the Apache Airflow cluster as `` key:value `` pairs. For example, "env": "prod". */ + labels: { [key: string]: string }; + /** Configuration of Apache Airflow components. */ + config?: ClusterConfig; + /** Network related configuration options. */ + network?: NetworkConfig; + /** Parameters of the location and access to the code that will be executed in the cluster. */ + codeSync?: CodeSyncConfig; + /** Deletion Protection inhibits deletion of the cluster. */ + deletionProtection: boolean; + /** + * Service account used to access Cloud resources. + * For more information, see [documentation](/docs/managed-airflow/concepts/impersonation). + */ + serviceAccountId: string; + /** Cloud Logging configuration. */ + logging?: LoggingConfig; + /** Password of user `admin`. */ + adminPassword: string; +} + +export interface CreateClusterRequest_LabelsEntry { + $type: "yandex.cloud.airflow.v1.CreateClusterRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface CreateClusterMetadata { + $type: "yandex.cloud.airflow.v1.CreateClusterMetadata"; + /** ID of the Apache Airflow cluster that is being created. */ + clusterId: string; +} + +export interface UpdateClusterConfigSpec { + $type: "yandex.cloud.airflow.v1.UpdateClusterConfigSpec"; + /** Configuration of the Apache Airflow application itself. */ + airflow?: AirflowConfig; + /** Configuration of webserver instances. */ + webserver?: WebserverConfig; + /** Configuration of scheduler instances. */ + scheduler?: SchedulerConfig; + /** Configuration of triggerer instances. */ + triggerer?: TriggererConfig; + /** Configuration of worker instances. */ + worker?: WorkerConfig; + /** The list of additional packages installed in the cluster. */ + dependencies?: Dependencies; + /** Configuration of Lockbox Secret Backend. */ + lockbox?: LockboxConfig; +} + +export interface UpdateNetworkConfigSpec { + $type: "yandex.cloud.airflow.v1.UpdateNetworkConfigSpec"; + /** User security groups. */ + securityGroupIds: string[]; +} + +export interface UpdateClusterRequest { + $type: "yandex.cloud.airflow.v1.UpdateClusterRequest"; + /** ID of the Apache Airflow Cluster resource to update. */ + clusterId: string; + /** Field mask that specifies which fields of the Apache Airflow Cluster resource should be updated. */ + updateMask?: FieldMask; + /** New name of the cluster. */ + name: string; + /** New description of the Apache Airflow cluster. */ + description: string; + /** + * Custom labels for the Apache Airflow cluster as `` key:value `` pairs. For example, "env": "prod". + * + * The new set of labels will completely replace the old ones. To add a label, request the current + * set with the [ClusterService.Get] method, then send an [ClusterService.Update] request with the new label added to the set. + */ + labels: { [key: string]: string }; + /** Configuration of Apache Airflow components. */ + configSpec?: UpdateClusterConfigSpec; + /** Parameters of the location and access to the code that will be executed in the cluster. */ + codeSync?: CodeSyncConfig; + /** Network related configuration options. */ + networkSpec?: UpdateNetworkConfigSpec; + /** Deletion Protection inhibits deletion of the cluster */ + deletionProtection: boolean; + /** + * Service account used to access Cloud resources. + * For more information, see [documentation](/docs/managed-airflow/concepts/impersonation). + */ + serviceAccountId: string; + /** Cloud Logging configuration. */ + logging?: LoggingConfig; +} + +export interface UpdateClusterRequest_LabelsEntry { + $type: "yandex.cloud.airflow.v1.UpdateClusterRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateClusterMetadata { + $type: "yandex.cloud.airflow.v1.UpdateClusterMetadata"; + /** ID of the Apache Airflow Cluster resource that is being updated. */ + clusterId: string; +} + +export interface DeleteClusterRequest { + $type: "yandex.cloud.airflow.v1.DeleteClusterRequest"; + /** ID of the Apache Airflow cluster to delete. */ + clusterId: string; +} + +export interface DeleteClusterMetadata { + $type: "yandex.cloud.airflow.v1.DeleteClusterMetadata"; + /** ID of the Apache Airflow cluster that is being deleted. */ + clusterId: string; +} + +export interface StartClusterRequest { + $type: "yandex.cloud.airflow.v1.StartClusterRequest"; + /** ID of the Apache Airflow cluster to start. */ + clusterId: string; +} + +export interface StartClusterMetadata { + $type: "yandex.cloud.airflow.v1.StartClusterMetadata"; + /** ID of the Apache Airflow cluster that is being started. */ + clusterId: string; +} + +export interface StopClusterRequest { + $type: "yandex.cloud.airflow.v1.StopClusterRequest"; + /** ID of the Apache Airflow cluster to stop. */ + clusterId: string; +} + +export interface StopClusterMetadata { + $type: "yandex.cloud.airflow.v1.StopClusterMetadata"; + /** ID of the Apache Airflow cluster that is being stopped. */ + clusterId: string; +} + +export interface ListClusterOperationsRequest { + $type: "yandex.cloud.airflow.v1.ListClusterOperationsRequest"; + /** ID of the Apache Airflow Cluster resource to list operations for. */ + clusterId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], the service returns a [ListClusterOperationsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] to the [ListClusterOperationsResponse.next_page_token] + * returned by the previous list request. + */ + pageToken: string; +} + +export interface ListClusterOperationsResponse { + $type: "yandex.cloud.airflow.v1.ListClusterOperationsResponse"; + /** List of Operation resources for the specified Apache Airflow cluster. */ + operations: Operation[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListClusterOperationsRequest.page_size], use the [next_page_token] as the value + * for the [ListClusterOperationsRequest.page_token] query parameter in the next list request. + * Each subsequent list request will have its own [next_page_token] to continue paging through the results. + */ + nextPageToken: string; +} + +const baseGetClusterRequest: object = { + $type: "yandex.cloud.airflow.v1.GetClusterRequest", + clusterId: "", +}; + +export const GetClusterRequest = { + $type: "yandex.cloud.airflow.v1.GetClusterRequest" as const, + + encode( + message: GetClusterRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetClusterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetClusterRequest } as GetClusterRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetClusterRequest { + const message = { ...baseGetClusterRequest } as GetClusterRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: GetClusterRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetClusterRequest { + const message = { ...baseGetClusterRequest } as GetClusterRequest; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetClusterRequest.$type, GetClusterRequest); + +const baseListClustersRequest: object = { + $type: "yandex.cloud.airflow.v1.ListClustersRequest", + folderId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListClustersRequest = { + $type: "yandex.cloud.airflow.v1.ListClustersRequest" as const, + + encode( + message: ListClustersRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListClustersRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListClustersRequest } as ListClustersRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListClustersRequest { + const message = { ...baseListClustersRequest } as ListClustersRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListClustersRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListClustersRequest { + const message = { ...baseListClustersRequest } as ListClustersRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListClustersRequest.$type, ListClustersRequest); + +const baseListClustersResponse: object = { + $type: "yandex.cloud.airflow.v1.ListClustersResponse", + nextPageToken: "", +}; + +export const ListClustersResponse = { + $type: "yandex.cloud.airflow.v1.ListClustersResponse" as const, + + encode( + message: ListClustersResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.clusters) { + Cluster.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListClustersResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListClustersResponse } as ListClustersResponse; + message.clusters = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusters.push(Cluster.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListClustersResponse { + const message = { ...baseListClustersResponse } as ListClustersResponse; + message.clusters = (object.clusters ?? []).map((e: any) => + Cluster.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListClustersResponse): unknown { + const obj: any = {}; + if (message.clusters) { + obj.clusters = message.clusters.map((e) => + e ? Cluster.toJSON(e) : undefined + ); + } else { + obj.clusters = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListClustersResponse { + const message = { ...baseListClustersResponse } as ListClustersResponse; + message.clusters = + object.clusters?.map((e) => Cluster.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListClustersResponse.$type, ListClustersResponse); + +const baseCreateClusterRequest: object = { + $type: "yandex.cloud.airflow.v1.CreateClusterRequest", + folderId: "", + name: "", + description: "", + deletionProtection: false, + serviceAccountId: "", + adminPassword: "", +}; + +export const CreateClusterRequest = { + $type: "yandex.cloud.airflow.v1.CreateClusterRequest" as const, + + encode( + message: CreateClusterRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateClusterRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.airflow.v1.CreateClusterRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(34).fork() + ).ldelim(); + }); + if (message.config !== undefined) { + ClusterConfig.encode(message.config, writer.uint32(50).fork()).ldelim(); + } + if (message.network !== undefined) { + NetworkConfig.encode(message.network, writer.uint32(58).fork()).ldelim(); + } + if (message.codeSync !== undefined) { + CodeSyncConfig.encode( + message.codeSync, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.deletionProtection === true) { + writer.uint32(72).bool(message.deletionProtection); + } + if (message.serviceAccountId !== "") { + writer.uint32(82).string(message.serviceAccountId); + } + if (message.logging !== undefined) { + LoggingConfig.encode(message.logging, writer.uint32(90).fork()).ldelim(); + } + if (message.adminPassword !== "") { + writer.uint32(98).string(message.adminPassword); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateClusterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateClusterRequest } as CreateClusterRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + const entry4 = CreateClusterRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry4.value !== undefined) { + message.labels[entry4.key] = entry4.value; + } + break; + case 6: + message.config = ClusterConfig.decode(reader, reader.uint32()); + break; + case 7: + message.network = NetworkConfig.decode(reader, reader.uint32()); + break; + case 8: + message.codeSync = CodeSyncConfig.decode(reader, reader.uint32()); + break; + case 9: + message.deletionProtection = reader.bool(); + break; + case 10: + message.serviceAccountId = reader.string(); + break; + case 11: + message.logging = LoggingConfig.decode(reader, reader.uint32()); + break; + case 12: + message.adminPassword = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateClusterRequest { + const message = { ...baseCreateClusterRequest } as CreateClusterRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.config = + object.config !== undefined && object.config !== null + ? ClusterConfig.fromJSON(object.config) + : undefined; + message.network = + object.network !== undefined && object.network !== null + ? NetworkConfig.fromJSON(object.network) + : undefined; + message.codeSync = + object.codeSync !== undefined && object.codeSync !== null + ? CodeSyncConfig.fromJSON(object.codeSync) + : undefined; + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.logging = + object.logging !== undefined && object.logging !== null + ? LoggingConfig.fromJSON(object.logging) + : undefined; + message.adminPassword = + object.adminPassword !== undefined && object.adminPassword !== null + ? String(object.adminPassword) + : ""; + return message; + }, + + toJSON(message: CreateClusterRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.config !== undefined && + (obj.config = message.config + ? ClusterConfig.toJSON(message.config) + : undefined); + message.network !== undefined && + (obj.network = message.network + ? NetworkConfig.toJSON(message.network) + : undefined); + message.codeSync !== undefined && + (obj.codeSync = message.codeSync + ? CodeSyncConfig.toJSON(message.codeSync) + : undefined); + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.logging !== undefined && + (obj.logging = message.logging + ? LoggingConfig.toJSON(message.logging) + : undefined); + message.adminPassword !== undefined && + (obj.adminPassword = message.adminPassword); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateClusterRequest { + const message = { ...baseCreateClusterRequest } as CreateClusterRequest; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.config = + object.config !== undefined && object.config !== null + ? ClusterConfig.fromPartial(object.config) + : undefined; + message.network = + object.network !== undefined && object.network !== null + ? NetworkConfig.fromPartial(object.network) + : undefined; + message.codeSync = + object.codeSync !== undefined && object.codeSync !== null + ? CodeSyncConfig.fromPartial(object.codeSync) + : undefined; + message.deletionProtection = object.deletionProtection ?? false; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.logging = + object.logging !== undefined && object.logging !== null + ? LoggingConfig.fromPartial(object.logging) + : undefined; + message.adminPassword = object.adminPassword ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateClusterRequest.$type, CreateClusterRequest); + +const baseCreateClusterRequest_LabelsEntry: object = { + $type: "yandex.cloud.airflow.v1.CreateClusterRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateClusterRequest_LabelsEntry = { + $type: "yandex.cloud.airflow.v1.CreateClusterRequest.LabelsEntry" as const, + + encode( + message: CreateClusterRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateClusterRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateClusterRequest_LabelsEntry, + } as CreateClusterRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateClusterRequest_LabelsEntry { + const message = { + ...baseCreateClusterRequest_LabelsEntry, + } as CreateClusterRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateClusterRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateClusterRequest_LabelsEntry { + const message = { + ...baseCreateClusterRequest_LabelsEntry, + } as CreateClusterRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateClusterRequest_LabelsEntry.$type, + CreateClusterRequest_LabelsEntry +); + +const baseCreateClusterMetadata: object = { + $type: "yandex.cloud.airflow.v1.CreateClusterMetadata", + clusterId: "", +}; + +export const CreateClusterMetadata = { + $type: "yandex.cloud.airflow.v1.CreateClusterMetadata" as const, + + encode( + message: CreateClusterMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateClusterMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateClusterMetadata } as CreateClusterMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateClusterMetadata { + const message = { ...baseCreateClusterMetadata } as CreateClusterMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: CreateClusterMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateClusterMetadata { + const message = { ...baseCreateClusterMetadata } as CreateClusterMetadata; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateClusterMetadata.$type, CreateClusterMetadata); + +const baseUpdateClusterConfigSpec: object = { + $type: "yandex.cloud.airflow.v1.UpdateClusterConfigSpec", +}; + +export const UpdateClusterConfigSpec = { + $type: "yandex.cloud.airflow.v1.UpdateClusterConfigSpec" as const, + + encode( + message: UpdateClusterConfigSpec, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.airflow !== undefined) { + AirflowConfig.encode(message.airflow, writer.uint32(18).fork()).ldelim(); + } + if (message.webserver !== undefined) { + WebserverConfig.encode( + message.webserver, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.scheduler !== undefined) { + SchedulerConfig.encode( + message.scheduler, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.triggerer !== undefined) { + TriggererConfig.encode( + message.triggerer, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.worker !== undefined) { + WorkerConfig.encode(message.worker, writer.uint32(50).fork()).ldelim(); + } + if (message.dependencies !== undefined) { + Dependencies.encode( + message.dependencies, + writer.uint32(58).fork() + ).ldelim(); + } + if (message.lockbox !== undefined) { + LockboxConfig.encode(message.lockbox, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateClusterConfigSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateClusterConfigSpec, + } as UpdateClusterConfigSpec; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.airflow = AirflowConfig.decode(reader, reader.uint32()); + break; + case 3: + message.webserver = WebserverConfig.decode(reader, reader.uint32()); + break; + case 4: + message.scheduler = SchedulerConfig.decode(reader, reader.uint32()); + break; + case 5: + message.triggerer = TriggererConfig.decode(reader, reader.uint32()); + break; + case 6: + message.worker = WorkerConfig.decode(reader, reader.uint32()); + break; + case 7: + message.dependencies = Dependencies.decode(reader, reader.uint32()); + break; + case 8: + message.lockbox = LockboxConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateClusterConfigSpec { + const message = { + ...baseUpdateClusterConfigSpec, + } as UpdateClusterConfigSpec; + message.airflow = + object.airflow !== undefined && object.airflow !== null + ? AirflowConfig.fromJSON(object.airflow) + : undefined; + message.webserver = + object.webserver !== undefined && object.webserver !== null + ? WebserverConfig.fromJSON(object.webserver) + : undefined; + message.scheduler = + object.scheduler !== undefined && object.scheduler !== null + ? SchedulerConfig.fromJSON(object.scheduler) + : undefined; + message.triggerer = + object.triggerer !== undefined && object.triggerer !== null + ? TriggererConfig.fromJSON(object.triggerer) + : undefined; + message.worker = + object.worker !== undefined && object.worker !== null + ? WorkerConfig.fromJSON(object.worker) + : undefined; + message.dependencies = + object.dependencies !== undefined && object.dependencies !== null + ? Dependencies.fromJSON(object.dependencies) + : undefined; + message.lockbox = + object.lockbox !== undefined && object.lockbox !== null + ? LockboxConfig.fromJSON(object.lockbox) + : undefined; + return message; + }, + + toJSON(message: UpdateClusterConfigSpec): unknown { + const obj: any = {}; + message.airflow !== undefined && + (obj.airflow = message.airflow + ? AirflowConfig.toJSON(message.airflow) + : undefined); + message.webserver !== undefined && + (obj.webserver = message.webserver + ? WebserverConfig.toJSON(message.webserver) + : undefined); + message.scheduler !== undefined && + (obj.scheduler = message.scheduler + ? SchedulerConfig.toJSON(message.scheduler) + : undefined); + message.triggerer !== undefined && + (obj.triggerer = message.triggerer + ? TriggererConfig.toJSON(message.triggerer) + : undefined); + message.worker !== undefined && + (obj.worker = message.worker + ? WorkerConfig.toJSON(message.worker) + : undefined); + message.dependencies !== undefined && + (obj.dependencies = message.dependencies + ? Dependencies.toJSON(message.dependencies) + : undefined); + message.lockbox !== undefined && + (obj.lockbox = message.lockbox + ? LockboxConfig.toJSON(message.lockbox) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateClusterConfigSpec { + const message = { + ...baseUpdateClusterConfigSpec, + } as UpdateClusterConfigSpec; + message.airflow = + object.airflow !== undefined && object.airflow !== null + ? AirflowConfig.fromPartial(object.airflow) + : undefined; + message.webserver = + object.webserver !== undefined && object.webserver !== null + ? WebserverConfig.fromPartial(object.webserver) + : undefined; + message.scheduler = + object.scheduler !== undefined && object.scheduler !== null + ? SchedulerConfig.fromPartial(object.scheduler) + : undefined; + message.triggerer = + object.triggerer !== undefined && object.triggerer !== null + ? TriggererConfig.fromPartial(object.triggerer) + : undefined; + message.worker = + object.worker !== undefined && object.worker !== null + ? WorkerConfig.fromPartial(object.worker) + : undefined; + message.dependencies = + object.dependencies !== undefined && object.dependencies !== null + ? Dependencies.fromPartial(object.dependencies) + : undefined; + message.lockbox = + object.lockbox !== undefined && object.lockbox !== null + ? LockboxConfig.fromPartial(object.lockbox) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UpdateClusterConfigSpec.$type, UpdateClusterConfigSpec); + +const baseUpdateNetworkConfigSpec: object = { + $type: "yandex.cloud.airflow.v1.UpdateNetworkConfigSpec", + securityGroupIds: "", +}; + +export const UpdateNetworkConfigSpec = { + $type: "yandex.cloud.airflow.v1.UpdateNetworkConfigSpec" as const, + + encode( + message: UpdateNetworkConfigSpec, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.securityGroupIds) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateNetworkConfigSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateNetworkConfigSpec, + } as UpdateNetworkConfigSpec; + message.securityGroupIds = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.securityGroupIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateNetworkConfigSpec { + const message = { + ...baseUpdateNetworkConfigSpec, + } as UpdateNetworkConfigSpec; + message.securityGroupIds = (object.securityGroupIds ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: UpdateNetworkConfigSpec): unknown { + const obj: any = {}; + if (message.securityGroupIds) { + obj.securityGroupIds = message.securityGroupIds.map((e) => e); + } else { + obj.securityGroupIds = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateNetworkConfigSpec { + const message = { + ...baseUpdateNetworkConfigSpec, + } as UpdateNetworkConfigSpec; + message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(UpdateNetworkConfigSpec.$type, UpdateNetworkConfigSpec); + +const baseUpdateClusterRequest: object = { + $type: "yandex.cloud.airflow.v1.UpdateClusterRequest", + clusterId: "", + name: "", + description: "", + deletionProtection: false, + serviceAccountId: "", +}; + +export const UpdateClusterRequest = { + $type: "yandex.cloud.airflow.v1.UpdateClusterRequest" as const, + + encode( + message: UpdateClusterRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateClusterRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.airflow.v1.UpdateClusterRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(42).fork() + ).ldelim(); + }); + if (message.configSpec !== undefined) { + UpdateClusterConfigSpec.encode( + message.configSpec, + writer.uint32(50).fork() + ).ldelim(); + } + if (message.codeSync !== undefined) { + CodeSyncConfig.encode( + message.codeSync, + writer.uint32(58).fork() + ).ldelim(); + } + if (message.networkSpec !== undefined) { + UpdateNetworkConfigSpec.encode( + message.networkSpec, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.deletionProtection === true) { + writer.uint32(72).bool(message.deletionProtection); + } + if (message.serviceAccountId !== "") { + writer.uint32(82).string(message.serviceAccountId); + } + if (message.logging !== undefined) { + LoggingConfig.encode(message.logging, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateClusterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateClusterRequest } as UpdateClusterRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + const entry5 = UpdateClusterRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry5.value !== undefined) { + message.labels[entry5.key] = entry5.value; + } + break; + case 6: + message.configSpec = UpdateClusterConfigSpec.decode( + reader, + reader.uint32() + ); + break; + case 7: + message.codeSync = CodeSyncConfig.decode(reader, reader.uint32()); + break; + case 8: + message.networkSpec = UpdateNetworkConfigSpec.decode( + reader, + reader.uint32() + ); + break; + case 9: + message.deletionProtection = reader.bool(); + break; + case 10: + message.serviceAccountId = reader.string(); + break; + case 11: + message.logging = LoggingConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateClusterRequest { + const message = { ...baseUpdateClusterRequest } as UpdateClusterRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.configSpec = + object.configSpec !== undefined && object.configSpec !== null + ? UpdateClusterConfigSpec.fromJSON(object.configSpec) + : undefined; + message.codeSync = + object.codeSync !== undefined && object.codeSync !== null + ? CodeSyncConfig.fromJSON(object.codeSync) + : undefined; + message.networkSpec = + object.networkSpec !== undefined && object.networkSpec !== null + ? UpdateNetworkConfigSpec.fromJSON(object.networkSpec) + : undefined; + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.logging = + object.logging !== undefined && object.logging !== null + ? LoggingConfig.fromJSON(object.logging) + : undefined; + return message; + }, + + toJSON(message: UpdateClusterRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.configSpec !== undefined && + (obj.configSpec = message.configSpec + ? UpdateClusterConfigSpec.toJSON(message.configSpec) + : undefined); + message.codeSync !== undefined && + (obj.codeSync = message.codeSync + ? CodeSyncConfig.toJSON(message.codeSync) + : undefined); + message.networkSpec !== undefined && + (obj.networkSpec = message.networkSpec + ? UpdateNetworkConfigSpec.toJSON(message.networkSpec) + : undefined); + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.logging !== undefined && + (obj.logging = message.logging + ? LoggingConfig.toJSON(message.logging) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateClusterRequest { + const message = { ...baseUpdateClusterRequest } as UpdateClusterRequest; + message.clusterId = object.clusterId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.configSpec = + object.configSpec !== undefined && object.configSpec !== null + ? UpdateClusterConfigSpec.fromPartial(object.configSpec) + : undefined; + message.codeSync = + object.codeSync !== undefined && object.codeSync !== null + ? CodeSyncConfig.fromPartial(object.codeSync) + : undefined; + message.networkSpec = + object.networkSpec !== undefined && object.networkSpec !== null + ? UpdateNetworkConfigSpec.fromPartial(object.networkSpec) + : undefined; + message.deletionProtection = object.deletionProtection ?? false; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.logging = + object.logging !== undefined && object.logging !== null + ? LoggingConfig.fromPartial(object.logging) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UpdateClusterRequest.$type, UpdateClusterRequest); + +const baseUpdateClusterRequest_LabelsEntry: object = { + $type: "yandex.cloud.airflow.v1.UpdateClusterRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateClusterRequest_LabelsEntry = { + $type: "yandex.cloud.airflow.v1.UpdateClusterRequest.LabelsEntry" as const, + + encode( + message: UpdateClusterRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateClusterRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateClusterRequest_LabelsEntry, + } as UpdateClusterRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateClusterRequest_LabelsEntry { + const message = { + ...baseUpdateClusterRequest_LabelsEntry, + } as UpdateClusterRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateClusterRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateClusterRequest_LabelsEntry { + const message = { + ...baseUpdateClusterRequest_LabelsEntry, + } as UpdateClusterRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateClusterRequest_LabelsEntry.$type, + UpdateClusterRequest_LabelsEntry +); + +const baseUpdateClusterMetadata: object = { + $type: "yandex.cloud.airflow.v1.UpdateClusterMetadata", + clusterId: "", +}; + +export const UpdateClusterMetadata = { + $type: "yandex.cloud.airflow.v1.UpdateClusterMetadata" as const, + + encode( + message: UpdateClusterMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateClusterMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateClusterMetadata } as UpdateClusterMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateClusterMetadata { + const message = { ...baseUpdateClusterMetadata } as UpdateClusterMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: UpdateClusterMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateClusterMetadata { + const message = { ...baseUpdateClusterMetadata } as UpdateClusterMetadata; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateClusterMetadata.$type, UpdateClusterMetadata); + +const baseDeleteClusterRequest: object = { + $type: "yandex.cloud.airflow.v1.DeleteClusterRequest", + clusterId: "", +}; + +export const DeleteClusterRequest = { + $type: "yandex.cloud.airflow.v1.DeleteClusterRequest" as const, + + encode( + message: DeleteClusterRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteClusterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteClusterRequest } as DeleteClusterRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteClusterRequest { + const message = { ...baseDeleteClusterRequest } as DeleteClusterRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: DeleteClusterRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteClusterRequest { + const message = { ...baseDeleteClusterRequest } as DeleteClusterRequest; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteClusterRequest.$type, DeleteClusterRequest); + +const baseDeleteClusterMetadata: object = { + $type: "yandex.cloud.airflow.v1.DeleteClusterMetadata", + clusterId: "", +}; + +export const DeleteClusterMetadata = { + $type: "yandex.cloud.airflow.v1.DeleteClusterMetadata" as const, + + encode( + message: DeleteClusterMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteClusterMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteClusterMetadata } as DeleteClusterMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteClusterMetadata { + const message = { ...baseDeleteClusterMetadata } as DeleteClusterMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: DeleteClusterMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteClusterMetadata { + const message = { ...baseDeleteClusterMetadata } as DeleteClusterMetadata; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteClusterMetadata.$type, DeleteClusterMetadata); + +const baseStartClusterRequest: object = { + $type: "yandex.cloud.airflow.v1.StartClusterRequest", + clusterId: "", +}; + +export const StartClusterRequest = { + $type: "yandex.cloud.airflow.v1.StartClusterRequest" as const, + + encode( + message: StartClusterRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StartClusterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStartClusterRequest } as StartClusterRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StartClusterRequest { + const message = { ...baseStartClusterRequest } as StartClusterRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: StartClusterRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): StartClusterRequest { + const message = { ...baseStartClusterRequest } as StartClusterRequest; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StartClusterRequest.$type, StartClusterRequest); + +const baseStartClusterMetadata: object = { + $type: "yandex.cloud.airflow.v1.StartClusterMetadata", + clusterId: "", +}; + +export const StartClusterMetadata = { + $type: "yandex.cloud.airflow.v1.StartClusterMetadata" as const, + + encode( + message: StartClusterMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): StartClusterMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStartClusterMetadata } as StartClusterMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StartClusterMetadata { + const message = { ...baseStartClusterMetadata } as StartClusterMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: StartClusterMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): StartClusterMetadata { + const message = { ...baseStartClusterMetadata } as StartClusterMetadata; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StartClusterMetadata.$type, StartClusterMetadata); + +const baseStopClusterRequest: object = { + $type: "yandex.cloud.airflow.v1.StopClusterRequest", + clusterId: "", +}; + +export const StopClusterRequest = { + $type: "yandex.cloud.airflow.v1.StopClusterRequest" as const, + + encode( + message: StopClusterRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StopClusterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStopClusterRequest } as StopClusterRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StopClusterRequest { + const message = { ...baseStopClusterRequest } as StopClusterRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: StopClusterRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): StopClusterRequest { + const message = { ...baseStopClusterRequest } as StopClusterRequest; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StopClusterRequest.$type, StopClusterRequest); + +const baseStopClusterMetadata: object = { + $type: "yandex.cloud.airflow.v1.StopClusterMetadata", + clusterId: "", +}; + +export const StopClusterMetadata = { + $type: "yandex.cloud.airflow.v1.StopClusterMetadata" as const, + + encode( + message: StopClusterMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StopClusterMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStopClusterMetadata } as StopClusterMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StopClusterMetadata { + const message = { ...baseStopClusterMetadata } as StopClusterMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: StopClusterMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): StopClusterMetadata { + const message = { ...baseStopClusterMetadata } as StopClusterMetadata; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StopClusterMetadata.$type, StopClusterMetadata); + +const baseListClusterOperationsRequest: object = { + $type: "yandex.cloud.airflow.v1.ListClusterOperationsRequest", + clusterId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListClusterOperationsRequest = { + $type: "yandex.cloud.airflow.v1.ListClusterOperationsRequest" as const, + + encode( + message: ListClusterOperationsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListClusterOperationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListClusterOperationsRequest, + } as ListClusterOperationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListClusterOperationsRequest { + const message = { + ...baseListClusterOperationsRequest, + } as ListClusterOperationsRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListClusterOperationsRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListClusterOperationsRequest { + const message = { + ...baseListClusterOperationsRequest, + } as ListClusterOperationsRequest; + message.clusterId = object.clusterId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListClusterOperationsRequest.$type, + ListClusterOperationsRequest +); + +const baseListClusterOperationsResponse: object = { + $type: "yandex.cloud.airflow.v1.ListClusterOperationsResponse", + nextPageToken: "", +}; + +export const ListClusterOperationsResponse = { + $type: "yandex.cloud.airflow.v1.ListClusterOperationsResponse" as const, + + encode( + message: ListClusterOperationsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.operations) { + Operation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListClusterOperationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListClusterOperationsResponse, + } as ListClusterOperationsResponse; + message.operations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operations.push(Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListClusterOperationsResponse { + const message = { + ...baseListClusterOperationsResponse, + } as ListClusterOperationsResponse; + message.operations = (object.operations ?? []).map((e: any) => + Operation.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListClusterOperationsResponse): unknown { + const obj: any = {}; + if (message.operations) { + obj.operations = message.operations.map((e) => + e ? Operation.toJSON(e) : undefined + ); + } else { + obj.operations = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListClusterOperationsResponse { + const message = { + ...baseListClusterOperationsResponse, + } as ListClusterOperationsResponse; + message.operations = + object.operations?.map((e) => Operation.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListClusterOperationsResponse.$type, + ListClusterOperationsResponse +); + +/** A set of methods for managing Apache Airflow Cluster resources. */ +export const ClusterServiceService = { + /** Returns the specified Apache Airflow Cluster resource. */ + get: { + path: "/yandex.cloud.airflow.v1.ClusterService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetClusterRequest) => + Buffer.from(GetClusterRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetClusterRequest.decode(value), + responseSerialize: (value: Cluster) => + Buffer.from(Cluster.encode(value).finish()), + responseDeserialize: (value: Buffer) => Cluster.decode(value), + }, + /** Retrieves a list of Apache Airflow Cluster resources. */ + list: { + path: "/yandex.cloud.airflow.v1.ClusterService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListClustersRequest) => + Buffer.from(ListClustersRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListClustersRequest.decode(value), + responseSerialize: (value: ListClustersResponse) => + Buffer.from(ListClustersResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListClustersResponse.decode(value), + }, + /** Creates an Apache Airflow cluster. */ + create: { + path: "/yandex.cloud.airflow.v1.ClusterService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateClusterRequest) => + Buffer.from(CreateClusterRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateClusterRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates the specified Apache Airflow cluster. */ + update: { + path: "/yandex.cloud.airflow.v1.ClusterService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateClusterRequest) => + Buffer.from(UpdateClusterRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateClusterRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes the specified Apache Airflow cluster. */ + delete: { + path: "/yandex.cloud.airflow.v1.ClusterService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteClusterRequest) => + Buffer.from(DeleteClusterRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteClusterRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Starts the specified Apache Airflow cluster. */ + start: { + path: "/yandex.cloud.airflow.v1.ClusterService/Start", + requestStream: false, + responseStream: false, + requestSerialize: (value: StartClusterRequest) => + Buffer.from(StartClusterRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => StartClusterRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Stops the specified Apache Airflow cluster. */ + stop: { + path: "/yandex.cloud.airflow.v1.ClusterService/Stop", + requestStream: false, + responseStream: false, + requestSerialize: (value: StopClusterRequest) => + Buffer.from(StopClusterRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => StopClusterRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Retrieves the list of Operation resources for the specified cluster. */ + listOperations: { + path: "/yandex.cloud.airflow.v1.ClusterService/ListOperations", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListClusterOperationsRequest) => + Buffer.from(ListClusterOperationsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListClusterOperationsRequest.decode(value), + responseSerialize: (value: ListClusterOperationsResponse) => + Buffer.from(ListClusterOperationsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListClusterOperationsResponse.decode(value), + }, +} as const; + +export interface ClusterServiceServer extends UntypedServiceImplementation { + /** Returns the specified Apache Airflow Cluster resource. */ + get: handleUnaryCall; + /** Retrieves a list of Apache Airflow Cluster resources. */ + list: handleUnaryCall; + /** Creates an Apache Airflow cluster. */ + create: handleUnaryCall; + /** Updates the specified Apache Airflow cluster. */ + update: handleUnaryCall; + /** Deletes the specified Apache Airflow cluster. */ + delete: handleUnaryCall; + /** Starts the specified Apache Airflow cluster. */ + start: handleUnaryCall; + /** Stops the specified Apache Airflow cluster. */ + stop: handleUnaryCall; + /** Retrieves the list of Operation resources for the specified cluster. */ + listOperations: handleUnaryCall< + ListClusterOperationsRequest, + ListClusterOperationsResponse + >; +} + +export interface ClusterServiceClient extends Client { + /** Returns the specified Apache Airflow Cluster resource. */ + get( + request: GetClusterRequest, + callback: (error: ServiceError | null, response: Cluster) => void + ): ClientUnaryCall; + get( + request: GetClusterRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Cluster) => void + ): ClientUnaryCall; + get( + request: GetClusterRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Cluster) => void + ): ClientUnaryCall; + /** Retrieves a list of Apache Airflow Cluster resources. */ + list( + request: ListClustersRequest, + callback: ( + error: ServiceError | null, + response: ListClustersResponse + ) => void + ): ClientUnaryCall; + list( + request: ListClustersRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListClustersResponse + ) => void + ): ClientUnaryCall; + list( + request: ListClustersRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListClustersResponse + ) => void + ): ClientUnaryCall; + /** Creates an Apache Airflow cluster. */ + create( + request: CreateClusterRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateClusterRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateClusterRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates the specified Apache Airflow cluster. */ + update( + request: UpdateClusterRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateClusterRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateClusterRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes the specified Apache Airflow cluster. */ + delete( + request: DeleteClusterRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteClusterRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteClusterRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Starts the specified Apache Airflow cluster. */ + start( + request: StartClusterRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + start( + request: StartClusterRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + start( + request: StartClusterRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Stops the specified Apache Airflow cluster. */ + stop( + request: StopClusterRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + stop( + request: StopClusterRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + stop( + request: StopClusterRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Retrieves the list of Operation resources for the specified cluster. */ + listOperations( + request: ListClusterOperationsRequest, + callback: ( + error: ServiceError | null, + response: ListClusterOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListClusterOperationsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListClusterOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListClusterOperationsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListClusterOperationsResponse + ) => void + ): ClientUnaryCall; +} + +export const ClusterServiceClient = makeGenericClientConstructor( + ClusterServiceService, + "yandex.cloud.airflow.v1.ClusterService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ClusterServiceClient; + service: typeof ClusterServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/airflow/v1/common.ts b/src/generated/yandex/cloud/airflow/v1/common.ts new file mode 100644 index 00000000..10a40260 --- /dev/null +++ b/src/generated/yandex/cloud/airflow/v1/common.ts @@ -0,0 +1,155 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.airflow.v1"; + +export enum Health { + /** HEALTH_UNKNOWN - Cluster is in unknown state (we have no data). */ + HEALTH_UNKNOWN = 0, + /** ALIVE - Cluster is alive and well. */ + ALIVE = 1, + /** DEAD - Cluster is inoperable (it cannot perform any of its essential functions). */ + DEAD = 2, + /** DEGRADED - Cluster is partially alive (it can perform some of its essential functions). */ + DEGRADED = 3, + UNRECOGNIZED = -1, +} + +export function healthFromJSON(object: any): Health { + switch (object) { + case 0: + case "HEALTH_UNKNOWN": + return Health.HEALTH_UNKNOWN; + case 1: + case "ALIVE": + return Health.ALIVE; + case 2: + case "DEAD": + return Health.DEAD; + case 3: + case "DEGRADED": + return Health.DEGRADED; + case -1: + case "UNRECOGNIZED": + default: + return Health.UNRECOGNIZED; + } +} + +export function healthToJSON(object: Health): string { + switch (object) { + case Health.HEALTH_UNKNOWN: + return "HEALTH_UNKNOWN"; + case Health.ALIVE: + return "ALIVE"; + case Health.DEAD: + return "DEAD"; + case Health.DEGRADED: + return "DEGRADED"; + default: + return "UNKNOWN"; + } +} + +export interface Resources { + $type: "yandex.cloud.airflow.v1.Resources"; + /** ID of the preset for computational resources available to an instance (CPU, memory etc.). */ + resourcePresetId: string; +} + +const baseResources: object = { + $type: "yandex.cloud.airflow.v1.Resources", + resourcePresetId: "", +}; + +export const Resources = { + $type: "yandex.cloud.airflow.v1.Resources" as const, + + encode( + message: Resources, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resourcePresetId !== "") { + writer.uint32(26).string(message.resourcePresetId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Resources { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResources } as Resources; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.resourcePresetId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Resources { + const message = { ...baseResources } as Resources; + message.resourcePresetId = + object.resourcePresetId !== undefined && object.resourcePresetId !== null + ? String(object.resourcePresetId) + : ""; + return message; + }, + + toJSON(message: Resources): unknown { + const obj: any = {}; + message.resourcePresetId !== undefined && + (obj.resourcePresetId = message.resourcePresetId); + return obj; + }, + + fromPartial, I>>( + object: I + ): Resources { + const message = { ...baseResources } as Resources; + message.resourcePresetId = object.resourcePresetId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Resources.$type, Resources); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/apploadbalancer/index.ts b/src/generated/yandex/cloud/apploadbalancer/index.ts index 2f8de2fe..3877c391 100644 --- a/src/generated/yandex/cloud/apploadbalancer/index.ts +++ b/src/generated/yandex/cloud/apploadbalancer/index.ts @@ -1,13 +1,13 @@ -export * as backend_group from './v1/backend_group' -export * as backend_group_service from './v1/backend_group_service' -export * as http_router from './v1/http_router' -export * as http_router_service from './v1/http_router_service' -export * as load_balancer from './v1/load_balancer' -export * as load_balancer_service from './v1/load_balancer_service' -export * as logging from './v1/logging' -export * as payload from './v1/payload' -export * as target_group from './v1/target_group' -export * as target_group_service from './v1/target_group_service' -export * as tls from './v1/tls' -export * as virtual_host from './v1/virtual_host' -export * as virtual_host_service from './v1/virtual_host_service' \ No newline at end of file +export * as v1_backend_group from './v1/backend_group' +export * as v1_backend_group_service from './v1/backend_group_service' +export * as v1_http_router from './v1/http_router' +export * as v1_http_router_service from './v1/http_router_service' +export * as v1_load_balancer from './v1/load_balancer' +export * as v1_load_balancer_service from './v1/load_balancer_service' +export * as v1_logging from './v1/logging' +export * as v1_payload from './v1/payload' +export * as v1_target_group from './v1/target_group' +export * as v1_target_group_service from './v1/target_group_service' +export * as v1_tls from './v1/tls' +export * as v1_virtual_host from './v1/virtual_host' +export * as v1_virtual_host_service from './v1/virtual_host_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/apploadbalancer/v1/load_balancer.ts b/src/generated/yandex/cloud/apploadbalancer/v1/load_balancer.ts index 2deca4f3..f719d5d4 100644 --- a/src/generated/yandex/cloud/apploadbalancer/v1/load_balancer.ts +++ b/src/generated/yandex/cloud/apploadbalancer/v1/load_balancer.ts @@ -157,7 +157,7 @@ export interface Address { /** * Internal IPv4 endpoint address. * - * To enable the use of listeners with internal addresses, [contact support](https://console.cloud.yandex.ru/support). + * To enable the use of listeners with internal addresses, [contact support](/docs/support/overview#response-time). */ internalIpv4Address?: InternalIpv4Address | undefined; /** Public IPv6 endpoint address. */ diff --git a/src/generated/yandex/cloud/apploadbalancer/v1/load_balancer_service.ts b/src/generated/yandex/cloud/apploadbalancer/v1/load_balancer_service.ts index bc74c3e4..01a795fc 100644 --- a/src/generated/yandex/cloud/apploadbalancer/v1/load_balancer_service.ts +++ b/src/generated/yandex/cloud/apploadbalancer/v1/load_balancer_service.ts @@ -363,7 +363,7 @@ export interface AddressSpec { /** * Internal IPv4 endpoint address. * - * To enable the use of listeners with internal addresses, [contact support](https://console.cloud.yandex.ru/support). + * To enable the use of listeners with internal addresses, [contact support](/docs/support/overview#response-time). */ internalIpv4AddressSpec?: InternalIpv4AddressSpec | undefined; /** Public IPv6 endpoint address. */ diff --git a/src/generated/yandex/cloud/audittrails/index.ts b/src/generated/yandex/cloud/audittrails/index.ts new file mode 100644 index 00000000..7fece359 --- /dev/null +++ b/src/generated/yandex/cloud/audittrails/index.ts @@ -0,0 +1,2 @@ +export * as v1_trail from './v1/trail' +export * as v1_trail_service from './v1/trail_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/audittrails/v1/trail.ts b/src/generated/yandex/cloud/audittrails/v1/trail.ts new file mode 100644 index 00000000..4c33ba07 --- /dev/null +++ b/src/generated/yandex/cloud/audittrails/v1/trail.ts @@ -0,0 +1,2297 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.audittrails.v1"; + +/** Trail describes the filtering and destination configuration of the process of sending Audit events */ +export interface Trail { + $type: "yandex.cloud.audittrails.v1.Trail"; + /** ID of the trail */ + id: string; + /** ID of the folder that the trail belongs to */ + folderId: string; + /** The timestamp for the creation operation */ + createdAt?: Date; + /** The timestamp of the last update operation */ + updatedAt?: Date; + /** Name of the trail */ + name: string; + /** Description of the trail */ + description: string; + /** Custom labels of the trail as `key:value` pairs. Maximum 64 per key */ + labels: { [key: string]: string }; + /** Destination configuration of the trail */ + destination?: Trail_Destination; + /** Service account ID of the trail */ + serviceAccountId: string; + /** Status of the trail */ + status: Trail_Status; + /** + * Filtering configuration of the trail + * deprecated: use filtering_policy instead + * + * @deprecated + */ + filter?: Trail_Filter; + /** Current error message of the trail. Empty in case if the trail is active */ + statusErrorMessage: string; + /** ID of the cloud that the trail belongs to */ + cloudId: string; + /** + * Event filtering policy + * Describes which groups of events will be sent and which resources will be monitored + */ + filteringPolicy?: Trail_FilteringPolicy; +} + +export enum Trail_Status { + STATUS_UNSPECIFIED = 0, + /** ACTIVE - The trail is active and Audit events are processed */ + ACTIVE = 1, + /** ERROR - The trail configuration has issues that are preventing Audit Trails from delivering events */ + ERROR = 2, + /** DELETED - The trail is being deleted */ + DELETED = 3, + UNRECOGNIZED = -1, +} + +export function trail_StatusFromJSON(object: any): Trail_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return Trail_Status.STATUS_UNSPECIFIED; + case 1: + case "ACTIVE": + return Trail_Status.ACTIVE; + case 2: + case "ERROR": + return Trail_Status.ERROR; + case 3: + case "DELETED": + return Trail_Status.DELETED; + case -1: + case "UNRECOGNIZED": + default: + return Trail_Status.UNRECOGNIZED; + } +} + +export function trail_StatusToJSON(object: Trail_Status): string { + switch (object) { + case Trail_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case Trail_Status.ACTIVE: + return "ACTIVE"; + case Trail_Status.ERROR: + return "ERROR"; + case Trail_Status.DELETED: + return "DELETED"; + default: + return "UNKNOWN"; + } +} + +export enum Trail_EventCategoryFilter { + EVENT_CATEGORY_FILTER_UNSPECIFIED = 0, + /** CONTROL_PLANE - The events that are generated during the interaction with the service's resources */ + CONTROL_PLANE = 1, + /** DATA_PLANE - Events that are generated during interaction with data within the service's resources */ + DATA_PLANE = 2, + UNRECOGNIZED = -1, +} + +export function trail_EventCategoryFilterFromJSON( + object: any +): Trail_EventCategoryFilter { + switch (object) { + case 0: + case "EVENT_CATEGORY_FILTER_UNSPECIFIED": + return Trail_EventCategoryFilter.EVENT_CATEGORY_FILTER_UNSPECIFIED; + case 1: + case "CONTROL_PLANE": + return Trail_EventCategoryFilter.CONTROL_PLANE; + case 2: + case "DATA_PLANE": + return Trail_EventCategoryFilter.DATA_PLANE; + case -1: + case "UNRECOGNIZED": + default: + return Trail_EventCategoryFilter.UNRECOGNIZED; + } +} + +export function trail_EventCategoryFilterToJSON( + object: Trail_EventCategoryFilter +): string { + switch (object) { + case Trail_EventCategoryFilter.EVENT_CATEGORY_FILTER_UNSPECIFIED: + return "EVENT_CATEGORY_FILTER_UNSPECIFIED"; + case Trail_EventCategoryFilter.CONTROL_PLANE: + return "CONTROL_PLANE"; + case Trail_EventCategoryFilter.DATA_PLANE: + return "DATA_PLANE"; + default: + return "UNKNOWN"; + } +} + +export enum Trail_EventAccessTypeFilter { + EVENT_ACCESS_TYPE_FILTER_UNSPECIFIED = 0, + /** WRITE - Events for operations that do perform some modification */ + WRITE = 1, + /** READ - Events for operations that do not perform any modifications */ + READ = 2, + UNRECOGNIZED = -1, +} + +export function trail_EventAccessTypeFilterFromJSON( + object: any +): Trail_EventAccessTypeFilter { + switch (object) { + case 0: + case "EVENT_ACCESS_TYPE_FILTER_UNSPECIFIED": + return Trail_EventAccessTypeFilter.EVENT_ACCESS_TYPE_FILTER_UNSPECIFIED; + case 1: + case "WRITE": + return Trail_EventAccessTypeFilter.WRITE; + case 2: + case "READ": + return Trail_EventAccessTypeFilter.READ; + case -1: + case "UNRECOGNIZED": + default: + return Trail_EventAccessTypeFilter.UNRECOGNIZED; + } +} + +export function trail_EventAccessTypeFilterToJSON( + object: Trail_EventAccessTypeFilter +): string { + switch (object) { + case Trail_EventAccessTypeFilter.EVENT_ACCESS_TYPE_FILTER_UNSPECIFIED: + return "EVENT_ACCESS_TYPE_FILTER_UNSPECIFIED"; + case Trail_EventAccessTypeFilter.WRITE: + return "WRITE"; + case Trail_EventAccessTypeFilter.READ: + return "READ"; + default: + return "UNKNOWN"; + } +} + +export interface Trail_LabelsEntry { + $type: "yandex.cloud.audittrails.v1.Trail.LabelsEntry"; + key: string; + value: string; +} + +export interface Trail_Destination { + $type: "yandex.cloud.audittrails.v1.Trail.Destination"; + /** + * Configuration for event delivery to Object Storage + * + * Uploaded objects will have prefix / by default + */ + objectStorage?: Trail_ObjectStorage | undefined; + /** Configuration for event delivery to Cloud Logging */ + cloudLogging?: Trail_CloudLogging | undefined; + /** Configuration for event delivery to YDS */ + dataStream?: Trail_DataStream | undefined; +} + +export interface Trail_ObjectStorage { + $type: "yandex.cloud.audittrails.v1.Trail.ObjectStorage"; + /** Name of the destination bucket */ + bucketId: string; + /** + * Prefix for exported objects. Optional + * If specified, uploaded objects will have prefix // + */ + objectPrefix: string; +} + +export interface Trail_CloudLogging { + $type: "yandex.cloud.audittrails.v1.Trail.CloudLogging"; + /** ID of the Cloud Logging destination group */ + logGroupId: string | undefined; +} + +export interface Trail_DataStream { + $type: "yandex.cloud.audittrails.v1.Trail.DataStream"; + /** ID of the database hosting the destination YDS */ + databaseId: string; + /** Name of the destination YDS */ + streamName: string; +} + +export interface Trail_Filter { + $type: "yandex.cloud.audittrails.v1.Trail.Filter"; + /** + * Configuration of default events gathering for the trail + * If not specified, default events won't be gathered for the trail + */ + pathFilter?: Trail_PathFilter; + /** Configuration of additional events gathering from specific services */ + eventFilter?: Trail_EventFilter; +} + +export interface Trail_PathFilter { + $type: "yandex.cloud.audittrails.v1.Trail.PathFilter"; + /** + * Root element of the resource path filter for the trail + * Resource described in that filter node must contain the trail itself + */ + root?: Trail_PathFilterElement; +} + +export interface Trail_PathFilterElement { + $type: "yandex.cloud.audittrails.v1.Trail.PathFilterElement"; + /** Filter element with ANY type. If used, configures the trail to gather any events from the resource */ + anyFilter?: Trail_PathFilterElementAny | undefined; + /** Filter element with SOME type. If used, configures the trail to gather some of the events from the resource */ + someFilter?: Trail_PathFilterElementSome | undefined; +} + +export interface Trail_PathFilterElementAny { + $type: "yandex.cloud.audittrails.v1.Trail.PathFilterElementAny"; + /** Resource definition */ + resource?: Trail_Resource; +} + +export interface Trail_PathFilterElementSome { + $type: "yandex.cloud.audittrails.v1.Trail.PathFilterElementSome"; + /** Definition of the resource that contains nested resources */ + resource?: Trail_Resource; + /** Filters for the resources contained in the parent resource */ + filters: Trail_PathFilterElement[]; +} + +export interface Trail_Resource { + $type: "yandex.cloud.audittrails.v1.Trail.Resource"; + /** ID of the resource */ + id: string; + /** Type of the resource */ + type: string; +} + +export interface Trail_EventFilter { + $type: "yandex.cloud.audittrails.v1.Trail.EventFilter"; + /** List of filters for services */ + filters: Trail_EventFilterElement[]; +} + +export interface Trail_EventFilterElement { + $type: "yandex.cloud.audittrails.v1.Trail.EventFilterElement"; + /** Service ID of the gathered events */ + service: string; + /** List of the event categories gathered for a specified service */ + categories: Trail_EventFilterElementCategory[]; + /** Resource path filter for a specified service */ + pathFilter?: Trail_PathFilter; +} + +export interface Trail_EventFilterElementCategory { + $type: "yandex.cloud.audittrails.v1.Trail.EventFilterElementCategory"; + /** Plane of the gathered category */ + plane: Trail_EventCategoryFilter; + /** Type of the gathered category */ + type: Trail_EventAccessTypeFilter; +} + +/** Policy for gathering data events */ +export interface Trail_DataEventsFiltering { + $type: "yandex.cloud.audittrails.v1.Trail.DataEventsFiltering"; + /** Name of the service whose events will be delivered */ + service: string; + /** + * Explicitly included events of specified service + * New events of the service won't be delivered by default + */ + includedEvents?: Trail_EventTypes | undefined; + /** + * Explicitly excluded events of specified service + * New events of the service will be delivered by default + */ + excludedEvents?: Trail_EventTypes | undefined; + /** A list of resources which will be monitored by the trail */ + resourceScopes: Trail_Resource[]; +} + +/** Policy with explicitly specified event group */ +export interface Trail_EventTypes { + $type: "yandex.cloud.audittrails.v1.Trail.EventTypes"; + eventTypes: string[]; +} + +/** Policy for gathering management events */ +export interface Trail_ManagementEventsFiltering { + $type: "yandex.cloud.audittrails.v1.Trail.ManagementEventsFiltering"; + /** A list of resources which will be monitored by the trail */ + resourceScopes: Trail_Resource[]; +} + +/** + * Combination of policies describing event filtering process of the trail + * At least one filed must be filled + */ +export interface Trail_FilteringPolicy { + $type: "yandex.cloud.audittrails.v1.Trail.FilteringPolicy"; + /** Singular filter describing gathering management events */ + managementEventsFilter?: Trail_ManagementEventsFiltering; + /** List of filters describing gathering data events */ + dataEventsFilters: Trail_DataEventsFiltering[]; +} + +const baseTrail: object = { + $type: "yandex.cloud.audittrails.v1.Trail", + id: "", + folderId: "", + name: "", + description: "", + serviceAccountId: "", + status: 0, + statusErrorMessage: "", + cloudId: "", +}; + +export const Trail = { + $type: "yandex.cloud.audittrails.v1.Trail" as const, + + encode(message: Trail, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(26).fork() + ).ldelim(); + } + if (message.updatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.updatedAt), + writer.uint32(34).fork() + ).ldelim(); + } + if (message.name !== "") { + writer.uint32(42).string(message.name); + } + if (message.description !== "") { + writer.uint32(50).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + Trail_LabelsEntry.encode( + { + $type: "yandex.cloud.audittrails.v1.Trail.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(58).fork() + ).ldelim(); + }); + if (message.destination !== undefined) { + Trail_Destination.encode( + message.destination, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.serviceAccountId !== "") { + writer.uint32(74).string(message.serviceAccountId); + } + if (message.status !== 0) { + writer.uint32(80).int32(message.status); + } + if (message.filter !== undefined) { + Trail_Filter.encode(message.filter, writer.uint32(90).fork()).ldelim(); + } + if (message.statusErrorMessage !== "") { + writer.uint32(98).string(message.statusErrorMessage); + } + if (message.cloudId !== "") { + writer.uint32(114).string(message.cloudId); + } + if (message.filteringPolicy !== undefined) { + Trail_FilteringPolicy.encode( + message.filteringPolicy, + writer.uint32(122).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Trail { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTrail } as Trail; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 4: + message.updatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 5: + message.name = reader.string(); + break; + case 6: + message.description = reader.string(); + break; + case 7: + const entry7 = Trail_LabelsEntry.decode(reader, reader.uint32()); + if (entry7.value !== undefined) { + message.labels[entry7.key] = entry7.value; + } + break; + case 8: + message.destination = Trail_Destination.decode( + reader, + reader.uint32() + ); + break; + case 9: + message.serviceAccountId = reader.string(); + break; + case 10: + message.status = reader.int32() as any; + break; + case 11: + message.filter = Trail_Filter.decode(reader, reader.uint32()); + break; + case 12: + message.statusErrorMessage = reader.string(); + break; + case 14: + message.cloudId = reader.string(); + break; + case 15: + message.filteringPolicy = Trail_FilteringPolicy.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail { + const message = { ...baseTrail } as Trail; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.updatedAt = + object.updatedAt !== undefined && object.updatedAt !== null + ? fromJsonTimestamp(object.updatedAt) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.destination = + object.destination !== undefined && object.destination !== null + ? Trail_Destination.fromJSON(object.destination) + : undefined; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.status = + object.status !== undefined && object.status !== null + ? trail_StatusFromJSON(object.status) + : 0; + message.filter = + object.filter !== undefined && object.filter !== null + ? Trail_Filter.fromJSON(object.filter) + : undefined; + message.statusErrorMessage = + object.statusErrorMessage !== undefined && + object.statusErrorMessage !== null + ? String(object.statusErrorMessage) + : ""; + message.cloudId = + object.cloudId !== undefined && object.cloudId !== null + ? String(object.cloudId) + : ""; + message.filteringPolicy = + object.filteringPolicy !== undefined && object.filteringPolicy !== null + ? Trail_FilteringPolicy.fromJSON(object.filteringPolicy) + : undefined; + return message; + }, + + toJSON(message: Trail): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.updatedAt !== undefined && + (obj.updatedAt = message.updatedAt.toISOString()); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.destination !== undefined && + (obj.destination = message.destination + ? Trail_Destination.toJSON(message.destination) + : undefined); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.status !== undefined && + (obj.status = trail_StatusToJSON(message.status)); + message.filter !== undefined && + (obj.filter = message.filter + ? Trail_Filter.toJSON(message.filter) + : undefined); + message.statusErrorMessage !== undefined && + (obj.statusErrorMessage = message.statusErrorMessage); + message.cloudId !== undefined && (obj.cloudId = message.cloudId); + message.filteringPolicy !== undefined && + (obj.filteringPolicy = message.filteringPolicy + ? Trail_FilteringPolicy.toJSON(message.filteringPolicy) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Trail { + const message = { ...baseTrail } as Trail; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.updatedAt = object.updatedAt ?? undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.destination = + object.destination !== undefined && object.destination !== null + ? Trail_Destination.fromPartial(object.destination) + : undefined; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.status = object.status ?? 0; + message.filter = + object.filter !== undefined && object.filter !== null + ? Trail_Filter.fromPartial(object.filter) + : undefined; + message.statusErrorMessage = object.statusErrorMessage ?? ""; + message.cloudId = object.cloudId ?? ""; + message.filteringPolicy = + object.filteringPolicy !== undefined && object.filteringPolicy !== null + ? Trail_FilteringPolicy.fromPartial(object.filteringPolicy) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Trail.$type, Trail); + +const baseTrail_LabelsEntry: object = { + $type: "yandex.cloud.audittrails.v1.Trail.LabelsEntry", + key: "", + value: "", +}; + +export const Trail_LabelsEntry = { + $type: "yandex.cloud.audittrails.v1.Trail.LabelsEntry" as const, + + encode( + message: Trail_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Trail_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTrail_LabelsEntry } as Trail_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_LabelsEntry { + const message = { ...baseTrail_LabelsEntry } as Trail_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Trail_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_LabelsEntry { + const message = { ...baseTrail_LabelsEntry } as Trail_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Trail_LabelsEntry.$type, Trail_LabelsEntry); + +const baseTrail_Destination: object = { + $type: "yandex.cloud.audittrails.v1.Trail.Destination", +}; + +export const Trail_Destination = { + $type: "yandex.cloud.audittrails.v1.Trail.Destination" as const, + + encode( + message: Trail_Destination, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.objectStorage !== undefined) { + Trail_ObjectStorage.encode( + message.objectStorage, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.cloudLogging !== undefined) { + Trail_CloudLogging.encode( + message.cloudLogging, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.dataStream !== undefined) { + Trail_DataStream.encode( + message.dataStream, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Trail_Destination { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTrail_Destination } as Trail_Destination; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.objectStorage = Trail_ObjectStorage.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.cloudLogging = Trail_CloudLogging.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.dataStream = Trail_DataStream.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_Destination { + const message = { ...baseTrail_Destination } as Trail_Destination; + message.objectStorage = + object.objectStorage !== undefined && object.objectStorage !== null + ? Trail_ObjectStorage.fromJSON(object.objectStorage) + : undefined; + message.cloudLogging = + object.cloudLogging !== undefined && object.cloudLogging !== null + ? Trail_CloudLogging.fromJSON(object.cloudLogging) + : undefined; + message.dataStream = + object.dataStream !== undefined && object.dataStream !== null + ? Trail_DataStream.fromJSON(object.dataStream) + : undefined; + return message; + }, + + toJSON(message: Trail_Destination): unknown { + const obj: any = {}; + message.objectStorage !== undefined && + (obj.objectStorage = message.objectStorage + ? Trail_ObjectStorage.toJSON(message.objectStorage) + : undefined); + message.cloudLogging !== undefined && + (obj.cloudLogging = message.cloudLogging + ? Trail_CloudLogging.toJSON(message.cloudLogging) + : undefined); + message.dataStream !== undefined && + (obj.dataStream = message.dataStream + ? Trail_DataStream.toJSON(message.dataStream) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_Destination { + const message = { ...baseTrail_Destination } as Trail_Destination; + message.objectStorage = + object.objectStorage !== undefined && object.objectStorage !== null + ? Trail_ObjectStorage.fromPartial(object.objectStorage) + : undefined; + message.cloudLogging = + object.cloudLogging !== undefined && object.cloudLogging !== null + ? Trail_CloudLogging.fromPartial(object.cloudLogging) + : undefined; + message.dataStream = + object.dataStream !== undefined && object.dataStream !== null + ? Trail_DataStream.fromPartial(object.dataStream) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Trail_Destination.$type, Trail_Destination); + +const baseTrail_ObjectStorage: object = { + $type: "yandex.cloud.audittrails.v1.Trail.ObjectStorage", + bucketId: "", + objectPrefix: "", +}; + +export const Trail_ObjectStorage = { + $type: "yandex.cloud.audittrails.v1.Trail.ObjectStorage" as const, + + encode( + message: Trail_ObjectStorage, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.bucketId !== "") { + writer.uint32(10).string(message.bucketId); + } + if (message.objectPrefix !== "") { + writer.uint32(18).string(message.objectPrefix); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Trail_ObjectStorage { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTrail_ObjectStorage } as Trail_ObjectStorage; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bucketId = reader.string(); + break; + case 2: + message.objectPrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_ObjectStorage { + const message = { ...baseTrail_ObjectStorage } as Trail_ObjectStorage; + message.bucketId = + object.bucketId !== undefined && object.bucketId !== null + ? String(object.bucketId) + : ""; + message.objectPrefix = + object.objectPrefix !== undefined && object.objectPrefix !== null + ? String(object.objectPrefix) + : ""; + return message; + }, + + toJSON(message: Trail_ObjectStorage): unknown { + const obj: any = {}; + message.bucketId !== undefined && (obj.bucketId = message.bucketId); + message.objectPrefix !== undefined && + (obj.objectPrefix = message.objectPrefix); + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_ObjectStorage { + const message = { ...baseTrail_ObjectStorage } as Trail_ObjectStorage; + message.bucketId = object.bucketId ?? ""; + message.objectPrefix = object.objectPrefix ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Trail_ObjectStorage.$type, Trail_ObjectStorage); + +const baseTrail_CloudLogging: object = { + $type: "yandex.cloud.audittrails.v1.Trail.CloudLogging", +}; + +export const Trail_CloudLogging = { + $type: "yandex.cloud.audittrails.v1.Trail.CloudLogging" as const, + + encode( + message: Trail_CloudLogging, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.logGroupId !== undefined) { + writer.uint32(10).string(message.logGroupId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Trail_CloudLogging { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTrail_CloudLogging } as Trail_CloudLogging; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.logGroupId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_CloudLogging { + const message = { ...baseTrail_CloudLogging } as Trail_CloudLogging; + message.logGroupId = + object.logGroupId !== undefined && object.logGroupId !== null + ? String(object.logGroupId) + : undefined; + return message; + }, + + toJSON(message: Trail_CloudLogging): unknown { + const obj: any = {}; + message.logGroupId !== undefined && (obj.logGroupId = message.logGroupId); + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_CloudLogging { + const message = { ...baseTrail_CloudLogging } as Trail_CloudLogging; + message.logGroupId = object.logGroupId ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Trail_CloudLogging.$type, Trail_CloudLogging); + +const baseTrail_DataStream: object = { + $type: "yandex.cloud.audittrails.v1.Trail.DataStream", + databaseId: "", + streamName: "", +}; + +export const Trail_DataStream = { + $type: "yandex.cloud.audittrails.v1.Trail.DataStream" as const, + + encode( + message: Trail_DataStream, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.databaseId !== "") { + writer.uint32(10).string(message.databaseId); + } + if (message.streamName !== "") { + writer.uint32(18).string(message.streamName); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Trail_DataStream { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTrail_DataStream } as Trail_DataStream; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.databaseId = reader.string(); + break; + case 2: + message.streamName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_DataStream { + const message = { ...baseTrail_DataStream } as Trail_DataStream; + message.databaseId = + object.databaseId !== undefined && object.databaseId !== null + ? String(object.databaseId) + : ""; + message.streamName = + object.streamName !== undefined && object.streamName !== null + ? String(object.streamName) + : ""; + return message; + }, + + toJSON(message: Trail_DataStream): unknown { + const obj: any = {}; + message.databaseId !== undefined && (obj.databaseId = message.databaseId); + message.streamName !== undefined && (obj.streamName = message.streamName); + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_DataStream { + const message = { ...baseTrail_DataStream } as Trail_DataStream; + message.databaseId = object.databaseId ?? ""; + message.streamName = object.streamName ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Trail_DataStream.$type, Trail_DataStream); + +const baseTrail_Filter: object = { + $type: "yandex.cloud.audittrails.v1.Trail.Filter", +}; + +export const Trail_Filter = { + $type: "yandex.cloud.audittrails.v1.Trail.Filter" as const, + + encode( + message: Trail_Filter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.pathFilter !== undefined) { + Trail_PathFilter.encode( + message.pathFilter, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.eventFilter !== undefined) { + Trail_EventFilter.encode( + message.eventFilter, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Trail_Filter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTrail_Filter } as Trail_Filter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pathFilter = Trail_PathFilter.decode(reader, reader.uint32()); + break; + case 2: + message.eventFilter = Trail_EventFilter.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_Filter { + const message = { ...baseTrail_Filter } as Trail_Filter; + message.pathFilter = + object.pathFilter !== undefined && object.pathFilter !== null + ? Trail_PathFilter.fromJSON(object.pathFilter) + : undefined; + message.eventFilter = + object.eventFilter !== undefined && object.eventFilter !== null + ? Trail_EventFilter.fromJSON(object.eventFilter) + : undefined; + return message; + }, + + toJSON(message: Trail_Filter): unknown { + const obj: any = {}; + message.pathFilter !== undefined && + (obj.pathFilter = message.pathFilter + ? Trail_PathFilter.toJSON(message.pathFilter) + : undefined); + message.eventFilter !== undefined && + (obj.eventFilter = message.eventFilter + ? Trail_EventFilter.toJSON(message.eventFilter) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_Filter { + const message = { ...baseTrail_Filter } as Trail_Filter; + message.pathFilter = + object.pathFilter !== undefined && object.pathFilter !== null + ? Trail_PathFilter.fromPartial(object.pathFilter) + : undefined; + message.eventFilter = + object.eventFilter !== undefined && object.eventFilter !== null + ? Trail_EventFilter.fromPartial(object.eventFilter) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Trail_Filter.$type, Trail_Filter); + +const baseTrail_PathFilter: object = { + $type: "yandex.cloud.audittrails.v1.Trail.PathFilter", +}; + +export const Trail_PathFilter = { + $type: "yandex.cloud.audittrails.v1.Trail.PathFilter" as const, + + encode( + message: Trail_PathFilter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.root !== undefined) { + Trail_PathFilterElement.encode( + message.root, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Trail_PathFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTrail_PathFilter } as Trail_PathFilter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.root = Trail_PathFilterElement.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_PathFilter { + const message = { ...baseTrail_PathFilter } as Trail_PathFilter; + message.root = + object.root !== undefined && object.root !== null + ? Trail_PathFilterElement.fromJSON(object.root) + : undefined; + return message; + }, + + toJSON(message: Trail_PathFilter): unknown { + const obj: any = {}; + message.root !== undefined && + (obj.root = message.root + ? Trail_PathFilterElement.toJSON(message.root) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_PathFilter { + const message = { ...baseTrail_PathFilter } as Trail_PathFilter; + message.root = + object.root !== undefined && object.root !== null + ? Trail_PathFilterElement.fromPartial(object.root) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Trail_PathFilter.$type, Trail_PathFilter); + +const baseTrail_PathFilterElement: object = { + $type: "yandex.cloud.audittrails.v1.Trail.PathFilterElement", +}; + +export const Trail_PathFilterElement = { + $type: "yandex.cloud.audittrails.v1.Trail.PathFilterElement" as const, + + encode( + message: Trail_PathFilterElement, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.anyFilter !== undefined) { + Trail_PathFilterElementAny.encode( + message.anyFilter, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.someFilter !== undefined) { + Trail_PathFilterElementSome.encode( + message.someFilter, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Trail_PathFilterElement { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTrail_PathFilterElement, + } as Trail_PathFilterElement; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.anyFilter = Trail_PathFilterElementAny.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.someFilter = Trail_PathFilterElementSome.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_PathFilterElement { + const message = { + ...baseTrail_PathFilterElement, + } as Trail_PathFilterElement; + message.anyFilter = + object.anyFilter !== undefined && object.anyFilter !== null + ? Trail_PathFilterElementAny.fromJSON(object.anyFilter) + : undefined; + message.someFilter = + object.someFilter !== undefined && object.someFilter !== null + ? Trail_PathFilterElementSome.fromJSON(object.someFilter) + : undefined; + return message; + }, + + toJSON(message: Trail_PathFilterElement): unknown { + const obj: any = {}; + message.anyFilter !== undefined && + (obj.anyFilter = message.anyFilter + ? Trail_PathFilterElementAny.toJSON(message.anyFilter) + : undefined); + message.someFilter !== undefined && + (obj.someFilter = message.someFilter + ? Trail_PathFilterElementSome.toJSON(message.someFilter) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_PathFilterElement { + const message = { + ...baseTrail_PathFilterElement, + } as Trail_PathFilterElement; + message.anyFilter = + object.anyFilter !== undefined && object.anyFilter !== null + ? Trail_PathFilterElementAny.fromPartial(object.anyFilter) + : undefined; + message.someFilter = + object.someFilter !== undefined && object.someFilter !== null + ? Trail_PathFilterElementSome.fromPartial(object.someFilter) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Trail_PathFilterElement.$type, Trail_PathFilterElement); + +const baseTrail_PathFilterElementAny: object = { + $type: "yandex.cloud.audittrails.v1.Trail.PathFilterElementAny", +}; + +export const Trail_PathFilterElementAny = { + $type: "yandex.cloud.audittrails.v1.Trail.PathFilterElementAny" as const, + + encode( + message: Trail_PathFilterElementAny, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resource !== undefined) { + Trail_Resource.encode( + message.resource, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Trail_PathFilterElementAny { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTrail_PathFilterElementAny, + } as Trail_PathFilterElementAny; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = Trail_Resource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_PathFilterElementAny { + const message = { + ...baseTrail_PathFilterElementAny, + } as Trail_PathFilterElementAny; + message.resource = + object.resource !== undefined && object.resource !== null + ? Trail_Resource.fromJSON(object.resource) + : undefined; + return message; + }, + + toJSON(message: Trail_PathFilterElementAny): unknown { + const obj: any = {}; + message.resource !== undefined && + (obj.resource = message.resource + ? Trail_Resource.toJSON(message.resource) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_PathFilterElementAny { + const message = { + ...baseTrail_PathFilterElementAny, + } as Trail_PathFilterElementAny; + message.resource = + object.resource !== undefined && object.resource !== null + ? Trail_Resource.fromPartial(object.resource) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + Trail_PathFilterElementAny.$type, + Trail_PathFilterElementAny +); + +const baseTrail_PathFilterElementSome: object = { + $type: "yandex.cloud.audittrails.v1.Trail.PathFilterElementSome", +}; + +export const Trail_PathFilterElementSome = { + $type: "yandex.cloud.audittrails.v1.Trail.PathFilterElementSome" as const, + + encode( + message: Trail_PathFilterElementSome, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resource !== undefined) { + Trail_Resource.encode( + message.resource, + writer.uint32(10).fork() + ).ldelim(); + } + for (const v of message.filters) { + Trail_PathFilterElement.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Trail_PathFilterElementSome { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTrail_PathFilterElementSome, + } as Trail_PathFilterElementSome; + message.filters = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = Trail_Resource.decode(reader, reader.uint32()); + break; + case 2: + message.filters.push( + Trail_PathFilterElement.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_PathFilterElementSome { + const message = { + ...baseTrail_PathFilterElementSome, + } as Trail_PathFilterElementSome; + message.resource = + object.resource !== undefined && object.resource !== null + ? Trail_Resource.fromJSON(object.resource) + : undefined; + message.filters = (object.filters ?? []).map((e: any) => + Trail_PathFilterElement.fromJSON(e) + ); + return message; + }, + + toJSON(message: Trail_PathFilterElementSome): unknown { + const obj: any = {}; + message.resource !== undefined && + (obj.resource = message.resource + ? Trail_Resource.toJSON(message.resource) + : undefined); + if (message.filters) { + obj.filters = message.filters.map((e) => + e ? Trail_PathFilterElement.toJSON(e) : undefined + ); + } else { + obj.filters = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_PathFilterElementSome { + const message = { + ...baseTrail_PathFilterElementSome, + } as Trail_PathFilterElementSome; + message.resource = + object.resource !== undefined && object.resource !== null + ? Trail_Resource.fromPartial(object.resource) + : undefined; + message.filters = + object.filters?.map((e) => Trail_PathFilterElement.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Trail_PathFilterElementSome.$type, + Trail_PathFilterElementSome +); + +const baseTrail_Resource: object = { + $type: "yandex.cloud.audittrails.v1.Trail.Resource", + id: "", + type: "", +}; + +export const Trail_Resource = { + $type: "yandex.cloud.audittrails.v1.Trail.Resource" as const, + + encode( + message: Trail_Resource, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Trail_Resource { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTrail_Resource } as Trail_Resource; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_Resource { + const message = { ...baseTrail_Resource } as Trail_Resource; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.type = + object.type !== undefined && object.type !== null + ? String(object.type) + : ""; + return message; + }, + + toJSON(message: Trail_Resource): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.type !== undefined && (obj.type = message.type); + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_Resource { + const message = { ...baseTrail_Resource } as Trail_Resource; + message.id = object.id ?? ""; + message.type = object.type ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Trail_Resource.$type, Trail_Resource); + +const baseTrail_EventFilter: object = { + $type: "yandex.cloud.audittrails.v1.Trail.EventFilter", +}; + +export const Trail_EventFilter = { + $type: "yandex.cloud.audittrails.v1.Trail.EventFilter" as const, + + encode( + message: Trail_EventFilter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.filters) { + Trail_EventFilterElement.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Trail_EventFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTrail_EventFilter } as Trail_EventFilter; + message.filters = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.filters.push( + Trail_EventFilterElement.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_EventFilter { + const message = { ...baseTrail_EventFilter } as Trail_EventFilter; + message.filters = (object.filters ?? []).map((e: any) => + Trail_EventFilterElement.fromJSON(e) + ); + return message; + }, + + toJSON(message: Trail_EventFilter): unknown { + const obj: any = {}; + if (message.filters) { + obj.filters = message.filters.map((e) => + e ? Trail_EventFilterElement.toJSON(e) : undefined + ); + } else { + obj.filters = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_EventFilter { + const message = { ...baseTrail_EventFilter } as Trail_EventFilter; + message.filters = + object.filters?.map((e) => Trail_EventFilterElement.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Trail_EventFilter.$type, Trail_EventFilter); + +const baseTrail_EventFilterElement: object = { + $type: "yandex.cloud.audittrails.v1.Trail.EventFilterElement", + service: "", +}; + +export const Trail_EventFilterElement = { + $type: "yandex.cloud.audittrails.v1.Trail.EventFilterElement" as const, + + encode( + message: Trail_EventFilterElement, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.service !== "") { + writer.uint32(10).string(message.service); + } + for (const v of message.categories) { + Trail_EventFilterElementCategory.encode( + v!, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.pathFilter !== undefined) { + Trail_PathFilter.encode( + message.pathFilter, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Trail_EventFilterElement { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTrail_EventFilterElement, + } as Trail_EventFilterElement; + message.categories = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.service = reader.string(); + break; + case 2: + message.categories.push( + Trail_EventFilterElementCategory.decode(reader, reader.uint32()) + ); + break; + case 3: + message.pathFilter = Trail_PathFilter.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_EventFilterElement { + const message = { + ...baseTrail_EventFilterElement, + } as Trail_EventFilterElement; + message.service = + object.service !== undefined && object.service !== null + ? String(object.service) + : ""; + message.categories = (object.categories ?? []).map((e: any) => + Trail_EventFilterElementCategory.fromJSON(e) + ); + message.pathFilter = + object.pathFilter !== undefined && object.pathFilter !== null + ? Trail_PathFilter.fromJSON(object.pathFilter) + : undefined; + return message; + }, + + toJSON(message: Trail_EventFilterElement): unknown { + const obj: any = {}; + message.service !== undefined && (obj.service = message.service); + if (message.categories) { + obj.categories = message.categories.map((e) => + e ? Trail_EventFilterElementCategory.toJSON(e) : undefined + ); + } else { + obj.categories = []; + } + message.pathFilter !== undefined && + (obj.pathFilter = message.pathFilter + ? Trail_PathFilter.toJSON(message.pathFilter) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_EventFilterElement { + const message = { + ...baseTrail_EventFilterElement, + } as Trail_EventFilterElement; + message.service = object.service ?? ""; + message.categories = + object.categories?.map((e) => + Trail_EventFilterElementCategory.fromPartial(e) + ) || []; + message.pathFilter = + object.pathFilter !== undefined && object.pathFilter !== null + ? Trail_PathFilter.fromPartial(object.pathFilter) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + Trail_EventFilterElement.$type, + Trail_EventFilterElement +); + +const baseTrail_EventFilterElementCategory: object = { + $type: "yandex.cloud.audittrails.v1.Trail.EventFilterElementCategory", + plane: 0, + type: 0, +}; + +export const Trail_EventFilterElementCategory = { + $type: + "yandex.cloud.audittrails.v1.Trail.EventFilterElementCategory" as const, + + encode( + message: Trail_EventFilterElementCategory, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.plane !== 0) { + writer.uint32(8).int32(message.plane); + } + if (message.type !== 0) { + writer.uint32(16).int32(message.type); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Trail_EventFilterElementCategory { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTrail_EventFilterElementCategory, + } as Trail_EventFilterElementCategory; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plane = reader.int32() as any; + break; + case 2: + message.type = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_EventFilterElementCategory { + const message = { + ...baseTrail_EventFilterElementCategory, + } as Trail_EventFilterElementCategory; + message.plane = + object.plane !== undefined && object.plane !== null + ? trail_EventCategoryFilterFromJSON(object.plane) + : 0; + message.type = + object.type !== undefined && object.type !== null + ? trail_EventAccessTypeFilterFromJSON(object.type) + : 0; + return message; + }, + + toJSON(message: Trail_EventFilterElementCategory): unknown { + const obj: any = {}; + message.plane !== undefined && + (obj.plane = trail_EventCategoryFilterToJSON(message.plane)); + message.type !== undefined && + (obj.type = trail_EventAccessTypeFilterToJSON(message.type)); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): Trail_EventFilterElementCategory { + const message = { + ...baseTrail_EventFilterElementCategory, + } as Trail_EventFilterElementCategory; + message.plane = object.plane ?? 0; + message.type = object.type ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + Trail_EventFilterElementCategory.$type, + Trail_EventFilterElementCategory +); + +const baseTrail_DataEventsFiltering: object = { + $type: "yandex.cloud.audittrails.v1.Trail.DataEventsFiltering", + service: "", +}; + +export const Trail_DataEventsFiltering = { + $type: "yandex.cloud.audittrails.v1.Trail.DataEventsFiltering" as const, + + encode( + message: Trail_DataEventsFiltering, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.service !== "") { + writer.uint32(10).string(message.service); + } + if (message.includedEvents !== undefined) { + Trail_EventTypes.encode( + message.includedEvents, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.excludedEvents !== undefined) { + Trail_EventTypes.encode( + message.excludedEvents, + writer.uint32(26).fork() + ).ldelim(); + } + for (const v of message.resourceScopes) { + Trail_Resource.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Trail_DataEventsFiltering { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTrail_DataEventsFiltering, + } as Trail_DataEventsFiltering; + message.resourceScopes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.service = reader.string(); + break; + case 2: + message.includedEvents = Trail_EventTypes.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.excludedEvents = Trail_EventTypes.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.resourceScopes.push( + Trail_Resource.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_DataEventsFiltering { + const message = { + ...baseTrail_DataEventsFiltering, + } as Trail_DataEventsFiltering; + message.service = + object.service !== undefined && object.service !== null + ? String(object.service) + : ""; + message.includedEvents = + object.includedEvents !== undefined && object.includedEvents !== null + ? Trail_EventTypes.fromJSON(object.includedEvents) + : undefined; + message.excludedEvents = + object.excludedEvents !== undefined && object.excludedEvents !== null + ? Trail_EventTypes.fromJSON(object.excludedEvents) + : undefined; + message.resourceScopes = (object.resourceScopes ?? []).map((e: any) => + Trail_Resource.fromJSON(e) + ); + return message; + }, + + toJSON(message: Trail_DataEventsFiltering): unknown { + const obj: any = {}; + message.service !== undefined && (obj.service = message.service); + message.includedEvents !== undefined && + (obj.includedEvents = message.includedEvents + ? Trail_EventTypes.toJSON(message.includedEvents) + : undefined); + message.excludedEvents !== undefined && + (obj.excludedEvents = message.excludedEvents + ? Trail_EventTypes.toJSON(message.excludedEvents) + : undefined); + if (message.resourceScopes) { + obj.resourceScopes = message.resourceScopes.map((e) => + e ? Trail_Resource.toJSON(e) : undefined + ); + } else { + obj.resourceScopes = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_DataEventsFiltering { + const message = { + ...baseTrail_DataEventsFiltering, + } as Trail_DataEventsFiltering; + message.service = object.service ?? ""; + message.includedEvents = + object.includedEvents !== undefined && object.includedEvents !== null + ? Trail_EventTypes.fromPartial(object.includedEvents) + : undefined; + message.excludedEvents = + object.excludedEvents !== undefined && object.excludedEvents !== null + ? Trail_EventTypes.fromPartial(object.excludedEvents) + : undefined; + message.resourceScopes = + object.resourceScopes?.map((e) => Trail_Resource.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Trail_DataEventsFiltering.$type, + Trail_DataEventsFiltering +); + +const baseTrail_EventTypes: object = { + $type: "yandex.cloud.audittrails.v1.Trail.EventTypes", + eventTypes: "", +}; + +export const Trail_EventTypes = { + $type: "yandex.cloud.audittrails.v1.Trail.EventTypes" as const, + + encode( + message: Trail_EventTypes, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.eventTypes) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Trail_EventTypes { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTrail_EventTypes } as Trail_EventTypes; + message.eventTypes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.eventTypes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_EventTypes { + const message = { ...baseTrail_EventTypes } as Trail_EventTypes; + message.eventTypes = (object.eventTypes ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: Trail_EventTypes): unknown { + const obj: any = {}; + if (message.eventTypes) { + obj.eventTypes = message.eventTypes.map((e) => e); + } else { + obj.eventTypes = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_EventTypes { + const message = { ...baseTrail_EventTypes } as Trail_EventTypes; + message.eventTypes = object.eventTypes?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(Trail_EventTypes.$type, Trail_EventTypes); + +const baseTrail_ManagementEventsFiltering: object = { + $type: "yandex.cloud.audittrails.v1.Trail.ManagementEventsFiltering", +}; + +export const Trail_ManagementEventsFiltering = { + $type: "yandex.cloud.audittrails.v1.Trail.ManagementEventsFiltering" as const, + + encode( + message: Trail_ManagementEventsFiltering, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.resourceScopes) { + Trail_Resource.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Trail_ManagementEventsFiltering { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTrail_ManagementEventsFiltering, + } as Trail_ManagementEventsFiltering; + message.resourceScopes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceScopes.push( + Trail_Resource.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_ManagementEventsFiltering { + const message = { + ...baseTrail_ManagementEventsFiltering, + } as Trail_ManagementEventsFiltering; + message.resourceScopes = (object.resourceScopes ?? []).map((e: any) => + Trail_Resource.fromJSON(e) + ); + return message; + }, + + toJSON(message: Trail_ManagementEventsFiltering): unknown { + const obj: any = {}; + if (message.resourceScopes) { + obj.resourceScopes = message.resourceScopes.map((e) => + e ? Trail_Resource.toJSON(e) : undefined + ); + } else { + obj.resourceScopes = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_ManagementEventsFiltering { + const message = { + ...baseTrail_ManagementEventsFiltering, + } as Trail_ManagementEventsFiltering; + message.resourceScopes = + object.resourceScopes?.map((e) => Trail_Resource.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Trail_ManagementEventsFiltering.$type, + Trail_ManagementEventsFiltering +); + +const baseTrail_FilteringPolicy: object = { + $type: "yandex.cloud.audittrails.v1.Trail.FilteringPolicy", +}; + +export const Trail_FilteringPolicy = { + $type: "yandex.cloud.audittrails.v1.Trail.FilteringPolicy" as const, + + encode( + message: Trail_FilteringPolicy, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.managementEventsFilter !== undefined) { + Trail_ManagementEventsFiltering.encode( + message.managementEventsFilter, + writer.uint32(10).fork() + ).ldelim(); + } + for (const v of message.dataEventsFilters) { + Trail_DataEventsFiltering.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Trail_FilteringPolicy { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTrail_FilteringPolicy } as Trail_FilteringPolicy; + message.dataEventsFilters = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.managementEventsFilter = + Trail_ManagementEventsFiltering.decode(reader, reader.uint32()); + break; + case 2: + message.dataEventsFilters.push( + Trail_DataEventsFiltering.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Trail_FilteringPolicy { + const message = { ...baseTrail_FilteringPolicy } as Trail_FilteringPolicy; + message.managementEventsFilter = + object.managementEventsFilter !== undefined && + object.managementEventsFilter !== null + ? Trail_ManagementEventsFiltering.fromJSON( + object.managementEventsFilter + ) + : undefined; + message.dataEventsFilters = (object.dataEventsFilters ?? []).map((e: any) => + Trail_DataEventsFiltering.fromJSON(e) + ); + return message; + }, + + toJSON(message: Trail_FilteringPolicy): unknown { + const obj: any = {}; + message.managementEventsFilter !== undefined && + (obj.managementEventsFilter = message.managementEventsFilter + ? Trail_ManagementEventsFiltering.toJSON(message.managementEventsFilter) + : undefined); + if (message.dataEventsFilters) { + obj.dataEventsFilters = message.dataEventsFilters.map((e) => + e ? Trail_DataEventsFiltering.toJSON(e) : undefined + ); + } else { + obj.dataEventsFilters = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Trail_FilteringPolicy { + const message = { ...baseTrail_FilteringPolicy } as Trail_FilteringPolicy; + message.managementEventsFilter = + object.managementEventsFilter !== undefined && + object.managementEventsFilter !== null + ? Trail_ManagementEventsFiltering.fromPartial( + object.managementEventsFilter + ) + : undefined; + message.dataEventsFilters = + object.dataEventsFilters?.map((e) => + Trail_DataEventsFiltering.fromPartial(e) + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(Trail_FilteringPolicy.$type, Trail_FilteringPolicy); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/audittrails/v1/trail_service.ts b/src/generated/yandex/cloud/audittrails/v1/trail_service.ts new file mode 100644 index 00000000..e5b95d3e --- /dev/null +++ b/src/generated/yandex/cloud/audittrails/v1/trail_service.ts @@ -0,0 +1,1898 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + Trail_Destination, + Trail_Filter, + Trail_FilteringPolicy, + Trail, +} from "../../../../yandex/cloud/audittrails/v1/trail"; +import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../yandex/cloud/access/access"; + +export const protobufPackage = "yandex.cloud.audittrails.v1"; + +export interface GetTrailRequest { + $type: "yandex.cloud.audittrails.v1.GetTrailRequest"; + /** + * ID of the trail to return. + * + * To get a trail ID make a [List] request. + */ + trailId: string; +} + +export interface ListTrailsRequest { + $type: "yandex.cloud.audittrails.v1.ListTrailsRequest"; + /** ID of the folder to list trails in. */ + folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than `page_size`, the service returns a [ListTrailsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * [ListTrailsRequest.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters subscription locks listed in the response. + * + * The expression must specify: + * 1. The field name. Currently you can use filtering on [Trail.name, Trail.created_at] fields. + * 2. An operator. Can be either `=` or `!=` for single values, `IN` or `NOT IN` for lists of values. + * 3. The value. Must be in double quotes `""`. Must be 3-63 characters long and match the regular expression `^[a-z][-a-z0-9]{1,61}[a-z0-9]`. + * Example of a filter: `name="my-name"`. + */ + filter: string; + /** + * By which column the listing should be ordered and in which direction. + * format is " desc|acs" + */ + orderBy: string; +} + +export interface ListTrailsResponse { + $type: "yandex.cloud.audittrails.v1.ListTrailsResponse"; + /** List of trails in the specified folder. */ + trails: Trail[]; + /** + * This token allows you to get the next page of results for list requests. If the number + * of results is greater than the specified [ListTrailsRequest.page_size], use + * the `next_page_token` as the value for the [ListTrailsRequest.page_token] query parameter + * in the next list request. Each subsequent list request will have its own + * `next_page_token` to continue paging through the results. + */ + nextPageToken: string; +} + +export interface CreateTrailRequest { + $type: "yandex.cloud.audittrails.v1.CreateTrailRequest"; + /** ID of the folder to create a trail in. */ + folderId: string; + /** Name of the trail. */ + name: string; + /** Description of the trail. */ + description: string; + /** + * Custom labels for the secret as `key:value` pairs. Maximum 64 per key. + * For example, `"type": "critical"` or `"source": "dictionary"`. + */ + labels: { [key: string]: string }; + /** Destination configuration for the trail */ + destination?: Trail_Destination; + /** Service account ID of the trail */ + serviceAccountId: string; + /** + * Event filtering configuration of the trail + * deprecated: use filtering_policy instead + * + * @deprecated + */ + filter?: Trail_Filter; + /** Event filtering policy of the trail */ + filteringPolicy?: Trail_FilteringPolicy; +} + +export interface CreateTrailRequest_LabelsEntry { + $type: "yandex.cloud.audittrails.v1.CreateTrailRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateTrailRequest { + $type: "yandex.cloud.audittrails.v1.UpdateTrailRequest"; + /** ID of the trail to update. */ + trailId: string; + /** Field mask that specifies which attributes of the trail are going to be updated. */ + updateMask?: FieldMask; + /** New name of the trail. */ + name: string; + /** New description of the trail. */ + description: string; + /** New custom labels for the secret as `key:value` pairs. Maximum 64 per key. */ + labels: { [key: string]: string }; + /** New destination configuration for the trail */ + destination?: Trail_Destination; + /** New service account ID of the trail */ + serviceAccountId: string; + /** + * Updated filtering configuration of the trail + * deprecated: use filtering_policy instead + * + * @deprecated + */ + filter?: Trail_Filter; + /** Updated event filtering policy */ + filteringPolicy?: Trail_FilteringPolicy; +} + +export interface UpdateTrailRequest_LabelsEntry { + $type: "yandex.cloud.audittrails.v1.UpdateTrailRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface DeleteTrailRequest { + $type: "yandex.cloud.audittrails.v1.DeleteTrailRequest"; + /** ID of the trail to be deleted. */ + trailId: string; +} + +export interface CreateTrailMetadata { + $type: "yandex.cloud.audittrails.v1.CreateTrailMetadata"; + /** ID of the trail that is being created */ + trailId: string; +} + +export interface UpdateTrailMetadata { + $type: "yandex.cloud.audittrails.v1.UpdateTrailMetadata"; + /** ID of the trail that is being updated */ + trailId: string; +} + +export interface DeleteTrailMetadata { + $type: "yandex.cloud.audittrails.v1.DeleteTrailMetadata"; + /** ID of the trail that is being deleted */ + trailId: string; +} + +export interface ListTrailOperationsRequest { + $type: "yandex.cloud.audittrails.v1.ListTrailOperationsRequest"; + /** ID of the trail to get operations for. */ + trailId: string; + /** + * The maximum number of results per page that should be returned. If the number of available + * results is larger than `page_size`, the service returns a [ListTrailOperationsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * [ListTrailOperationsRequest.next_page_token] returned by a previous list request. + */ + pageToken: string; +} + +export interface ListTrailOperationsResponse { + $type: "yandex.cloud.audittrails.v1.ListTrailOperationsResponse"; + /** List of operations for the specified trail. */ + operations: Operation[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListTrailOperationsResponse.page_size], use the `next_page_token` as the value + * for the [ListTrailOperationsResponse.page_token] query parameter in the next list request. + * Each subsequent list request will have its own `next_page_token` to continue paging through the results. + */ + nextPageToken: string; +} + +const baseGetTrailRequest: object = { + $type: "yandex.cloud.audittrails.v1.GetTrailRequest", + trailId: "", +}; + +export const GetTrailRequest = { + $type: "yandex.cloud.audittrails.v1.GetTrailRequest" as const, + + encode( + message: GetTrailRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.trailId !== "") { + writer.uint32(10).string(message.trailId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetTrailRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetTrailRequest } as GetTrailRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trailId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetTrailRequest { + const message = { ...baseGetTrailRequest } as GetTrailRequest; + message.trailId = + object.trailId !== undefined && object.trailId !== null + ? String(object.trailId) + : ""; + return message; + }, + + toJSON(message: GetTrailRequest): unknown { + const obj: any = {}; + message.trailId !== undefined && (obj.trailId = message.trailId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetTrailRequest { + const message = { ...baseGetTrailRequest } as GetTrailRequest; + message.trailId = object.trailId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetTrailRequest.$type, GetTrailRequest); + +const baseListTrailsRequest: object = { + $type: "yandex.cloud.audittrails.v1.ListTrailsRequest", + folderId: "", + pageSize: 0, + pageToken: "", + filter: "", + orderBy: "", +}; + +export const ListTrailsRequest = { + $type: "yandex.cloud.audittrails.v1.ListTrailsRequest" as const, + + encode( + message: ListTrailsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + if (message.orderBy !== "") { + writer.uint32(42).string(message.orderBy); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListTrailsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListTrailsRequest } as ListTrailsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + case 5: + message.orderBy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListTrailsRequest { + const message = { ...baseListTrailsRequest } as ListTrailsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + message.orderBy = + object.orderBy !== undefined && object.orderBy !== null + ? String(object.orderBy) + : ""; + return message; + }, + + toJSON(message: ListTrailsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + message.orderBy !== undefined && (obj.orderBy = message.orderBy); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListTrailsRequest { + const message = { ...baseListTrailsRequest } as ListTrailsRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + message.orderBy = object.orderBy ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListTrailsRequest.$type, ListTrailsRequest); + +const baseListTrailsResponse: object = { + $type: "yandex.cloud.audittrails.v1.ListTrailsResponse", + nextPageToken: "", +}; + +export const ListTrailsResponse = { + $type: "yandex.cloud.audittrails.v1.ListTrailsResponse" as const, + + encode( + message: ListTrailsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.trails) { + Trail.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListTrailsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListTrailsResponse } as ListTrailsResponse; + message.trails = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trails.push(Trail.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListTrailsResponse { + const message = { ...baseListTrailsResponse } as ListTrailsResponse; + message.trails = (object.trails ?? []).map((e: any) => Trail.fromJSON(e)); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListTrailsResponse): unknown { + const obj: any = {}; + if (message.trails) { + obj.trails = message.trails.map((e) => (e ? Trail.toJSON(e) : undefined)); + } else { + obj.trails = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListTrailsResponse { + const message = { ...baseListTrailsResponse } as ListTrailsResponse; + message.trails = object.trails?.map((e) => Trail.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListTrailsResponse.$type, ListTrailsResponse); + +const baseCreateTrailRequest: object = { + $type: "yandex.cloud.audittrails.v1.CreateTrailRequest", + folderId: "", + name: "", + description: "", + serviceAccountId: "", +}; + +export const CreateTrailRequest = { + $type: "yandex.cloud.audittrails.v1.CreateTrailRequest" as const, + + encode( + message: CreateTrailRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateTrailRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.audittrails.v1.CreateTrailRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(34).fork() + ).ldelim(); + }); + if (message.destination !== undefined) { + Trail_Destination.encode( + message.destination, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.serviceAccountId !== "") { + writer.uint32(50).string(message.serviceAccountId); + } + if (message.filter !== undefined) { + Trail_Filter.encode(message.filter, writer.uint32(58).fork()).ldelim(); + } + if (message.filteringPolicy !== undefined) { + Trail_FilteringPolicy.encode( + message.filteringPolicy, + writer.uint32(66).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateTrailRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateTrailRequest } as CreateTrailRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + const entry4 = CreateTrailRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry4.value !== undefined) { + message.labels[entry4.key] = entry4.value; + } + break; + case 5: + message.destination = Trail_Destination.decode( + reader, + reader.uint32() + ); + break; + case 6: + message.serviceAccountId = reader.string(); + break; + case 7: + message.filter = Trail_Filter.decode(reader, reader.uint32()); + break; + case 8: + message.filteringPolicy = Trail_FilteringPolicy.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateTrailRequest { + const message = { ...baseCreateTrailRequest } as CreateTrailRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.destination = + object.destination !== undefined && object.destination !== null + ? Trail_Destination.fromJSON(object.destination) + : undefined; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? Trail_Filter.fromJSON(object.filter) + : undefined; + message.filteringPolicy = + object.filteringPolicy !== undefined && object.filteringPolicy !== null + ? Trail_FilteringPolicy.fromJSON(object.filteringPolicy) + : undefined; + return message; + }, + + toJSON(message: CreateTrailRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.destination !== undefined && + (obj.destination = message.destination + ? Trail_Destination.toJSON(message.destination) + : undefined); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.filter !== undefined && + (obj.filter = message.filter + ? Trail_Filter.toJSON(message.filter) + : undefined); + message.filteringPolicy !== undefined && + (obj.filteringPolicy = message.filteringPolicy + ? Trail_FilteringPolicy.toJSON(message.filteringPolicy) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateTrailRequest { + const message = { ...baseCreateTrailRequest } as CreateTrailRequest; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.destination = + object.destination !== undefined && object.destination !== null + ? Trail_Destination.fromPartial(object.destination) + : undefined; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? Trail_Filter.fromPartial(object.filter) + : undefined; + message.filteringPolicy = + object.filteringPolicy !== undefined && object.filteringPolicy !== null + ? Trail_FilteringPolicy.fromPartial(object.filteringPolicy) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CreateTrailRequest.$type, CreateTrailRequest); + +const baseCreateTrailRequest_LabelsEntry: object = { + $type: "yandex.cloud.audittrails.v1.CreateTrailRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateTrailRequest_LabelsEntry = { + $type: "yandex.cloud.audittrails.v1.CreateTrailRequest.LabelsEntry" as const, + + encode( + message: CreateTrailRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateTrailRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateTrailRequest_LabelsEntry, + } as CreateTrailRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateTrailRequest_LabelsEntry { + const message = { + ...baseCreateTrailRequest_LabelsEntry, + } as CreateTrailRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateTrailRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateTrailRequest_LabelsEntry { + const message = { + ...baseCreateTrailRequest_LabelsEntry, + } as CreateTrailRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateTrailRequest_LabelsEntry.$type, + CreateTrailRequest_LabelsEntry +); + +const baseUpdateTrailRequest: object = { + $type: "yandex.cloud.audittrails.v1.UpdateTrailRequest", + trailId: "", + name: "", + description: "", + serviceAccountId: "", +}; + +export const UpdateTrailRequest = { + $type: "yandex.cloud.audittrails.v1.UpdateTrailRequest" as const, + + encode( + message: UpdateTrailRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.trailId !== "") { + writer.uint32(10).string(message.trailId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateTrailRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.audittrails.v1.UpdateTrailRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(42).fork() + ).ldelim(); + }); + if (message.destination !== undefined) { + Trail_Destination.encode( + message.destination, + writer.uint32(50).fork() + ).ldelim(); + } + if (message.serviceAccountId !== "") { + writer.uint32(58).string(message.serviceAccountId); + } + if (message.filter !== undefined) { + Trail_Filter.encode(message.filter, writer.uint32(66).fork()).ldelim(); + } + if (message.filteringPolicy !== undefined) { + Trail_FilteringPolicy.encode( + message.filteringPolicy, + writer.uint32(74).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateTrailRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateTrailRequest } as UpdateTrailRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trailId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + const entry5 = UpdateTrailRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry5.value !== undefined) { + message.labels[entry5.key] = entry5.value; + } + break; + case 6: + message.destination = Trail_Destination.decode( + reader, + reader.uint32() + ); + break; + case 7: + message.serviceAccountId = reader.string(); + break; + case 8: + message.filter = Trail_Filter.decode(reader, reader.uint32()); + break; + case 9: + message.filteringPolicy = Trail_FilteringPolicy.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateTrailRequest { + const message = { ...baseUpdateTrailRequest } as UpdateTrailRequest; + message.trailId = + object.trailId !== undefined && object.trailId !== null + ? String(object.trailId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.destination = + object.destination !== undefined && object.destination !== null + ? Trail_Destination.fromJSON(object.destination) + : undefined; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? Trail_Filter.fromJSON(object.filter) + : undefined; + message.filteringPolicy = + object.filteringPolicy !== undefined && object.filteringPolicy !== null + ? Trail_FilteringPolicy.fromJSON(object.filteringPolicy) + : undefined; + return message; + }, + + toJSON(message: UpdateTrailRequest): unknown { + const obj: any = {}; + message.trailId !== undefined && (obj.trailId = message.trailId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.destination !== undefined && + (obj.destination = message.destination + ? Trail_Destination.toJSON(message.destination) + : undefined); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.filter !== undefined && + (obj.filter = message.filter + ? Trail_Filter.toJSON(message.filter) + : undefined); + message.filteringPolicy !== undefined && + (obj.filteringPolicy = message.filteringPolicy + ? Trail_FilteringPolicy.toJSON(message.filteringPolicy) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateTrailRequest { + const message = { ...baseUpdateTrailRequest } as UpdateTrailRequest; + message.trailId = object.trailId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.destination = + object.destination !== undefined && object.destination !== null + ? Trail_Destination.fromPartial(object.destination) + : undefined; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? Trail_Filter.fromPartial(object.filter) + : undefined; + message.filteringPolicy = + object.filteringPolicy !== undefined && object.filteringPolicy !== null + ? Trail_FilteringPolicy.fromPartial(object.filteringPolicy) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UpdateTrailRequest.$type, UpdateTrailRequest); + +const baseUpdateTrailRequest_LabelsEntry: object = { + $type: "yandex.cloud.audittrails.v1.UpdateTrailRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateTrailRequest_LabelsEntry = { + $type: "yandex.cloud.audittrails.v1.UpdateTrailRequest.LabelsEntry" as const, + + encode( + message: UpdateTrailRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateTrailRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateTrailRequest_LabelsEntry, + } as UpdateTrailRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateTrailRequest_LabelsEntry { + const message = { + ...baseUpdateTrailRequest_LabelsEntry, + } as UpdateTrailRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateTrailRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateTrailRequest_LabelsEntry { + const message = { + ...baseUpdateTrailRequest_LabelsEntry, + } as UpdateTrailRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateTrailRequest_LabelsEntry.$type, + UpdateTrailRequest_LabelsEntry +); + +const baseDeleteTrailRequest: object = { + $type: "yandex.cloud.audittrails.v1.DeleteTrailRequest", + trailId: "", +}; + +export const DeleteTrailRequest = { + $type: "yandex.cloud.audittrails.v1.DeleteTrailRequest" as const, + + encode( + message: DeleteTrailRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.trailId !== "") { + writer.uint32(10).string(message.trailId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteTrailRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteTrailRequest } as DeleteTrailRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trailId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteTrailRequest { + const message = { ...baseDeleteTrailRequest } as DeleteTrailRequest; + message.trailId = + object.trailId !== undefined && object.trailId !== null + ? String(object.trailId) + : ""; + return message; + }, + + toJSON(message: DeleteTrailRequest): unknown { + const obj: any = {}; + message.trailId !== undefined && (obj.trailId = message.trailId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteTrailRequest { + const message = { ...baseDeleteTrailRequest } as DeleteTrailRequest; + message.trailId = object.trailId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteTrailRequest.$type, DeleteTrailRequest); + +const baseCreateTrailMetadata: object = { + $type: "yandex.cloud.audittrails.v1.CreateTrailMetadata", + trailId: "", +}; + +export const CreateTrailMetadata = { + $type: "yandex.cloud.audittrails.v1.CreateTrailMetadata" as const, + + encode( + message: CreateTrailMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.trailId !== "") { + writer.uint32(10).string(message.trailId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateTrailMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateTrailMetadata } as CreateTrailMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trailId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateTrailMetadata { + const message = { ...baseCreateTrailMetadata } as CreateTrailMetadata; + message.trailId = + object.trailId !== undefined && object.trailId !== null + ? String(object.trailId) + : ""; + return message; + }, + + toJSON(message: CreateTrailMetadata): unknown { + const obj: any = {}; + message.trailId !== undefined && (obj.trailId = message.trailId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateTrailMetadata { + const message = { ...baseCreateTrailMetadata } as CreateTrailMetadata; + message.trailId = object.trailId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateTrailMetadata.$type, CreateTrailMetadata); + +const baseUpdateTrailMetadata: object = { + $type: "yandex.cloud.audittrails.v1.UpdateTrailMetadata", + trailId: "", +}; + +export const UpdateTrailMetadata = { + $type: "yandex.cloud.audittrails.v1.UpdateTrailMetadata" as const, + + encode( + message: UpdateTrailMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.trailId !== "") { + writer.uint32(10).string(message.trailId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateTrailMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateTrailMetadata } as UpdateTrailMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trailId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateTrailMetadata { + const message = { ...baseUpdateTrailMetadata } as UpdateTrailMetadata; + message.trailId = + object.trailId !== undefined && object.trailId !== null + ? String(object.trailId) + : ""; + return message; + }, + + toJSON(message: UpdateTrailMetadata): unknown { + const obj: any = {}; + message.trailId !== undefined && (obj.trailId = message.trailId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateTrailMetadata { + const message = { ...baseUpdateTrailMetadata } as UpdateTrailMetadata; + message.trailId = object.trailId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateTrailMetadata.$type, UpdateTrailMetadata); + +const baseDeleteTrailMetadata: object = { + $type: "yandex.cloud.audittrails.v1.DeleteTrailMetadata", + trailId: "", +}; + +export const DeleteTrailMetadata = { + $type: "yandex.cloud.audittrails.v1.DeleteTrailMetadata" as const, + + encode( + message: DeleteTrailMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.trailId !== "") { + writer.uint32(10).string(message.trailId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteTrailMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteTrailMetadata } as DeleteTrailMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trailId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteTrailMetadata { + const message = { ...baseDeleteTrailMetadata } as DeleteTrailMetadata; + message.trailId = + object.trailId !== undefined && object.trailId !== null + ? String(object.trailId) + : ""; + return message; + }, + + toJSON(message: DeleteTrailMetadata): unknown { + const obj: any = {}; + message.trailId !== undefined && (obj.trailId = message.trailId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteTrailMetadata { + const message = { ...baseDeleteTrailMetadata } as DeleteTrailMetadata; + message.trailId = object.trailId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteTrailMetadata.$type, DeleteTrailMetadata); + +const baseListTrailOperationsRequest: object = { + $type: "yandex.cloud.audittrails.v1.ListTrailOperationsRequest", + trailId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListTrailOperationsRequest = { + $type: "yandex.cloud.audittrails.v1.ListTrailOperationsRequest" as const, + + encode( + message: ListTrailOperationsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.trailId !== "") { + writer.uint32(10).string(message.trailId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListTrailOperationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListTrailOperationsRequest, + } as ListTrailOperationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trailId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListTrailOperationsRequest { + const message = { + ...baseListTrailOperationsRequest, + } as ListTrailOperationsRequest; + message.trailId = + object.trailId !== undefined && object.trailId !== null + ? String(object.trailId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListTrailOperationsRequest): unknown { + const obj: any = {}; + message.trailId !== undefined && (obj.trailId = message.trailId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListTrailOperationsRequest { + const message = { + ...baseListTrailOperationsRequest, + } as ListTrailOperationsRequest; + message.trailId = object.trailId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListTrailOperationsRequest.$type, + ListTrailOperationsRequest +); + +const baseListTrailOperationsResponse: object = { + $type: "yandex.cloud.audittrails.v1.ListTrailOperationsResponse", + nextPageToken: "", +}; + +export const ListTrailOperationsResponse = { + $type: "yandex.cloud.audittrails.v1.ListTrailOperationsResponse" as const, + + encode( + message: ListTrailOperationsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.operations) { + Operation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListTrailOperationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListTrailOperationsResponse, + } as ListTrailOperationsResponse; + message.operations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operations.push(Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListTrailOperationsResponse { + const message = { + ...baseListTrailOperationsResponse, + } as ListTrailOperationsResponse; + message.operations = (object.operations ?? []).map((e: any) => + Operation.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListTrailOperationsResponse): unknown { + const obj: any = {}; + if (message.operations) { + obj.operations = message.operations.map((e) => + e ? Operation.toJSON(e) : undefined + ); + } else { + obj.operations = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListTrailOperationsResponse { + const message = { + ...baseListTrailOperationsResponse, + } as ListTrailOperationsResponse; + message.operations = + object.operations?.map((e) => Operation.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListTrailOperationsResponse.$type, + ListTrailOperationsResponse +); + +/** A set of methods for managing trails. */ +export const TrailServiceService = { + /** + * Returns the specified trail. + * + * To get the list of all available trails, make a [List] request. + */ + get: { + path: "/yandex.cloud.audittrails.v1.TrailService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetTrailRequest) => + Buffer.from(GetTrailRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetTrailRequest.decode(value), + responseSerialize: (value: Trail) => + Buffer.from(Trail.encode(value).finish()), + responseDeserialize: (value: Buffer) => Trail.decode(value), + }, + /** Retrieves the list of trails in the specified folder. */ + list: { + path: "/yandex.cloud.audittrails.v1.TrailService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListTrailsRequest) => + Buffer.from(ListTrailsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListTrailsRequest.decode(value), + responseSerialize: (value: ListTrailsResponse) => + Buffer.from(ListTrailsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListTrailsResponse.decode(value), + }, + /** Creates a trail in the specified folder. */ + create: { + path: "/yandex.cloud.audittrails.v1.TrailService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateTrailRequest) => + Buffer.from(CreateTrailRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateTrailRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates the specified trail. */ + update: { + path: "/yandex.cloud.audittrails.v1.TrailService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateTrailRequest) => + Buffer.from(UpdateTrailRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateTrailRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes the specified trail. */ + delete: { + path: "/yandex.cloud.audittrails.v1.TrailService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteTrailRequest) => + Buffer.from(DeleteTrailRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteTrailRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Lists operations for the specified trail. */ + listOperations: { + path: "/yandex.cloud.audittrails.v1.TrailService/ListOperations", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListTrailOperationsRequest) => + Buffer.from(ListTrailOperationsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListTrailOperationsRequest.decode(value), + responseSerialize: (value: ListTrailOperationsResponse) => + Buffer.from(ListTrailOperationsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListTrailOperationsResponse.decode(value), + }, + /** Lists existing access bindings for the specified trail. */ + listAccessBindings: { + path: "/yandex.cloud.audittrails.v1.TrailService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the trail. */ + setAccessBindings: { + path: "/yandex.cloud.audittrails.v1.TrailService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the trail. */ + updateAccessBindings: { + path: "/yandex.cloud.audittrails.v1.TrailService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface TrailServiceServer extends UntypedServiceImplementation { + /** + * Returns the specified trail. + * + * To get the list of all available trails, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of trails in the specified folder. */ + list: handleUnaryCall; + /** Creates a trail in the specified folder. */ + create: handleUnaryCall; + /** Updates the specified trail. */ + update: handleUnaryCall; + /** Deletes the specified trail. */ + delete: handleUnaryCall; + /** Lists operations for the specified trail. */ + listOperations: handleUnaryCall< + ListTrailOperationsRequest, + ListTrailOperationsResponse + >; + /** Lists existing access bindings for the specified trail. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the trail. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the trail. */ + updateAccessBindings: handleUnaryCall; +} + +export interface TrailServiceClient extends Client { + /** + * Returns the specified trail. + * + * To get the list of all available trails, make a [List] request. + */ + get( + request: GetTrailRequest, + callback: (error: ServiceError | null, response: Trail) => void + ): ClientUnaryCall; + get( + request: GetTrailRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Trail) => void + ): ClientUnaryCall; + get( + request: GetTrailRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Trail) => void + ): ClientUnaryCall; + /** Retrieves the list of trails in the specified folder. */ + list( + request: ListTrailsRequest, + callback: (error: ServiceError | null, response: ListTrailsResponse) => void + ): ClientUnaryCall; + list( + request: ListTrailsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: ListTrailsResponse) => void + ): ClientUnaryCall; + list( + request: ListTrailsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: ListTrailsResponse) => void + ): ClientUnaryCall; + /** Creates a trail in the specified folder. */ + create( + request: CreateTrailRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateTrailRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateTrailRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates the specified trail. */ + update( + request: UpdateTrailRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateTrailRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateTrailRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes the specified trail. */ + delete( + request: DeleteTrailRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteTrailRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteTrailRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Lists operations for the specified trail. */ + listOperations( + request: ListTrailOperationsRequest, + callback: ( + error: ServiceError | null, + response: ListTrailOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListTrailOperationsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListTrailOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListTrailOperationsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListTrailOperationsResponse + ) => void + ): ClientUnaryCall; + /** Lists existing access bindings for the specified trail. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the trail. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the trail. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const TrailServiceClient = makeGenericClientConstructor( + TrailServiceService, + "yandex.cloud.audittrails.v1.TrailService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): TrailServiceClient; + service: typeof TrailServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/backup/index.ts b/src/generated/yandex/cloud/backup/index.ts index 1b05d72e..50390be2 100644 --- a/src/generated/yandex/cloud/backup/index.ts +++ b/src/generated/yandex/cloud/backup/index.ts @@ -1,7 +1,7 @@ -export * as backup from './v1/backup' -export * as backup_service from './v1/backup_service' -export * as policy from './v1/policy' -export * as policy_service from './v1/policy_service' -export * as provider_service from './v1/provider_service' -export * as resource from './v1/resource' -export * as resource_service from './v1/resource_service' \ No newline at end of file +export * as v1_backup from './v1/backup' +export * as v1_backup_service from './v1/backup_service' +export * as v1_policy from './v1/policy' +export * as v1_policy_service from './v1/policy_service' +export * as v1_provider_service from './v1/provider_service' +export * as v1_resource from './v1/resource' +export * as v1_resource_service from './v1/resource_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/backup/v1/policy.ts b/src/generated/yandex/cloud/backup/v1/policy.ts index 4ad96929..8180b9c9 100644 --- a/src/generated/yandex/cloud/backup/v1/policy.ts +++ b/src/generated/yandex/cloud/backup/v1/policy.ts @@ -515,8 +515,8 @@ export interface PolicySettings_Retention { $type: "yandex.cloud.backup.v1.PolicySettings.Retention"; /** A list of retention rules. */ rules: PolicySettings_Retention_RetentionRule[]; - /** If true, retention rules will be applied after backup is finished. */ - afterBackup: boolean; + /** If true, retention rules will be applied before backup is finished. */ + beforeBackup: boolean; } export interface PolicySettings_Retention_RetentionRule { @@ -626,6 +626,65 @@ export interface PolicySettings_Scheduling_BackupSet { sinceLastExecTime?: | PolicySettings_Scheduling_BackupSet_SinceLastExecTime | undefined; + /** + * BackupSet type -- one of incr, full, differential or auto. + * if custom scheme is used the BackupSet type should be specified + */ + type: PolicySettings_Scheduling_BackupSet_Type; +} + +export enum PolicySettings_Scheduling_BackupSet_Type { + TYPE_UNSPECIFIED = 0, + TYPE_AUTO = 1, + TYPE_FULL = 2, + TYPE_INCREMENTAL = 3, + TYPE_DIFFERENTIAL = 4, + UNRECOGNIZED = -1, +} + +export function policySettings_Scheduling_BackupSet_TypeFromJSON( + object: any +): PolicySettings_Scheduling_BackupSet_Type { + switch (object) { + case 0: + case "TYPE_UNSPECIFIED": + return PolicySettings_Scheduling_BackupSet_Type.TYPE_UNSPECIFIED; + case 1: + case "TYPE_AUTO": + return PolicySettings_Scheduling_BackupSet_Type.TYPE_AUTO; + case 2: + case "TYPE_FULL": + return PolicySettings_Scheduling_BackupSet_Type.TYPE_FULL; + case 3: + case "TYPE_INCREMENTAL": + return PolicySettings_Scheduling_BackupSet_Type.TYPE_INCREMENTAL; + case 4: + case "TYPE_DIFFERENTIAL": + return PolicySettings_Scheduling_BackupSet_Type.TYPE_DIFFERENTIAL; + case -1: + case "UNRECOGNIZED": + default: + return PolicySettings_Scheduling_BackupSet_Type.UNRECOGNIZED; + } +} + +export function policySettings_Scheduling_BackupSet_TypeToJSON( + object: PolicySettings_Scheduling_BackupSet_Type +): string { + switch (object) { + case PolicySettings_Scheduling_BackupSet_Type.TYPE_UNSPECIFIED: + return "TYPE_UNSPECIFIED"; + case PolicySettings_Scheduling_BackupSet_Type.TYPE_AUTO: + return "TYPE_AUTO"; + case PolicySettings_Scheduling_BackupSet_Type.TYPE_FULL: + return "TYPE_FULL"; + case PolicySettings_Scheduling_BackupSet_Type.TYPE_INCREMENTAL: + return "TYPE_INCREMENTAL"; + case PolicySettings_Scheduling_BackupSet_Type.TYPE_DIFFERENTIAL: + return "TYPE_DIFFERENTIAL"; + default: + return "UNKNOWN"; + } } export interface PolicySettings_Scheduling_BackupSet_Time { @@ -671,6 +730,8 @@ export interface PolicyApplication { enabled: boolean; status: PolicyApplication_Status; createdAt?: Date; + /** If true, then the policy is in in the process of binding to the instance. */ + isProcessing: boolean; } export enum PolicyApplication_Status { @@ -1853,7 +1914,7 @@ messageTypeRegistry.set( const basePolicySettings_Retention: object = { $type: "yandex.cloud.backup.v1.PolicySettings.Retention", - afterBackup: false, + beforeBackup: false, }; export const PolicySettings_Retention = { @@ -1869,8 +1930,8 @@ export const PolicySettings_Retention = { writer.uint32(10).fork() ).ldelim(); } - if (message.afterBackup === true) { - writer.uint32(16).bool(message.afterBackup); + if (message.beforeBackup === true) { + writer.uint32(24).bool(message.beforeBackup); } return writer; }, @@ -1896,8 +1957,8 @@ export const PolicySettings_Retention = { ) ); break; - case 2: - message.afterBackup = reader.bool(); + case 3: + message.beforeBackup = reader.bool(); break; default: reader.skipType(tag & 7); @@ -1914,9 +1975,9 @@ export const PolicySettings_Retention = { message.rules = (object.rules ?? []).map((e: any) => PolicySettings_Retention_RetentionRule.fromJSON(e) ); - message.afterBackup = - object.afterBackup !== undefined && object.afterBackup !== null - ? Boolean(object.afterBackup) + message.beforeBackup = + object.beforeBackup !== undefined && object.beforeBackup !== null + ? Boolean(object.beforeBackup) : false; return message; }, @@ -1930,8 +1991,8 @@ export const PolicySettings_Retention = { } else { obj.rules = []; } - message.afterBackup !== undefined && - (obj.afterBackup = message.afterBackup); + message.beforeBackup !== undefined && + (obj.beforeBackup = message.beforeBackup); return obj; }, @@ -1945,7 +2006,7 @@ export const PolicySettings_Retention = { object.rules?.map((e) => PolicySettings_Retention_RetentionRule.fromPartial(e) ) || []; - message.afterBackup = object.afterBackup ?? false; + message.beforeBackup = object.beforeBackup ?? false; return message; }, }; @@ -2251,6 +2312,7 @@ messageTypeRegistry.set( const basePolicySettings_Scheduling_BackupSet: object = { $type: "yandex.cloud.backup.v1.PolicySettings.Scheduling.BackupSet", + type: 0, }; export const PolicySettings_Scheduling_BackupSet = { @@ -2272,6 +2334,9 @@ export const PolicySettings_Scheduling_BackupSet = { writer.uint32(18).fork() ).ldelim(); } + if (message.type !== 0) { + writer.uint32(24).int32(message.type); + } return writer; }, @@ -2300,6 +2365,9 @@ export const PolicySettings_Scheduling_BackupSet = { reader.uint32() ); break; + case 3: + message.type = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -2323,6 +2391,10 @@ export const PolicySettings_Scheduling_BackupSet = { object.sinceLastExecTime ) : undefined; + message.type = + object.type !== undefined && object.type !== null + ? policySettings_Scheduling_BackupSet_TypeFromJSON(object.type) + : 0; return message; }, @@ -2338,6 +2410,8 @@ export const PolicySettings_Scheduling_BackupSet = { message.sinceLastExecTime ) : undefined); + message.type !== undefined && + (obj.type = policySettings_Scheduling_BackupSet_TypeToJSON(message.type)); return obj; }, @@ -2358,6 +2432,7 @@ export const PolicySettings_Scheduling_BackupSet = { object.sinceLastExecTime ) : undefined; + message.type = object.type ?? 0; return message; }, }; @@ -2724,6 +2799,7 @@ const basePolicyApplication: object = { computeInstanceId: "", enabled: false, status: 0, + isProcessing: false, }; export const PolicyApplication = { @@ -2751,6 +2827,9 @@ export const PolicyApplication = { writer.uint32(42).fork() ).ldelim(); } + if (message.isProcessing === true) { + writer.uint32(48).bool(message.isProcessing); + } return writer; }, @@ -2778,6 +2857,9 @@ export const PolicyApplication = { Timestamp.decode(reader, reader.uint32()) ); break; + case 6: + message.isProcessing = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -2809,6 +2891,10 @@ export const PolicyApplication = { object.createdAt !== undefined && object.createdAt !== null ? fromJsonTimestamp(object.createdAt) : undefined; + message.isProcessing = + object.isProcessing !== undefined && object.isProcessing !== null + ? Boolean(object.isProcessing) + : false; return message; }, @@ -2822,6 +2908,8 @@ export const PolicyApplication = { (obj.status = policyApplication_StatusToJSON(message.status)); message.createdAt !== undefined && (obj.createdAt = message.createdAt.toISOString()); + message.isProcessing !== undefined && + (obj.isProcessing = message.isProcessing); return obj; }, @@ -2834,6 +2922,7 @@ export const PolicyApplication = { message.enabled = object.enabled ?? false; message.status = object.status ?? 0; message.createdAt = object.createdAt ?? undefined; + message.isProcessing = object.isProcessing ?? false; return message; }, }; diff --git a/src/generated/yandex/cloud/backup/v1/policy_service.ts b/src/generated/yandex/cloud/backup/v1/policy_service.ts index 3fd782c4..c912f3d2 100644 --- a/src/generated/yandex/cloud/backup/v1/policy_service.ts +++ b/src/generated/yandex/cloud/backup/v1/policy_service.ts @@ -106,6 +106,8 @@ export interface ListApplicationsRequest { policyId: string | undefined; /** Compute Cloud instance ID. */ computeInstanceId: string | undefined; + /** If true, also returns applications that in the process of binding. */ + showProcessing: boolean; } export interface ListApplicationsResponse { @@ -127,6 +129,8 @@ export interface ExecuteMetadata { policyId: string; /** Compute Cloud instance ID. */ computeInstanceId: string; + /** Progress of the backup process. */ + progressPercentage: number; } export interface RevokeRequest { @@ -946,6 +950,7 @@ messageTypeRegistry.set(ApplyPolicyMetadata.$type, ApplyPolicyMetadata); const baseListApplicationsRequest: object = { $type: "yandex.cloud.backup.v1.ListApplicationsRequest", + showProcessing: false, }; export const ListApplicationsRequest = { @@ -964,6 +969,9 @@ export const ListApplicationsRequest = { if (message.computeInstanceId !== undefined) { writer.uint32(26).string(message.computeInstanceId); } + if (message.showProcessing === true) { + writer.uint32(32).bool(message.showProcessing); + } return writer; }, @@ -988,6 +996,9 @@ export const ListApplicationsRequest = { case 3: message.computeInstanceId = reader.string(); break; + case 4: + message.showProcessing = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -1013,6 +1024,10 @@ export const ListApplicationsRequest = { object.computeInstanceId !== null ? String(object.computeInstanceId) : undefined; + message.showProcessing = + object.showProcessing !== undefined && object.showProcessing !== null + ? Boolean(object.showProcessing) + : false; return message; }, @@ -1022,6 +1037,8 @@ export const ListApplicationsRequest = { message.policyId !== undefined && (obj.policyId = message.policyId); message.computeInstanceId !== undefined && (obj.computeInstanceId = message.computeInstanceId); + message.showProcessing !== undefined && + (obj.showProcessing = message.showProcessing); return obj; }, @@ -1034,6 +1051,7 @@ export const ListApplicationsRequest = { message.folderId = object.folderId ?? undefined; message.policyId = object.policyId ?? undefined; message.computeInstanceId = object.computeInstanceId ?? undefined; + message.showProcessing = object.showProcessing ?? false; return message; }, }; @@ -1203,6 +1221,7 @@ const baseExecuteMetadata: object = { $type: "yandex.cloud.backup.v1.ExecuteMetadata", policyId: "", computeInstanceId: "", + progressPercentage: 0, }; export const ExecuteMetadata = { @@ -1218,6 +1237,9 @@ export const ExecuteMetadata = { if (message.computeInstanceId !== "") { writer.uint32(18).string(message.computeInstanceId); } + if (message.progressPercentage !== 0) { + writer.uint32(25).double(message.progressPercentage); + } return writer; }, @@ -1234,6 +1256,9 @@ export const ExecuteMetadata = { case 2: message.computeInstanceId = reader.string(); break; + case 3: + message.progressPercentage = reader.double(); + break; default: reader.skipType(tag & 7); break; @@ -1253,6 +1278,11 @@ export const ExecuteMetadata = { object.computeInstanceId !== null ? String(object.computeInstanceId) : ""; + message.progressPercentage = + object.progressPercentage !== undefined && + object.progressPercentage !== null + ? Number(object.progressPercentage) + : 0; return message; }, @@ -1261,6 +1291,8 @@ export const ExecuteMetadata = { message.policyId !== undefined && (obj.policyId = message.policyId); message.computeInstanceId !== undefined && (obj.computeInstanceId = message.computeInstanceId); + message.progressPercentage !== undefined && + (obj.progressPercentage = message.progressPercentage); return obj; }, @@ -1270,6 +1302,7 @@ export const ExecuteMetadata = { const message = { ...baseExecuteMetadata } as ExecuteMetadata; message.policyId = object.policyId ?? ""; message.computeInstanceId = object.computeInstanceId ?? ""; + message.progressPercentage = object.progressPercentage ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/backup/v1/provider_service.ts b/src/generated/yandex/cloud/backup/v1/provider_service.ts index ee1e952e..8a01c983 100644 --- a/src/generated/yandex/cloud/backup/v1/provider_service.ts +++ b/src/generated/yandex/cloud/backup/v1/provider_service.ts @@ -28,6 +28,8 @@ export interface ActivateProviderRequest { * For more information, please see [activate-provider](/docs/backup/quickstart#activate-provider) */ name: string; + /** Don't create default policies while activating the provider. */ + skipDefaultPolicy: boolean; } export interface ActivateProviderMetadata { @@ -54,6 +56,7 @@ const baseActivateProviderRequest: object = { $type: "yandex.cloud.backup.v1.ActivateProviderRequest", folderId: "", name: "", + skipDefaultPolicy: false, }; export const ActivateProviderRequest = { @@ -69,6 +72,9 @@ export const ActivateProviderRequest = { if (message.name !== "") { writer.uint32(26).string(message.name); } + if (message.skipDefaultPolicy === true) { + writer.uint32(32).bool(message.skipDefaultPolicy); + } return writer; }, @@ -90,6 +96,9 @@ export const ActivateProviderRequest = { case 3: message.name = reader.string(); break; + case 4: + message.skipDefaultPolicy = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -110,6 +119,11 @@ export const ActivateProviderRequest = { object.name !== undefined && object.name !== null ? String(object.name) : ""; + message.skipDefaultPolicy = + object.skipDefaultPolicy !== undefined && + object.skipDefaultPolicy !== null + ? Boolean(object.skipDefaultPolicy) + : false; return message; }, @@ -117,6 +131,8 @@ export const ActivateProviderRequest = { const obj: any = {}; message.folderId !== undefined && (obj.folderId = message.folderId); message.name !== undefined && (obj.name = message.name); + message.skipDefaultPolicy !== undefined && + (obj.skipDefaultPolicy = message.skipDefaultPolicy); return obj; }, @@ -128,6 +144,7 @@ export const ActivateProviderRequest = { } as ActivateProviderRequest; message.folderId = object.folderId ?? ""; message.name = object.name ?? ""; + message.skipDefaultPolicy = object.skipDefaultPolicy ?? false; return message; }, }; diff --git a/src/generated/yandex/cloud/backup/v1/resource.ts b/src/generated/yandex/cloud/backup/v1/resource.ts index 719f0ea0..f4647976 100644 --- a/src/generated/yandex/cloud/backup/v1/resource.ts +++ b/src/generated/yandex/cloud/backup/v1/resource.ts @@ -6,6 +6,46 @@ import { Timestamp } from "../../../../google/protobuf/timestamp"; export const protobufPackage = "yandex.cloud.backup.v1"; +export enum ResourceType { + RESOURCE_TYPE_UNSPECIFIED = 0, + /** COMPUTE - Resource is Compute Cloud VM */ + COMPUTE = 1, + /** BMS - Resource is baremetal server */ + BMS = 2, + UNRECOGNIZED = -1, +} + +export function resourceTypeFromJSON(object: any): ResourceType { + switch (object) { + case 0: + case "RESOURCE_TYPE_UNSPECIFIED": + return ResourceType.RESOURCE_TYPE_UNSPECIFIED; + case 1: + case "COMPUTE": + return ResourceType.COMPUTE; + case 2: + case "BMS": + return ResourceType.BMS; + case -1: + case "UNRECOGNIZED": + default: + return ResourceType.UNRECOGNIZED; + } +} + +export function resourceTypeToJSON(object: ResourceType): string { + switch (object) { + case ResourceType.RESOURCE_TYPE_UNSPECIFIED: + return "RESOURCE_TYPE_UNSPECIFIED"; + case ResourceType.COMPUTE: + return "COMPUTE"; + case ResourceType.BMS: + return "BMS"; + default: + return "UNKNOWN"; + } +} + export interface Resource { $type: "yandex.cloud.backup.v1.Resource"; /** Compute Cloud instance ID. */ @@ -37,6 +77,15 @@ export interface Resource { * Cloud Backup resource. */ isActive: boolean; + /** Status of resource initialization in cloud backup service. */ + initStatus: Resource_InitStatus; + /** + * Metadata to provide details about instance registration process + * if status is FAILED_REGISTRATION or REGISTERING + */ + metadata: string; + /** Type of resource. Could be compute VM or baremetal server. */ + type: ResourceType; } export enum Resource_Status { @@ -106,6 +155,60 @@ export function resource_StatusToJSON(object: Resource_Status): string { } } +export enum Resource_InitStatus { + INIT_STATUS_UNSPECIFIED = 0, + /** REGISTERING - Registration of instance in cloud backups have started. */ + REGISTERING = 1, + /** REGISTRED - Instance is registered in cloud backups. */ + REGISTRED = 2, + /** FAILED_REGISTRATION - Instance registration failed. */ + FAILED_REGISTRATION = 3, + /** DELETED - Instance is deleted from cloud backup service. */ + DELETED = 4, + UNRECOGNIZED = -1, +} + +export function resource_InitStatusFromJSON(object: any): Resource_InitStatus { + switch (object) { + case 0: + case "INIT_STATUS_UNSPECIFIED": + return Resource_InitStatus.INIT_STATUS_UNSPECIFIED; + case 1: + case "REGISTERING": + return Resource_InitStatus.REGISTERING; + case 2: + case "REGISTRED": + return Resource_InitStatus.REGISTRED; + case 3: + case "FAILED_REGISTRATION": + return Resource_InitStatus.FAILED_REGISTRATION; + case 4: + case "DELETED": + return Resource_InitStatus.DELETED; + case -1: + case "UNRECOGNIZED": + default: + return Resource_InitStatus.UNRECOGNIZED; + } +} + +export function resource_InitStatusToJSON(object: Resource_InitStatus): string { + switch (object) { + case Resource_InitStatus.INIT_STATUS_UNSPECIFIED: + return "INIT_STATUS_UNSPECIFIED"; + case Resource_InitStatus.REGISTERING: + return "REGISTERING"; + case Resource_InitStatus.REGISTRED: + return "REGISTRED"; + case Resource_InitStatus.FAILED_REGISTRATION: + return "FAILED_REGISTRATION"; + case Resource_InitStatus.DELETED: + return "DELETED"; + default: + return "UNKNOWN"; + } +} + export interface Progress { $type: "yandex.cloud.backup.v1.Progress"; current: number; @@ -135,6 +238,10 @@ export interface Task { completedAt?: Date; /** Compute Cloud instance ID. */ computeInstanceId: string; + /** Task result code. */ + resultCode: Task_Code; + /** Task error message if task finished with not OK code */ + error: string; } export enum Task_Type { @@ -142,6 +249,8 @@ export enum Task_Type { BACKUP = 1, RETENTION = 2, RECOVERY = 3, + APPLY_POLICY = 4, + REVOKE_POLICY = 5, UNRECOGNIZED = -1, } @@ -159,6 +268,12 @@ export function task_TypeFromJSON(object: any): Task_Type { case 3: case "RECOVERY": return Task_Type.RECOVERY; + case 4: + case "APPLY_POLICY": + return Task_Type.APPLY_POLICY; + case 5: + case "REVOKE_POLICY": + return Task_Type.REVOKE_POLICY; case -1: case "UNRECOGNIZED": default: @@ -176,6 +291,10 @@ export function task_TypeToJSON(object: Task_Type): string { return "RETENTION"; case Task_Type.RECOVERY: return "RECOVERY"; + case Task_Type.APPLY_POLICY: + return "APPLY_POLICY"; + case Task_Type.REVOKE_POLICY: + return "REVOKE_POLICY"; default: return "UNKNOWN"; } @@ -238,6 +357,69 @@ export function task_StatusToJSON(object: Task_Status): string { } } +/** Result code of task */ +export enum Task_Code { + CODE_UNSPECIFIED = 0, + OK = 1, + ERROR = 2, + WARNING = 3, + CANCELLED = 4, + ABANDONED = 5, + TIMEDOUT = 6, + UNRECOGNIZED = -1, +} + +export function task_CodeFromJSON(object: any): Task_Code { + switch (object) { + case 0: + case "CODE_UNSPECIFIED": + return Task_Code.CODE_UNSPECIFIED; + case 1: + case "OK": + return Task_Code.OK; + case 2: + case "ERROR": + return Task_Code.ERROR; + case 3: + case "WARNING": + return Task_Code.WARNING; + case 4: + case "CANCELLED": + return Task_Code.CANCELLED; + case 5: + case "ABANDONED": + return Task_Code.ABANDONED; + case 6: + case "TIMEDOUT": + return Task_Code.TIMEDOUT; + case -1: + case "UNRECOGNIZED": + default: + return Task_Code.UNRECOGNIZED; + } +} + +export function task_CodeToJSON(object: Task_Code): string { + switch (object) { + case Task_Code.CODE_UNSPECIFIED: + return "CODE_UNSPECIFIED"; + case Task_Code.OK: + return "OK"; + case Task_Code.ERROR: + return "ERROR"; + case Task_Code.WARNING: + return "WARNING"; + case Task_Code.CANCELLED: + return "CANCELLED"; + case Task_Code.ABANDONED: + return "ABANDONED"; + case Task_Code.TIMEDOUT: + return "TIMEDOUT"; + default: + return "UNKNOWN"; + } +} + const baseResource: object = { $type: "yandex.cloud.backup.v1.Resource", computeInstanceId: "", @@ -248,6 +430,9 @@ const baseResource: object = { statusProgress: 0, resourceId: "", isActive: false, + initStatus: 0, + metadata: "", + type: 0, }; export const Resource = { @@ -305,6 +490,15 @@ export const Resource = { if (message.isActive === true) { writer.uint32(96).bool(message.isActive); } + if (message.initStatus !== 0) { + writer.uint32(104).int32(message.initStatus); + } + if (message.metadata !== "") { + writer.uint32(114).string(message.metadata); + } + if (message.type !== 0) { + writer.uint32(120).int32(message.type); + } return writer; }, @@ -359,6 +553,15 @@ export const Resource = { case 12: message.isActive = reader.bool(); break; + case 13: + message.initStatus = reader.int32() as any; + break; + case 14: + message.metadata = reader.string(); + break; + case 15: + message.type = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -418,6 +621,18 @@ export const Resource = { object.isActive !== undefined && object.isActive !== null ? Boolean(object.isActive) : false; + message.initStatus = + object.initStatus !== undefined && object.initStatus !== null + ? resource_InitStatusFromJSON(object.initStatus) + : 0; + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? String(object.metadata) + : ""; + message.type = + object.type !== undefined && object.type !== null + ? resourceTypeFromJSON(object.type) + : 0; return message; }, @@ -443,6 +658,10 @@ export const Resource = { (obj.nextBackupTime = message.nextBackupTime.toISOString()); message.resourceId !== undefined && (obj.resourceId = message.resourceId); message.isActive !== undefined && (obj.isActive = message.isActive); + message.initStatus !== undefined && + (obj.initStatus = resource_InitStatusToJSON(message.initStatus)); + message.metadata !== undefined && (obj.metadata = message.metadata); + message.type !== undefined && (obj.type = resourceTypeToJSON(message.type)); return obj; }, @@ -460,6 +679,9 @@ export const Resource = { message.nextBackupTime = object.nextBackupTime ?? undefined; message.resourceId = object.resourceId ?? ""; message.isActive = object.isActive ?? false; + message.initStatus = object.initStatus ?? 0; + message.metadata = object.metadata ?? ""; + message.type = object.type ?? 0; return message; }, }; @@ -548,6 +770,8 @@ const baseTask: object = { type: 0, status: 0, computeInstanceId: "", + resultCode: 0, + error: "", }; export const Task = { @@ -599,6 +823,12 @@ export const Task = { if (message.computeInstanceId !== "") { writer.uint32(90).string(message.computeInstanceId); } + if (message.resultCode !== 0) { + writer.uint32(96).int32(message.resultCode); + } + if (message.error !== "") { + writer.uint32(106).string(message.error); + } return writer; }, @@ -650,6 +880,12 @@ export const Task = { case 11: message.computeInstanceId = reader.string(); break; + case 12: + message.resultCode = reader.int32() as any; + break; + case 13: + message.error = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -703,6 +939,14 @@ export const Task = { object.computeInstanceId !== null ? String(object.computeInstanceId) : ""; + message.resultCode = + object.resultCode !== undefined && object.resultCode !== null + ? task_CodeFromJSON(object.resultCode) + : 0; + message.error = + object.error !== undefined && object.error !== null + ? String(object.error) + : ""; return message; }, @@ -729,6 +973,9 @@ export const Task = { (obj.completedAt = message.completedAt.toISOString()); message.computeInstanceId !== undefined && (obj.computeInstanceId = message.computeInstanceId); + message.resultCode !== undefined && + (obj.resultCode = task_CodeToJSON(message.resultCode)); + message.error !== undefined && (obj.error = message.error); return obj; }, @@ -748,6 +995,8 @@ export const Task = { message.updatedAt = object.updatedAt ?? undefined; message.completedAt = object.completedAt ?? undefined; message.computeInstanceId = object.computeInstanceId ?? ""; + message.resultCode = object.resultCode ?? 0; + message.error = object.error ?? ""; return message; }, }; diff --git a/src/generated/yandex/cloud/backup/v1/resource_service.ts b/src/generated/yandex/cloud/backup/v1/resource_service.ts index 649cc643..b42b7b83 100644 --- a/src/generated/yandex/cloud/backup/v1/resource_service.ts +++ b/src/generated/yandex/cloud/backup/v1/resource_service.ts @@ -14,7 +14,13 @@ import { ServiceError, } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; -import { Resource, Task } from "../../../../yandex/cloud/backup/v1/resource"; +import { + ResourceType, + Resource, + Task, + resourceTypeFromJSON, + resourceTypeToJSON, +} from "../../../../yandex/cloud/backup/v1/resource"; import { Operation } from "../../../../yandex/cloud/operation/operation"; export const protobufPackage = "yandex.cloud.backup.v1"; @@ -27,6 +33,8 @@ export interface ListResourcesRequest { pageSize: number; /** Token for the results page. */ pageToken: string; + /** Type of resource. Could be compute VM or baremetal server. */ + type: ResourceType; } export interface ListResourcesResponse { @@ -173,11 +181,30 @@ export interface CreateDirectoryMetadata { path: string; } +export interface ListResourceOperationsRequest { + $type: "yandex.cloud.backup.v1.ListResourceOperationsRequest"; + /** Compute Cloud instance ID. */ + computeInstanceId: string; + /** Number of results per page. */ + pageSize: number; + /** Token for the results page. */ + pageToken: string; +} + +export interface ListResourceOperationsResponse { + $type: "yandex.cloud.backup.v1.ListResourceOperationsResponse"; + /** List of operations for the specified instance. */ + operations: Operation[]; + /** Token for the next results page. */ + nextPageToken: string; +} + const baseListResourcesRequest: object = { $type: "yandex.cloud.backup.v1.ListResourcesRequest", folderId: "", pageSize: 0, pageToken: "", + type: 0, }; export const ListResourcesRequest = { @@ -196,6 +223,9 @@ export const ListResourcesRequest = { if (message.pageToken !== "") { writer.uint32(26).string(message.pageToken); } + if (message.type !== 0) { + writer.uint32(32).int32(message.type); + } return writer; }, @@ -218,6 +248,9 @@ export const ListResourcesRequest = { case 3: message.pageToken = reader.string(); break; + case 4: + message.type = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -240,6 +273,10 @@ export const ListResourcesRequest = { object.pageToken !== undefined && object.pageToken !== null ? String(object.pageToken) : ""; + message.type = + object.type !== undefined && object.type !== null + ? resourceTypeFromJSON(object.type) + : 0; return message; }, @@ -249,6 +286,7 @@ export const ListResourcesRequest = { message.pageSize !== undefined && (obj.pageSize = Math.round(message.pageSize)); message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.type !== undefined && (obj.type = resourceTypeToJSON(message.type)); return obj; }, @@ -259,6 +297,7 @@ export const ListResourcesRequest = { message.folderId = object.folderId ?? ""; message.pageSize = object.pageSize ?? 0; message.pageToken = object.pageToken ?? ""; + message.type = object.type ?? 0; return message; }, }; @@ -1265,6 +1304,203 @@ export const CreateDirectoryMetadata = { messageTypeRegistry.set(CreateDirectoryMetadata.$type, CreateDirectoryMetadata); +const baseListResourceOperationsRequest: object = { + $type: "yandex.cloud.backup.v1.ListResourceOperationsRequest", + computeInstanceId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListResourceOperationsRequest = { + $type: "yandex.cloud.backup.v1.ListResourceOperationsRequest" as const, + + encode( + message: ListResourceOperationsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.computeInstanceId !== "") { + writer.uint32(10).string(message.computeInstanceId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListResourceOperationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListResourceOperationsRequest, + } as ListResourceOperationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.computeInstanceId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListResourceOperationsRequest { + const message = { + ...baseListResourceOperationsRequest, + } as ListResourceOperationsRequest; + message.computeInstanceId = + object.computeInstanceId !== undefined && + object.computeInstanceId !== null + ? String(object.computeInstanceId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListResourceOperationsRequest): unknown { + const obj: any = {}; + message.computeInstanceId !== undefined && + (obj.computeInstanceId = message.computeInstanceId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListResourceOperationsRequest { + const message = { + ...baseListResourceOperationsRequest, + } as ListResourceOperationsRequest; + message.computeInstanceId = object.computeInstanceId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListResourceOperationsRequest.$type, + ListResourceOperationsRequest +); + +const baseListResourceOperationsResponse: object = { + $type: "yandex.cloud.backup.v1.ListResourceOperationsResponse", + nextPageToken: "", +}; + +export const ListResourceOperationsResponse = { + $type: "yandex.cloud.backup.v1.ListResourceOperationsResponse" as const, + + encode( + message: ListResourceOperationsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.operations) { + Operation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListResourceOperationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListResourceOperationsResponse, + } as ListResourceOperationsResponse; + message.operations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operations.push(Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListResourceOperationsResponse { + const message = { + ...baseListResourceOperationsResponse, + } as ListResourceOperationsResponse; + message.operations = (object.operations ?? []).map((e: any) => + Operation.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListResourceOperationsResponse): unknown { + const obj: any = {}; + if (message.operations) { + obj.operations = message.operations.map((e) => + e ? Operation.toJSON(e) : undefined + ); + } else { + obj.operations = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListResourceOperationsResponse { + const message = { + ...baseListResourceOperationsResponse, + } as ListResourceOperationsResponse; + message.operations = + object.operations?.map((e) => Operation.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListResourceOperationsResponse.$type, + ListResourceOperationsResponse +); + /** A set of methods for managing backup resources: [Compute Cloud instances](/docs/backup/concepts/vm-connection#os). */ export const ResourceServiceService = { /** List resources: Compute Cloud instances. */ @@ -1345,6 +1581,20 @@ export const ResourceServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** ListOperations return all operations in backup service for given instance */ + listOperations: { + path: "/yandex.cloud.backup.v1.ResourceService/ListOperations", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListResourceOperationsRequest) => + Buffer.from(ListResourceOperationsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListResourceOperationsRequest.decode(value), + responseSerialize: (value: ListResourceOperationsResponse) => + Buffer.from(ListResourceOperationsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListResourceOperationsResponse.decode(value), + }, } as const; export interface ResourceServiceServer extends UntypedServiceImplementation { @@ -1366,6 +1616,11 @@ export interface ResourceServiceServer extends UntypedServiceImplementation { listDirectory: handleUnaryCall; /** CreateDirectory creates new directory by requested path. */ createDirectory: handleUnaryCall; + /** ListOperations return all operations in backup service for given instance */ + listOperations: handleUnaryCall< + ListResourceOperationsRequest, + ListResourceOperationsResponse + >; } export interface ResourceServiceClient extends Client { @@ -1498,6 +1753,31 @@ export interface ResourceServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** ListOperations return all operations in backup service for given instance */ + listOperations( + request: ListResourceOperationsRequest, + callback: ( + error: ServiceError | null, + response: ListResourceOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListResourceOperationsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListResourceOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListResourceOperationsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListResourceOperationsResponse + ) => void + ): ClientUnaryCall; } export const ResourceServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/billing/index.ts b/src/generated/yandex/cloud/billing/index.ts index 1567d331..c5672a3c 100644 --- a/src/generated/yandex/cloud/billing/index.ts +++ b/src/generated/yandex/cloud/billing/index.ts @@ -1,11 +1,11 @@ -export * as billable_object from './v1/billable_object' -export * as billing_account from './v1/billing_account' -export * as billing_account_service from './v1/billing_account_service' -export * as budget from './v1/budget' -export * as budget_service from './v1/budget_service' -export * as customer from './v1/customer' -export * as customer_service from './v1/customer_service' -export * as service from './v1/service' -export * as service_service from './v1/service_service' -export * as sku from './v1/sku' -export * as sku_service from './v1/sku_service' \ No newline at end of file +export * as v1_billable_object from './v1/billable_object' +export * as v1_billing_account from './v1/billing_account' +export * as v1_billing_account_service from './v1/billing_account_service' +export * as v1_budget from './v1/budget' +export * as v1_budget_service from './v1/budget_service' +export * as v1_customer from './v1/customer' +export * as v1_customer_service from './v1/customer_service' +export * as v1_service from './v1/service' +export * as v1_service_service from './v1/service_service' +export * as v1_sku from './v1/sku' +export * as v1_sku_service from './v1/sku_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/billing/v1/customer.ts b/src/generated/yandex/cloud/billing/v1/customer.ts index 915b5819..28fe331a 100644 --- a/src/generated/yandex/cloud/billing/v1/customer.ts +++ b/src/generated/yandex/cloud/billing/v1/customer.ts @@ -17,21 +17,53 @@ export interface Customer { /** Person of the customer. Contains legal information. */ export interface CustomerPerson { $type: "yandex.cloud.billing.v1.CustomerPerson"; - /** Name of the person. */ + /** + * Optional. Name of the person. + * + * String length is not limited. + */ name: string; - /** Long name of the person. */ + /** + * Optional. Long name of the person. + * + * String length is not limited. + */ longname: string; - /** Phone of the person. */ + /** + * Optional. Phone of the person. + * + * Must be a valid telephone number or a valid [phoneword](https://en.m.wikipedia.org/wiki/Phoneword). + */ phone: string; - /** Email of the person. */ + /** + * Optional. Email of the person. + * + * Must be a valid [email address](https://en.wikipedia.org/wiki/Email_address). + */ email: string; - /** Post code of the person. */ + /** + * Optional. Post code of the person. + * + * String length is not limited. + */ postCode: string; - /** Post address of the person. */ + /** + * Optional. Post address of the person. + * + * String length is not limited. + */ postAddress: string; - /** Legal address of the person. */ + /** + * Optional. Legal address of the person. + * + * String length is not limited. + */ legalAddress: string; - /** Tax identification number of the person. */ + /** + * Optional. Tax identification number of the person. + * + * String length is not limited. + */ tin: string; } diff --git a/src/generated/yandex/cloud/billing/v1/customer_service.ts b/src/generated/yandex/cloud/billing/v1/customer_service.ts index 7f6bde6f..9caeacaa 100644 --- a/src/generated/yandex/cloud/billing/v1/customer_service.ts +++ b/src/generated/yandex/cloud/billing/v1/customer_service.ts @@ -58,7 +58,7 @@ export interface ListCustomersResponse { export interface InviteCustomerRequest { $type: "yandex.cloud.billing.v1.InviteCustomerRequest"; - /** ID of the reseller that customer will be associated with. */ + /** Billing account ID of the reseller that the customer will be associated with. */ resellerId: string; /** Name of the customer. */ name: string; @@ -70,9 +70,19 @@ export interface InviteCustomerRequest { export interface CreateResellerServedCustomerRequest { $type: "yandex.cloud.billing.v1.CreateResellerServedCustomerRequest"; - /** ID of the reseller that customer will be associated with. */ + /** + * ID of the reseller that customer will be associated with. + * + * Value must match either one of the two regular expressions: + * `^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{32})$` + * or `^[a-z][-a-zA-Z0-9.]{0,48}[a-zA-Z0-9]$`. + */ resellerId: string; - /** Name of the customer. */ + /** + * Name of the customer. + * + * String length is not limited. + */ name: string; /** Person of the customer. */ person?: CustomerPerson; diff --git a/src/generated/yandex/cloud/billing/v1/sku_service.ts b/src/generated/yandex/cloud/billing/v1/sku_service.ts index b42b142e..7ba50d8e 100644 --- a/src/generated/yandex/cloud/billing/v1/sku_service.ts +++ b/src/generated/yandex/cloud/billing/v1/sku_service.ts @@ -63,6 +63,7 @@ export interface ListSkusRequest { * 1. The field name. Currently you can use filtering only on the [yandex.cloud.billing.v1.Sku.id] and [yandex.cloud.billing.v1.Sku.service_id] field. * 2. An `=` operator. * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. + * E.g. `filter=serviceId="dn28hpu6268356q0j8mk"`. */ filter: string; /** diff --git a/src/generated/yandex/cloud/cdn/index.ts b/src/generated/yandex/cloud/cdn/index.ts index b5ae2427..85b3f49b 100644 --- a/src/generated/yandex/cloud/cdn/index.ts +++ b/src/generated/yandex/cloud/cdn/index.ts @@ -1,10 +1,12 @@ -export * as cache_service from './v1/cache_service' -export * as origin from './v1/origin' -export * as origin_group from './v1/origin_group' -export * as origin_group_service from './v1/origin_group_service' -export * as origin_service from './v1/origin_service' -export * as provider_service from './v1/provider_service' -export * as raw_logs from './v1/raw_logs' -export * as raw_logs_service from './v1/raw_logs_service' -export * as resource from './v1/resource' -export * as resource_service from './v1/resource_service' \ No newline at end of file +export * as v1_cache_service from './v1/cache_service' +export * as v1_origin from './v1/origin' +export * as v1_origin_group from './v1/origin_group' +export * as v1_origin_group_service from './v1/origin_group_service' +export * as v1_origin_service from './v1/origin_service' +export * as v1_provider_service from './v1/provider_service' +export * as v1_raw_logs from './v1/raw_logs' +export * as v1_raw_logs_service from './v1/raw_logs_service' +export * as v1_resource from './v1/resource' +export * as v1_resource_service from './v1/resource_service' +export * as v1_rule from './v1/rule' +export * as v1_rule_service from './v1/rule_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/cdn/v1/cache_service.ts b/src/generated/yandex/cloud/cdn/v1/cache_service.ts index b2e9d335..014c7f0f 100644 --- a/src/generated/yandex/cloud/cdn/v1/cache_service.ts +++ b/src/generated/yandex/cloud/cdn/v1/cache_service.ts @@ -28,7 +28,7 @@ export interface PurgeCacheRequest { * * You may use asterisk (`*`) as a wildcard character that substitutes any number of characters. * - * If an empty array of paths is specified, the cache is purged entirely. + * If an empty array of paths is specified (`"paths": []`), the cache is purged entirely. */ paths: string[]; } diff --git a/src/generated/yandex/cloud/cdn/v1/resource.ts b/src/generated/yandex/cloud/cdn/v1/resource.ts index fc32e1ee..93dee268 100644 --- a/src/generated/yandex/cloud/cdn/v1/resource.ts +++ b/src/generated/yandex/cloud/cdn/v1/resource.ts @@ -122,15 +122,101 @@ export function rewriteFlagToJSON(object: RewriteFlag): string { } } +/** SecureKeyURLType defines type of the URL signing. */ +export enum SecureKeyURLType { + SECURE_KEY_URL_TYPE_UNSPECIFIED = 0, + /** ENABLE_IP_SIGNING - Use scpecific IP address in URL signing. URL will be availible only for this IP. */ + ENABLE_IP_SIGNING = 1, + /** DISABLE_IP_SIGNING - Sign URL without using IP address. URL will be available for all IP addresses. */ + DISABLE_IP_SIGNING = 2, + UNRECOGNIZED = -1, +} + +export function secureKeyURLTypeFromJSON(object: any): SecureKeyURLType { + switch (object) { + case 0: + case "SECURE_KEY_URL_TYPE_UNSPECIFIED": + return SecureKeyURLType.SECURE_KEY_URL_TYPE_UNSPECIFIED; + case 1: + case "ENABLE_IP_SIGNING": + return SecureKeyURLType.ENABLE_IP_SIGNING; + case 2: + case "DISABLE_IP_SIGNING": + return SecureKeyURLType.DISABLE_IP_SIGNING; + case -1: + case "UNRECOGNIZED": + default: + return SecureKeyURLType.UNRECOGNIZED; + } +} + +export function secureKeyURLTypeToJSON(object: SecureKeyURLType): string { + switch (object) { + case SecureKeyURLType.SECURE_KEY_URL_TYPE_UNSPECIFIED: + return "SECURE_KEY_URL_TYPE_UNSPECIFIED"; + case SecureKeyURLType.ENABLE_IP_SIGNING: + return "ENABLE_IP_SIGNING"; + case SecureKeyURLType.DISABLE_IP_SIGNING: + return "DISABLE_IP_SIGNING"; + default: + return "UNKNOWN"; + } +} + +/** PolicyType defines type of the policy in IP address acl rules. */ +export enum PolicyType { + POLICY_TYPE_UNSPECIFIED = 0, + /** POLICY_TYPE_ALLOW - Allow access to all IP addresses except the ones specified in the excepted_values field. */ + POLICY_TYPE_ALLOW = 1, + /** POLICY_TYPE_DENY - Block access to all IP addresses except the ones specified in the excepted_values field. */ + POLICY_TYPE_DENY = 2, + UNRECOGNIZED = -1, +} + +export function policyTypeFromJSON(object: any): PolicyType { + switch (object) { + case 0: + case "POLICY_TYPE_UNSPECIFIED": + return PolicyType.POLICY_TYPE_UNSPECIFIED; + case 1: + case "POLICY_TYPE_ALLOW": + return PolicyType.POLICY_TYPE_ALLOW; + case 2: + case "POLICY_TYPE_DENY": + return PolicyType.POLICY_TYPE_DENY; + case -1: + case "UNRECOGNIZED": + default: + return PolicyType.UNRECOGNIZED; + } +} + +export function policyTypeToJSON(object: PolicyType): string { + switch (object) { + case PolicyType.POLICY_TYPE_UNSPECIFIED: + return "POLICY_TYPE_UNSPECIFIED"; + case PolicyType.POLICY_TYPE_ALLOW: + return "POLICY_TYPE_ALLOW"; + case PolicyType.POLICY_TYPE_DENY: + return "POLICY_TYPE_DENY"; + default: + return "UNKNOWN"; + } +} + /** A certificate type parameters. */ export enum SSLCertificateType { /** SSL_CERTIFICATE_TYPE_UNSPECIFIED - SSL certificate is unspecified. */ SSL_CERTIFICATE_TYPE_UNSPECIFIED = 0, /** DONT_USE - No SSL certificate is added, the requests are sent via HTTP. */ DONT_USE = 1, - /** LETS_ENCRYPT_GCORE - Works only if you have already pointed your domain name to the protected IP address in your DNS */ + /** + * LETS_ENCRYPT_GCORE - The option is deprecated. Works only if you have already pointed your domain name to the protected IP address in your DNS. + * + * @deprecated + */ LETS_ENCRYPT_GCORE = 2, - /** CM - Add your SSL certificate by uploading the certificate in PEM format and your private key */ + /** CM - Add your SSL certificate by uploading the certificate in PEM format and your private key. */ CM = 3, UNRECOGNIZED = -1, } @@ -177,7 +263,11 @@ export enum SSLCertificateStatus { SSL_CERTIFICATE_STATUS_UNSPECIFIED = 0, /** READY - SSL certificate is ready to use. */ READY = 1, - /** CREATING - SSL certificate is creating. */ + /** + * CREATING - The option is deprecated. SSL certificate is creating. + * + * @deprecated + */ CREATING = 2, UNRECOGNIZED = -1, } @@ -341,6 +431,13 @@ export interface ResourceOptions { ignoreCookie?: ResourceOptions_BoolOption; /** Changing or redirecting query paths. */ rewrite?: ResourceOptions_RewriteOption; + /** Secure token to protect contect and limit access by IP addresses and time limits. */ + secureKey?: ResourceOptions_SecureKeyOption; + /** + * Manage the state of the IP access policy option. + * The option controls access to content from the specified IP addresses. + */ + ipAddressAcl?: ResourceOptions_IPAddressACLOption; } /** Set up bool values. */ @@ -565,6 +662,32 @@ export interface ResourceOptions_RewriteOption { flag: RewriteFlag; } +export interface ResourceOptions_SecureKeyOption { + $type: "yandex.cloud.cdn.v1.ResourceOptions.SecureKeyOption"; + /** + * True - the option is enabled and its [flag] is applied to the resource. + * False - the option is disabled and its default value of the [flag] is used for the resource. + */ + enabled: boolean; + /** The key for the URL signing. */ + key: string; + /** The type of the URL signing. The URL could be available for all IP addresses or for the only one IP. */ + type: SecureKeyURLType; +} + +export interface ResourceOptions_IPAddressACLOption { + $type: "yandex.cloud.cdn.v1.ResourceOptions.IPAddressACLOption"; + /** + * True - the option is enabled and its [flag] is applied to the resource. + * False - the option is disabled and its default value of the [flag] is used for the resource. + */ + enabled: boolean; + /** The policy type. One of allow or deny value. */ + policyType: PolicyType; + /** The list of IP addresses to be allowed or denied. */ + exceptedValues: string[]; +} + /** A set of the personal SSL certificate parameters. */ export interface SSLTargetCertificate { $type: "yandex.cloud.cdn.v1.SSLTargetCertificate"; @@ -1141,6 +1264,18 @@ export const ResourceOptions = { writer.uint32(154).fork() ).ldelim(); } + if (message.secureKey !== undefined) { + ResourceOptions_SecureKeyOption.encode( + message.secureKey, + writer.uint32(162).fork() + ).ldelim(); + } + if (message.ipAddressAcl !== undefined) { + ResourceOptions_IPAddressACLOption.encode( + message.ipAddressAcl, + writer.uint32(170).fork() + ).ldelim(); + } return writer; }, @@ -1259,6 +1394,18 @@ export const ResourceOptions = { reader.uint32() ); break; + case 20: + message.secureKey = ResourceOptions_SecureKeyOption.decode( + reader, + reader.uint32() + ); + break; + case 21: + message.ipAddressAcl = ResourceOptions_IPAddressACLOption.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1353,6 +1500,14 @@ export const ResourceOptions = { object.rewrite !== undefined && object.rewrite !== null ? ResourceOptions_RewriteOption.fromJSON(object.rewrite) : undefined; + message.secureKey = + object.secureKey !== undefined && object.secureKey !== null + ? ResourceOptions_SecureKeyOption.fromJSON(object.secureKey) + : undefined; + message.ipAddressAcl = + object.ipAddressAcl !== undefined && object.ipAddressAcl !== null + ? ResourceOptions_IPAddressACLOption.fromJSON(object.ipAddressAcl) + : undefined; return message; }, @@ -1434,6 +1589,14 @@ export const ResourceOptions = { (obj.rewrite = message.rewrite ? ResourceOptions_RewriteOption.toJSON(message.rewrite) : undefined); + message.secureKey !== undefined && + (obj.secureKey = message.secureKey + ? ResourceOptions_SecureKeyOption.toJSON(message.secureKey) + : undefined); + message.ipAddressAcl !== undefined && + (obj.ipAddressAcl = message.ipAddressAcl + ? ResourceOptions_IPAddressACLOption.toJSON(message.ipAddressAcl) + : undefined); return obj; }, @@ -1535,6 +1698,14 @@ export const ResourceOptions = { object.rewrite !== undefined && object.rewrite !== null ? ResourceOptions_RewriteOption.fromPartial(object.rewrite) : undefined; + message.secureKey = + object.secureKey !== undefined && object.secureKey !== null + ? ResourceOptions_SecureKeyOption.fromPartial(object.secureKey) + : undefined; + message.ipAddressAcl = + object.ipAddressAcl !== undefined && object.ipAddressAcl !== null + ? ResourceOptions_IPAddressACLOption.fromPartial(object.ipAddressAcl) + : undefined; return message; }, }; @@ -3357,6 +3528,210 @@ messageTypeRegistry.set( ResourceOptions_RewriteOption ); +const baseResourceOptions_SecureKeyOption: object = { + $type: "yandex.cloud.cdn.v1.ResourceOptions.SecureKeyOption", + enabled: false, + key: "", + type: 0, +}; + +export const ResourceOptions_SecureKeyOption = { + $type: "yandex.cloud.cdn.v1.ResourceOptions.SecureKeyOption" as const, + + encode( + message: ResourceOptions_SecureKeyOption, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + if (message.key !== "") { + writer.uint32(18).string(message.key); + } + if (message.type !== 0) { + writer.uint32(24).int32(message.type); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ResourceOptions_SecureKeyOption { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseResourceOptions_SecureKeyOption, + } as ResourceOptions_SecureKeyOption; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + case 2: + message.key = reader.string(); + break; + case 3: + message.type = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResourceOptions_SecureKeyOption { + const message = { + ...baseResourceOptions_SecureKeyOption, + } as ResourceOptions_SecureKeyOption; + message.enabled = + object.enabled !== undefined && object.enabled !== null + ? Boolean(object.enabled) + : false; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.type = + object.type !== undefined && object.type !== null + ? secureKeyURLTypeFromJSON(object.type) + : 0; + return message; + }, + + toJSON(message: ResourceOptions_SecureKeyOption): unknown { + const obj: any = {}; + message.enabled !== undefined && (obj.enabled = message.enabled); + message.key !== undefined && (obj.key = message.key); + message.type !== undefined && + (obj.type = secureKeyURLTypeToJSON(message.type)); + return obj; + }, + + fromPartial, I>>( + object: I + ): ResourceOptions_SecureKeyOption { + const message = { + ...baseResourceOptions_SecureKeyOption, + } as ResourceOptions_SecureKeyOption; + message.enabled = object.enabled ?? false; + message.key = object.key ?? ""; + message.type = object.type ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + ResourceOptions_SecureKeyOption.$type, + ResourceOptions_SecureKeyOption +); + +const baseResourceOptions_IPAddressACLOption: object = { + $type: "yandex.cloud.cdn.v1.ResourceOptions.IPAddressACLOption", + enabled: false, + policyType: 0, + exceptedValues: "", +}; + +export const ResourceOptions_IPAddressACLOption = { + $type: "yandex.cloud.cdn.v1.ResourceOptions.IPAddressACLOption" as const, + + encode( + message: ResourceOptions_IPAddressACLOption, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + if (message.policyType !== 0) { + writer.uint32(16).int32(message.policyType); + } + for (const v of message.exceptedValues) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ResourceOptions_IPAddressACLOption { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseResourceOptions_IPAddressACLOption, + } as ResourceOptions_IPAddressACLOption; + message.exceptedValues = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + case 2: + message.policyType = reader.int32() as any; + break; + case 3: + message.exceptedValues.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResourceOptions_IPAddressACLOption { + const message = { + ...baseResourceOptions_IPAddressACLOption, + } as ResourceOptions_IPAddressACLOption; + message.enabled = + object.enabled !== undefined && object.enabled !== null + ? Boolean(object.enabled) + : false; + message.policyType = + object.policyType !== undefined && object.policyType !== null + ? policyTypeFromJSON(object.policyType) + : 0; + message.exceptedValues = (object.exceptedValues ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: ResourceOptions_IPAddressACLOption): unknown { + const obj: any = {}; + message.enabled !== undefined && (obj.enabled = message.enabled); + message.policyType !== undefined && + (obj.policyType = policyTypeToJSON(message.policyType)); + if (message.exceptedValues) { + obj.exceptedValues = message.exceptedValues.map((e) => e); + } else { + obj.exceptedValues = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): ResourceOptions_IPAddressACLOption { + const message = { + ...baseResourceOptions_IPAddressACLOption, + } as ResourceOptions_IPAddressACLOption; + message.enabled = object.enabled ?? false; + message.policyType = object.policyType ?? 0; + message.exceptedValues = object.exceptedValues?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + ResourceOptions_IPAddressACLOption.$type, + ResourceOptions_IPAddressACLOption +); + const baseSSLTargetCertificate: object = { $type: "yandex.cloud.cdn.v1.SSLTargetCertificate", type: 0, diff --git a/src/generated/yandex/cloud/cdn/v1/rule.ts b/src/generated/yandex/cloud/cdn/v1/rule.ts new file mode 100644 index 00000000..78156b27 --- /dev/null +++ b/src/generated/yandex/cloud/cdn/v1/rule.ts @@ -0,0 +1,175 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ResourceOptions } from "../../../../yandex/cloud/cdn/v1/resource"; + +export const protobufPackage = "yandex.cloud.cdn.v1"; + +/** Resource rule. */ +export interface Rule { + $type: "yandex.cloud.cdn.v1.Rule"; + /** Rule ID. */ + id: number; + /** Rule name. */ + name: string; + /** + * Rule pattern. + * Must be a valid regular expression. + */ + rulePattern: string; + options?: ResourceOptions; +} + +const baseRule: object = { + $type: "yandex.cloud.cdn.v1.Rule", + id: 0, + name: "", + rulePattern: "", +}; + +export const Rule = { + $type: "yandex.cloud.cdn.v1.Rule" as const, + + encode(message: Rule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== 0) { + writer.uint32(8).int64(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.rulePattern !== "") { + writer.uint32(26).string(message.rulePattern); + } + if (message.options !== undefined) { + ResourceOptions.encode( + message.options, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Rule { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRule } as Rule; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = longToNumber(reader.int64() as Long); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.rulePattern = reader.string(); + break; + case 4: + message.options = ResourceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Rule { + const message = { ...baseRule } as Rule; + message.id = + object.id !== undefined && object.id !== null ? Number(object.id) : 0; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.rulePattern = + object.rulePattern !== undefined && object.rulePattern !== null + ? String(object.rulePattern) + : ""; + message.options = + object.options !== undefined && object.options !== null + ? ResourceOptions.fromJSON(object.options) + : undefined; + return message; + }, + + toJSON(message: Rule): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = Math.round(message.id)); + message.name !== undefined && (obj.name = message.name); + message.rulePattern !== undefined && + (obj.rulePattern = message.rulePattern); + message.options !== undefined && + (obj.options = message.options + ? ResourceOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Rule { + const message = { ...baseRule } as Rule; + message.id = object.id ?? 0; + message.name = object.name ?? ""; + message.rulePattern = object.rulePattern ?? ""; + message.options = + object.options !== undefined && object.options !== null + ? ResourceOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Rule.$type, Rule); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cdn/v1/rule_service.ts b/src/generated/yandex/cloud/cdn/v1/rule_service.ts new file mode 100644 index 00000000..8af9e912 --- /dev/null +++ b/src/generated/yandex/cloud/cdn/v1/rule_service.ts @@ -0,0 +1,1170 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { ResourceOptions } from "../../../../yandex/cloud/cdn/v1/resource"; +import { Rule } from "../../../../yandex/cloud/cdn/v1/rule"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.cdn.v1"; + +export interface ListResourceRulesRequest { + $type: "yandex.cloud.cdn.v1.ListResourceRulesRequest"; + /** ID of resource. */ + resourceId: string; +} + +export interface ListResourceRulesResponse { + $type: "yandex.cloud.cdn.v1.ListResourceRulesResponse"; + /** List of the resource rules. */ + rules: Rule[]; +} + +export interface CreateResourceRuleRequest { + $type: "yandex.cloud.cdn.v1.CreateResourceRuleRequest"; + /** ID of resource. */ + resourceId: string; + /** Name of created resource rule. */ + name: string; + /** Resource rule pattern. */ + rulePattern: string; + options?: ResourceOptions; +} + +export interface CreateResourceRuleMetadata { + $type: "yandex.cloud.cdn.v1.CreateResourceRuleMetadata"; + /** ID of resource. */ + resourceId: string; + /** ID of created resource rule. */ + ruleId: number; +} + +export interface GetResourceRuleRequest { + $type: "yandex.cloud.cdn.v1.GetResourceRuleRequest"; + /** ID of resource. */ + resourceId: string; + /** ID of the requested resource rule. */ + ruleId: number; +} + +export interface UpdateResourceRuleRequest { + $type: "yandex.cloud.cdn.v1.UpdateResourceRuleRequest"; + /** ID of resource. */ + resourceId: string; + /** ID of updated resource rule. */ + ruleId: number; + /** Name of updated resource rule. */ + name: string; + /** Resource rule pattern. */ + rulePattern: string; + options?: ResourceOptions; +} + +export interface UpdateResourceRuleMetadata { + $type: "yandex.cloud.cdn.v1.UpdateResourceRuleMetadata"; + /** ID of resource. */ + resourceId: string; + /** ID of updated resource rule. */ + ruleId: number; +} + +export interface DeleteResourceRuleRequest { + $type: "yandex.cloud.cdn.v1.DeleteResourceRuleRequest"; + /** ID of resource. */ + resourceId: string; + /** ID of deleted resource rule. */ + ruleId: number; +} + +export interface DeleteResourceRuleMetadata { + $type: "yandex.cloud.cdn.v1.DeleteResourceRuleMetadata"; + /** ID of resource. */ + resourceId: string; + /** ID of deleted resource rule. */ + ruleId: number; +} + +const baseListResourceRulesRequest: object = { + $type: "yandex.cloud.cdn.v1.ListResourceRulesRequest", + resourceId: "", +}; + +export const ListResourceRulesRequest = { + $type: "yandex.cloud.cdn.v1.ListResourceRulesRequest" as const, + + encode( + message: ListResourceRulesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resourceId !== "") { + writer.uint32(10).string(message.resourceId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListResourceRulesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListResourceRulesRequest, + } as ListResourceRulesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListResourceRulesRequest { + const message = { + ...baseListResourceRulesRequest, + } as ListResourceRulesRequest; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + return message; + }, + + toJSON(message: ListResourceRulesRequest): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListResourceRulesRequest { + const message = { + ...baseListResourceRulesRequest, + } as ListResourceRulesRequest; + message.resourceId = object.resourceId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListResourceRulesRequest.$type, + ListResourceRulesRequest +); + +const baseListResourceRulesResponse: object = { + $type: "yandex.cloud.cdn.v1.ListResourceRulesResponse", +}; + +export const ListResourceRulesResponse = { + $type: "yandex.cloud.cdn.v1.ListResourceRulesResponse" as const, + + encode( + message: ListResourceRulesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.rules) { + Rule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListResourceRulesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListResourceRulesResponse, + } as ListResourceRulesResponse; + message.rules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(Rule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListResourceRulesResponse { + const message = { + ...baseListResourceRulesResponse, + } as ListResourceRulesResponse; + message.rules = (object.rules ?? []).map((e: any) => Rule.fromJSON(e)); + return message; + }, + + toJSON(message: ListResourceRulesResponse): unknown { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map((e) => (e ? Rule.toJSON(e) : undefined)); + } else { + obj.rules = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ListResourceRulesResponse { + const message = { + ...baseListResourceRulesResponse, + } as ListResourceRulesResponse; + message.rules = object.rules?.map((e) => Rule.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + ListResourceRulesResponse.$type, + ListResourceRulesResponse +); + +const baseCreateResourceRuleRequest: object = { + $type: "yandex.cloud.cdn.v1.CreateResourceRuleRequest", + resourceId: "", + name: "", + rulePattern: "", +}; + +export const CreateResourceRuleRequest = { + $type: "yandex.cloud.cdn.v1.CreateResourceRuleRequest" as const, + + encode( + message: CreateResourceRuleRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resourceId !== "") { + writer.uint32(10).string(message.resourceId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.rulePattern !== "") { + writer.uint32(26).string(message.rulePattern); + } + if (message.options !== undefined) { + ResourceOptions.encode( + message.options, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateResourceRuleRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateResourceRuleRequest, + } as CreateResourceRuleRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.rulePattern = reader.string(); + break; + case 4: + message.options = ResourceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateResourceRuleRequest { + const message = { + ...baseCreateResourceRuleRequest, + } as CreateResourceRuleRequest; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.rulePattern = + object.rulePattern !== undefined && object.rulePattern !== null + ? String(object.rulePattern) + : ""; + message.options = + object.options !== undefined && object.options !== null + ? ResourceOptions.fromJSON(object.options) + : undefined; + return message; + }, + + toJSON(message: CreateResourceRuleRequest): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + message.name !== undefined && (obj.name = message.name); + message.rulePattern !== undefined && + (obj.rulePattern = message.rulePattern); + message.options !== undefined && + (obj.options = message.options + ? ResourceOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateResourceRuleRequest { + const message = { + ...baseCreateResourceRuleRequest, + } as CreateResourceRuleRequest; + message.resourceId = object.resourceId ?? ""; + message.name = object.name ?? ""; + message.rulePattern = object.rulePattern ?? ""; + message.options = + object.options !== undefined && object.options !== null + ? ResourceOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + CreateResourceRuleRequest.$type, + CreateResourceRuleRequest +); + +const baseCreateResourceRuleMetadata: object = { + $type: "yandex.cloud.cdn.v1.CreateResourceRuleMetadata", + resourceId: "", + ruleId: 0, +}; + +export const CreateResourceRuleMetadata = { + $type: "yandex.cloud.cdn.v1.CreateResourceRuleMetadata" as const, + + encode( + message: CreateResourceRuleMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resourceId !== "") { + writer.uint32(10).string(message.resourceId); + } + if (message.ruleId !== 0) { + writer.uint32(16).int64(message.ruleId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateResourceRuleMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateResourceRuleMetadata, + } as CreateResourceRuleMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.string(); + break; + case 2: + message.ruleId = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateResourceRuleMetadata { + const message = { + ...baseCreateResourceRuleMetadata, + } as CreateResourceRuleMetadata; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? Number(object.ruleId) + : 0; + return message; + }, + + toJSON(message: CreateResourceRuleMetadata): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + message.ruleId !== undefined && (obj.ruleId = Math.round(message.ruleId)); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateResourceRuleMetadata { + const message = { + ...baseCreateResourceRuleMetadata, + } as CreateResourceRuleMetadata; + message.resourceId = object.resourceId ?? ""; + message.ruleId = object.ruleId ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + CreateResourceRuleMetadata.$type, + CreateResourceRuleMetadata +); + +const baseGetResourceRuleRequest: object = { + $type: "yandex.cloud.cdn.v1.GetResourceRuleRequest", + resourceId: "", + ruleId: 0, +}; + +export const GetResourceRuleRequest = { + $type: "yandex.cloud.cdn.v1.GetResourceRuleRequest" as const, + + encode( + message: GetResourceRuleRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resourceId !== "") { + writer.uint32(10).string(message.resourceId); + } + if (message.ruleId !== 0) { + writer.uint32(16).int64(message.ruleId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetResourceRuleRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetResourceRuleRequest } as GetResourceRuleRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.string(); + break; + case 2: + message.ruleId = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetResourceRuleRequest { + const message = { ...baseGetResourceRuleRequest } as GetResourceRuleRequest; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? Number(object.ruleId) + : 0; + return message; + }, + + toJSON(message: GetResourceRuleRequest): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + message.ruleId !== undefined && (obj.ruleId = Math.round(message.ruleId)); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetResourceRuleRequest { + const message = { ...baseGetResourceRuleRequest } as GetResourceRuleRequest; + message.resourceId = object.resourceId ?? ""; + message.ruleId = object.ruleId ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(GetResourceRuleRequest.$type, GetResourceRuleRequest); + +const baseUpdateResourceRuleRequest: object = { + $type: "yandex.cloud.cdn.v1.UpdateResourceRuleRequest", + resourceId: "", + ruleId: 0, + name: "", + rulePattern: "", +}; + +export const UpdateResourceRuleRequest = { + $type: "yandex.cloud.cdn.v1.UpdateResourceRuleRequest" as const, + + encode( + message: UpdateResourceRuleRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resourceId !== "") { + writer.uint32(10).string(message.resourceId); + } + if (message.ruleId !== 0) { + writer.uint32(16).int64(message.ruleId); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.rulePattern !== "") { + writer.uint32(34).string(message.rulePattern); + } + if (message.options !== undefined) { + ResourceOptions.encode( + message.options, + writer.uint32(42).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateResourceRuleRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateResourceRuleRequest, + } as UpdateResourceRuleRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.string(); + break; + case 2: + message.ruleId = longToNumber(reader.int64() as Long); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.rulePattern = reader.string(); + break; + case 5: + message.options = ResourceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateResourceRuleRequest { + const message = { + ...baseUpdateResourceRuleRequest, + } as UpdateResourceRuleRequest; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? Number(object.ruleId) + : 0; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.rulePattern = + object.rulePattern !== undefined && object.rulePattern !== null + ? String(object.rulePattern) + : ""; + message.options = + object.options !== undefined && object.options !== null + ? ResourceOptions.fromJSON(object.options) + : undefined; + return message; + }, + + toJSON(message: UpdateResourceRuleRequest): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + message.ruleId !== undefined && (obj.ruleId = Math.round(message.ruleId)); + message.name !== undefined && (obj.name = message.name); + message.rulePattern !== undefined && + (obj.rulePattern = message.rulePattern); + message.options !== undefined && + (obj.options = message.options + ? ResourceOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateResourceRuleRequest { + const message = { + ...baseUpdateResourceRuleRequest, + } as UpdateResourceRuleRequest; + message.resourceId = object.resourceId ?? ""; + message.ruleId = object.ruleId ?? 0; + message.name = object.name ?? ""; + message.rulePattern = object.rulePattern ?? ""; + message.options = + object.options !== undefined && object.options !== null + ? ResourceOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateResourceRuleRequest.$type, + UpdateResourceRuleRequest +); + +const baseUpdateResourceRuleMetadata: object = { + $type: "yandex.cloud.cdn.v1.UpdateResourceRuleMetadata", + resourceId: "", + ruleId: 0, +}; + +export const UpdateResourceRuleMetadata = { + $type: "yandex.cloud.cdn.v1.UpdateResourceRuleMetadata" as const, + + encode( + message: UpdateResourceRuleMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resourceId !== "") { + writer.uint32(10).string(message.resourceId); + } + if (message.ruleId !== 0) { + writer.uint32(16).int64(message.ruleId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateResourceRuleMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateResourceRuleMetadata, + } as UpdateResourceRuleMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.string(); + break; + case 2: + message.ruleId = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateResourceRuleMetadata { + const message = { + ...baseUpdateResourceRuleMetadata, + } as UpdateResourceRuleMetadata; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? Number(object.ruleId) + : 0; + return message; + }, + + toJSON(message: UpdateResourceRuleMetadata): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + message.ruleId !== undefined && (obj.ruleId = Math.round(message.ruleId)); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateResourceRuleMetadata { + const message = { + ...baseUpdateResourceRuleMetadata, + } as UpdateResourceRuleMetadata; + message.resourceId = object.resourceId ?? ""; + message.ruleId = object.ruleId ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateResourceRuleMetadata.$type, + UpdateResourceRuleMetadata +); + +const baseDeleteResourceRuleRequest: object = { + $type: "yandex.cloud.cdn.v1.DeleteResourceRuleRequest", + resourceId: "", + ruleId: 0, +}; + +export const DeleteResourceRuleRequest = { + $type: "yandex.cloud.cdn.v1.DeleteResourceRuleRequest" as const, + + encode( + message: DeleteResourceRuleRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resourceId !== "") { + writer.uint32(10).string(message.resourceId); + } + if (message.ruleId !== 0) { + writer.uint32(16).int64(message.ruleId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteResourceRuleRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteResourceRuleRequest, + } as DeleteResourceRuleRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.string(); + break; + case 2: + message.ruleId = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteResourceRuleRequest { + const message = { + ...baseDeleteResourceRuleRequest, + } as DeleteResourceRuleRequest; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? Number(object.ruleId) + : 0; + return message; + }, + + toJSON(message: DeleteResourceRuleRequest): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + message.ruleId !== undefined && (obj.ruleId = Math.round(message.ruleId)); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteResourceRuleRequest { + const message = { + ...baseDeleteResourceRuleRequest, + } as DeleteResourceRuleRequest; + message.resourceId = object.resourceId ?? ""; + message.ruleId = object.ruleId ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteResourceRuleRequest.$type, + DeleteResourceRuleRequest +); + +const baseDeleteResourceRuleMetadata: object = { + $type: "yandex.cloud.cdn.v1.DeleteResourceRuleMetadata", + resourceId: "", + ruleId: 0, +}; + +export const DeleteResourceRuleMetadata = { + $type: "yandex.cloud.cdn.v1.DeleteResourceRuleMetadata" as const, + + encode( + message: DeleteResourceRuleMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resourceId !== "") { + writer.uint32(10).string(message.resourceId); + } + if (message.ruleId !== 0) { + writer.uint32(16).int64(message.ruleId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteResourceRuleMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteResourceRuleMetadata, + } as DeleteResourceRuleMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.string(); + break; + case 2: + message.ruleId = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteResourceRuleMetadata { + const message = { + ...baseDeleteResourceRuleMetadata, + } as DeleteResourceRuleMetadata; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? Number(object.ruleId) + : 0; + return message; + }, + + toJSON(message: DeleteResourceRuleMetadata): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + message.ruleId !== undefined && (obj.ruleId = Math.round(message.ruleId)); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteResourceRuleMetadata { + const message = { + ...baseDeleteResourceRuleMetadata, + } as DeleteResourceRuleMetadata; + message.resourceId = object.resourceId ?? ""; + message.ruleId = object.ruleId ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteResourceRuleMetadata.$type, + DeleteResourceRuleMetadata +); + +/** + * Rules management service. + * + * Used for Resources Rules management. + */ +export const ResourceRulesServiceService = { + /** List all rules for specified resource. */ + list: { + path: "/yandex.cloud.cdn.v1.ResourceRulesService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListResourceRulesRequest) => + Buffer.from(ListResourceRulesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListResourceRulesRequest.decode(value), + responseSerialize: (value: ListResourceRulesResponse) => + Buffer.from(ListResourceRulesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListResourceRulesResponse.decode(value), + }, + /** Create new resource rule with specified unique name and rule patter. */ + create: { + path: "/yandex.cloud.cdn.v1.ResourceRulesService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateResourceRuleRequest) => + Buffer.from(CreateResourceRuleRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CreateResourceRuleRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Get specified by id resource rule. */ + get: { + path: "/yandex.cloud.cdn.v1.ResourceRulesService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetResourceRuleRequest) => + Buffer.from(GetResourceRuleRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetResourceRuleRequest.decode(value), + responseSerialize: (value: Rule) => + Buffer.from(Rule.encode(value).finish()), + responseDeserialize: (value: Buffer) => Rule.decode(value), + }, + /** Update specified by id resource rule. */ + update: { + path: "/yandex.cloud.cdn.v1.ResourceRulesService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateResourceRuleRequest) => + Buffer.from(UpdateResourceRuleRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateResourceRuleRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Delete specified by id resource rule. */ + delete: { + path: "/yandex.cloud.cdn.v1.ResourceRulesService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteResourceRuleRequest) => + Buffer.from(DeleteResourceRuleRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteResourceRuleRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface ResourceRulesServiceServer + extends UntypedServiceImplementation { + /** List all rules for specified resource. */ + list: handleUnaryCall; + /** Create new resource rule with specified unique name and rule patter. */ + create: handleUnaryCall; + /** Get specified by id resource rule. */ + get: handleUnaryCall; + /** Update specified by id resource rule. */ + update: handleUnaryCall; + /** Delete specified by id resource rule. */ + delete: handleUnaryCall; +} + +export interface ResourceRulesServiceClient extends Client { + /** List all rules for specified resource. */ + list( + request: ListResourceRulesRequest, + callback: ( + error: ServiceError | null, + response: ListResourceRulesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListResourceRulesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListResourceRulesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListResourceRulesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListResourceRulesResponse + ) => void + ): ClientUnaryCall; + /** Create new resource rule with specified unique name and rule patter. */ + create( + request: CreateResourceRuleRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateResourceRuleRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateResourceRuleRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Get specified by id resource rule. */ + get( + request: GetResourceRuleRequest, + callback: (error: ServiceError | null, response: Rule) => void + ): ClientUnaryCall; + get( + request: GetResourceRuleRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Rule) => void + ): ClientUnaryCall; + get( + request: GetResourceRuleRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Rule) => void + ): ClientUnaryCall; + /** Update specified by id resource rule. */ + update( + request: UpdateResourceRuleRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateResourceRuleRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateResourceRuleRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Delete specified by id resource rule. */ + delete( + request: DeleteResourceRuleRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteResourceRuleRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteResourceRuleRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const ResourceRulesServiceClient = makeGenericClientConstructor( + ResourceRulesServiceService, + "yandex.cloud.cdn.v1.ResourceRulesService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ResourceRulesServiceClient; + service: typeof ResourceRulesServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/certificatemanager/index.ts b/src/generated/yandex/cloud/certificatemanager/index.ts index 8af2db83..995ea89a 100644 --- a/src/generated/yandex/cloud/certificatemanager/index.ts +++ b/src/generated/yandex/cloud/certificatemanager/index.ts @@ -1,3 +1,3 @@ -export * as certificate from './v1/certificate' -export * as certificate_content_service from './v1/certificate_content_service' -export * as certificate_service from './v1/certificate_service' \ No newline at end of file +export * as v1_certificate from './v1/certificate' +export * as v1_certificate_content_service from './v1/certificate_content_service' +export * as v1_certificate_service from './v1/certificate_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/cic/index.ts b/src/generated/yandex/cloud/cic/index.ts new file mode 100644 index 00000000..5774becd --- /dev/null +++ b/src/generated/yandex/cloud/cic/index.ts @@ -0,0 +1,14 @@ +export * as v1_partner from './v1/partner' +export * as v1_partner_service from './v1/partner_service' +export * as v1_peering from './v1/peering' +export * as v1_point_of_presence from './v1/point_of_presence' +export * as v1_point_of_presence_service from './v1/point_of_presence_service' +export * as v1_private_connection from './v1/private_connection' +export * as v1_private_connection_service from './v1/private_connection_service' +export * as v1_public_connection from './v1/public_connection' +export * as v1_public_connection_service from './v1/public_connection_service' +export * as v1_trunk_connection from './v1/trunk_connection' +export * as v1_trunk_connection_service from './v1/trunk_connection_service' +export * as v1_common_lag_allocation_settings from './v1/common/lag_allocation_settings' +export * as v1_common_lag_info from './v1/common/lag_info' +export * as v1_common_transceiver_type from './v1/common/transceiver_type' \ No newline at end of file diff --git a/src/generated/yandex/cloud/cic/v1/common/lag_allocation_settings.ts b/src/generated/yandex/cloud/cic/v1/common/lag_allocation_settings.ts new file mode 100644 index 00000000..424e4f8f --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/common/lag_allocation_settings.ts @@ -0,0 +1,238 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { LagInfo } from "../../../../../yandex/cloud/cic/v1/common/lag_info"; + +export const protobufPackage = "yandex.cloud.cic.v1.common"; + +/** Structure for create and update requests that describes LAG allocation settings */ +export interface LagAllocationSettingsRequest { + $type: "yandex.cloud.cic.v1.common.LagAllocationSettingsRequest"; + /** + * Size of LAG. + * Must be from 1 to 10 inclusively. + */ + lagSize: number | undefined; + /** LagInfo */ + lagInfo?: LagInfo | undefined; +} + +/** Structure that describes LAG allocation settings */ +export interface LagAllocationSettings { + $type: "yandex.cloud.cic.v1.common.LagAllocationSettings"; + /** LagInfo */ + lagInfo?: LagInfo; +} + +const baseLagAllocationSettingsRequest: object = { + $type: "yandex.cloud.cic.v1.common.LagAllocationSettingsRequest", +}; + +export const LagAllocationSettingsRequest = { + $type: "yandex.cloud.cic.v1.common.LagAllocationSettingsRequest" as const, + + encode( + message: LagAllocationSettingsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.lagSize !== undefined) { + writer.uint32(104).int64(message.lagSize); + } + if (message.lagInfo !== undefined) { + LagInfo.encode(message.lagInfo, writer.uint32(114).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): LagAllocationSettingsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseLagAllocationSettingsRequest, + } as LagAllocationSettingsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 13: + message.lagSize = longToNumber(reader.int64() as Long); + break; + case 14: + message.lagInfo = LagInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LagAllocationSettingsRequest { + const message = { + ...baseLagAllocationSettingsRequest, + } as LagAllocationSettingsRequest; + message.lagSize = + object.lagSize !== undefined && object.lagSize !== null + ? Number(object.lagSize) + : undefined; + message.lagInfo = + object.lagInfo !== undefined && object.lagInfo !== null + ? LagInfo.fromJSON(object.lagInfo) + : undefined; + return message; + }, + + toJSON(message: LagAllocationSettingsRequest): unknown { + const obj: any = {}; + message.lagSize !== undefined && + (obj.lagSize = Math.round(message.lagSize)); + message.lagInfo !== undefined && + (obj.lagInfo = message.lagInfo + ? LagInfo.toJSON(message.lagInfo) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): LagAllocationSettingsRequest { + const message = { + ...baseLagAllocationSettingsRequest, + } as LagAllocationSettingsRequest; + message.lagSize = object.lagSize ?? undefined; + message.lagInfo = + object.lagInfo !== undefined && object.lagInfo !== null + ? LagInfo.fromPartial(object.lagInfo) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + LagAllocationSettingsRequest.$type, + LagAllocationSettingsRequest +); + +const baseLagAllocationSettings: object = { + $type: "yandex.cloud.cic.v1.common.LagAllocationSettings", +}; + +export const LagAllocationSettings = { + $type: "yandex.cloud.cic.v1.common.LagAllocationSettings" as const, + + encode( + message: LagAllocationSettings, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.lagInfo !== undefined) { + LagInfo.encode(message.lagInfo, writer.uint32(114).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): LagAllocationSettings { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLagAllocationSettings } as LagAllocationSettings; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 14: + message.lagInfo = LagInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LagAllocationSettings { + const message = { ...baseLagAllocationSettings } as LagAllocationSettings; + message.lagInfo = + object.lagInfo !== undefined && object.lagInfo !== null + ? LagInfo.fromJSON(object.lagInfo) + : undefined; + return message; + }, + + toJSON(message: LagAllocationSettings): unknown { + const obj: any = {}; + message.lagInfo !== undefined && + (obj.lagInfo = message.lagInfo + ? LagInfo.toJSON(message.lagInfo) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): LagAllocationSettings { + const message = { ...baseLagAllocationSettings } as LagAllocationSettings; + message.lagInfo = + object.lagInfo !== undefined && object.lagInfo !== null + ? LagInfo.fromPartial(object.lagInfo) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(LagAllocationSettings.$type, LagAllocationSettings); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cic/v1/common/lag_info.ts b/src/generated/yandex/cloud/cic/v1/common/lag_info.ts new file mode 100644 index 00000000..a9ec0111 --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/common/lag_info.ts @@ -0,0 +1,128 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Int64Value } from "../../../../../google/protobuf/wrappers"; + +export const protobufPackage = "yandex.cloud.cic.v1.common"; + +export interface LagInfo { + $type: "yandex.cloud.cic.v1.common.LagInfo"; + /** + * ID of LAG. + * Optional. + * If is not set scheduler selects it by himself. + */ + lagId?: number; + /** List of port names that the LAG is deployed on. */ + portNames: string[]; +} + +const baseLagInfo: object = { + $type: "yandex.cloud.cic.v1.common.LagInfo", + portNames: "", +}; + +export const LagInfo = { + $type: "yandex.cloud.cic.v1.common.LagInfo" as const, + + encode( + message: LagInfo, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.lagId !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.lagId! }, + writer.uint32(10).fork() + ).ldelim(); + } + for (const v of message.portNames) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LagInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLagInfo } as LagInfo; + message.portNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lagId = Int64Value.decode(reader, reader.uint32()).value; + break; + case 2: + message.portNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LagInfo { + const message = { ...baseLagInfo } as LagInfo; + message.lagId = + object.lagId !== undefined && object.lagId !== null + ? Number(object.lagId) + : undefined; + message.portNames = (object.portNames ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: LagInfo): unknown { + const obj: any = {}; + message.lagId !== undefined && (obj.lagId = message.lagId); + if (message.portNames) { + obj.portNames = message.portNames.map((e) => e); + } else { + obj.portNames = []; + } + return obj; + }, + + fromPartial, I>>(object: I): LagInfo { + const message = { ...baseLagInfo } as LagInfo; + message.lagId = object.lagId ?? undefined; + message.portNames = object.portNames?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(LagInfo.$type, LagInfo); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cic/v1/common/transceiver_type.ts b/src/generated/yandex/cloud/cic/v1/common/transceiver_type.ts new file mode 100644 index 00000000..a284153a --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/common/transceiver_type.ts @@ -0,0 +1,66 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.cic.v1.common"; + +export enum TransceiverType { + TRANSCEIVER_TYPE_UNSPECIFIED = 0, + TRANSCEIVER_TYPE_1000BASE_LX = 1, + TRANSCEIVER_TYPE_10GBASE_LR = 2, + TRANSCEIVER_TYPE_10GBASE_ER = 3, + TRANSCEIVER_TYPE_100GBASE_LR4 = 4, + TRANSCEIVER_TYPE_100GBASE_ER4 = 5, + UNRECOGNIZED = -1, +} + +export function transceiverTypeFromJSON(object: any): TransceiverType { + switch (object) { + case 0: + case "TRANSCEIVER_TYPE_UNSPECIFIED": + return TransceiverType.TRANSCEIVER_TYPE_UNSPECIFIED; + case 1: + case "TRANSCEIVER_TYPE_1000BASE_LX": + return TransceiverType.TRANSCEIVER_TYPE_1000BASE_LX; + case 2: + case "TRANSCEIVER_TYPE_10GBASE_LR": + return TransceiverType.TRANSCEIVER_TYPE_10GBASE_LR; + case 3: + case "TRANSCEIVER_TYPE_10GBASE_ER": + return TransceiverType.TRANSCEIVER_TYPE_10GBASE_ER; + case 4: + case "TRANSCEIVER_TYPE_100GBASE_LR4": + return TransceiverType.TRANSCEIVER_TYPE_100GBASE_LR4; + case 5: + case "TRANSCEIVER_TYPE_100GBASE_ER4": + return TransceiverType.TRANSCEIVER_TYPE_100GBASE_ER4; + case -1: + case "UNRECOGNIZED": + default: + return TransceiverType.UNRECOGNIZED; + } +} + +export function transceiverTypeToJSON(object: TransceiverType): string { + switch (object) { + case TransceiverType.TRANSCEIVER_TYPE_UNSPECIFIED: + return "TRANSCEIVER_TYPE_UNSPECIFIED"; + case TransceiverType.TRANSCEIVER_TYPE_1000BASE_LX: + return "TRANSCEIVER_TYPE_1000BASE_LX"; + case TransceiverType.TRANSCEIVER_TYPE_10GBASE_LR: + return "TRANSCEIVER_TYPE_10GBASE_LR"; + case TransceiverType.TRANSCEIVER_TYPE_10GBASE_ER: + return "TRANSCEIVER_TYPE_10GBASE_ER"; + case TransceiverType.TRANSCEIVER_TYPE_100GBASE_LR4: + return "TRANSCEIVER_TYPE_100GBASE_LR4"; + case TransceiverType.TRANSCEIVER_TYPE_100GBASE_ER4: + return "TRANSCEIVER_TYPE_100GBASE_ER4"; + default: + return "UNKNOWN"; + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cic/v1/partner.ts b/src/generated/yandex/cloud/cic/v1/partner.ts new file mode 100644 index 00000000..454ecdab --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/partner.ts @@ -0,0 +1,172 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.cic.v1"; + +/** A Partner resource. */ +export interface Partner { + $type: "yandex.cloud.cic.v1.Partner"; + /** ID of the routingInstance. */ + id: string; + /** ID of the region that the partner belongs to. */ + regionId: string; + /** Status of the partner. */ + status: Partner_Status; +} + +export enum Partner_Status { + STATUS_UNSPECIFIED = 0, + UP = 1, + DOWN = 2, + UNRECOGNIZED = -1, +} + +export function partner_StatusFromJSON(object: any): Partner_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return Partner_Status.STATUS_UNSPECIFIED; + case 1: + case "UP": + return Partner_Status.UP; + case 2: + case "DOWN": + return Partner_Status.DOWN; + case -1: + case "UNRECOGNIZED": + default: + return Partner_Status.UNRECOGNIZED; + } +} + +export function partner_StatusToJSON(object: Partner_Status): string { + switch (object) { + case Partner_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case Partner_Status.UP: + return "UP"; + case Partner_Status.DOWN: + return "DOWN"; + default: + return "UNKNOWN"; + } +} + +const basePartner: object = { + $type: "yandex.cloud.cic.v1.Partner", + id: "", + regionId: "", + status: 0, +}; + +export const Partner = { + $type: "yandex.cloud.cic.v1.Partner" as const, + + encode( + message: Partner, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.regionId !== "") { + writer.uint32(50).string(message.regionId); + } + if (message.status !== 0) { + writer.uint32(88).int32(message.status); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Partner { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePartner } as Partner; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 6: + message.regionId = reader.string(); + break; + case 11: + message.status = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Partner { + const message = { ...basePartner } as Partner; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.regionId = + object.regionId !== undefined && object.regionId !== null + ? String(object.regionId) + : ""; + message.status = + object.status !== undefined && object.status !== null + ? partner_StatusFromJSON(object.status) + : 0; + return message; + }, + + toJSON(message: Partner): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.regionId !== undefined && (obj.regionId = message.regionId); + message.status !== undefined && + (obj.status = partner_StatusToJSON(message.status)); + return obj; + }, + + fromPartial, I>>(object: I): Partner { + const message = { ...basePartner } as Partner; + message.id = object.id ?? ""; + message.regionId = object.regionId ?? ""; + message.status = object.status ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Partner.$type, Partner); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cic/v1/partner_service.ts b/src/generated/yandex/cloud/cic/v1/partner_service.ts new file mode 100644 index 00000000..0d9af038 --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/partner_service.ts @@ -0,0 +1,456 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { Partner } from "../../../../yandex/cloud/cic/v1/partner"; + +export const protobufPackage = "yandex.cloud.cic.v1"; + +export interface GetPartnerRequest { + $type: "yandex.cloud.cic.v1.GetPartnerRequest"; + /** + * ID of the Partner resource to return. + * To get the partner ID use a [PartnerService.List] request. + */ + partnerId: string; +} + +export interface ListPartnersRequest { + $type: "yandex.cloud.cic.v1.ListPartnersRequest"; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], + * the service returns a [ListPartnersResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] to the + * [ListPartnersResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters resources listed in the response. + * The expression must specify: + * 1. The field name. Currently you can use filtering only on [Subnet.name] field. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. + */ + filter: string; +} + +export interface ListPartnersResponse { + $type: "yandex.cloud.cic.v1.ListPartnersResponse"; + /** List of Partner resources. */ + partners: Partner[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListPartnersRequest.page_size], use + * the [next_page_token] as the value + * for the [ListPartnersRequest.page_token] query parameter + * in the next list request. Subsequent list requests will have their own + * [next_page_token] to continue paging through the results. + */ + nextPageToken: string; +} + +const baseGetPartnerRequest: object = { + $type: "yandex.cloud.cic.v1.GetPartnerRequest", + partnerId: "", +}; + +export const GetPartnerRequest = { + $type: "yandex.cloud.cic.v1.GetPartnerRequest" as const, + + encode( + message: GetPartnerRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.partnerId !== "") { + writer.uint32(10).string(message.partnerId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetPartnerRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetPartnerRequest } as GetPartnerRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.partnerId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetPartnerRequest { + const message = { ...baseGetPartnerRequest } as GetPartnerRequest; + message.partnerId = + object.partnerId !== undefined && object.partnerId !== null + ? String(object.partnerId) + : ""; + return message; + }, + + toJSON(message: GetPartnerRequest): unknown { + const obj: any = {}; + message.partnerId !== undefined && (obj.partnerId = message.partnerId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetPartnerRequest { + const message = { ...baseGetPartnerRequest } as GetPartnerRequest; + message.partnerId = object.partnerId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetPartnerRequest.$type, GetPartnerRequest); + +const baseListPartnersRequest: object = { + $type: "yandex.cloud.cic.v1.ListPartnersRequest", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListPartnersRequest = { + $type: "yandex.cloud.cic.v1.ListPartnersRequest" as const, + + encode( + message: ListPartnersRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListPartnersRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListPartnersRequest } as ListPartnersRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPartnersRequest { + const message = { ...baseListPartnersRequest } as ListPartnersRequest; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListPartnersRequest): unknown { + const obj: any = {}; + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListPartnersRequest { + const message = { ...baseListPartnersRequest } as ListPartnersRequest; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListPartnersRequest.$type, ListPartnersRequest); + +const baseListPartnersResponse: object = { + $type: "yandex.cloud.cic.v1.ListPartnersResponse", + nextPageToken: "", +}; + +export const ListPartnersResponse = { + $type: "yandex.cloud.cic.v1.ListPartnersResponse" as const, + + encode( + message: ListPartnersResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.partners) { + Partner.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListPartnersResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListPartnersResponse } as ListPartnersResponse; + message.partners = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.partners.push(Partner.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPartnersResponse { + const message = { ...baseListPartnersResponse } as ListPartnersResponse; + message.partners = (object.partners ?? []).map((e: any) => + Partner.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListPartnersResponse): unknown { + const obj: any = {}; + if (message.partners) { + obj.partners = message.partners.map((e) => + e ? Partner.toJSON(e) : undefined + ); + } else { + obj.partners = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListPartnersResponse { + const message = { ...baseListPartnersResponse } as ListPartnersResponse; + message.partners = + object.partners?.map((e) => Partner.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListPartnersResponse.$type, ListPartnersResponse); + +/** A set of methods for managing Partner resources. */ +export const PartnerServiceService = { + /** + * Returns the specified Partner resource. + * + * To get the list of available Partner resources, make a [List] request. + */ + get: { + path: "/yandex.cloud.cic.v1.PartnerService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetPartnerRequest) => + Buffer.from(GetPartnerRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetPartnerRequest.decode(value), + responseSerialize: (value: Partner) => + Buffer.from(Partner.encode(value).finish()), + responseDeserialize: (value: Buffer) => Partner.decode(value), + }, + /** Retrieves the list of Partner resources in the specified folder. */ + list: { + path: "/yandex.cloud.cic.v1.PartnerService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListPartnersRequest) => + Buffer.from(ListPartnersRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListPartnersRequest.decode(value), + responseSerialize: (value: ListPartnersResponse) => + Buffer.from(ListPartnersResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListPartnersResponse.decode(value), + }, +} as const; + +export interface PartnerServiceServer extends UntypedServiceImplementation { + /** + * Returns the specified Partner resource. + * + * To get the list of available Partner resources, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of Partner resources in the specified folder. */ + list: handleUnaryCall; +} + +export interface PartnerServiceClient extends Client { + /** + * Returns the specified Partner resource. + * + * To get the list of available Partner resources, make a [List] request. + */ + get( + request: GetPartnerRequest, + callback: (error: ServiceError | null, response: Partner) => void + ): ClientUnaryCall; + get( + request: GetPartnerRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Partner) => void + ): ClientUnaryCall; + get( + request: GetPartnerRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Partner) => void + ): ClientUnaryCall; + /** Retrieves the list of Partner resources in the specified folder. */ + list( + request: ListPartnersRequest, + callback: ( + error: ServiceError | null, + response: ListPartnersResponse + ) => void + ): ClientUnaryCall; + list( + request: ListPartnersRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListPartnersResponse + ) => void + ): ClientUnaryCall; + list( + request: ListPartnersRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListPartnersResponse + ) => void + ): ClientUnaryCall; +} + +export const PartnerServiceClient = makeGenericClientConstructor( + PartnerServiceService, + "yandex.cloud.cic.v1.PartnerService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): PartnerServiceClient; + service: typeof PartnerServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cic/v1/peering.ts b/src/generated/yandex/cloud/cic/v1/peering.ts new file mode 100644 index 00000000..1e849362 --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/peering.ts @@ -0,0 +1,216 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.cic.v1"; + +export interface Peering { + $type: "yandex.cloud.cic.v1.Peering"; + /** + * PeeringSubnet. + * It's an ip with format ipPrefix/length where address part of ipPrefix is 0. + */ + peeringSubnet: string; + /** + * PeerIp. + * It's an ip with just an ipAddress format without mask. + */ + peerIp: string; + /** + * CloudIp. + * It's an ip with just an ipAddress format without mask. + */ + cloudIp: string; + /** + * PeerBgpAsn. + * PeerAsn excluding rfc5398 (excluding 64496 - 64511 and 65536 - 65551). + */ + peerBgpAsn: number; + /** CloudBgpAsn. */ + cloudBgpAsn: number; + /** + * PeerBgpMd5Key. + * Optional. + */ + peerBgpMd5Key: string; +} + +const basePeering: object = { + $type: "yandex.cloud.cic.v1.Peering", + peeringSubnet: "", + peerIp: "", + cloudIp: "", + peerBgpAsn: 0, + cloudBgpAsn: 0, + peerBgpMd5Key: "", +}; + +export const Peering = { + $type: "yandex.cloud.cic.v1.Peering" as const, + + encode( + message: Peering, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.peeringSubnet !== "") { + writer.uint32(10).string(message.peeringSubnet); + } + if (message.peerIp !== "") { + writer.uint32(18).string(message.peerIp); + } + if (message.cloudIp !== "") { + writer.uint32(26).string(message.cloudIp); + } + if (message.peerBgpAsn !== 0) { + writer.uint32(32).int64(message.peerBgpAsn); + } + if (message.cloudBgpAsn !== 0) { + writer.uint32(40).int64(message.cloudBgpAsn); + } + if (message.peerBgpMd5Key !== "") { + writer.uint32(50).string(message.peerBgpMd5Key); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Peering { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePeering } as Peering; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.peeringSubnet = reader.string(); + break; + case 2: + message.peerIp = reader.string(); + break; + case 3: + message.cloudIp = reader.string(); + break; + case 4: + message.peerBgpAsn = longToNumber(reader.int64() as Long); + break; + case 5: + message.cloudBgpAsn = longToNumber(reader.int64() as Long); + break; + case 6: + message.peerBgpMd5Key = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Peering { + const message = { ...basePeering } as Peering; + message.peeringSubnet = + object.peeringSubnet !== undefined && object.peeringSubnet !== null + ? String(object.peeringSubnet) + : ""; + message.peerIp = + object.peerIp !== undefined && object.peerIp !== null + ? String(object.peerIp) + : ""; + message.cloudIp = + object.cloudIp !== undefined && object.cloudIp !== null + ? String(object.cloudIp) + : ""; + message.peerBgpAsn = + object.peerBgpAsn !== undefined && object.peerBgpAsn !== null + ? Number(object.peerBgpAsn) + : 0; + message.cloudBgpAsn = + object.cloudBgpAsn !== undefined && object.cloudBgpAsn !== null + ? Number(object.cloudBgpAsn) + : 0; + message.peerBgpMd5Key = + object.peerBgpMd5Key !== undefined && object.peerBgpMd5Key !== null + ? String(object.peerBgpMd5Key) + : ""; + return message; + }, + + toJSON(message: Peering): unknown { + const obj: any = {}; + message.peeringSubnet !== undefined && + (obj.peeringSubnet = message.peeringSubnet); + message.peerIp !== undefined && (obj.peerIp = message.peerIp); + message.cloudIp !== undefined && (obj.cloudIp = message.cloudIp); + message.peerBgpAsn !== undefined && + (obj.peerBgpAsn = Math.round(message.peerBgpAsn)); + message.cloudBgpAsn !== undefined && + (obj.cloudBgpAsn = Math.round(message.cloudBgpAsn)); + message.peerBgpMd5Key !== undefined && + (obj.peerBgpMd5Key = message.peerBgpMd5Key); + return obj; + }, + + fromPartial, I>>(object: I): Peering { + const message = { ...basePeering } as Peering; + message.peeringSubnet = object.peeringSubnet ?? ""; + message.peerIp = object.peerIp ?? ""; + message.cloudIp = object.cloudIp ?? ""; + message.peerBgpAsn = object.peerBgpAsn ?? 0; + message.cloudBgpAsn = object.cloudBgpAsn ?? 0; + message.peerBgpMd5Key = object.peerBgpMd5Key ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Peering.$type, Peering); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cic/v1/point_of_presence.ts b/src/generated/yandex/cloud/cic/v1/point_of_presence.ts new file mode 100644 index 00000000..252103d4 --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/point_of_presence.ts @@ -0,0 +1,120 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.cic.v1"; + +/** A PointOfPresence resource. */ +export interface PointOfPresence { + $type: "yandex.cloud.cic.v1.PointOfPresence"; + /** ID of the pointOfPresence. */ + id: string; + /** ID of the region that the pointOfPresence belongs to. */ + regionId: string; +} + +const basePointOfPresence: object = { + $type: "yandex.cloud.cic.v1.PointOfPresence", + id: "", + regionId: "", +}; + +export const PointOfPresence = { + $type: "yandex.cloud.cic.v1.PointOfPresence" as const, + + encode( + message: PointOfPresence, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.regionId !== "") { + writer.uint32(50).string(message.regionId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PointOfPresence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePointOfPresence } as PointOfPresence; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 6: + message.regionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PointOfPresence { + const message = { ...basePointOfPresence } as PointOfPresence; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.regionId = + object.regionId !== undefined && object.regionId !== null + ? String(object.regionId) + : ""; + return message; + }, + + toJSON(message: PointOfPresence): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.regionId !== undefined && (obj.regionId = message.regionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): PointOfPresence { + const message = { ...basePointOfPresence } as PointOfPresence; + message.id = object.id ?? ""; + message.regionId = object.regionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(PointOfPresence.$type, PointOfPresence); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cic/v1/point_of_presence_service.ts b/src/generated/yandex/cloud/cic/v1/point_of_presence_service.ts new file mode 100644 index 00000000..f6f8b1fe --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/point_of_presence_service.ts @@ -0,0 +1,500 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { PointOfPresence } from "../../../../yandex/cloud/cic/v1/point_of_presence"; + +export const protobufPackage = "yandex.cloud.cic.v1"; + +export interface GetPointOfPresenceRequest { + $type: "yandex.cloud.cic.v1.GetPointOfPresenceRequest"; + /** + * ID of the PointOfPresence resource to return. + * To get the pointOfPresence ID use a [PointOfPresenceService.List] request. + */ + pointOfPresenceId: string; +} + +export interface ListPointOfPresencesRequest { + $type: "yandex.cloud.cic.v1.ListPointOfPresencesRequest"; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], + * the service returns a [ListPointOfPresencesResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] to the + * [ListPointOfPresencesResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters resources listed in the response. + * The expression must specify: + * 1. The field name. Currently you can use filtering only on [Subnet.name] field. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. + */ + filter: string; +} + +export interface ListPointOfPresencesResponse { + $type: "yandex.cloud.cic.v1.ListPointOfPresencesResponse"; + /** List of PointOfPresence resources. */ + pointOfPresences: PointOfPresence[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListPointOfPresencesRequest.page_size], use + * the [next_page_token] as the value + * for the [ListPointOfPresencesRequest.page_token] query parameter + * in the next list request. Subsequent list requests will have their own + * [next_page_token] to continue paging through the results. + */ + nextPageToken: string; +} + +const baseGetPointOfPresenceRequest: object = { + $type: "yandex.cloud.cic.v1.GetPointOfPresenceRequest", + pointOfPresenceId: "", +}; + +export const GetPointOfPresenceRequest = { + $type: "yandex.cloud.cic.v1.GetPointOfPresenceRequest" as const, + + encode( + message: GetPointOfPresenceRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.pointOfPresenceId !== "") { + writer.uint32(10).string(message.pointOfPresenceId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetPointOfPresenceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetPointOfPresenceRequest, + } as GetPointOfPresenceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pointOfPresenceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetPointOfPresenceRequest { + const message = { + ...baseGetPointOfPresenceRequest, + } as GetPointOfPresenceRequest; + message.pointOfPresenceId = + object.pointOfPresenceId !== undefined && + object.pointOfPresenceId !== null + ? String(object.pointOfPresenceId) + : ""; + return message; + }, + + toJSON(message: GetPointOfPresenceRequest): unknown { + const obj: any = {}; + message.pointOfPresenceId !== undefined && + (obj.pointOfPresenceId = message.pointOfPresenceId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetPointOfPresenceRequest { + const message = { + ...baseGetPointOfPresenceRequest, + } as GetPointOfPresenceRequest; + message.pointOfPresenceId = object.pointOfPresenceId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetPointOfPresenceRequest.$type, + GetPointOfPresenceRequest +); + +const baseListPointOfPresencesRequest: object = { + $type: "yandex.cloud.cic.v1.ListPointOfPresencesRequest", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListPointOfPresencesRequest = { + $type: "yandex.cloud.cic.v1.ListPointOfPresencesRequest" as const, + + encode( + message: ListPointOfPresencesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListPointOfPresencesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListPointOfPresencesRequest, + } as ListPointOfPresencesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPointOfPresencesRequest { + const message = { + ...baseListPointOfPresencesRequest, + } as ListPointOfPresencesRequest; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListPointOfPresencesRequest): unknown { + const obj: any = {}; + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListPointOfPresencesRequest { + const message = { + ...baseListPointOfPresencesRequest, + } as ListPointOfPresencesRequest; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListPointOfPresencesRequest.$type, + ListPointOfPresencesRequest +); + +const baseListPointOfPresencesResponse: object = { + $type: "yandex.cloud.cic.v1.ListPointOfPresencesResponse", + nextPageToken: "", +}; + +export const ListPointOfPresencesResponse = { + $type: "yandex.cloud.cic.v1.ListPointOfPresencesResponse" as const, + + encode( + message: ListPointOfPresencesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.pointOfPresences) { + PointOfPresence.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListPointOfPresencesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListPointOfPresencesResponse, + } as ListPointOfPresencesResponse; + message.pointOfPresences = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pointOfPresences.push( + PointOfPresence.decode(reader, reader.uint32()) + ); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPointOfPresencesResponse { + const message = { + ...baseListPointOfPresencesResponse, + } as ListPointOfPresencesResponse; + message.pointOfPresences = (object.pointOfPresences ?? []).map((e: any) => + PointOfPresence.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListPointOfPresencesResponse): unknown { + const obj: any = {}; + if (message.pointOfPresences) { + obj.pointOfPresences = message.pointOfPresences.map((e) => + e ? PointOfPresence.toJSON(e) : undefined + ); + } else { + obj.pointOfPresences = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListPointOfPresencesResponse { + const message = { + ...baseListPointOfPresencesResponse, + } as ListPointOfPresencesResponse; + message.pointOfPresences = + object.pointOfPresences?.map((e) => PointOfPresence.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListPointOfPresencesResponse.$type, + ListPointOfPresencesResponse +); + +/** A set of methods for managing PointOfPresence resources. */ +export const PointOfPresenceServiceService = { + /** + * Returns the specified PointOfPresence resource. + * + * To get the list of available PointOfPresence resources, make a [List] request. + */ + get: { + path: "/yandex.cloud.cic.v1.PointOfPresenceService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetPointOfPresenceRequest) => + Buffer.from(GetPointOfPresenceRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetPointOfPresenceRequest.decode(value), + responseSerialize: (value: PointOfPresence) => + Buffer.from(PointOfPresence.encode(value).finish()), + responseDeserialize: (value: Buffer) => PointOfPresence.decode(value), + }, + /** Retrieves the list of PointOfPresence resources in the specified folder. */ + list: { + path: "/yandex.cloud.cic.v1.PointOfPresenceService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListPointOfPresencesRequest) => + Buffer.from(ListPointOfPresencesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListPointOfPresencesRequest.decode(value), + responseSerialize: (value: ListPointOfPresencesResponse) => + Buffer.from(ListPointOfPresencesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListPointOfPresencesResponse.decode(value), + }, +} as const; + +export interface PointOfPresenceServiceServer + extends UntypedServiceImplementation { + /** + * Returns the specified PointOfPresence resource. + * + * To get the list of available PointOfPresence resources, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of PointOfPresence resources in the specified folder. */ + list: handleUnaryCall< + ListPointOfPresencesRequest, + ListPointOfPresencesResponse + >; +} + +export interface PointOfPresenceServiceClient extends Client { + /** + * Returns the specified PointOfPresence resource. + * + * To get the list of available PointOfPresence resources, make a [List] request. + */ + get( + request: GetPointOfPresenceRequest, + callback: (error: ServiceError | null, response: PointOfPresence) => void + ): ClientUnaryCall; + get( + request: GetPointOfPresenceRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: PointOfPresence) => void + ): ClientUnaryCall; + get( + request: GetPointOfPresenceRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: PointOfPresence) => void + ): ClientUnaryCall; + /** Retrieves the list of PointOfPresence resources in the specified folder. */ + list( + request: ListPointOfPresencesRequest, + callback: ( + error: ServiceError | null, + response: ListPointOfPresencesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListPointOfPresencesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListPointOfPresencesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListPointOfPresencesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListPointOfPresencesResponse + ) => void + ): ClientUnaryCall; +} + +export const PointOfPresenceServiceClient = makeGenericClientConstructor( + PointOfPresenceServiceService, + "yandex.cloud.cic.v1.PointOfPresenceService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): PointOfPresenceServiceClient; + service: typeof PointOfPresenceServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cic/v1/private_connection.ts b/src/generated/yandex/cloud/cic/v1/private_connection.ts new file mode 100644 index 00000000..3b7a1a3b --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/private_connection.ts @@ -0,0 +1,501 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Peering } from "../../../../yandex/cloud/cic/v1/peering"; +import { Int64Value } from "../../../../google/protobuf/wrappers"; + +export const protobufPackage = "yandex.cloud.cic.v1"; + +/** A PrivateConnection resource. */ +export interface PrivateConnection { + $type: "yandex.cloud.cic.v1.PrivateConnection"; + /** ID of the privateConnection. */ + id: string; + /** + * Name of the privateConnection. + * The name must be unique within the folder. + * Value must match the regular expression ``\|[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])?``. + */ + name: string; + /** Optional description of the privateConnection. 0-256 characters long. */ + description: string; + /** ID of the folder that the privateConnection belongs to. */ + folderId: string; + /** ID of the region that the privateConnection belongs to. */ + regionId: string; + /** ID of the trunk_connection that the privateConnection belongs to. */ + trunkConnectionId: string; + /** + * VLAN_ID that the privateConnection uses in multiplexing. + * Not used in connections over partners-II + * Value range: [1, 4095] + */ + vlanId?: number; + /** IPv4 peering config of connection */ + ipv4Peering?: Peering; + /** IPv4 StaticRoute config of connection */ + ipv4StaticRoutes: PrivateConnection_StaticRoute[]; + /** + * Resource labels, `key:value` pairs. + * No more than 64 per resource. + * The maximum string length in characters for each value is 63. + * Each value must match the regular expression `[-_0-9a-z]*`. + * The string length in characters for each key must be 1-63. + * Each key must match the regular expression `[a-z][-_0-9a-z]*`. + */ + labels: { [key: string]: string }; +} + +export interface PrivateConnection_LabelsEntry { + $type: "yandex.cloud.cic.v1.PrivateConnection.LabelsEntry"; + key: string; + value: string; +} + +export interface PrivateConnection_StaticRoute { + $type: "yandex.cloud.cic.v1.PrivateConnection.StaticRoute"; + /** + * Prefix. + * It's an ip with format ipPrefix/length where address part of ipPrefix is 0. + */ + prefix: string; + /** + * PeerIp. + * It's an ip with just an ipAddress format without mask. + */ + nextHop: string[]; +} + +const basePrivateConnection: object = { + $type: "yandex.cloud.cic.v1.PrivateConnection", + id: "", + name: "", + description: "", + folderId: "", + regionId: "", + trunkConnectionId: "", +}; + +export const PrivateConnection = { + $type: "yandex.cloud.cic.v1.PrivateConnection" as const, + + encode( + message: PrivateConnection, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.folderId !== "") { + writer.uint32(42).string(message.folderId); + } + if (message.regionId !== "") { + writer.uint32(50).string(message.regionId); + } + if (message.trunkConnectionId !== "") { + writer.uint32(58).string(message.trunkConnectionId); + } + if (message.vlanId !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.vlanId! }, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.ipv4Peering !== undefined) { + Peering.encode(message.ipv4Peering, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.ipv4StaticRoutes) { + PrivateConnection_StaticRoute.encode( + v!, + writer.uint32(146).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + PrivateConnection_LabelsEntry.encode( + { + $type: "yandex.cloud.cic.v1.PrivateConnection.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(194).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PrivateConnection { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePrivateConnection } as PrivateConnection; + message.ipv4StaticRoutes = []; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 5: + message.folderId = reader.string(); + break; + case 6: + message.regionId = reader.string(); + break; + case 7: + message.trunkConnectionId = reader.string(); + break; + case 8: + message.vlanId = Int64Value.decode(reader, reader.uint32()).value; + break; + case 9: + message.ipv4Peering = Peering.decode(reader, reader.uint32()); + break; + case 18: + message.ipv4StaticRoutes.push( + PrivateConnection_StaticRoute.decode(reader, reader.uint32()) + ); + break; + case 24: + const entry24 = PrivateConnection_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry24.value !== undefined) { + message.labels[entry24.key] = entry24.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PrivateConnection { + const message = { ...basePrivateConnection } as PrivateConnection; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.regionId = + object.regionId !== undefined && object.regionId !== null + ? String(object.regionId) + : ""; + message.trunkConnectionId = + object.trunkConnectionId !== undefined && + object.trunkConnectionId !== null + ? String(object.trunkConnectionId) + : ""; + message.vlanId = + object.vlanId !== undefined && object.vlanId !== null + ? Number(object.vlanId) + : undefined; + message.ipv4Peering = + object.ipv4Peering !== undefined && object.ipv4Peering !== null + ? Peering.fromJSON(object.ipv4Peering) + : undefined; + message.ipv4StaticRoutes = (object.ipv4StaticRoutes ?? []).map((e: any) => + PrivateConnection_StaticRoute.fromJSON(e) + ); + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: PrivateConnection): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.regionId !== undefined && (obj.regionId = message.regionId); + message.trunkConnectionId !== undefined && + (obj.trunkConnectionId = message.trunkConnectionId); + message.vlanId !== undefined && (obj.vlanId = message.vlanId); + message.ipv4Peering !== undefined && + (obj.ipv4Peering = message.ipv4Peering + ? Peering.toJSON(message.ipv4Peering) + : undefined); + if (message.ipv4StaticRoutes) { + obj.ipv4StaticRoutes = message.ipv4StaticRoutes.map((e) => + e ? PrivateConnection_StaticRoute.toJSON(e) : undefined + ); + } else { + obj.ipv4StaticRoutes = []; + } + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): PrivateConnection { + const message = { ...basePrivateConnection } as PrivateConnection; + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.folderId = object.folderId ?? ""; + message.regionId = object.regionId ?? ""; + message.trunkConnectionId = object.trunkConnectionId ?? ""; + message.vlanId = object.vlanId ?? undefined; + message.ipv4Peering = + object.ipv4Peering !== undefined && object.ipv4Peering !== null + ? Peering.fromPartial(object.ipv4Peering) + : undefined; + message.ipv4StaticRoutes = + object.ipv4StaticRoutes?.map((e) => + PrivateConnection_StaticRoute.fromPartial(e) + ) || []; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(PrivateConnection.$type, PrivateConnection); + +const basePrivateConnection_LabelsEntry: object = { + $type: "yandex.cloud.cic.v1.PrivateConnection.LabelsEntry", + key: "", + value: "", +}; + +export const PrivateConnection_LabelsEntry = { + $type: "yandex.cloud.cic.v1.PrivateConnection.LabelsEntry" as const, + + encode( + message: PrivateConnection_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PrivateConnection_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePrivateConnection_LabelsEntry, + } as PrivateConnection_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PrivateConnection_LabelsEntry { + const message = { + ...basePrivateConnection_LabelsEntry, + } as PrivateConnection_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: PrivateConnection_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): PrivateConnection_LabelsEntry { + const message = { + ...basePrivateConnection_LabelsEntry, + } as PrivateConnection_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + PrivateConnection_LabelsEntry.$type, + PrivateConnection_LabelsEntry +); + +const basePrivateConnection_StaticRoute: object = { + $type: "yandex.cloud.cic.v1.PrivateConnection.StaticRoute", + prefix: "", + nextHop: "", +}; + +export const PrivateConnection_StaticRoute = { + $type: "yandex.cloud.cic.v1.PrivateConnection.StaticRoute" as const, + + encode( + message: PrivateConnection_StaticRoute, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.prefix !== "") { + writer.uint32(10).string(message.prefix); + } + for (const v of message.nextHop) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PrivateConnection_StaticRoute { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePrivateConnection_StaticRoute, + } as PrivateConnection_StaticRoute; + message.nextHop = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prefix = reader.string(); + break; + case 2: + message.nextHop.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PrivateConnection_StaticRoute { + const message = { + ...basePrivateConnection_StaticRoute, + } as PrivateConnection_StaticRoute; + message.prefix = + object.prefix !== undefined && object.prefix !== null + ? String(object.prefix) + : ""; + message.nextHop = (object.nextHop ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: PrivateConnection_StaticRoute): unknown { + const obj: any = {}; + message.prefix !== undefined && (obj.prefix = message.prefix); + if (message.nextHop) { + obj.nextHop = message.nextHop.map((e) => e); + } else { + obj.nextHop = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): PrivateConnection_StaticRoute { + const message = { + ...basePrivateConnection_StaticRoute, + } as PrivateConnection_StaticRoute; + message.prefix = object.prefix ?? ""; + message.nextHop = object.nextHop?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + PrivateConnection_StaticRoute.$type, + PrivateConnection_StaticRoute +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cic/v1/private_connection_service.ts b/src/generated/yandex/cloud/cic/v1/private_connection_service.ts new file mode 100644 index 00000000..219165ac --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/private_connection_service.ts @@ -0,0 +1,519 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { PrivateConnection } from "../../../../yandex/cloud/cic/v1/private_connection"; + +export const protobufPackage = "yandex.cloud.cic.v1"; + +export interface GetPrivateConnectionRequest { + $type: "yandex.cloud.cic.v1.GetPrivateConnectionRequest"; + /** + * ID of the PrivateConnection resource to return. + * To get the privateConnection ID use a [PrivateConnectionService.List] request. + */ + privateConnectionId: string; +} + +export interface ListPrivateConnectionsRequest { + $type: "yandex.cloud.cic.v1.ListPrivateConnectionsRequest"; + /** + * ID of the folder to list privateConnections in. + * To get the folder ID use a [yandex.cloud.resourcemanager.v1.FolderService.List] request. + */ + folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], + * the service returns a [ListPrivatesConnectionResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] to the + * [ListPrivatesConnectionResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters resources listed in the response. + * The expression must specify: + * 1. The field name. Currently you can use filtering only on [Subnet.name] field. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. + */ + filter: string; +} + +export interface ListPrivateConnectionsResponse { + $type: "yandex.cloud.cic.v1.ListPrivateConnectionsResponse"; + /** List of PrivateConnection resources. */ + privateConnections: PrivateConnection[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListPrivateConnectionsRequest.page_size], use + * the [next_page_token] as the value + * for the [ListPrivateConnectionsRequest.page_token] query parameter + * in the next list request. Subsequent list requests will have their own + * [next_page_token] to continue paging through the results. + */ + nextPageToken: string; +} + +const baseGetPrivateConnectionRequest: object = { + $type: "yandex.cloud.cic.v1.GetPrivateConnectionRequest", + privateConnectionId: "", +}; + +export const GetPrivateConnectionRequest = { + $type: "yandex.cloud.cic.v1.GetPrivateConnectionRequest" as const, + + encode( + message: GetPrivateConnectionRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.privateConnectionId !== "") { + writer.uint32(10).string(message.privateConnectionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetPrivateConnectionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetPrivateConnectionRequest, + } as GetPrivateConnectionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privateConnectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetPrivateConnectionRequest { + const message = { + ...baseGetPrivateConnectionRequest, + } as GetPrivateConnectionRequest; + message.privateConnectionId = + object.privateConnectionId !== undefined && + object.privateConnectionId !== null + ? String(object.privateConnectionId) + : ""; + return message; + }, + + toJSON(message: GetPrivateConnectionRequest): unknown { + const obj: any = {}; + message.privateConnectionId !== undefined && + (obj.privateConnectionId = message.privateConnectionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetPrivateConnectionRequest { + const message = { + ...baseGetPrivateConnectionRequest, + } as GetPrivateConnectionRequest; + message.privateConnectionId = object.privateConnectionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetPrivateConnectionRequest.$type, + GetPrivateConnectionRequest +); + +const baseListPrivateConnectionsRequest: object = { + $type: "yandex.cloud.cic.v1.ListPrivateConnectionsRequest", + folderId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListPrivateConnectionsRequest = { + $type: "yandex.cloud.cic.v1.ListPrivateConnectionsRequest" as const, + + encode( + message: ListPrivateConnectionsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListPrivateConnectionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListPrivateConnectionsRequest, + } as ListPrivateConnectionsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPrivateConnectionsRequest { + const message = { + ...baseListPrivateConnectionsRequest, + } as ListPrivateConnectionsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListPrivateConnectionsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListPrivateConnectionsRequest { + const message = { + ...baseListPrivateConnectionsRequest, + } as ListPrivateConnectionsRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListPrivateConnectionsRequest.$type, + ListPrivateConnectionsRequest +); + +const baseListPrivateConnectionsResponse: object = { + $type: "yandex.cloud.cic.v1.ListPrivateConnectionsResponse", + nextPageToken: "", +}; + +export const ListPrivateConnectionsResponse = { + $type: "yandex.cloud.cic.v1.ListPrivateConnectionsResponse" as const, + + encode( + message: ListPrivateConnectionsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.privateConnections) { + PrivateConnection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListPrivateConnectionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListPrivateConnectionsResponse, + } as ListPrivateConnectionsResponse; + message.privateConnections = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privateConnections.push( + PrivateConnection.decode(reader, reader.uint32()) + ); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPrivateConnectionsResponse { + const message = { + ...baseListPrivateConnectionsResponse, + } as ListPrivateConnectionsResponse; + message.privateConnections = (object.privateConnections ?? []).map( + (e: any) => PrivateConnection.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListPrivateConnectionsResponse): unknown { + const obj: any = {}; + if (message.privateConnections) { + obj.privateConnections = message.privateConnections.map((e) => + e ? PrivateConnection.toJSON(e) : undefined + ); + } else { + obj.privateConnections = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListPrivateConnectionsResponse { + const message = { + ...baseListPrivateConnectionsResponse, + } as ListPrivateConnectionsResponse; + message.privateConnections = + object.privateConnections?.map((e) => PrivateConnection.fromPartial(e)) || + []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListPrivateConnectionsResponse.$type, + ListPrivateConnectionsResponse +); + +/** A set of methods for managing PrivateConnection resources. */ +export const PrivateConnectionServiceService = { + /** + * Returns the specified PrivateConnection resource. + * + * To get the list of available PrivateConnection resources, make a [List] request. + */ + get: { + path: "/yandex.cloud.cic.v1.PrivateConnectionService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetPrivateConnectionRequest) => + Buffer.from(GetPrivateConnectionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetPrivateConnectionRequest.decode(value), + responseSerialize: (value: PrivateConnection) => + Buffer.from(PrivateConnection.encode(value).finish()), + responseDeserialize: (value: Buffer) => PrivateConnection.decode(value), + }, + /** Retrieves the list of PrivateConnection resources in the specified folder. */ + list: { + path: "/yandex.cloud.cic.v1.PrivateConnectionService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListPrivateConnectionsRequest) => + Buffer.from(ListPrivateConnectionsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListPrivateConnectionsRequest.decode(value), + responseSerialize: (value: ListPrivateConnectionsResponse) => + Buffer.from(ListPrivateConnectionsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListPrivateConnectionsResponse.decode(value), + }, +} as const; + +export interface PrivateConnectionServiceServer + extends UntypedServiceImplementation { + /** + * Returns the specified PrivateConnection resource. + * + * To get the list of available PrivateConnection resources, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of PrivateConnection resources in the specified folder. */ + list: handleUnaryCall< + ListPrivateConnectionsRequest, + ListPrivateConnectionsResponse + >; +} + +export interface PrivateConnectionServiceClient extends Client { + /** + * Returns the specified PrivateConnection resource. + * + * To get the list of available PrivateConnection resources, make a [List] request. + */ + get( + request: GetPrivateConnectionRequest, + callback: (error: ServiceError | null, response: PrivateConnection) => void + ): ClientUnaryCall; + get( + request: GetPrivateConnectionRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: PrivateConnection) => void + ): ClientUnaryCall; + get( + request: GetPrivateConnectionRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: PrivateConnection) => void + ): ClientUnaryCall; + /** Retrieves the list of PrivateConnection resources in the specified folder. */ + list( + request: ListPrivateConnectionsRequest, + callback: ( + error: ServiceError | null, + response: ListPrivateConnectionsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListPrivateConnectionsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListPrivateConnectionsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListPrivateConnectionsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListPrivateConnectionsResponse + ) => void + ): ClientUnaryCall; +} + +export const PrivateConnectionServiceClient = makeGenericClientConstructor( + PrivateConnectionServiceService, + "yandex.cloud.cic.v1.PrivateConnectionService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): PrivateConnectionServiceClient; + service: typeof PrivateConnectionServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cic/v1/public_connection.ts b/src/generated/yandex/cloud/cic/v1/public_connection.ts new file mode 100644 index 00000000..3adcf3b1 --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/public_connection.ts @@ -0,0 +1,523 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Peering } from "../../../../yandex/cloud/cic/v1/peering"; +import { Int64Value } from "../../../../google/protobuf/wrappers"; + +export const protobufPackage = "yandex.cloud.cic.v1"; + +/** A PublicConnection resource. */ +export interface PublicConnection { + $type: "yandex.cloud.cic.v1.PublicConnection"; + /** ID of the publicConnection. */ + id: string; + /** + * Name of the publicConnection. + * The name must be unique within the folder. + * Value must match the regular expression ``\|[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])?``. + */ + name: string; + /** Optional description of the publicConnection. 0-256 characters long. */ + description: string; + /** ID of the folder that the publicConnection belongs to. */ + folderId: string; + /** ID of the region that the publicConnection belongs to. */ + regionId: string; + /** ID of the trunk_connection that the publicConnection belongs to. */ + trunkConnectionId: string; + /** + * VLAN_ID that the privateConnection uses in multiplexing. + * Not used in connections over partners-II + * Value range: [1, 4095] + */ + vlanId?: number; + /** IPv4 peering config of connection */ + ipv4Peering?: Peering; + /** Cloud services that the publicConnection connects to. */ + ipv4AllowedServiceTypes: PublicConnection_CloudServiceType[]; + /** + * IPv4 Peer Announced Prefixes + * It's an list of ip with format ipPrefix/length where address part of ipPrefix is 0 + */ + ipv4PeerAnnouncedPrefixes: string[]; + /** + * Resource labels, `key:value` pairs. + * No more than 64 per resource. + * The maximum string length in characters for each value is 63. + * Each value must match the regular expression `[-_0-9a-z]*`. + * The string length in characters for each key must be 1-63. + * Each key must match the regular expression `[a-z][-_0-9a-z]*`. + */ + labels: { [key: string]: string }; +} + +export enum PublicConnection_CloudServiceType { + CLOUD_SERVICE_TYPE_UNSPECIFIED = 0, + /** @deprecated */ + CLOUD_SERVICE_YANDEX = 1, + CLOUD_SERVICE_ALL_PUBLIC = 2, + CLOUD_SERVICE_S3 = 3, + CLOUD_SERVICE_ML = 4, + CLOUD_SERVICE_APIGW = 5, + CLOUD_SERVICE_CONTAINER_REGISTRY = 6, + CLOUD_SERVICE_CONSOLE = 7, + CLOUD_SERVICE_MONITORING = 8, + CLOUD_SERVICE_YANDEX_GPT = 9, + CLOUD_SERVICES_ALL_API_ENDPOINT = 10, + CLOUD_SERVICE_YMQ = 11, + UNRECOGNIZED = -1, +} + +export function publicConnection_CloudServiceTypeFromJSON( + object: any +): PublicConnection_CloudServiceType { + switch (object) { + case 0: + case "CLOUD_SERVICE_TYPE_UNSPECIFIED": + return PublicConnection_CloudServiceType.CLOUD_SERVICE_TYPE_UNSPECIFIED; + case 1: + case "CLOUD_SERVICE_YANDEX": + return PublicConnection_CloudServiceType.CLOUD_SERVICE_YANDEX; + case 2: + case "CLOUD_SERVICE_ALL_PUBLIC": + return PublicConnection_CloudServiceType.CLOUD_SERVICE_ALL_PUBLIC; + case 3: + case "CLOUD_SERVICE_S3": + return PublicConnection_CloudServiceType.CLOUD_SERVICE_S3; + case 4: + case "CLOUD_SERVICE_ML": + return PublicConnection_CloudServiceType.CLOUD_SERVICE_ML; + case 5: + case "CLOUD_SERVICE_APIGW": + return PublicConnection_CloudServiceType.CLOUD_SERVICE_APIGW; + case 6: + case "CLOUD_SERVICE_CONTAINER_REGISTRY": + return PublicConnection_CloudServiceType.CLOUD_SERVICE_CONTAINER_REGISTRY; + case 7: + case "CLOUD_SERVICE_CONSOLE": + return PublicConnection_CloudServiceType.CLOUD_SERVICE_CONSOLE; + case 8: + case "CLOUD_SERVICE_MONITORING": + return PublicConnection_CloudServiceType.CLOUD_SERVICE_MONITORING; + case 9: + case "CLOUD_SERVICE_YANDEX_GPT": + return PublicConnection_CloudServiceType.CLOUD_SERVICE_YANDEX_GPT; + case 10: + case "CLOUD_SERVICES_ALL_API_ENDPOINT": + return PublicConnection_CloudServiceType.CLOUD_SERVICES_ALL_API_ENDPOINT; + case 11: + case "CLOUD_SERVICE_YMQ": + return PublicConnection_CloudServiceType.CLOUD_SERVICE_YMQ; + case -1: + case "UNRECOGNIZED": + default: + return PublicConnection_CloudServiceType.UNRECOGNIZED; + } +} + +export function publicConnection_CloudServiceTypeToJSON( + object: PublicConnection_CloudServiceType +): string { + switch (object) { + case PublicConnection_CloudServiceType.CLOUD_SERVICE_TYPE_UNSPECIFIED: + return "CLOUD_SERVICE_TYPE_UNSPECIFIED"; + case PublicConnection_CloudServiceType.CLOUD_SERVICE_YANDEX: + return "CLOUD_SERVICE_YANDEX"; + case PublicConnection_CloudServiceType.CLOUD_SERVICE_ALL_PUBLIC: + return "CLOUD_SERVICE_ALL_PUBLIC"; + case PublicConnection_CloudServiceType.CLOUD_SERVICE_S3: + return "CLOUD_SERVICE_S3"; + case PublicConnection_CloudServiceType.CLOUD_SERVICE_ML: + return "CLOUD_SERVICE_ML"; + case PublicConnection_CloudServiceType.CLOUD_SERVICE_APIGW: + return "CLOUD_SERVICE_APIGW"; + case PublicConnection_CloudServiceType.CLOUD_SERVICE_CONTAINER_REGISTRY: + return "CLOUD_SERVICE_CONTAINER_REGISTRY"; + case PublicConnection_CloudServiceType.CLOUD_SERVICE_CONSOLE: + return "CLOUD_SERVICE_CONSOLE"; + case PublicConnection_CloudServiceType.CLOUD_SERVICE_MONITORING: + return "CLOUD_SERVICE_MONITORING"; + case PublicConnection_CloudServiceType.CLOUD_SERVICE_YANDEX_GPT: + return "CLOUD_SERVICE_YANDEX_GPT"; + case PublicConnection_CloudServiceType.CLOUD_SERVICES_ALL_API_ENDPOINT: + return "CLOUD_SERVICES_ALL_API_ENDPOINT"; + case PublicConnection_CloudServiceType.CLOUD_SERVICE_YMQ: + return "CLOUD_SERVICE_YMQ"; + default: + return "UNKNOWN"; + } +} + +export interface PublicConnection_LabelsEntry { + $type: "yandex.cloud.cic.v1.PublicConnection.LabelsEntry"; + key: string; + value: string; +} + +const basePublicConnection: object = { + $type: "yandex.cloud.cic.v1.PublicConnection", + id: "", + name: "", + description: "", + folderId: "", + regionId: "", + trunkConnectionId: "", + ipv4AllowedServiceTypes: 0, + ipv4PeerAnnouncedPrefixes: "", +}; + +export const PublicConnection = { + $type: "yandex.cloud.cic.v1.PublicConnection" as const, + + encode( + message: PublicConnection, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.folderId !== "") { + writer.uint32(42).string(message.folderId); + } + if (message.regionId !== "") { + writer.uint32(50).string(message.regionId); + } + if (message.trunkConnectionId !== "") { + writer.uint32(58).string(message.trunkConnectionId); + } + if (message.vlanId !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.vlanId! }, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.ipv4Peering !== undefined) { + Peering.encode(message.ipv4Peering, writer.uint32(74).fork()).ldelim(); + } + writer.uint32(90).fork(); + for (const v of message.ipv4AllowedServiceTypes) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.ipv4PeerAnnouncedPrefixes) { + writer.uint32(106).string(v!); + } + Object.entries(message.labels).forEach(([key, value]) => { + PublicConnection_LabelsEntry.encode( + { + $type: "yandex.cloud.cic.v1.PublicConnection.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(146).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PublicConnection { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublicConnection } as PublicConnection; + message.ipv4AllowedServiceTypes = []; + message.ipv4PeerAnnouncedPrefixes = []; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 5: + message.folderId = reader.string(); + break; + case 6: + message.regionId = reader.string(); + break; + case 7: + message.trunkConnectionId = reader.string(); + break; + case 8: + message.vlanId = Int64Value.decode(reader, reader.uint32()).value; + break; + case 9: + message.ipv4Peering = Peering.decode(reader, reader.uint32()); + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.ipv4AllowedServiceTypes.push(reader.int32() as any); + } + } else { + message.ipv4AllowedServiceTypes.push(reader.int32() as any); + } + break; + case 13: + message.ipv4PeerAnnouncedPrefixes.push(reader.string()); + break; + case 18: + const entry18 = PublicConnection_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry18.value !== undefined) { + message.labels[entry18.key] = entry18.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PublicConnection { + const message = { ...basePublicConnection } as PublicConnection; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.regionId = + object.regionId !== undefined && object.regionId !== null + ? String(object.regionId) + : ""; + message.trunkConnectionId = + object.trunkConnectionId !== undefined && + object.trunkConnectionId !== null + ? String(object.trunkConnectionId) + : ""; + message.vlanId = + object.vlanId !== undefined && object.vlanId !== null + ? Number(object.vlanId) + : undefined; + message.ipv4Peering = + object.ipv4Peering !== undefined && object.ipv4Peering !== null + ? Peering.fromJSON(object.ipv4Peering) + : undefined; + message.ipv4AllowedServiceTypes = ( + object.ipv4AllowedServiceTypes ?? [] + ).map((e: any) => publicConnection_CloudServiceTypeFromJSON(e)); + message.ipv4PeerAnnouncedPrefixes = ( + object.ipv4PeerAnnouncedPrefixes ?? [] + ).map((e: any) => String(e)); + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: PublicConnection): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.regionId !== undefined && (obj.regionId = message.regionId); + message.trunkConnectionId !== undefined && + (obj.trunkConnectionId = message.trunkConnectionId); + message.vlanId !== undefined && (obj.vlanId = message.vlanId); + message.ipv4Peering !== undefined && + (obj.ipv4Peering = message.ipv4Peering + ? Peering.toJSON(message.ipv4Peering) + : undefined); + if (message.ipv4AllowedServiceTypes) { + obj.ipv4AllowedServiceTypes = message.ipv4AllowedServiceTypes.map((e) => + publicConnection_CloudServiceTypeToJSON(e) + ); + } else { + obj.ipv4AllowedServiceTypes = []; + } + if (message.ipv4PeerAnnouncedPrefixes) { + obj.ipv4PeerAnnouncedPrefixes = message.ipv4PeerAnnouncedPrefixes.map( + (e) => e + ); + } else { + obj.ipv4PeerAnnouncedPrefixes = []; + } + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): PublicConnection { + const message = { ...basePublicConnection } as PublicConnection; + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.folderId = object.folderId ?? ""; + message.regionId = object.regionId ?? ""; + message.trunkConnectionId = object.trunkConnectionId ?? ""; + message.vlanId = object.vlanId ?? undefined; + message.ipv4Peering = + object.ipv4Peering !== undefined && object.ipv4Peering !== null + ? Peering.fromPartial(object.ipv4Peering) + : undefined; + message.ipv4AllowedServiceTypes = + object.ipv4AllowedServiceTypes?.map((e) => e) || []; + message.ipv4PeerAnnouncedPrefixes = + object.ipv4PeerAnnouncedPrefixes?.map((e) => e) || []; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(PublicConnection.$type, PublicConnection); + +const basePublicConnection_LabelsEntry: object = { + $type: "yandex.cloud.cic.v1.PublicConnection.LabelsEntry", + key: "", + value: "", +}; + +export const PublicConnection_LabelsEntry = { + $type: "yandex.cloud.cic.v1.PublicConnection.LabelsEntry" as const, + + encode( + message: PublicConnection_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PublicConnection_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePublicConnection_LabelsEntry, + } as PublicConnection_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PublicConnection_LabelsEntry { + const message = { + ...basePublicConnection_LabelsEntry, + } as PublicConnection_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: PublicConnection_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): PublicConnection_LabelsEntry { + const message = { + ...basePublicConnection_LabelsEntry, + } as PublicConnection_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + PublicConnection_LabelsEntry.$type, + PublicConnection_LabelsEntry +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cic/v1/public_connection_service.ts b/src/generated/yandex/cloud/cic/v1/public_connection_service.ts new file mode 100644 index 00000000..a5518718 --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/public_connection_service.ts @@ -0,0 +1,519 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { PublicConnection } from "../../../../yandex/cloud/cic/v1/public_connection"; + +export const protobufPackage = "yandex.cloud.cic.v1"; + +export interface GetPublicConnectionRequest { + $type: "yandex.cloud.cic.v1.GetPublicConnectionRequest"; + /** + * ID of the PublicConnection resource to return. + * To get the publicConnection ID use a [PublicConnectionService.List] request. + */ + publicConnectionId: string; +} + +export interface ListPublicConnectionsRequest { + $type: "yandex.cloud.cic.v1.ListPublicConnectionsRequest"; + /** + * ID of the folder to list publicConnections in. + * To get the folder ID use a [yandex.cloud.resourcemanager.v1.FolderService.List] request. + */ + folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], + * the service returns a [ListPublicConnectionsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] to the + * [ListPublicConnectionsResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters resources listed in the response. + * The expression must specify: + * 1. The field name. Currently you can use filtering only on [Subnet.name] field. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. + */ + filter: string; +} + +export interface ListPublicConnectionsResponse { + $type: "yandex.cloud.cic.v1.ListPublicConnectionsResponse"; + /** List of PublicConnection resources. */ + publicConnections: PublicConnection[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListPublicConnectionsRequest.page_size], use + * the [next_page_token] as the value + * for the [ListPublicConnectionsRequest.page_token] query parameter + * in the next list request. Subsequent list requests will have their own + * [next_page_token] to continue paging through the results. + */ + nextPageToken: string; +} + +const baseGetPublicConnectionRequest: object = { + $type: "yandex.cloud.cic.v1.GetPublicConnectionRequest", + publicConnectionId: "", +}; + +export const GetPublicConnectionRequest = { + $type: "yandex.cloud.cic.v1.GetPublicConnectionRequest" as const, + + encode( + message: GetPublicConnectionRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.publicConnectionId !== "") { + writer.uint32(10).string(message.publicConnectionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetPublicConnectionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetPublicConnectionRequest, + } as GetPublicConnectionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicConnectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetPublicConnectionRequest { + const message = { + ...baseGetPublicConnectionRequest, + } as GetPublicConnectionRequest; + message.publicConnectionId = + object.publicConnectionId !== undefined && + object.publicConnectionId !== null + ? String(object.publicConnectionId) + : ""; + return message; + }, + + toJSON(message: GetPublicConnectionRequest): unknown { + const obj: any = {}; + message.publicConnectionId !== undefined && + (obj.publicConnectionId = message.publicConnectionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetPublicConnectionRequest { + const message = { + ...baseGetPublicConnectionRequest, + } as GetPublicConnectionRequest; + message.publicConnectionId = object.publicConnectionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetPublicConnectionRequest.$type, + GetPublicConnectionRequest +); + +const baseListPublicConnectionsRequest: object = { + $type: "yandex.cloud.cic.v1.ListPublicConnectionsRequest", + folderId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListPublicConnectionsRequest = { + $type: "yandex.cloud.cic.v1.ListPublicConnectionsRequest" as const, + + encode( + message: ListPublicConnectionsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListPublicConnectionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListPublicConnectionsRequest, + } as ListPublicConnectionsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPublicConnectionsRequest { + const message = { + ...baseListPublicConnectionsRequest, + } as ListPublicConnectionsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListPublicConnectionsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListPublicConnectionsRequest { + const message = { + ...baseListPublicConnectionsRequest, + } as ListPublicConnectionsRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListPublicConnectionsRequest.$type, + ListPublicConnectionsRequest +); + +const baseListPublicConnectionsResponse: object = { + $type: "yandex.cloud.cic.v1.ListPublicConnectionsResponse", + nextPageToken: "", +}; + +export const ListPublicConnectionsResponse = { + $type: "yandex.cloud.cic.v1.ListPublicConnectionsResponse" as const, + + encode( + message: ListPublicConnectionsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.publicConnections) { + PublicConnection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListPublicConnectionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListPublicConnectionsResponse, + } as ListPublicConnectionsResponse; + message.publicConnections = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicConnections.push( + PublicConnection.decode(reader, reader.uint32()) + ); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPublicConnectionsResponse { + const message = { + ...baseListPublicConnectionsResponse, + } as ListPublicConnectionsResponse; + message.publicConnections = (object.publicConnections ?? []).map((e: any) => + PublicConnection.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListPublicConnectionsResponse): unknown { + const obj: any = {}; + if (message.publicConnections) { + obj.publicConnections = message.publicConnections.map((e) => + e ? PublicConnection.toJSON(e) : undefined + ); + } else { + obj.publicConnections = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListPublicConnectionsResponse { + const message = { + ...baseListPublicConnectionsResponse, + } as ListPublicConnectionsResponse; + message.publicConnections = + object.publicConnections?.map((e) => PublicConnection.fromPartial(e)) || + []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListPublicConnectionsResponse.$type, + ListPublicConnectionsResponse +); + +/** A set of methods for managing PublicConnection resources. */ +export const PublicConnectionServiceService = { + /** + * Returns the specified PublicConnection resource. + * + * To get the list of available PublicConnection resources, make a [List] request. + */ + get: { + path: "/yandex.cloud.cic.v1.PublicConnectionService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetPublicConnectionRequest) => + Buffer.from(GetPublicConnectionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetPublicConnectionRequest.decode(value), + responseSerialize: (value: PublicConnection) => + Buffer.from(PublicConnection.encode(value).finish()), + responseDeserialize: (value: Buffer) => PublicConnection.decode(value), + }, + /** Retrieves the list of PublicConnection resources in the specified folder. */ + list: { + path: "/yandex.cloud.cic.v1.PublicConnectionService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListPublicConnectionsRequest) => + Buffer.from(ListPublicConnectionsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListPublicConnectionsRequest.decode(value), + responseSerialize: (value: ListPublicConnectionsResponse) => + Buffer.from(ListPublicConnectionsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListPublicConnectionsResponse.decode(value), + }, +} as const; + +export interface PublicConnectionServiceServer + extends UntypedServiceImplementation { + /** + * Returns the specified PublicConnection resource. + * + * To get the list of available PublicConnection resources, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of PublicConnection resources in the specified folder. */ + list: handleUnaryCall< + ListPublicConnectionsRequest, + ListPublicConnectionsResponse + >; +} + +export interface PublicConnectionServiceClient extends Client { + /** + * Returns the specified PublicConnection resource. + * + * To get the list of available PublicConnection resources, make a [List] request. + */ + get( + request: GetPublicConnectionRequest, + callback: (error: ServiceError | null, response: PublicConnection) => void + ): ClientUnaryCall; + get( + request: GetPublicConnectionRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: PublicConnection) => void + ): ClientUnaryCall; + get( + request: GetPublicConnectionRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: PublicConnection) => void + ): ClientUnaryCall; + /** Retrieves the list of PublicConnection resources in the specified folder. */ + list( + request: ListPublicConnectionsRequest, + callback: ( + error: ServiceError | null, + response: ListPublicConnectionsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListPublicConnectionsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListPublicConnectionsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListPublicConnectionsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListPublicConnectionsResponse + ) => void + ): ClientUnaryCall; +} + +export const PublicConnectionServiceClient = makeGenericClientConstructor( + PublicConnectionServiceService, + "yandex.cloud.cic.v1.PublicConnectionService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): PublicConnectionServiceClient; + service: typeof PublicConnectionServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cic/v1/trunk_connection.ts b/src/generated/yandex/cloud/cic/v1/trunk_connection.ts new file mode 100644 index 00000000..2131a605 --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/trunk_connection.ts @@ -0,0 +1,921 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + TransceiverType, + transceiverTypeFromJSON, + transceiverTypeToJSON, +} from "../../../../yandex/cloud/cic/v1/common/transceiver_type"; +import { LagAllocationSettings } from "../../../../yandex/cloud/cic/v1/common/lag_allocation_settings"; +import { StringValue } from "../../../../google/protobuf/wrappers"; + +export const protobufPackage = "yandex.cloud.cic.v1"; + +/** A TrunkConnection resource. */ +export interface TrunkConnection { + $type: "yandex.cloud.cic.v1.TrunkConnection"; + /** ID of the trunkConnection. */ + id: string; + /** + * Name of the trunkConnection. + * The name must be unique within the folder. + * Value must match the regular expression ``\|[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])?``. + */ + name: string; + /** Optional description of the trunkConnection. 0-256 characters long. */ + description: string; + /** ID of the folder that the trunkConnection belongs to. */ + folderId: string; + /** ID of the region that the trunkConnection belongs to. */ + regionId: string; + singlePortDirectJoint?: TrunkConnection_SinglePortDirectJoint | undefined; + lagDirectJoint?: TrunkConnection_LagDirectJoint | undefined; + partnerJointInfo?: TrunkConnection_PartnerJointInfo | undefined; + /** + * ID of pointOfPresence that the trunkConnection is deployed on. + * Optional. + * If is not set scheduler selects it by himself. + */ + pointOfPresenceId?: string; + /** Capacity of the trunkConnection */ + capacity: TrunkConnection_Capacity; + /** + * Resource labels, `key:value` pairs. + * No more than 64 per resource. + * The maximum string length in characters for each value is 63. + * Each value must match the regular expression `[-_0-9a-z]*`. + * The string length in characters for each key must be 1-63. + * Each key must match the regular expression `[a-z][-_0-9a-z]*`. + */ + labels: { [key: string]: string }; +} + +export enum TrunkConnection_Capacity { + CAPACITY_UNSPECIFIED = 0, + CAPACITY_50_MBPS = 1, + CAPACITY_100_MBPS = 2, + CAPACITY_200_MBPS = 3, + CAPACITY_300_MBPS = 4, + CAPACITY_400_MBPS = 5, + CAPACITY_500_MBPS = 6, + CAPACITY_1_GBPS = 7, + CAPACITY_2_GBPS = 8, + CAPACITY_3_GBPS = 9, + CAPACITY_4_GBPS = 10, + CAPACITY_5_GBPS = 11, + CAPACITY_10_GBPS = 12, + CAPACITY_20_GBPS = 13, + CAPACITY_30_GBPS = 14, + CAPACITY_40_GBPS = 15, + CAPACITY_50_GBPS = 16, + CAPACITY_100_GBPS = 17, + UNRECOGNIZED = -1, +} + +export function trunkConnection_CapacityFromJSON( + object: any +): TrunkConnection_Capacity { + switch (object) { + case 0: + case "CAPACITY_UNSPECIFIED": + return TrunkConnection_Capacity.CAPACITY_UNSPECIFIED; + case 1: + case "CAPACITY_50_MBPS": + return TrunkConnection_Capacity.CAPACITY_50_MBPS; + case 2: + case "CAPACITY_100_MBPS": + return TrunkConnection_Capacity.CAPACITY_100_MBPS; + case 3: + case "CAPACITY_200_MBPS": + return TrunkConnection_Capacity.CAPACITY_200_MBPS; + case 4: + case "CAPACITY_300_MBPS": + return TrunkConnection_Capacity.CAPACITY_300_MBPS; + case 5: + case "CAPACITY_400_MBPS": + return TrunkConnection_Capacity.CAPACITY_400_MBPS; + case 6: + case "CAPACITY_500_MBPS": + return TrunkConnection_Capacity.CAPACITY_500_MBPS; + case 7: + case "CAPACITY_1_GBPS": + return TrunkConnection_Capacity.CAPACITY_1_GBPS; + case 8: + case "CAPACITY_2_GBPS": + return TrunkConnection_Capacity.CAPACITY_2_GBPS; + case 9: + case "CAPACITY_3_GBPS": + return TrunkConnection_Capacity.CAPACITY_3_GBPS; + case 10: + case "CAPACITY_4_GBPS": + return TrunkConnection_Capacity.CAPACITY_4_GBPS; + case 11: + case "CAPACITY_5_GBPS": + return TrunkConnection_Capacity.CAPACITY_5_GBPS; + case 12: + case "CAPACITY_10_GBPS": + return TrunkConnection_Capacity.CAPACITY_10_GBPS; + case 13: + case "CAPACITY_20_GBPS": + return TrunkConnection_Capacity.CAPACITY_20_GBPS; + case 14: + case "CAPACITY_30_GBPS": + return TrunkConnection_Capacity.CAPACITY_30_GBPS; + case 15: + case "CAPACITY_40_GBPS": + return TrunkConnection_Capacity.CAPACITY_40_GBPS; + case 16: + case "CAPACITY_50_GBPS": + return TrunkConnection_Capacity.CAPACITY_50_GBPS; + case 17: + case "CAPACITY_100_GBPS": + return TrunkConnection_Capacity.CAPACITY_100_GBPS; + case -1: + case "UNRECOGNIZED": + default: + return TrunkConnection_Capacity.UNRECOGNIZED; + } +} + +export function trunkConnection_CapacityToJSON( + object: TrunkConnection_Capacity +): string { + switch (object) { + case TrunkConnection_Capacity.CAPACITY_UNSPECIFIED: + return "CAPACITY_UNSPECIFIED"; + case TrunkConnection_Capacity.CAPACITY_50_MBPS: + return "CAPACITY_50_MBPS"; + case TrunkConnection_Capacity.CAPACITY_100_MBPS: + return "CAPACITY_100_MBPS"; + case TrunkConnection_Capacity.CAPACITY_200_MBPS: + return "CAPACITY_200_MBPS"; + case TrunkConnection_Capacity.CAPACITY_300_MBPS: + return "CAPACITY_300_MBPS"; + case TrunkConnection_Capacity.CAPACITY_400_MBPS: + return "CAPACITY_400_MBPS"; + case TrunkConnection_Capacity.CAPACITY_500_MBPS: + return "CAPACITY_500_MBPS"; + case TrunkConnection_Capacity.CAPACITY_1_GBPS: + return "CAPACITY_1_GBPS"; + case TrunkConnection_Capacity.CAPACITY_2_GBPS: + return "CAPACITY_2_GBPS"; + case TrunkConnection_Capacity.CAPACITY_3_GBPS: + return "CAPACITY_3_GBPS"; + case TrunkConnection_Capacity.CAPACITY_4_GBPS: + return "CAPACITY_4_GBPS"; + case TrunkConnection_Capacity.CAPACITY_5_GBPS: + return "CAPACITY_5_GBPS"; + case TrunkConnection_Capacity.CAPACITY_10_GBPS: + return "CAPACITY_10_GBPS"; + case TrunkConnection_Capacity.CAPACITY_20_GBPS: + return "CAPACITY_20_GBPS"; + case TrunkConnection_Capacity.CAPACITY_30_GBPS: + return "CAPACITY_30_GBPS"; + case TrunkConnection_Capacity.CAPACITY_40_GBPS: + return "CAPACITY_40_GBPS"; + case TrunkConnection_Capacity.CAPACITY_50_GBPS: + return "CAPACITY_50_GBPS"; + case TrunkConnection_Capacity.CAPACITY_100_GBPS: + return "CAPACITY_100_GBPS"; + default: + return "UNKNOWN"; + } +} + +export interface TrunkConnection_LabelsEntry { + $type: "yandex.cloud.cic.v1.TrunkConnection.LabelsEntry"; + key: string; + value: string; +} + +/** Config of trunkConnection that is deployed on partner joint. */ +export interface TrunkConnection_PartnerJointInfo { + $type: "yandex.cloud.cic.v1.TrunkConnection.PartnerJointInfo"; + /** Reserved for future using; */ + serviceKey: string; + /** + * ID of partner that the trunkConnection is deployed on. + * Optional. + * If is not set scheduler selects it by himself. + */ + partnerId?: string; +} + +/** Config of trunkConnection that is deployed on single port. */ +export interface TrunkConnection_SinglePortDirectJoint { + $type: "yandex.cloud.cic.v1.TrunkConnection.SinglePortDirectJoint"; + /** Type of transceiver that the trunkConnection is deployed on. */ + transceiverType: TransceiverType; + /** Name of port that the trunkConnection is deployed on. */ + portName?: string; + /** Device name which is set in LLDP message. */ + accessDeviceName: string; +} + +/** Config of trunkConnection that is deployed on lag. */ +export interface TrunkConnection_LagDirectJoint { + $type: "yandex.cloud.cic.v1.TrunkConnection.LagDirectJoint"; + /** Type of transceiver that the trunkConnection is deployed on. */ + transceiverType: TransceiverType; + /** LAG allocation settings that the trunkConnection is deployed on. */ + lagAllocationSettings?: LagAllocationSettings; + /** Device name which is set in LLDP message. */ + accessDeviceName: string; +} + +const baseTrunkConnection: object = { + $type: "yandex.cloud.cic.v1.TrunkConnection", + id: "", + name: "", + description: "", + folderId: "", + regionId: "", + capacity: 0, +}; + +export const TrunkConnection = { + $type: "yandex.cloud.cic.v1.TrunkConnection" as const, + + encode( + message: TrunkConnection, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.folderId !== "") { + writer.uint32(42).string(message.folderId); + } + if (message.regionId !== "") { + writer.uint32(50).string(message.regionId); + } + if (message.singlePortDirectJoint !== undefined) { + TrunkConnection_SinglePortDirectJoint.encode( + message.singlePortDirectJoint, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.lagDirectJoint !== undefined) { + TrunkConnection_LagDirectJoint.encode( + message.lagDirectJoint, + writer.uint32(82).fork() + ).ldelim(); + } + if (message.partnerJointInfo !== undefined) { + TrunkConnection_PartnerJointInfo.encode( + message.partnerJointInfo, + writer.uint32(90).fork() + ).ldelim(); + } + if (message.pointOfPresenceId !== undefined) { + StringValue.encode( + { + $type: "google.protobuf.StringValue", + value: message.pointOfPresenceId!, + }, + writer.uint32(98).fork() + ).ldelim(); + } + if (message.capacity !== 0) { + writer.uint32(176).int32(message.capacity); + } + Object.entries(message.labels).forEach(([key, value]) => { + TrunkConnection_LabelsEntry.encode( + { + $type: "yandex.cloud.cic.v1.TrunkConnection.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(186).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TrunkConnection { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTrunkConnection } as TrunkConnection; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 5: + message.folderId = reader.string(); + break; + case 6: + message.regionId = reader.string(); + break; + case 9: + message.singlePortDirectJoint = + TrunkConnection_SinglePortDirectJoint.decode( + reader, + reader.uint32() + ); + break; + case 10: + message.lagDirectJoint = TrunkConnection_LagDirectJoint.decode( + reader, + reader.uint32() + ); + break; + case 11: + message.partnerJointInfo = TrunkConnection_PartnerJointInfo.decode( + reader, + reader.uint32() + ); + break; + case 12: + message.pointOfPresenceId = StringValue.decode( + reader, + reader.uint32() + ).value; + break; + case 22: + message.capacity = reader.int32() as any; + break; + case 23: + const entry23 = TrunkConnection_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry23.value !== undefined) { + message.labels[entry23.key] = entry23.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TrunkConnection { + const message = { ...baseTrunkConnection } as TrunkConnection; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.regionId = + object.regionId !== undefined && object.regionId !== null + ? String(object.regionId) + : ""; + message.singlePortDirectJoint = + object.singlePortDirectJoint !== undefined && + object.singlePortDirectJoint !== null + ? TrunkConnection_SinglePortDirectJoint.fromJSON( + object.singlePortDirectJoint + ) + : undefined; + message.lagDirectJoint = + object.lagDirectJoint !== undefined && object.lagDirectJoint !== null + ? TrunkConnection_LagDirectJoint.fromJSON(object.lagDirectJoint) + : undefined; + message.partnerJointInfo = + object.partnerJointInfo !== undefined && object.partnerJointInfo !== null + ? TrunkConnection_PartnerJointInfo.fromJSON(object.partnerJointInfo) + : undefined; + message.pointOfPresenceId = + object.pointOfPresenceId !== undefined && + object.pointOfPresenceId !== null + ? String(object.pointOfPresenceId) + : undefined; + message.capacity = + object.capacity !== undefined && object.capacity !== null + ? trunkConnection_CapacityFromJSON(object.capacity) + : 0; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: TrunkConnection): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.regionId !== undefined && (obj.regionId = message.regionId); + message.singlePortDirectJoint !== undefined && + (obj.singlePortDirectJoint = message.singlePortDirectJoint + ? TrunkConnection_SinglePortDirectJoint.toJSON( + message.singlePortDirectJoint + ) + : undefined); + message.lagDirectJoint !== undefined && + (obj.lagDirectJoint = message.lagDirectJoint + ? TrunkConnection_LagDirectJoint.toJSON(message.lagDirectJoint) + : undefined); + message.partnerJointInfo !== undefined && + (obj.partnerJointInfo = message.partnerJointInfo + ? TrunkConnection_PartnerJointInfo.toJSON(message.partnerJointInfo) + : undefined); + message.pointOfPresenceId !== undefined && + (obj.pointOfPresenceId = message.pointOfPresenceId); + message.capacity !== undefined && + (obj.capacity = trunkConnection_CapacityToJSON(message.capacity)); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): TrunkConnection { + const message = { ...baseTrunkConnection } as TrunkConnection; + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.folderId = object.folderId ?? ""; + message.regionId = object.regionId ?? ""; + message.singlePortDirectJoint = + object.singlePortDirectJoint !== undefined && + object.singlePortDirectJoint !== null + ? TrunkConnection_SinglePortDirectJoint.fromPartial( + object.singlePortDirectJoint + ) + : undefined; + message.lagDirectJoint = + object.lagDirectJoint !== undefined && object.lagDirectJoint !== null + ? TrunkConnection_LagDirectJoint.fromPartial(object.lagDirectJoint) + : undefined; + message.partnerJointInfo = + object.partnerJointInfo !== undefined && object.partnerJointInfo !== null + ? TrunkConnection_PartnerJointInfo.fromPartial(object.partnerJointInfo) + : undefined; + message.pointOfPresenceId = object.pointOfPresenceId ?? undefined; + message.capacity = object.capacity ?? 0; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(TrunkConnection.$type, TrunkConnection); + +const baseTrunkConnection_LabelsEntry: object = { + $type: "yandex.cloud.cic.v1.TrunkConnection.LabelsEntry", + key: "", + value: "", +}; + +export const TrunkConnection_LabelsEntry = { + $type: "yandex.cloud.cic.v1.TrunkConnection.LabelsEntry" as const, + + encode( + message: TrunkConnection_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): TrunkConnection_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTrunkConnection_LabelsEntry, + } as TrunkConnection_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TrunkConnection_LabelsEntry { + const message = { + ...baseTrunkConnection_LabelsEntry, + } as TrunkConnection_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: TrunkConnection_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): TrunkConnection_LabelsEntry { + const message = { + ...baseTrunkConnection_LabelsEntry, + } as TrunkConnection_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + TrunkConnection_LabelsEntry.$type, + TrunkConnection_LabelsEntry +); + +const baseTrunkConnection_PartnerJointInfo: object = { + $type: "yandex.cloud.cic.v1.TrunkConnection.PartnerJointInfo", + serviceKey: "", +}; + +export const TrunkConnection_PartnerJointInfo = { + $type: "yandex.cloud.cic.v1.TrunkConnection.PartnerJointInfo" as const, + + encode( + message: TrunkConnection_PartnerJointInfo, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.serviceKey !== "") { + writer.uint32(26).string(message.serviceKey); + } + if (message.partnerId !== undefined) { + StringValue.encode( + { $type: "google.protobuf.StringValue", value: message.partnerId! }, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): TrunkConnection_PartnerJointInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTrunkConnection_PartnerJointInfo, + } as TrunkConnection_PartnerJointInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.serviceKey = reader.string(); + break; + case 4: + message.partnerId = StringValue.decode(reader, reader.uint32()).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TrunkConnection_PartnerJointInfo { + const message = { + ...baseTrunkConnection_PartnerJointInfo, + } as TrunkConnection_PartnerJointInfo; + message.serviceKey = + object.serviceKey !== undefined && object.serviceKey !== null + ? String(object.serviceKey) + : ""; + message.partnerId = + object.partnerId !== undefined && object.partnerId !== null + ? String(object.partnerId) + : undefined; + return message; + }, + + toJSON(message: TrunkConnection_PartnerJointInfo): unknown { + const obj: any = {}; + message.serviceKey !== undefined && (obj.serviceKey = message.serviceKey); + message.partnerId !== undefined && (obj.partnerId = message.partnerId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): TrunkConnection_PartnerJointInfo { + const message = { + ...baseTrunkConnection_PartnerJointInfo, + } as TrunkConnection_PartnerJointInfo; + message.serviceKey = object.serviceKey ?? ""; + message.partnerId = object.partnerId ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + TrunkConnection_PartnerJointInfo.$type, + TrunkConnection_PartnerJointInfo +); + +const baseTrunkConnection_SinglePortDirectJoint: object = { + $type: "yandex.cloud.cic.v1.TrunkConnection.SinglePortDirectJoint", + transceiverType: 0, + accessDeviceName: "", +}; + +export const TrunkConnection_SinglePortDirectJoint = { + $type: "yandex.cloud.cic.v1.TrunkConnection.SinglePortDirectJoint" as const, + + encode( + message: TrunkConnection_SinglePortDirectJoint, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.transceiverType !== 0) { + writer.uint32(8).int32(message.transceiverType); + } + if (message.portName !== undefined) { + StringValue.encode( + { $type: "google.protobuf.StringValue", value: message.portName! }, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.accessDeviceName !== "") { + writer.uint32(34).string(message.accessDeviceName); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): TrunkConnection_SinglePortDirectJoint { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTrunkConnection_SinglePortDirectJoint, + } as TrunkConnection_SinglePortDirectJoint; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transceiverType = reader.int32() as any; + break; + case 3: + message.portName = StringValue.decode(reader, reader.uint32()).value; + break; + case 4: + message.accessDeviceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TrunkConnection_SinglePortDirectJoint { + const message = { + ...baseTrunkConnection_SinglePortDirectJoint, + } as TrunkConnection_SinglePortDirectJoint; + message.transceiverType = + object.transceiverType !== undefined && object.transceiverType !== null + ? transceiverTypeFromJSON(object.transceiverType) + : 0; + message.portName = + object.portName !== undefined && object.portName !== null + ? String(object.portName) + : undefined; + message.accessDeviceName = + object.accessDeviceName !== undefined && object.accessDeviceName !== null + ? String(object.accessDeviceName) + : ""; + return message; + }, + + toJSON(message: TrunkConnection_SinglePortDirectJoint): unknown { + const obj: any = {}; + message.transceiverType !== undefined && + (obj.transceiverType = transceiverTypeToJSON(message.transceiverType)); + message.portName !== undefined && (obj.portName = message.portName); + message.accessDeviceName !== undefined && + (obj.accessDeviceName = message.accessDeviceName); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): TrunkConnection_SinglePortDirectJoint { + const message = { + ...baseTrunkConnection_SinglePortDirectJoint, + } as TrunkConnection_SinglePortDirectJoint; + message.transceiverType = object.transceiverType ?? 0; + message.portName = object.portName ?? undefined; + message.accessDeviceName = object.accessDeviceName ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + TrunkConnection_SinglePortDirectJoint.$type, + TrunkConnection_SinglePortDirectJoint +); + +const baseTrunkConnection_LagDirectJoint: object = { + $type: "yandex.cloud.cic.v1.TrunkConnection.LagDirectJoint", + transceiverType: 0, + accessDeviceName: "", +}; + +export const TrunkConnection_LagDirectJoint = { + $type: "yandex.cloud.cic.v1.TrunkConnection.LagDirectJoint" as const, + + encode( + message: TrunkConnection_LagDirectJoint, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.transceiverType !== 0) { + writer.uint32(8).int32(message.transceiverType); + } + if (message.lagAllocationSettings !== undefined) { + LagAllocationSettings.encode( + message.lagAllocationSettings, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.accessDeviceName !== "") { + writer.uint32(34).string(message.accessDeviceName); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): TrunkConnection_LagDirectJoint { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTrunkConnection_LagDirectJoint, + } as TrunkConnection_LagDirectJoint; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transceiverType = reader.int32() as any; + break; + case 3: + message.lagAllocationSettings = LagAllocationSettings.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.accessDeviceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TrunkConnection_LagDirectJoint { + const message = { + ...baseTrunkConnection_LagDirectJoint, + } as TrunkConnection_LagDirectJoint; + message.transceiverType = + object.transceiverType !== undefined && object.transceiverType !== null + ? transceiverTypeFromJSON(object.transceiverType) + : 0; + message.lagAllocationSettings = + object.lagAllocationSettings !== undefined && + object.lagAllocationSettings !== null + ? LagAllocationSettings.fromJSON(object.lagAllocationSettings) + : undefined; + message.accessDeviceName = + object.accessDeviceName !== undefined && object.accessDeviceName !== null + ? String(object.accessDeviceName) + : ""; + return message; + }, + + toJSON(message: TrunkConnection_LagDirectJoint): unknown { + const obj: any = {}; + message.transceiverType !== undefined && + (obj.transceiverType = transceiverTypeToJSON(message.transceiverType)); + message.lagAllocationSettings !== undefined && + (obj.lagAllocationSettings = message.lagAllocationSettings + ? LagAllocationSettings.toJSON(message.lagAllocationSettings) + : undefined); + message.accessDeviceName !== undefined && + (obj.accessDeviceName = message.accessDeviceName); + return obj; + }, + + fromPartial, I>>( + object: I + ): TrunkConnection_LagDirectJoint { + const message = { + ...baseTrunkConnection_LagDirectJoint, + } as TrunkConnection_LagDirectJoint; + message.transceiverType = object.transceiverType ?? 0; + message.lagAllocationSettings = + object.lagAllocationSettings !== undefined && + object.lagAllocationSettings !== null + ? LagAllocationSettings.fromPartial(object.lagAllocationSettings) + : undefined; + message.accessDeviceName = object.accessDeviceName ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + TrunkConnection_LagDirectJoint.$type, + TrunkConnection_LagDirectJoint +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cic/v1/trunk_connection_service.ts b/src/generated/yandex/cloud/cic/v1/trunk_connection_service.ts new file mode 100644 index 00000000..63fb6f59 --- /dev/null +++ b/src/generated/yandex/cloud/cic/v1/trunk_connection_service.ts @@ -0,0 +1,518 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { TrunkConnection } from "../../../../yandex/cloud/cic/v1/trunk_connection"; + +export const protobufPackage = "yandex.cloud.cic.v1"; + +export interface GetTrunkConnectionRequest { + $type: "yandex.cloud.cic.v1.GetTrunkConnectionRequest"; + /** + * ID of the TrunkConnection resource to return. + * To get the trunkConnection ID use a [TrunkConnectionService.List] request. + */ + trunkConnectionId: string; +} + +export interface ListTrunkConnectionsRequest { + $type: "yandex.cloud.cic.v1.ListTrunkConnectionsRequest"; + /** + * ID of the folder to list trunkConnections in. + * To get the folder ID use a [yandex.cloud.resourcemanager.v1.FolderService.List] request. + */ + folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], + * the service returns a [ListTrunkConnectionsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] to the + * [ListTrunkConnectionsResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters resources listed in the response. + * The expression must specify: + * 1. The field name. Currently you can use filtering only on [Subnet.name] field. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. + */ + filter: string; +} + +export interface ListTrunkConnectionsResponse { + $type: "yandex.cloud.cic.v1.ListTrunkConnectionsResponse"; + /** List of TrunkConnection resources. */ + trunkConnections: TrunkConnection[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListTrunkConnectionsRequest.page_size], use + * the [next_page_token] as the value + * for the [ListTrunkConnectionsRequest.page_token] query parameter + * in the next list request. Subsequent list requests will have their own + * [next_page_token] to continue paging through the results. + */ + nextPageToken: string; +} + +const baseGetTrunkConnectionRequest: object = { + $type: "yandex.cloud.cic.v1.GetTrunkConnectionRequest", + trunkConnectionId: "", +}; + +export const GetTrunkConnectionRequest = { + $type: "yandex.cloud.cic.v1.GetTrunkConnectionRequest" as const, + + encode( + message: GetTrunkConnectionRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.trunkConnectionId !== "") { + writer.uint32(10).string(message.trunkConnectionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetTrunkConnectionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetTrunkConnectionRequest, + } as GetTrunkConnectionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trunkConnectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetTrunkConnectionRequest { + const message = { + ...baseGetTrunkConnectionRequest, + } as GetTrunkConnectionRequest; + message.trunkConnectionId = + object.trunkConnectionId !== undefined && + object.trunkConnectionId !== null + ? String(object.trunkConnectionId) + : ""; + return message; + }, + + toJSON(message: GetTrunkConnectionRequest): unknown { + const obj: any = {}; + message.trunkConnectionId !== undefined && + (obj.trunkConnectionId = message.trunkConnectionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetTrunkConnectionRequest { + const message = { + ...baseGetTrunkConnectionRequest, + } as GetTrunkConnectionRequest; + message.trunkConnectionId = object.trunkConnectionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetTrunkConnectionRequest.$type, + GetTrunkConnectionRequest +); + +const baseListTrunkConnectionsRequest: object = { + $type: "yandex.cloud.cic.v1.ListTrunkConnectionsRequest", + folderId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListTrunkConnectionsRequest = { + $type: "yandex.cloud.cic.v1.ListTrunkConnectionsRequest" as const, + + encode( + message: ListTrunkConnectionsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListTrunkConnectionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListTrunkConnectionsRequest, + } as ListTrunkConnectionsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListTrunkConnectionsRequest { + const message = { + ...baseListTrunkConnectionsRequest, + } as ListTrunkConnectionsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListTrunkConnectionsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListTrunkConnectionsRequest { + const message = { + ...baseListTrunkConnectionsRequest, + } as ListTrunkConnectionsRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListTrunkConnectionsRequest.$type, + ListTrunkConnectionsRequest +); + +const baseListTrunkConnectionsResponse: object = { + $type: "yandex.cloud.cic.v1.ListTrunkConnectionsResponse", + nextPageToken: "", +}; + +export const ListTrunkConnectionsResponse = { + $type: "yandex.cloud.cic.v1.ListTrunkConnectionsResponse" as const, + + encode( + message: ListTrunkConnectionsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.trunkConnections) { + TrunkConnection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListTrunkConnectionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListTrunkConnectionsResponse, + } as ListTrunkConnectionsResponse; + message.trunkConnections = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.trunkConnections.push( + TrunkConnection.decode(reader, reader.uint32()) + ); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListTrunkConnectionsResponse { + const message = { + ...baseListTrunkConnectionsResponse, + } as ListTrunkConnectionsResponse; + message.trunkConnections = (object.trunkConnections ?? []).map((e: any) => + TrunkConnection.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListTrunkConnectionsResponse): unknown { + const obj: any = {}; + if (message.trunkConnections) { + obj.trunkConnections = message.trunkConnections.map((e) => + e ? TrunkConnection.toJSON(e) : undefined + ); + } else { + obj.trunkConnections = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListTrunkConnectionsResponse { + const message = { + ...baseListTrunkConnectionsResponse, + } as ListTrunkConnectionsResponse; + message.trunkConnections = + object.trunkConnections?.map((e) => TrunkConnection.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListTrunkConnectionsResponse.$type, + ListTrunkConnectionsResponse +); + +/** A set of methods for managing TrunkConnection resources. */ +export const TrunkConnectionServiceService = { + /** + * Returns the specified TrunkConnection resource. + * + * To get the list of available TrunkConnection resources, make a [List] request. + */ + get: { + path: "/yandex.cloud.cic.v1.TrunkConnectionService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetTrunkConnectionRequest) => + Buffer.from(GetTrunkConnectionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetTrunkConnectionRequest.decode(value), + responseSerialize: (value: TrunkConnection) => + Buffer.from(TrunkConnection.encode(value).finish()), + responseDeserialize: (value: Buffer) => TrunkConnection.decode(value), + }, + /** Retrieves the list of TrunkConnection resources in the specified folder. */ + list: { + path: "/yandex.cloud.cic.v1.TrunkConnectionService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListTrunkConnectionsRequest) => + Buffer.from(ListTrunkConnectionsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListTrunkConnectionsRequest.decode(value), + responseSerialize: (value: ListTrunkConnectionsResponse) => + Buffer.from(ListTrunkConnectionsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListTrunkConnectionsResponse.decode(value), + }, +} as const; + +export interface TrunkConnectionServiceServer + extends UntypedServiceImplementation { + /** + * Returns the specified TrunkConnection resource. + * + * To get the list of available TrunkConnection resources, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of TrunkConnection resources in the specified folder. */ + list: handleUnaryCall< + ListTrunkConnectionsRequest, + ListTrunkConnectionsResponse + >; +} + +export interface TrunkConnectionServiceClient extends Client { + /** + * Returns the specified TrunkConnection resource. + * + * To get the list of available TrunkConnection resources, make a [List] request. + */ + get( + request: GetTrunkConnectionRequest, + callback: (error: ServiceError | null, response: TrunkConnection) => void + ): ClientUnaryCall; + get( + request: GetTrunkConnectionRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: TrunkConnection) => void + ): ClientUnaryCall; + get( + request: GetTrunkConnectionRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: TrunkConnection) => void + ): ClientUnaryCall; + /** Retrieves the list of TrunkConnection resources in the specified folder. */ + list( + request: ListTrunkConnectionsRequest, + callback: ( + error: ServiceError | null, + response: ListTrunkConnectionsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListTrunkConnectionsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListTrunkConnectionsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListTrunkConnectionsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListTrunkConnectionsResponse + ) => void + ): ClientUnaryCall; +} + +export const TrunkConnectionServiceClient = makeGenericClientConstructor( + TrunkConnectionServiceService, + "yandex.cloud.cic.v1.TrunkConnectionService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): TrunkConnectionServiceClient; + service: typeof TrunkConnectionServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cloudapps/index.ts b/src/generated/yandex/cloud/cloudapps/index.ts new file mode 100644 index 00000000..37f6f277 --- /dev/null +++ b/src/generated/yandex/cloud/cloudapps/index.ts @@ -0,0 +1,2 @@ +export * as workload_v1_cloud_application from './workload/v1/cloud_application' +export * as workload_v1_cloud_application_service from './workload/v1/cloud_application_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/cloudapps/workload/v1/cloud_application.ts b/src/generated/yandex/cloud/cloudapps/workload/v1/cloud_application.ts new file mode 100644 index 00000000..2cdc70eb --- /dev/null +++ b/src/generated/yandex/cloud/cloudapps/workload/v1/cloud_application.ts @@ -0,0 +1,450 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.cloudapps.workload.v1"; + +export interface CloudApplication { + $type: "yandex.cloud.cloudapps.workload.v1.CloudApplication"; + /** Application Identifier */ + id: string; + /** Application Status */ + status: CloudApplication_Status; + /** Application billing info */ + billing?: CloudApplication_Billing; +} + +export enum CloudApplication_Status { + STATUS_UNSPECIFIED = 0, + /** PROCESSING - Application under deploying / updating /deleting */ + PROCESSING = 1, + /** DEPLOYED - Application successfully deployed to YC */ + DEPLOYED = 2, + /** FAILED - Application failed to deploy */ + FAILED = 3, + UNRECOGNIZED = -1, +} + +export function cloudApplication_StatusFromJSON( + object: any +): CloudApplication_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return CloudApplication_Status.STATUS_UNSPECIFIED; + case 1: + case "PROCESSING": + return CloudApplication_Status.PROCESSING; + case 2: + case "DEPLOYED": + return CloudApplication_Status.DEPLOYED; + case 3: + case "FAILED": + return CloudApplication_Status.FAILED; + case -1: + case "UNRECOGNIZED": + default: + return CloudApplication_Status.UNRECOGNIZED; + } +} + +export function cloudApplication_StatusToJSON( + object: CloudApplication_Status +): string { + switch (object) { + case CloudApplication_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case CloudApplication_Status.PROCESSING: + return "PROCESSING"; + case CloudApplication_Status.DEPLOYED: + return "DEPLOYED"; + case CloudApplication_Status.FAILED: + return "FAILED"; + default: + return "UNKNOWN"; + } +} + +export interface CloudApplication_Billing { + $type: "yandex.cloud.cloudapps.workload.v1.CloudApplication.Billing"; + /** Type of application billing */ + type: CloudApplication_Billing_BillingType; + /** Subscriptions bounded to cloud application */ + subscriptions: CloudApplication_Billing_Subscription[]; +} + +export enum CloudApplication_Billing_BillingType { + BILLING_TYPE_UNSPECIFIED = 0, + /** PAY_AS_YOU_GO - User pays for application usage time */ + PAY_AS_YOU_GO = 1, + /** SUBSCRIPTION - User bought a subscription */ + SUBSCRIPTION = 2, + UNRECOGNIZED = -1, +} + +export function cloudApplication_Billing_BillingTypeFromJSON( + object: any +): CloudApplication_Billing_BillingType { + switch (object) { + case 0: + case "BILLING_TYPE_UNSPECIFIED": + return CloudApplication_Billing_BillingType.BILLING_TYPE_UNSPECIFIED; + case 1: + case "PAY_AS_YOU_GO": + return CloudApplication_Billing_BillingType.PAY_AS_YOU_GO; + case 2: + case "SUBSCRIPTION": + return CloudApplication_Billing_BillingType.SUBSCRIPTION; + case -1: + case "UNRECOGNIZED": + default: + return CloudApplication_Billing_BillingType.UNRECOGNIZED; + } +} + +export function cloudApplication_Billing_BillingTypeToJSON( + object: CloudApplication_Billing_BillingType +): string { + switch (object) { + case CloudApplication_Billing_BillingType.BILLING_TYPE_UNSPECIFIED: + return "BILLING_TYPE_UNSPECIFIED"; + case CloudApplication_Billing_BillingType.PAY_AS_YOU_GO: + return "PAY_AS_YOU_GO"; + case CloudApplication_Billing_BillingType.SUBSCRIPTION: + return "SUBSCRIPTION"; + default: + return "UNKNOWN"; + } +} + +export interface CloudApplication_Billing_Subscription { + $type: "yandex.cloud.cloudapps.workload.v1.CloudApplication.Billing.Subscription"; + /** Identifier of subscription instance */ + instanceId: string; + /** Subscription template identifier */ + templateId: string; +} + +const baseCloudApplication: object = { + $type: "yandex.cloud.cloudapps.workload.v1.CloudApplication", + id: "", + status: 0, +}; + +export const CloudApplication = { + $type: "yandex.cloud.cloudapps.workload.v1.CloudApplication" as const, + + encode( + message: CloudApplication, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.status !== 0) { + writer.uint32(16).int32(message.status); + } + if (message.billing !== undefined) { + CloudApplication_Billing.encode( + message.billing, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CloudApplication { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCloudApplication } as CloudApplication; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.status = reader.int32() as any; + break; + case 3: + message.billing = CloudApplication_Billing.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CloudApplication { + const message = { ...baseCloudApplication } as CloudApplication; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.status = + object.status !== undefined && object.status !== null + ? cloudApplication_StatusFromJSON(object.status) + : 0; + message.billing = + object.billing !== undefined && object.billing !== null + ? CloudApplication_Billing.fromJSON(object.billing) + : undefined; + return message; + }, + + toJSON(message: CloudApplication): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.status !== undefined && + (obj.status = cloudApplication_StatusToJSON(message.status)); + message.billing !== undefined && + (obj.billing = message.billing + ? CloudApplication_Billing.toJSON(message.billing) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CloudApplication { + const message = { ...baseCloudApplication } as CloudApplication; + message.id = object.id ?? ""; + message.status = object.status ?? 0; + message.billing = + object.billing !== undefined && object.billing !== null + ? CloudApplication_Billing.fromPartial(object.billing) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CloudApplication.$type, CloudApplication); + +const baseCloudApplication_Billing: object = { + $type: "yandex.cloud.cloudapps.workload.v1.CloudApplication.Billing", + type: 0, +}; + +export const CloudApplication_Billing = { + $type: "yandex.cloud.cloudapps.workload.v1.CloudApplication.Billing" as const, + + encode( + message: CloudApplication_Billing, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + for (const v of message.subscriptions) { + CloudApplication_Billing_Subscription.encode( + v!, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CloudApplication_Billing { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCloudApplication_Billing, + } as CloudApplication_Billing; + message.subscriptions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.subscriptions.push( + CloudApplication_Billing_Subscription.decode( + reader, + reader.uint32() + ) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CloudApplication_Billing { + const message = { + ...baseCloudApplication_Billing, + } as CloudApplication_Billing; + message.type = + object.type !== undefined && object.type !== null + ? cloudApplication_Billing_BillingTypeFromJSON(object.type) + : 0; + message.subscriptions = (object.subscriptions ?? []).map((e: any) => + CloudApplication_Billing_Subscription.fromJSON(e) + ); + return message; + }, + + toJSON(message: CloudApplication_Billing): unknown { + const obj: any = {}; + message.type !== undefined && + (obj.type = cloudApplication_Billing_BillingTypeToJSON(message.type)); + if (message.subscriptions) { + obj.subscriptions = message.subscriptions.map((e) => + e ? CloudApplication_Billing_Subscription.toJSON(e) : undefined + ); + } else { + obj.subscriptions = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): CloudApplication_Billing { + const message = { + ...baseCloudApplication_Billing, + } as CloudApplication_Billing; + message.type = object.type ?? 0; + message.subscriptions = + object.subscriptions?.map((e) => + CloudApplication_Billing_Subscription.fromPartial(e) + ) || []; + return message; + }, +}; + +messageTypeRegistry.set( + CloudApplication_Billing.$type, + CloudApplication_Billing +); + +const baseCloudApplication_Billing_Subscription: object = { + $type: + "yandex.cloud.cloudapps.workload.v1.CloudApplication.Billing.Subscription", + instanceId: "", + templateId: "", +}; + +export const CloudApplication_Billing_Subscription = { + $type: + "yandex.cloud.cloudapps.workload.v1.CloudApplication.Billing.Subscription" as const, + + encode( + message: CloudApplication_Billing_Subscription, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.instanceId !== "") { + writer.uint32(10).string(message.instanceId); + } + if (message.templateId !== "") { + writer.uint32(18).string(message.templateId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CloudApplication_Billing_Subscription { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCloudApplication_Billing_Subscription, + } as CloudApplication_Billing_Subscription; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.instanceId = reader.string(); + break; + case 2: + message.templateId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CloudApplication_Billing_Subscription { + const message = { + ...baseCloudApplication_Billing_Subscription, + } as CloudApplication_Billing_Subscription; + message.instanceId = + object.instanceId !== undefined && object.instanceId !== null + ? String(object.instanceId) + : ""; + message.templateId = + object.templateId !== undefined && object.templateId !== null + ? String(object.templateId) + : ""; + return message; + }, + + toJSON(message: CloudApplication_Billing_Subscription): unknown { + const obj: any = {}; + message.instanceId !== undefined && (obj.instanceId = message.instanceId); + message.templateId !== undefined && (obj.templateId = message.templateId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CloudApplication_Billing_Subscription { + const message = { + ...baseCloudApplication_Billing_Subscription, + } as CloudApplication_Billing_Subscription; + message.instanceId = object.instanceId ?? ""; + message.templateId = object.templateId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CloudApplication_Billing_Subscription.$type, + CloudApplication_Billing_Subscription +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cloudapps/workload/v1/cloud_application_service.ts b/src/generated/yandex/cloud/cloudapps/workload/v1/cloud_application_service.ts new file mode 100644 index 00000000..18b92231 --- /dev/null +++ b/src/generated/yandex/cloud/cloudapps/workload/v1/cloud_application_service.ts @@ -0,0 +1,376 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { CloudApplication } from "../../../../../yandex/cloud/cloudapps/workload/v1/cloud_application"; +import { Empty } from "../../../../../google/protobuf/empty"; + +export const protobufPackage = "yandex.cloud.cloudapps.workload.v1"; + +export interface ResolveByWorkloadRequest { + $type: "yandex.cloud.cloudapps.workload.v1.ResolveByWorkloadRequest"; + /** Type of workload. See WorkloadType. */ + workloadType: ResolveByWorkloadRequest_WorkloadType; + /** Identifier of workload */ + workloadId: string; +} + +export enum ResolveByWorkloadRequest_WorkloadType { + WORKLOAD_TYPE_UNSPECIFIED = 0, + /** COMPUTE_INSTANCE - Compute Instance */ + COMPUTE_INSTANCE = 1, + UNRECOGNIZED = -1, +} + +export function resolveByWorkloadRequest_WorkloadTypeFromJSON( + object: any +): ResolveByWorkloadRequest_WorkloadType { + switch (object) { + case 0: + case "WORKLOAD_TYPE_UNSPECIFIED": + return ResolveByWorkloadRequest_WorkloadType.WORKLOAD_TYPE_UNSPECIFIED; + case 1: + case "COMPUTE_INSTANCE": + return ResolveByWorkloadRequest_WorkloadType.COMPUTE_INSTANCE; + case -1: + case "UNRECOGNIZED": + default: + return ResolveByWorkloadRequest_WorkloadType.UNRECOGNIZED; + } +} + +export function resolveByWorkloadRequest_WorkloadTypeToJSON( + object: ResolveByWorkloadRequest_WorkloadType +): string { + switch (object) { + case ResolveByWorkloadRequest_WorkloadType.WORKLOAD_TYPE_UNSPECIFIED: + return "WORKLOAD_TYPE_UNSPECIFIED"; + case ResolveByWorkloadRequest_WorkloadType.COMPUTE_INSTANCE: + return "COMPUTE_INSTANCE"; + default: + return "UNKNOWN"; + } +} + +export interface ResolveByWorkloadResponse { + $type: "yandex.cloud.cloudapps.workload.v1.ResolveByWorkloadResponse"; + /** Details of cloud application */ + cloudApplication?: CloudApplication; +} + +const baseResolveByWorkloadRequest: object = { + $type: "yandex.cloud.cloudapps.workload.v1.ResolveByWorkloadRequest", + workloadType: 0, + workloadId: "", +}; + +export const ResolveByWorkloadRequest = { + $type: "yandex.cloud.cloudapps.workload.v1.ResolveByWorkloadRequest" as const, + + encode( + message: ResolveByWorkloadRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.workloadType !== 0) { + writer.uint32(8).int32(message.workloadType); + } + if (message.workloadId !== "") { + writer.uint32(18).string(message.workloadId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ResolveByWorkloadRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseResolveByWorkloadRequest, + } as ResolveByWorkloadRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workloadType = reader.int32() as any; + break; + case 2: + message.workloadId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResolveByWorkloadRequest { + const message = { + ...baseResolveByWorkloadRequest, + } as ResolveByWorkloadRequest; + message.workloadType = + object.workloadType !== undefined && object.workloadType !== null + ? resolveByWorkloadRequest_WorkloadTypeFromJSON(object.workloadType) + : 0; + message.workloadId = + object.workloadId !== undefined && object.workloadId !== null + ? String(object.workloadId) + : ""; + return message; + }, + + toJSON(message: ResolveByWorkloadRequest): unknown { + const obj: any = {}; + message.workloadType !== undefined && + (obj.workloadType = resolveByWorkloadRequest_WorkloadTypeToJSON( + message.workloadType + )); + message.workloadId !== undefined && (obj.workloadId = message.workloadId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ResolveByWorkloadRequest { + const message = { + ...baseResolveByWorkloadRequest, + } as ResolveByWorkloadRequest; + message.workloadType = object.workloadType ?? 0; + message.workloadId = object.workloadId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ResolveByWorkloadRequest.$type, + ResolveByWorkloadRequest +); + +const baseResolveByWorkloadResponse: object = { + $type: "yandex.cloud.cloudapps.workload.v1.ResolveByWorkloadResponse", +}; + +export const ResolveByWorkloadResponse = { + $type: + "yandex.cloud.cloudapps.workload.v1.ResolveByWorkloadResponse" as const, + + encode( + message: ResolveByWorkloadResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.cloudApplication !== undefined) { + CloudApplication.encode( + message.cloudApplication, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ResolveByWorkloadResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseResolveByWorkloadResponse, + } as ResolveByWorkloadResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cloudApplication = CloudApplication.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResolveByWorkloadResponse { + const message = { + ...baseResolveByWorkloadResponse, + } as ResolveByWorkloadResponse; + message.cloudApplication = + object.cloudApplication !== undefined && object.cloudApplication !== null + ? CloudApplication.fromJSON(object.cloudApplication) + : undefined; + return message; + }, + + toJSON(message: ResolveByWorkloadResponse): unknown { + const obj: any = {}; + message.cloudApplication !== undefined && + (obj.cloudApplication = message.cloudApplication + ? CloudApplication.toJSON(message.cloudApplication) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ResolveByWorkloadResponse { + const message = { + ...baseResolveByWorkloadResponse, + } as ResolveByWorkloadResponse; + message.cloudApplication = + object.cloudApplication !== undefined && object.cloudApplication !== null + ? CloudApplication.fromPartial(object.cloudApplication) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + ResolveByWorkloadResponse.$type, + ResolveByWorkloadResponse +); + +/** Cloud Application Service to be used by Workload software inside Cloud Application installations */ +export const CloudApplicationServiceService = { + /** Get Current Application */ + get: { + path: "/yandex.cloud.cloudapps.workload.v1.CloudApplicationService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: Empty) => + Buffer.from(Empty.encode(value).finish()), + requestDeserialize: (value: Buffer) => Empty.decode(value), + responseSerialize: (value: CloudApplication) => + Buffer.from(CloudApplication.encode(value).finish()), + responseDeserialize: (value: Buffer) => CloudApplication.decode(value), + }, + /** Resolve Cloud Application by workload */ + resolveByWorkload: { + path: "/yandex.cloud.cloudapps.workload.v1.CloudApplicationService/ResolveByWorkload", + requestStream: false, + responseStream: false, + requestSerialize: (value: ResolveByWorkloadRequest) => + Buffer.from(ResolveByWorkloadRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ResolveByWorkloadRequest.decode(value), + responseSerialize: (value: ResolveByWorkloadResponse) => + Buffer.from(ResolveByWorkloadResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ResolveByWorkloadResponse.decode(value), + }, +} as const; + +export interface CloudApplicationServiceServer + extends UntypedServiceImplementation { + /** Get Current Application */ + get: handleUnaryCall; + /** Resolve Cloud Application by workload */ + resolveByWorkload: handleUnaryCall< + ResolveByWorkloadRequest, + ResolveByWorkloadResponse + >; +} + +export interface CloudApplicationServiceClient extends Client { + /** Get Current Application */ + get( + request: Empty, + callback: (error: ServiceError | null, response: CloudApplication) => void + ): ClientUnaryCall; + get( + request: Empty, + metadata: Metadata, + callback: (error: ServiceError | null, response: CloudApplication) => void + ): ClientUnaryCall; + get( + request: Empty, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: CloudApplication) => void + ): ClientUnaryCall; + /** Resolve Cloud Application by workload */ + resolveByWorkload( + request: ResolveByWorkloadRequest, + callback: ( + error: ServiceError | null, + response: ResolveByWorkloadResponse + ) => void + ): ClientUnaryCall; + resolveByWorkload( + request: ResolveByWorkloadRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ResolveByWorkloadResponse + ) => void + ): ClientUnaryCall; + resolveByWorkload( + request: ResolveByWorkloadRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ResolveByWorkloadResponse + ) => void + ): ClientUnaryCall; +} + +export const CloudApplicationServiceClient = makeGenericClientConstructor( + CloudApplicationServiceService, + "yandex.cloud.cloudapps.workload.v1.CloudApplicationService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): CloudApplicationServiceClient; + service: typeof CloudApplicationServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cloudrouter/index.ts b/src/generated/yandex/cloud/cloudrouter/index.ts new file mode 100644 index 00000000..8989a93f --- /dev/null +++ b/src/generated/yandex/cloud/cloudrouter/index.ts @@ -0,0 +1,2 @@ +export * as v1_routing_instance from './v1/routing_instance' +export * as v1_routing_instance_service from './v1/routing_instance_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/cloudrouter/v1/routing_instance.ts b/src/generated/yandex/cloud/cloudrouter/v1/routing_instance.ts new file mode 100644 index 00000000..aab02e49 --- /dev/null +++ b/src/generated/yandex/cloud/cloudrouter/v1/routing_instance.ts @@ -0,0 +1,930 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.cloudrouter.v1"; + +export interface RoutingInstance { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance"; + /** ID of the routingInstance. */ + id: string; + /** + * Name of the routingInstance. + * The name must be unique within the folder. + * Value must match the regular expression ``\|[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])?``. + */ + name: string; + /** Optional description of the routingInstance. 0-256 characters long. */ + description: string; + /** ID of the folder that the routingInstance belongs to. */ + folderId: string; + /** ID of the region that the routingInstance belongs to. */ + regionId: string; + /** List of the info about vpcNetworks which are attached to routingInstance */ + vpcInfo: RoutingInstance_VpcInfo[]; + /** List of the info about privateConnections which are attached to routingInstance */ + cicPrivateConnectionInfo: RoutingInstance_CicPrivateConnectionInfo[]; + /** Status of the routingInstance. */ + status: RoutingInstance_Status; + /** + * Resource labels, `key:value` pairs. + * No more than 64 per resource. + * The maximum string length in characters for each value is 63. + * Each value must match the regular expression `[-_0-9a-z]*`. + * The string length in characters for each key must be 1-63. + * Each key must match the regular expression `[a-z][-_0-9a-z]*`. + */ + labels: { [key: string]: string }; +} + +export enum RoutingInstance_Status { + STATUS_UNSPECIFIED = 0, + CREATING = 1, + UPDATING = 2, + DELETING = 3, + ACTIVE = 4, + UNRECOGNIZED = -1, +} + +export function routingInstance_StatusFromJSON( + object: any +): RoutingInstance_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return RoutingInstance_Status.STATUS_UNSPECIFIED; + case 1: + case "CREATING": + return RoutingInstance_Status.CREATING; + case 2: + case "UPDATING": + return RoutingInstance_Status.UPDATING; + case 3: + case "DELETING": + return RoutingInstance_Status.DELETING; + case 4: + case "ACTIVE": + return RoutingInstance_Status.ACTIVE; + case -1: + case "UNRECOGNIZED": + default: + return RoutingInstance_Status.UNRECOGNIZED; + } +} + +export function routingInstance_StatusToJSON( + object: RoutingInstance_Status +): string { + switch (object) { + case RoutingInstance_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case RoutingInstance_Status.CREATING: + return "CREATING"; + case RoutingInstance_Status.UPDATING: + return "UPDATING"; + case RoutingInstance_Status.DELETING: + return "DELETING"; + case RoutingInstance_Status.ACTIVE: + return "ACTIVE"; + default: + return "UNKNOWN"; + } +} + +export interface RoutingInstance_LabelsEntry { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.LabelsEntry"; + key: string; + value: string; +} + +export interface RoutingInstance_CicPrivateConnectionInfo { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.CicPrivateConnectionInfo"; + /** ID of the cicPrivateConnection that is attached to the routingInstance. */ + cicPrivateConnectionId: string; +} + +export interface RoutingInstance_VpcInfo { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.VpcInfo"; + /** ID of the vpcNetwork that is attached to the routingInstance. */ + vpcNetworkId: string; + /** List of the az-related info about vpcNetworks which are attached to routingInstance */ + azInfos: RoutingInstance_VpcAzInfo[]; +} + +export interface RoutingInstance_VpcAzInfo { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.VpcAzInfo"; + /** VpcInfo which is set by user */ + manualInfo?: RoutingInstance_VpcManualInfo; + /** VpcInfo which is get from vpc service by attached networks */ + automaticInfo?: RoutingInstance_VpcAutomaticInfo; +} + +export interface RoutingInstance_VpcManualInfo { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.VpcManualInfo"; + /** ID of the AZ */ + azId: string; + /** List of prefixes to announce */ + prefixes: string[]; +} + +export interface RoutingInstance_VpcAutomaticInfo { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.VpcAutomaticInfo"; + /** ID of the AZ */ + azId: string; + /** List of prefixes from attached VpcNetwork */ + prefixes: string[]; +} + +const baseRoutingInstance: object = { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance", + id: "", + name: "", + description: "", + folderId: "", + regionId: "", + status: 0, +}; + +export const RoutingInstance = { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance" as const, + + encode( + message: RoutingInstance, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.folderId !== "") { + writer.uint32(42).string(message.folderId); + } + if (message.regionId !== "") { + writer.uint32(50).string(message.regionId); + } + for (const v of message.vpcInfo) { + RoutingInstance_VpcInfo.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.cicPrivateConnectionInfo) { + RoutingInstance_CicPrivateConnectionInfo.encode( + v!, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.status !== 0) { + writer.uint32(72).int32(message.status); + } + Object.entries(message.labels).forEach(([key, value]) => { + RoutingInstance_LabelsEntry.encode( + { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(194).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RoutingInstance { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRoutingInstance } as RoutingInstance; + message.vpcInfo = []; + message.cicPrivateConnectionInfo = []; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 5: + message.folderId = reader.string(); + break; + case 6: + message.regionId = reader.string(); + break; + case 7: + message.vpcInfo.push( + RoutingInstance_VpcInfo.decode(reader, reader.uint32()) + ); + break; + case 8: + message.cicPrivateConnectionInfo.push( + RoutingInstance_CicPrivateConnectionInfo.decode( + reader, + reader.uint32() + ) + ); + break; + case 9: + message.status = reader.int32() as any; + break; + case 24: + const entry24 = RoutingInstance_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry24.value !== undefined) { + message.labels[entry24.key] = entry24.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RoutingInstance { + const message = { ...baseRoutingInstance } as RoutingInstance; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.regionId = + object.regionId !== undefined && object.regionId !== null + ? String(object.regionId) + : ""; + message.vpcInfo = (object.vpcInfo ?? []).map((e: any) => + RoutingInstance_VpcInfo.fromJSON(e) + ); + message.cicPrivateConnectionInfo = ( + object.cicPrivateConnectionInfo ?? [] + ).map((e: any) => RoutingInstance_CicPrivateConnectionInfo.fromJSON(e)); + message.status = + object.status !== undefined && object.status !== null + ? routingInstance_StatusFromJSON(object.status) + : 0; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: RoutingInstance): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.regionId !== undefined && (obj.regionId = message.regionId); + if (message.vpcInfo) { + obj.vpcInfo = message.vpcInfo.map((e) => + e ? RoutingInstance_VpcInfo.toJSON(e) : undefined + ); + } else { + obj.vpcInfo = []; + } + if (message.cicPrivateConnectionInfo) { + obj.cicPrivateConnectionInfo = message.cicPrivateConnectionInfo.map((e) => + e ? RoutingInstance_CicPrivateConnectionInfo.toJSON(e) : undefined + ); + } else { + obj.cicPrivateConnectionInfo = []; + } + message.status !== undefined && + (obj.status = routingInstance_StatusToJSON(message.status)); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): RoutingInstance { + const message = { ...baseRoutingInstance } as RoutingInstance; + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.folderId = object.folderId ?? ""; + message.regionId = object.regionId ?? ""; + message.vpcInfo = + object.vpcInfo?.map((e) => RoutingInstance_VpcInfo.fromPartial(e)) || []; + message.cicPrivateConnectionInfo = + object.cicPrivateConnectionInfo?.map((e) => + RoutingInstance_CicPrivateConnectionInfo.fromPartial(e) + ) || []; + message.status = object.status ?? 0; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(RoutingInstance.$type, RoutingInstance); + +const baseRoutingInstance_LabelsEntry: object = { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.LabelsEntry", + key: "", + value: "", +}; + +export const RoutingInstance_LabelsEntry = { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.LabelsEntry" as const, + + encode( + message: RoutingInstance_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RoutingInstance_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRoutingInstance_LabelsEntry, + } as RoutingInstance_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RoutingInstance_LabelsEntry { + const message = { + ...baseRoutingInstance_LabelsEntry, + } as RoutingInstance_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: RoutingInstance_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): RoutingInstance_LabelsEntry { + const message = { + ...baseRoutingInstance_LabelsEntry, + } as RoutingInstance_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + RoutingInstance_LabelsEntry.$type, + RoutingInstance_LabelsEntry +); + +const baseRoutingInstance_CicPrivateConnectionInfo: object = { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.CicPrivateConnectionInfo", + cicPrivateConnectionId: "", +}; + +export const RoutingInstance_CicPrivateConnectionInfo = { + $type: + "yandex.cloud.cloudrouter.v1.RoutingInstance.CicPrivateConnectionInfo" as const, + + encode( + message: RoutingInstance_CicPrivateConnectionInfo, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.cicPrivateConnectionId !== "") { + writer.uint32(10).string(message.cicPrivateConnectionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RoutingInstance_CicPrivateConnectionInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRoutingInstance_CicPrivateConnectionInfo, + } as RoutingInstance_CicPrivateConnectionInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cicPrivateConnectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RoutingInstance_CicPrivateConnectionInfo { + const message = { + ...baseRoutingInstance_CicPrivateConnectionInfo, + } as RoutingInstance_CicPrivateConnectionInfo; + message.cicPrivateConnectionId = + object.cicPrivateConnectionId !== undefined && + object.cicPrivateConnectionId !== null + ? String(object.cicPrivateConnectionId) + : ""; + return message; + }, + + toJSON(message: RoutingInstance_CicPrivateConnectionInfo): unknown { + const obj: any = {}; + message.cicPrivateConnectionId !== undefined && + (obj.cicPrivateConnectionId = message.cicPrivateConnectionId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): RoutingInstance_CicPrivateConnectionInfo { + const message = { + ...baseRoutingInstance_CicPrivateConnectionInfo, + } as RoutingInstance_CicPrivateConnectionInfo; + message.cicPrivateConnectionId = object.cicPrivateConnectionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + RoutingInstance_CicPrivateConnectionInfo.$type, + RoutingInstance_CicPrivateConnectionInfo +); + +const baseRoutingInstance_VpcInfo: object = { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.VpcInfo", + vpcNetworkId: "", +}; + +export const RoutingInstance_VpcInfo = { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.VpcInfo" as const, + + encode( + message: RoutingInstance_VpcInfo, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.vpcNetworkId !== "") { + writer.uint32(10).string(message.vpcNetworkId); + } + for (const v of message.azInfos) { + RoutingInstance_VpcAzInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RoutingInstance_VpcInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRoutingInstance_VpcInfo, + } as RoutingInstance_VpcInfo; + message.azInfos = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vpcNetworkId = reader.string(); + break; + case 2: + message.azInfos.push( + RoutingInstance_VpcAzInfo.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RoutingInstance_VpcInfo { + const message = { + ...baseRoutingInstance_VpcInfo, + } as RoutingInstance_VpcInfo; + message.vpcNetworkId = + object.vpcNetworkId !== undefined && object.vpcNetworkId !== null + ? String(object.vpcNetworkId) + : ""; + message.azInfos = (object.azInfos ?? []).map((e: any) => + RoutingInstance_VpcAzInfo.fromJSON(e) + ); + return message; + }, + + toJSON(message: RoutingInstance_VpcInfo): unknown { + const obj: any = {}; + message.vpcNetworkId !== undefined && + (obj.vpcNetworkId = message.vpcNetworkId); + if (message.azInfos) { + obj.azInfos = message.azInfos.map((e) => + e ? RoutingInstance_VpcAzInfo.toJSON(e) : undefined + ); + } else { + obj.azInfos = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): RoutingInstance_VpcInfo { + const message = { + ...baseRoutingInstance_VpcInfo, + } as RoutingInstance_VpcInfo; + message.vpcNetworkId = object.vpcNetworkId ?? ""; + message.azInfos = + object.azInfos?.map((e) => RoutingInstance_VpcAzInfo.fromPartial(e)) || + []; + return message; + }, +}; + +messageTypeRegistry.set(RoutingInstance_VpcInfo.$type, RoutingInstance_VpcInfo); + +const baseRoutingInstance_VpcAzInfo: object = { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.VpcAzInfo", +}; + +export const RoutingInstance_VpcAzInfo = { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.VpcAzInfo" as const, + + encode( + message: RoutingInstance_VpcAzInfo, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.manualInfo !== undefined) { + RoutingInstance_VpcManualInfo.encode( + message.manualInfo, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.automaticInfo !== undefined) { + RoutingInstance_VpcAutomaticInfo.encode( + message.automaticInfo, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RoutingInstance_VpcAzInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRoutingInstance_VpcAzInfo, + } as RoutingInstance_VpcAzInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.manualInfo = RoutingInstance_VpcManualInfo.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.automaticInfo = RoutingInstance_VpcAutomaticInfo.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RoutingInstance_VpcAzInfo { + const message = { + ...baseRoutingInstance_VpcAzInfo, + } as RoutingInstance_VpcAzInfo; + message.manualInfo = + object.manualInfo !== undefined && object.manualInfo !== null + ? RoutingInstance_VpcManualInfo.fromJSON(object.manualInfo) + : undefined; + message.automaticInfo = + object.automaticInfo !== undefined && object.automaticInfo !== null + ? RoutingInstance_VpcAutomaticInfo.fromJSON(object.automaticInfo) + : undefined; + return message; + }, + + toJSON(message: RoutingInstance_VpcAzInfo): unknown { + const obj: any = {}; + message.manualInfo !== undefined && + (obj.manualInfo = message.manualInfo + ? RoutingInstance_VpcManualInfo.toJSON(message.manualInfo) + : undefined); + message.automaticInfo !== undefined && + (obj.automaticInfo = message.automaticInfo + ? RoutingInstance_VpcAutomaticInfo.toJSON(message.automaticInfo) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): RoutingInstance_VpcAzInfo { + const message = { + ...baseRoutingInstance_VpcAzInfo, + } as RoutingInstance_VpcAzInfo; + message.manualInfo = + object.manualInfo !== undefined && object.manualInfo !== null + ? RoutingInstance_VpcManualInfo.fromPartial(object.manualInfo) + : undefined; + message.automaticInfo = + object.automaticInfo !== undefined && object.automaticInfo !== null + ? RoutingInstance_VpcAutomaticInfo.fromPartial(object.automaticInfo) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + RoutingInstance_VpcAzInfo.$type, + RoutingInstance_VpcAzInfo +); + +const baseRoutingInstance_VpcManualInfo: object = { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.VpcManualInfo", + azId: "", + prefixes: "", +}; + +export const RoutingInstance_VpcManualInfo = { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.VpcManualInfo" as const, + + encode( + message: RoutingInstance_VpcManualInfo, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.azId !== "") { + writer.uint32(10).string(message.azId); + } + for (const v of message.prefixes) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RoutingInstance_VpcManualInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRoutingInstance_VpcManualInfo, + } as RoutingInstance_VpcManualInfo; + message.prefixes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.azId = reader.string(); + break; + case 5: + message.prefixes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RoutingInstance_VpcManualInfo { + const message = { + ...baseRoutingInstance_VpcManualInfo, + } as RoutingInstance_VpcManualInfo; + message.azId = + object.azId !== undefined && object.azId !== null + ? String(object.azId) + : ""; + message.prefixes = (object.prefixes ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: RoutingInstance_VpcManualInfo): unknown { + const obj: any = {}; + message.azId !== undefined && (obj.azId = message.azId); + if (message.prefixes) { + obj.prefixes = message.prefixes.map((e) => e); + } else { + obj.prefixes = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): RoutingInstance_VpcManualInfo { + const message = { + ...baseRoutingInstance_VpcManualInfo, + } as RoutingInstance_VpcManualInfo; + message.azId = object.azId ?? ""; + message.prefixes = object.prefixes?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + RoutingInstance_VpcManualInfo.$type, + RoutingInstance_VpcManualInfo +); + +const baseRoutingInstance_VpcAutomaticInfo: object = { + $type: "yandex.cloud.cloudrouter.v1.RoutingInstance.VpcAutomaticInfo", + azId: "", + prefixes: "", +}; + +export const RoutingInstance_VpcAutomaticInfo = { + $type: + "yandex.cloud.cloudrouter.v1.RoutingInstance.VpcAutomaticInfo" as const, + + encode( + message: RoutingInstance_VpcAutomaticInfo, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.azId !== "") { + writer.uint32(10).string(message.azId); + } + for (const v of message.prefixes) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RoutingInstance_VpcAutomaticInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRoutingInstance_VpcAutomaticInfo, + } as RoutingInstance_VpcAutomaticInfo; + message.prefixes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.azId = reader.string(); + break; + case 2: + message.prefixes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RoutingInstance_VpcAutomaticInfo { + const message = { + ...baseRoutingInstance_VpcAutomaticInfo, + } as RoutingInstance_VpcAutomaticInfo; + message.azId = + object.azId !== undefined && object.azId !== null + ? String(object.azId) + : ""; + message.prefixes = (object.prefixes ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: RoutingInstance_VpcAutomaticInfo): unknown { + const obj: any = {}; + message.azId !== undefined && (obj.azId = message.azId); + if (message.prefixes) { + obj.prefixes = message.prefixes.map((e) => e); + } else { + obj.prefixes = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): RoutingInstance_VpcAutomaticInfo { + const message = { + ...baseRoutingInstance_VpcAutomaticInfo, + } as RoutingInstance_VpcAutomaticInfo; + message.azId = object.azId ?? ""; + message.prefixes = object.prefixes?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + RoutingInstance_VpcAutomaticInfo.$type, + RoutingInstance_VpcAutomaticInfo +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/cloudrouter/v1/routing_instance_service.ts b/src/generated/yandex/cloud/cloudrouter/v1/routing_instance_service.ts new file mode 100644 index 00000000..a0d1a9b5 --- /dev/null +++ b/src/generated/yandex/cloud/cloudrouter/v1/routing_instance_service.ts @@ -0,0 +1,791 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { RoutingInstance } from "../../../../yandex/cloud/cloudrouter/v1/routing_instance"; + +export const protobufPackage = "yandex.cloud.cloudrouter.v1"; + +export interface GetRoutingInstanceRequest { + $type: "yandex.cloud.cloudrouter.v1.GetRoutingInstanceRequest"; + /** + * ID of the RoutingInstance resource to return. + * To get the routingInstance ID use a [RoutingInstanceService.List] request. + */ + routingInstanceId: string; +} + +export interface GetRoutingInstanceByCicPrivateConnectionIdRequest { + $type: "yandex.cloud.cloudrouter.v1.GetRoutingInstanceByCicPrivateConnectionIdRequest"; + /** + * ID of the PrivateConnection resource to return by. + * To get the routingInstance ID use a [RoutingInstanceService.List] request. + */ + cicPrivateConnectionId: string; +} + +export interface GetRoutingInstanceByVpcNetworkIdRequest { + $type: "yandex.cloud.cloudrouter.v1.GetRoutingInstanceByVpcNetworkIdRequest"; + /** + * ID of the VpcNetwork resource to return by. + * To get the routingInstance ID use a [RoutingInstanceService.List] request. + */ + vpcNetworkId: string; +} + +export interface ListRoutingInstancesRequest { + $type: "yandex.cloud.cloudrouter.v1.ListRoutingInstancesRequest"; + /** + * ID of the folder to list routingInstance in. + * To get the folder ID use a [yandex.cloud.resourcemanager.v1.FolderService.List] request. + */ + folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], + * the service returns a [ListRoutingInstancesResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] to the + * [ListRoutingInstanceResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters resources listed in the response. + * The expression must specify: + * 1. The field name. Currently you can use filtering only on [RoutingInstance.name] field. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. + */ + filter: string; +} + +export interface ListRoutingInstancesResponse { + $type: "yandex.cloud.cloudrouter.v1.ListRoutingInstancesResponse"; + /** List of RoutingInstance resources. */ + routingInstances: RoutingInstance[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListRoutingInstancesResponse.page_size], use + * the [next_page_token] as the value + * for the [ListRoutingInstanceResponses.page_token] query parameter + * in the next list request. Subsequent list requests will have their own + * [next_page_token] to continue paging through the results. + */ + nextPageToken: string; +} + +const baseGetRoutingInstanceRequest: object = { + $type: "yandex.cloud.cloudrouter.v1.GetRoutingInstanceRequest", + routingInstanceId: "", +}; + +export const GetRoutingInstanceRequest = { + $type: "yandex.cloud.cloudrouter.v1.GetRoutingInstanceRequest" as const, + + encode( + message: GetRoutingInstanceRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.routingInstanceId !== "") { + writer.uint32(10).string(message.routingInstanceId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetRoutingInstanceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetRoutingInstanceRequest, + } as GetRoutingInstanceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.routingInstanceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetRoutingInstanceRequest { + const message = { + ...baseGetRoutingInstanceRequest, + } as GetRoutingInstanceRequest; + message.routingInstanceId = + object.routingInstanceId !== undefined && + object.routingInstanceId !== null + ? String(object.routingInstanceId) + : ""; + return message; + }, + + toJSON(message: GetRoutingInstanceRequest): unknown { + const obj: any = {}; + message.routingInstanceId !== undefined && + (obj.routingInstanceId = message.routingInstanceId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetRoutingInstanceRequest { + const message = { + ...baseGetRoutingInstanceRequest, + } as GetRoutingInstanceRequest; + message.routingInstanceId = object.routingInstanceId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetRoutingInstanceRequest.$type, + GetRoutingInstanceRequest +); + +const baseGetRoutingInstanceByCicPrivateConnectionIdRequest: object = { + $type: + "yandex.cloud.cloudrouter.v1.GetRoutingInstanceByCicPrivateConnectionIdRequest", + cicPrivateConnectionId: "", +}; + +export const GetRoutingInstanceByCicPrivateConnectionIdRequest = { + $type: + "yandex.cloud.cloudrouter.v1.GetRoutingInstanceByCicPrivateConnectionIdRequest" as const, + + encode( + message: GetRoutingInstanceByCicPrivateConnectionIdRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.cicPrivateConnectionId !== "") { + writer.uint32(10).string(message.cicPrivateConnectionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetRoutingInstanceByCicPrivateConnectionIdRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetRoutingInstanceByCicPrivateConnectionIdRequest, + } as GetRoutingInstanceByCicPrivateConnectionIdRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cicPrivateConnectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetRoutingInstanceByCicPrivateConnectionIdRequest { + const message = { + ...baseGetRoutingInstanceByCicPrivateConnectionIdRequest, + } as GetRoutingInstanceByCicPrivateConnectionIdRequest; + message.cicPrivateConnectionId = + object.cicPrivateConnectionId !== undefined && + object.cicPrivateConnectionId !== null + ? String(object.cicPrivateConnectionId) + : ""; + return message; + }, + + toJSON(message: GetRoutingInstanceByCicPrivateConnectionIdRequest): unknown { + const obj: any = {}; + message.cicPrivateConnectionId !== undefined && + (obj.cicPrivateConnectionId = message.cicPrivateConnectionId); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): GetRoutingInstanceByCicPrivateConnectionIdRequest { + const message = { + ...baseGetRoutingInstanceByCicPrivateConnectionIdRequest, + } as GetRoutingInstanceByCicPrivateConnectionIdRequest; + message.cicPrivateConnectionId = object.cicPrivateConnectionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetRoutingInstanceByCicPrivateConnectionIdRequest.$type, + GetRoutingInstanceByCicPrivateConnectionIdRequest +); + +const baseGetRoutingInstanceByVpcNetworkIdRequest: object = { + $type: "yandex.cloud.cloudrouter.v1.GetRoutingInstanceByVpcNetworkIdRequest", + vpcNetworkId: "", +}; + +export const GetRoutingInstanceByVpcNetworkIdRequest = { + $type: + "yandex.cloud.cloudrouter.v1.GetRoutingInstanceByVpcNetworkIdRequest" as const, + + encode( + message: GetRoutingInstanceByVpcNetworkIdRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.vpcNetworkId !== "") { + writer.uint32(10).string(message.vpcNetworkId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetRoutingInstanceByVpcNetworkIdRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetRoutingInstanceByVpcNetworkIdRequest, + } as GetRoutingInstanceByVpcNetworkIdRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vpcNetworkId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetRoutingInstanceByVpcNetworkIdRequest { + const message = { + ...baseGetRoutingInstanceByVpcNetworkIdRequest, + } as GetRoutingInstanceByVpcNetworkIdRequest; + message.vpcNetworkId = + object.vpcNetworkId !== undefined && object.vpcNetworkId !== null + ? String(object.vpcNetworkId) + : ""; + return message; + }, + + toJSON(message: GetRoutingInstanceByVpcNetworkIdRequest): unknown { + const obj: any = {}; + message.vpcNetworkId !== undefined && + (obj.vpcNetworkId = message.vpcNetworkId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): GetRoutingInstanceByVpcNetworkIdRequest { + const message = { + ...baseGetRoutingInstanceByVpcNetworkIdRequest, + } as GetRoutingInstanceByVpcNetworkIdRequest; + message.vpcNetworkId = object.vpcNetworkId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetRoutingInstanceByVpcNetworkIdRequest.$type, + GetRoutingInstanceByVpcNetworkIdRequest +); + +const baseListRoutingInstancesRequest: object = { + $type: "yandex.cloud.cloudrouter.v1.ListRoutingInstancesRequest", + folderId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListRoutingInstancesRequest = { + $type: "yandex.cloud.cloudrouter.v1.ListRoutingInstancesRequest" as const, + + encode( + message: ListRoutingInstancesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListRoutingInstancesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListRoutingInstancesRequest, + } as ListRoutingInstancesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListRoutingInstancesRequest { + const message = { + ...baseListRoutingInstancesRequest, + } as ListRoutingInstancesRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListRoutingInstancesRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListRoutingInstancesRequest { + const message = { + ...baseListRoutingInstancesRequest, + } as ListRoutingInstancesRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListRoutingInstancesRequest.$type, + ListRoutingInstancesRequest +); + +const baseListRoutingInstancesResponse: object = { + $type: "yandex.cloud.cloudrouter.v1.ListRoutingInstancesResponse", + nextPageToken: "", +}; + +export const ListRoutingInstancesResponse = { + $type: "yandex.cloud.cloudrouter.v1.ListRoutingInstancesResponse" as const, + + encode( + message: ListRoutingInstancesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.routingInstances) { + RoutingInstance.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListRoutingInstancesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListRoutingInstancesResponse, + } as ListRoutingInstancesResponse; + message.routingInstances = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.routingInstances.push( + RoutingInstance.decode(reader, reader.uint32()) + ); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListRoutingInstancesResponse { + const message = { + ...baseListRoutingInstancesResponse, + } as ListRoutingInstancesResponse; + message.routingInstances = (object.routingInstances ?? []).map((e: any) => + RoutingInstance.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListRoutingInstancesResponse): unknown { + const obj: any = {}; + if (message.routingInstances) { + obj.routingInstances = message.routingInstances.map((e) => + e ? RoutingInstance.toJSON(e) : undefined + ); + } else { + obj.routingInstances = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListRoutingInstancesResponse { + const message = { + ...baseListRoutingInstancesResponse, + } as ListRoutingInstancesResponse; + message.routingInstances = + object.routingInstances?.map((e) => RoutingInstance.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListRoutingInstancesResponse.$type, + ListRoutingInstancesResponse +); + +/** A set of methods for managing RoutingInstance resources. */ +export const RoutingInstanceServiceService = { + /** + * Returns the specified RoutingInstance resource. + * + * To get the list of available RoutingInstance resources, make a [List] request. + */ + get: { + path: "/yandex.cloud.cloudrouter.v1.RoutingInstanceService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetRoutingInstanceRequest) => + Buffer.from(GetRoutingInstanceRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetRoutingInstanceRequest.decode(value), + responseSerialize: (value: RoutingInstance) => + Buffer.from(RoutingInstance.encode(value).finish()), + responseDeserialize: (value: Buffer) => RoutingInstance.decode(value), + }, + /** + * Returns the RoutingInstance resource by vpcNetworkId + * + * To get the list of available RoutingInstance resources, make a [List] request. + */ + getByVpcNetworkId: { + path: "/yandex.cloud.cloudrouter.v1.RoutingInstanceService/GetByVpcNetworkId", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetRoutingInstanceByVpcNetworkIdRequest) => + Buffer.from( + GetRoutingInstanceByVpcNetworkIdRequest.encode(value).finish() + ), + requestDeserialize: (value: Buffer) => + GetRoutingInstanceByVpcNetworkIdRequest.decode(value), + responseSerialize: (value: RoutingInstance) => + Buffer.from(RoutingInstance.encode(value).finish()), + responseDeserialize: (value: Buffer) => RoutingInstance.decode(value), + }, + /** + * Returns the RoutingInstance resource by cicPrivateConnectionId + * + * To get the list of available RoutingInstance resources, make a [List] request. + */ + getByCicPrivateConnectionId: { + path: "/yandex.cloud.cloudrouter.v1.RoutingInstanceService/GetByCicPrivateConnectionId", + requestStream: false, + responseStream: false, + requestSerialize: ( + value: GetRoutingInstanceByCicPrivateConnectionIdRequest + ) => + Buffer.from( + GetRoutingInstanceByCicPrivateConnectionIdRequest.encode(value).finish() + ), + requestDeserialize: (value: Buffer) => + GetRoutingInstanceByCicPrivateConnectionIdRequest.decode(value), + responseSerialize: (value: RoutingInstance) => + Buffer.from(RoutingInstance.encode(value).finish()), + responseDeserialize: (value: Buffer) => RoutingInstance.decode(value), + }, + /** Retrieves the list of RoutingInstance resources in the specified folder. */ + list: { + path: "/yandex.cloud.cloudrouter.v1.RoutingInstanceService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListRoutingInstancesRequest) => + Buffer.from(ListRoutingInstancesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListRoutingInstancesRequest.decode(value), + responseSerialize: (value: ListRoutingInstancesResponse) => + Buffer.from(ListRoutingInstancesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListRoutingInstancesResponse.decode(value), + }, +} as const; + +export interface RoutingInstanceServiceServer + extends UntypedServiceImplementation { + /** + * Returns the specified RoutingInstance resource. + * + * To get the list of available RoutingInstance resources, make a [List] request. + */ + get: handleUnaryCall; + /** + * Returns the RoutingInstance resource by vpcNetworkId + * + * To get the list of available RoutingInstance resources, make a [List] request. + */ + getByVpcNetworkId: handleUnaryCall< + GetRoutingInstanceByVpcNetworkIdRequest, + RoutingInstance + >; + /** + * Returns the RoutingInstance resource by cicPrivateConnectionId + * + * To get the list of available RoutingInstance resources, make a [List] request. + */ + getByCicPrivateConnectionId: handleUnaryCall< + GetRoutingInstanceByCicPrivateConnectionIdRequest, + RoutingInstance + >; + /** Retrieves the list of RoutingInstance resources in the specified folder. */ + list: handleUnaryCall< + ListRoutingInstancesRequest, + ListRoutingInstancesResponse + >; +} + +export interface RoutingInstanceServiceClient extends Client { + /** + * Returns the specified RoutingInstance resource. + * + * To get the list of available RoutingInstance resources, make a [List] request. + */ + get( + request: GetRoutingInstanceRequest, + callback: (error: ServiceError | null, response: RoutingInstance) => void + ): ClientUnaryCall; + get( + request: GetRoutingInstanceRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: RoutingInstance) => void + ): ClientUnaryCall; + get( + request: GetRoutingInstanceRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: RoutingInstance) => void + ): ClientUnaryCall; + /** + * Returns the RoutingInstance resource by vpcNetworkId + * + * To get the list of available RoutingInstance resources, make a [List] request. + */ + getByVpcNetworkId( + request: GetRoutingInstanceByVpcNetworkIdRequest, + callback: (error: ServiceError | null, response: RoutingInstance) => void + ): ClientUnaryCall; + getByVpcNetworkId( + request: GetRoutingInstanceByVpcNetworkIdRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: RoutingInstance) => void + ): ClientUnaryCall; + getByVpcNetworkId( + request: GetRoutingInstanceByVpcNetworkIdRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: RoutingInstance) => void + ): ClientUnaryCall; + /** + * Returns the RoutingInstance resource by cicPrivateConnectionId + * + * To get the list of available RoutingInstance resources, make a [List] request. + */ + getByCicPrivateConnectionId( + request: GetRoutingInstanceByCicPrivateConnectionIdRequest, + callback: (error: ServiceError | null, response: RoutingInstance) => void + ): ClientUnaryCall; + getByCicPrivateConnectionId( + request: GetRoutingInstanceByCicPrivateConnectionIdRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: RoutingInstance) => void + ): ClientUnaryCall; + getByCicPrivateConnectionId( + request: GetRoutingInstanceByCicPrivateConnectionIdRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: RoutingInstance) => void + ): ClientUnaryCall; + /** Retrieves the list of RoutingInstance resources in the specified folder. */ + list( + request: ListRoutingInstancesRequest, + callback: ( + error: ServiceError | null, + response: ListRoutingInstancesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListRoutingInstancesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListRoutingInstancesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListRoutingInstancesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListRoutingInstancesResponse + ) => void + ): ClientUnaryCall; +} + +export const RoutingInstanceServiceClient = makeGenericClientConstructor( + RoutingInstanceServiceService, + "yandex.cloud.cloudrouter.v1.RoutingInstanceService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): RoutingInstanceServiceClient; + service: typeof RoutingInstanceServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/compute/index.ts b/src/generated/yandex/cloud/compute/index.ts index f7020946..62e95453 100644 --- a/src/generated/yandex/cloud/compute/index.ts +++ b/src/generated/yandex/cloud/compute/index.ts @@ -1,28 +1,30 @@ -export * as disk from './v1/disk' -export * as disk_placement_group from './v1/disk_placement_group' -export * as disk_placement_group_service from './v1/disk_placement_group_service' -export * as disk_service from './v1/disk_service' -export * as disk_type from './v1/disk_type' -export * as disk_type_service from './v1/disk_type_service' -export * as filesystem from './v1/filesystem' -export * as filesystem_service from './v1/filesystem_service' -export * as gpu_cluster from './v1/gpu_cluster' -export * as gpu_cluster_service from './v1/gpu_cluster_service' -export * as host_group from './v1/host_group' -export * as host_group_service from './v1/host_group_service' -export * as host_type from './v1/host_type' -export * as host_type_service from './v1/host_type_service' -export * as image from './v1/image' -export * as image_service from './v1/image_service' -export * as instance from './v1/instance' -export * as instance_service from './v1/instance_service' -export * as placement_group from './v1/placement_group' -export * as placement_group_service from './v1/placement_group_service' -export * as snapshot from './v1/snapshot' -export * as snapshot_schedule from './v1/snapshot_schedule' -export * as snapshot_schedule_service from './v1/snapshot_schedule_service' -export * as snapshot_service from './v1/snapshot_service' -export * as zone from './v1/zone' -export * as zone_service from './v1/zone_service' -export * as instance_group from './v1/instancegroup/instance_group' -export * as instance_group_service from './v1/instancegroup/instance_group_service' \ No newline at end of file +export * as v1_disk from './v1/disk' +export * as v1_disk_placement_group from './v1/disk_placement_group' +export * as v1_disk_placement_group_service from './v1/disk_placement_group_service' +export * as v1_disk_service from './v1/disk_service' +export * as v1_disk_type from './v1/disk_type' +export * as v1_disk_type_service from './v1/disk_type_service' +export * as v1_filesystem from './v1/filesystem' +export * as v1_filesystem_service from './v1/filesystem_service' +export * as v1_gpu_cluster from './v1/gpu_cluster' +export * as v1_gpu_cluster_service from './v1/gpu_cluster_service' +export * as v1_hardware_generation from './v1/hardware_generation' +export * as v1_host_group from './v1/host_group' +export * as v1_host_group_service from './v1/host_group_service' +export * as v1_host_type from './v1/host_type' +export * as v1_host_type_service from './v1/host_type_service' +export * as v1_image from './v1/image' +export * as v1_image_service from './v1/image_service' +export * as v1_instance from './v1/instance' +export * as v1_instance_service from './v1/instance_service' +export * as v1_maintenance from './v1/maintenance' +export * as v1_placement_group from './v1/placement_group' +export * as v1_placement_group_service from './v1/placement_group_service' +export * as v1_snapshot from './v1/snapshot' +export * as v1_snapshot_schedule from './v1/snapshot_schedule' +export * as v1_snapshot_schedule_service from './v1/snapshot_schedule_service' +export * as v1_snapshot_service from './v1/snapshot_service' +export * as v1_zone from './v1/zone' +export * as v1_zone_service from './v1/zone_service' +export * as v1_instancegroup_instance_group from './v1/instancegroup/instance_group' +export * as v1_instancegroup_instance_group_service from './v1/instancegroup/instance_group_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/compute/v1/disk.ts b/src/generated/yandex/cloud/compute/v1/disk.ts index c14dcc2f..a9a8aec7 100644 --- a/src/generated/yandex/cloud/compute/v1/disk.ts +++ b/src/generated/yandex/cloud/compute/v1/disk.ts @@ -2,6 +2,7 @@ import { messageTypeRegistry } from "../../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; +import { HardwareGeneration } from "../../../../yandex/cloud/compute/v1/hardware_generation"; import { Timestamp } from "../../../../google/protobuf/timestamp"; export const protobufPackage = "yandex.cloud.compute.v1"; @@ -49,6 +50,11 @@ export interface Disk { instanceIds: string[]; /** Placement policy configuration. */ diskPlacementPolicy?: DiskPlacementPolicy; + /** + * If specified, forces the same HardwareGeneration features to be applied to the instance + * created using this disk as a boot one. Otherwise the current default will be used. + */ + hardwareGeneration?: HardwareGeneration; } export enum Disk_Status { @@ -118,6 +124,14 @@ export interface DiskPlacementPolicy { placementGroupPartition: number; } +export interface DiskPlacementPolicyChange { + $type: "yandex.cloud.compute.v1.DiskPlacementPolicyChange"; + /** Disk ID. */ + diskId: string; + /** Placement policy configuration for given disk. */ + diskPlacementPolicy?: DiskPlacementPolicy; +} + const baseDisk: object = { $type: "yandex.cloud.compute.v1.Disk", id: "", @@ -198,6 +212,12 @@ export const Disk = { writer.uint32(130).fork() ).ldelim(); } + if (message.hardwareGeneration !== undefined) { + HardwareGeneration.encode( + message.hardwareGeneration, + writer.uint32(138).fork() + ).ldelim(); + } return writer; }, @@ -267,6 +287,12 @@ export const Disk = { reader.uint32() ); break; + case 17: + message.hardwareGeneration = HardwareGeneration.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -336,6 +362,11 @@ export const Disk = { object.diskPlacementPolicy !== null ? DiskPlacementPolicy.fromJSON(object.diskPlacementPolicy) : undefined; + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromJSON(object.hardwareGeneration) + : undefined; return message; }, @@ -379,6 +410,10 @@ export const Disk = { (obj.diskPlacementPolicy = message.diskPlacementPolicy ? DiskPlacementPolicy.toJSON(message.diskPlacementPolicy) : undefined); + message.hardwareGeneration !== undefined && + (obj.hardwareGeneration = message.hardwareGeneration + ? HardwareGeneration.toJSON(message.hardwareGeneration) + : undefined); return obj; }, @@ -411,6 +446,11 @@ export const Disk = { object.diskPlacementPolicy !== null ? DiskPlacementPolicy.fromPartial(object.diskPlacementPolicy) : undefined; + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromPartial(object.hardwareGeneration) + : undefined; return message; }, }; @@ -572,6 +612,106 @@ export const DiskPlacementPolicy = { messageTypeRegistry.set(DiskPlacementPolicy.$type, DiskPlacementPolicy); +const baseDiskPlacementPolicyChange: object = { + $type: "yandex.cloud.compute.v1.DiskPlacementPolicyChange", + diskId: "", +}; + +export const DiskPlacementPolicyChange = { + $type: "yandex.cloud.compute.v1.DiskPlacementPolicyChange" as const, + + encode( + message: DiskPlacementPolicyChange, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.diskId !== "") { + writer.uint32(10).string(message.diskId); + } + if (message.diskPlacementPolicy !== undefined) { + DiskPlacementPolicy.encode( + message.diskPlacementPolicy, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DiskPlacementPolicyChange { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDiskPlacementPolicyChange, + } as DiskPlacementPolicyChange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.diskId = reader.string(); + break; + case 2: + message.diskPlacementPolicy = DiskPlacementPolicy.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DiskPlacementPolicyChange { + const message = { + ...baseDiskPlacementPolicyChange, + } as DiskPlacementPolicyChange; + message.diskId = + object.diskId !== undefined && object.diskId !== null + ? String(object.diskId) + : ""; + message.diskPlacementPolicy = + object.diskPlacementPolicy !== undefined && + object.diskPlacementPolicy !== null + ? DiskPlacementPolicy.fromJSON(object.diskPlacementPolicy) + : undefined; + return message; + }, + + toJSON(message: DiskPlacementPolicyChange): unknown { + const obj: any = {}; + message.diskId !== undefined && (obj.diskId = message.diskId); + message.diskPlacementPolicy !== undefined && + (obj.diskPlacementPolicy = message.diskPlacementPolicy + ? DiskPlacementPolicy.toJSON(message.diskPlacementPolicy) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): DiskPlacementPolicyChange { + const message = { + ...baseDiskPlacementPolicyChange, + } as DiskPlacementPolicyChange; + message.diskId = object.diskId ?? ""; + message.diskPlacementPolicy = + object.diskPlacementPolicy !== undefined && + object.diskPlacementPolicy !== null + ? DiskPlacementPolicy.fromPartial(object.diskPlacementPolicy) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + DiskPlacementPolicyChange.$type, + DiskPlacementPolicyChange +); + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/generated/yandex/cloud/compute/v1/disk_placement_group_service.ts b/src/generated/yandex/cloud/compute/v1/disk_placement_group_service.ts index beab6b92..b0e2123d 100644 --- a/src/generated/yandex/cloud/compute/v1/disk_placement_group_service.ts +++ b/src/generated/yandex/cloud/compute/v1/disk_placement_group_service.ts @@ -22,6 +22,12 @@ import { } from "../../../../yandex/cloud/compute/v1/disk_placement_group"; import { Disk } from "../../../../yandex/cloud/compute/v1/disk"; import { Operation } from "../../../../yandex/cloud/operation/operation"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../yandex/cloud/access/access"; export const protobufPackage = "yandex.cloud.compute.v1"; @@ -1885,6 +1891,46 @@ export const DiskPlacementGroupServiceService = { responseDeserialize: (value: Buffer) => ListDiskPlacementGroupOperationsResponse.decode(value), }, + /** Lists access bindings for the disk placement group. */ + listAccessBindings: { + path: "/yandex.cloud.compute.v1.DiskPlacementGroupService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the disk placement group. */ + setAccessBindings: { + path: "/yandex.cloud.compute.v1.DiskPlacementGroupService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the disk placement group. */ + updateAccessBindings: { + path: "/yandex.cloud.compute.v1.DiskPlacementGroupService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface DiskPlacementGroupServiceServer @@ -1912,6 +1958,15 @@ export interface DiskPlacementGroupServiceServer ListDiskPlacementGroupOperationsRequest, ListDiskPlacementGroupOperationsResponse >; + /** Lists access bindings for the disk placement group. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the disk placement group. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the disk placement group. */ + updateAccessBindings: handleUnaryCall; } export interface DiskPlacementGroupServiceClient extends Client { @@ -2054,6 +2109,63 @@ export interface DiskPlacementGroupServiceClient extends Client { response: ListDiskPlacementGroupOperationsResponse ) => void ): ClientUnaryCall; + /** Lists access bindings for the disk placement group. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the disk placement group. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the disk placement group. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const DiskPlacementGroupServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/compute/v1/disk_service.ts b/src/generated/yandex/cloud/compute/v1/disk_service.ts index f3c0b9bd..fb4cfb88 100644 --- a/src/generated/yandex/cloud/compute/v1/disk_service.ts +++ b/src/generated/yandex/cloud/compute/v1/disk_service.ts @@ -18,9 +18,16 @@ import { DiskPlacementPolicy, Disk, } from "../../../../yandex/cloud/compute/v1/disk"; +import { HardwareGeneration } from "../../../../yandex/cloud/compute/v1/hardware_generation"; import { FieldMask } from "../../../../google/protobuf/field_mask"; import { Operation } from "../../../../yandex/cloud/operation/operation"; import { SnapshotSchedule } from "../../../../yandex/cloud/compute/v1/snapshot_schedule"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../yandex/cloud/access/access"; export const protobufPackage = "yandex.cloud.compute.v1"; @@ -125,6 +132,11 @@ export interface CreateDiskRequest { diskPlacementPolicy?: DiskPlacementPolicy; /** List of IDs of the snapshot schedules to attach the disk to. */ snapshotScheduleIds: string[]; + /** + * Specify the overrides to hardware_generation of a source disk, image or snapshot, + * or to the default values if the source does not define it. + */ + hardwareGeneration?: HardwareGeneration; } export interface CreateDiskRequest_LabelsEntry { @@ -261,6 +273,8 @@ export interface RelocateDiskRequest { * To get the zone ID, make a [ZoneService.List] request. */ destinationZoneId: string; + /** Placement policy configuration in target zone. Must be specified if disk has placement policy. */ + diskPlacementPolicy?: DiskPlacementPolicy; } export interface RelocateDiskMetadata { @@ -625,6 +639,12 @@ export const CreateDiskRequest = { for (const v of message.snapshotScheduleIds) { writer.uint32(98).string(v!); } + if (message.hardwareGeneration !== undefined) { + HardwareGeneration.encode( + message.hardwareGeneration, + writer.uint32(106).fork() + ).ldelim(); + } return writer; }, @@ -682,6 +702,12 @@ export const CreateDiskRequest = { case 12: message.snapshotScheduleIds.push(reader.string()); break; + case 13: + message.hardwareGeneration = HardwareGeneration.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -742,6 +768,11 @@ export const CreateDiskRequest = { message.snapshotScheduleIds = (object.snapshotScheduleIds ?? []).map( (e: any) => String(e) ); + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromJSON(object.hardwareGeneration) + : undefined; return message; }, @@ -773,6 +804,10 @@ export const CreateDiskRequest = { } else { obj.snapshotScheduleIds = []; } + message.hardwareGeneration !== undefined && + (obj.hardwareGeneration = message.hardwareGeneration + ? HardwareGeneration.toJSON(message.hardwareGeneration) + : undefined); return obj; }, @@ -804,6 +839,11 @@ export const CreateDiskRequest = { : undefined; message.snapshotScheduleIds = object.snapshotScheduleIds?.map((e) => e) || []; + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromPartial(object.hardwareGeneration) + : undefined; return message; }, }; @@ -1796,6 +1836,12 @@ export const RelocateDiskRequest = { if (message.destinationZoneId !== "") { writer.uint32(18).string(message.destinationZoneId); } + if (message.diskPlacementPolicy !== undefined) { + DiskPlacementPolicy.encode( + message.diskPlacementPolicy, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -1812,6 +1858,12 @@ export const RelocateDiskRequest = { case 2: message.destinationZoneId = reader.string(); break; + case 3: + message.diskPlacementPolicy = DiskPlacementPolicy.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1831,6 +1883,11 @@ export const RelocateDiskRequest = { object.destinationZoneId !== null ? String(object.destinationZoneId) : ""; + message.diskPlacementPolicy = + object.diskPlacementPolicy !== undefined && + object.diskPlacementPolicy !== null + ? DiskPlacementPolicy.fromJSON(object.diskPlacementPolicy) + : undefined; return message; }, @@ -1839,6 +1896,10 @@ export const RelocateDiskRequest = { message.diskId !== undefined && (obj.diskId = message.diskId); message.destinationZoneId !== undefined && (obj.destinationZoneId = message.destinationZoneId); + message.diskPlacementPolicy !== undefined && + (obj.diskPlacementPolicy = message.diskPlacementPolicy + ? DiskPlacementPolicy.toJSON(message.diskPlacementPolicy) + : undefined); return obj; }, @@ -1848,6 +1909,11 @@ export const RelocateDiskRequest = { const message = { ...baseRelocateDiskRequest } as RelocateDiskRequest; message.diskId = object.diskId ?? ""; message.destinationZoneId = object.destinationZoneId ?? ""; + message.diskPlacementPolicy = + object.diskPlacementPolicy !== undefined && + object.diskPlacementPolicy !== null + ? DiskPlacementPolicy.fromPartial(object.diskPlacementPolicy) + : undefined; return message; }, }; @@ -2281,6 +2347,46 @@ export const DiskServiceService = { responseDeserialize: (value: Buffer) => ListDiskSnapshotSchedulesResponse.decode(value), }, + /** Lists access bindings for the disk. */ + listAccessBindings: { + path: "/yandex.cloud.compute.v1.DiskService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the disk. */ + setAccessBindings: { + path: "/yandex.cloud.compute.v1.DiskService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the disk. */ + updateAccessBindings: { + path: "/yandex.cloud.compute.v1.DiskService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface DiskServiceServer extends UntypedServiceImplementation { @@ -2329,6 +2435,15 @@ export interface DiskServiceServer extends UntypedServiceImplementation { ListDiskSnapshotSchedulesRequest, ListDiskSnapshotSchedulesResponse >; + /** Lists access bindings for the disk. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the disk. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the disk. */ + updateAccessBindings: handleUnaryCall; } export interface DiskServiceClient extends Client { @@ -2515,6 +2630,63 @@ export interface DiskServiceClient extends Client { response: ListDiskSnapshotSchedulesResponse ) => void ): ClientUnaryCall; + /** Lists access bindings for the disk. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the disk. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the disk. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const DiskServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/compute/v1/filesystem_service.ts b/src/generated/yandex/cloud/compute/v1/filesystem_service.ts index 57c931af..545c5c21 100644 --- a/src/generated/yandex/cloud/compute/v1/filesystem_service.ts +++ b/src/generated/yandex/cloud/compute/v1/filesystem_service.ts @@ -17,6 +17,12 @@ import _m0 from "protobufjs/minimal"; import { FieldMask } from "../../../../google/protobuf/field_mask"; import { Filesystem } from "../../../../yandex/cloud/compute/v1/filesystem"; import { Operation } from "../../../../yandex/cloud/operation/operation"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../yandex/cloud/access/access"; export const protobufPackage = "yandex.cloud.compute.v1"; @@ -1626,6 +1632,46 @@ export const FilesystemServiceService = { responseDeserialize: (value: Buffer) => ListFilesystemOperationsResponse.decode(value), }, + /** Lists access bindings for the filesystem. */ + listAccessBindings: { + path: "/yandex.cloud.compute.v1.FilesystemService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the filesystem. */ + setAccessBindings: { + path: "/yandex.cloud.compute.v1.FilesystemService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the filesystem. */ + updateAccessBindings: { + path: "/yandex.cloud.compute.v1.FilesystemService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface FilesystemServiceServer extends UntypedServiceImplementation { @@ -1654,6 +1700,15 @@ export interface FilesystemServiceServer extends UntypedServiceImplementation { ListFilesystemOperationsRequest, ListFilesystemOperationsResponse >; + /** Lists access bindings for the filesystem. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the filesystem. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the filesystem. */ + updateAccessBindings: handleUnaryCall; } export interface FilesystemServiceClient extends Client { @@ -1781,6 +1836,63 @@ export interface FilesystemServiceClient extends Client { response: ListFilesystemOperationsResponse ) => void ): ClientUnaryCall; + /** Lists access bindings for the filesystem. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the filesystem. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the filesystem. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const FilesystemServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/compute/v1/gpu_cluster_service.ts b/src/generated/yandex/cloud/compute/v1/gpu_cluster_service.ts index 1bf2f5ad..8905f7c6 100644 --- a/src/generated/yandex/cloud/compute/v1/gpu_cluster_service.ts +++ b/src/generated/yandex/cloud/compute/v1/gpu_cluster_service.ts @@ -23,6 +23,12 @@ import { import { FieldMask } from "../../../../google/protobuf/field_mask"; import { Operation } from "../../../../yandex/cloud/operation/operation"; import { Instance } from "../../../../yandex/cloud/compute/v1/instance"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../yandex/cloud/access/access"; export const protobufPackage = "yandex.cloud.compute.v1"; @@ -1843,6 +1849,46 @@ export const GpuClusterServiceService = { responseDeserialize: (value: Buffer) => ListGpuClusterInstancesResponse.decode(value), }, + /** Lists access bindings for the GPU cluster. */ + listAccessBindings: { + path: "/yandex.cloud.compute.v1.GpuClusterService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the GPU cluster. */ + setAccessBindings: { + path: "/yandex.cloud.compute.v1.GpuClusterService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the GPU cluster. */ + updateAccessBindings: { + path: "/yandex.cloud.compute.v1.GpuClusterService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface GpuClusterServiceServer extends UntypedServiceImplementation { @@ -1878,6 +1924,15 @@ export interface GpuClusterServiceServer extends UntypedServiceImplementation { ListGpuClusterInstancesRequest, ListGpuClusterInstancesResponse >; + /** Lists access bindings for the GPU cluster. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the GPU cluster. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the GPU cluster. */ + updateAccessBindings: handleUnaryCall; } export interface GpuClusterServiceClient extends Client { @@ -2032,6 +2087,63 @@ export interface GpuClusterServiceClient extends Client { response: ListGpuClusterInstancesResponse ) => void ): ClientUnaryCall; + /** Lists access bindings for the GPU cluster. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the GPU cluster. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the GPU cluster. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const GpuClusterServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/compute/v1/hardware_generation.ts b/src/generated/yandex/cloud/compute/v1/hardware_generation.ts new file mode 100644 index 00000000..6017a969 --- /dev/null +++ b/src/generated/yandex/cloud/compute/v1/hardware_generation.ts @@ -0,0 +1,331 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.compute.v1"; + +export enum PCITopology { + PCI_TOPOLOGY_UNSPECIFIED = 0, + PCI_TOPOLOGY_V1 = 1, + PCI_TOPOLOGY_V2 = 2, + UNRECOGNIZED = -1, +} + +export function pCITopologyFromJSON(object: any): PCITopology { + switch (object) { + case 0: + case "PCI_TOPOLOGY_UNSPECIFIED": + return PCITopology.PCI_TOPOLOGY_UNSPECIFIED; + case 1: + case "PCI_TOPOLOGY_V1": + return PCITopology.PCI_TOPOLOGY_V1; + case 2: + case "PCI_TOPOLOGY_V2": + return PCITopology.PCI_TOPOLOGY_V2; + case -1: + case "UNRECOGNIZED": + default: + return PCITopology.UNRECOGNIZED; + } +} + +export function pCITopologyToJSON(object: PCITopology): string { + switch (object) { + case PCITopology.PCI_TOPOLOGY_UNSPECIFIED: + return "PCI_TOPOLOGY_UNSPECIFIED"; + case PCITopology.PCI_TOPOLOGY_V1: + return "PCI_TOPOLOGY_V1"; + case PCITopology.PCI_TOPOLOGY_V2: + return "PCI_TOPOLOGY_V2"; + default: + return "UNKNOWN"; + } +} + +/** + * A set of features, specific to a particular Compute hardware generation. + * They are not necessary supported by every host OS or distro, thus they are fixed to an image + * and are applied to all instances created with it as their boot disk image. + * These features significantly determine how the instance is created, thus cannot be changed after the fact. + */ +export interface HardwareGeneration { + $type: "yandex.cloud.compute.v1.HardwareGeneration"; + legacyFeatures?: LegacyHardwareFeatures | undefined; + generation2Features?: Generation2HardwareFeatures | undefined; +} + +/** + * A first hardware generation, by default compatible with all legacy images. + * Allows switching to PCI_TOPOLOGY_V2 and back. + */ +export interface LegacyHardwareFeatures { + $type: "yandex.cloud.compute.v1.LegacyHardwareFeatures"; + pciTopology: PCITopology; +} + +/** + * A second hardware generation, which by default assumes PCI_TOPOLOGY_V2 + * and UEFI boot (with UEFI related features). + */ +export interface Generation2HardwareFeatures { + $type: "yandex.cloud.compute.v1.Generation2HardwareFeatures"; +} + +const baseHardwareGeneration: object = { + $type: "yandex.cloud.compute.v1.HardwareGeneration", +}; + +export const HardwareGeneration = { + $type: "yandex.cloud.compute.v1.HardwareGeneration" as const, + + encode( + message: HardwareGeneration, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.legacyFeatures !== undefined) { + LegacyHardwareFeatures.encode( + message.legacyFeatures, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.generation2Features !== undefined) { + Generation2HardwareFeatures.encode( + message.generation2Features, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HardwareGeneration { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHardwareGeneration } as HardwareGeneration; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.legacyFeatures = LegacyHardwareFeatures.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.generation2Features = Generation2HardwareFeatures.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HardwareGeneration { + const message = { ...baseHardwareGeneration } as HardwareGeneration; + message.legacyFeatures = + object.legacyFeatures !== undefined && object.legacyFeatures !== null + ? LegacyHardwareFeatures.fromJSON(object.legacyFeatures) + : undefined; + message.generation2Features = + object.generation2Features !== undefined && + object.generation2Features !== null + ? Generation2HardwareFeatures.fromJSON(object.generation2Features) + : undefined; + return message; + }, + + toJSON(message: HardwareGeneration): unknown { + const obj: any = {}; + message.legacyFeatures !== undefined && + (obj.legacyFeatures = message.legacyFeatures + ? LegacyHardwareFeatures.toJSON(message.legacyFeatures) + : undefined); + message.generation2Features !== undefined && + (obj.generation2Features = message.generation2Features + ? Generation2HardwareFeatures.toJSON(message.generation2Features) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): HardwareGeneration { + const message = { ...baseHardwareGeneration } as HardwareGeneration; + message.legacyFeatures = + object.legacyFeatures !== undefined && object.legacyFeatures !== null + ? LegacyHardwareFeatures.fromPartial(object.legacyFeatures) + : undefined; + message.generation2Features = + object.generation2Features !== undefined && + object.generation2Features !== null + ? Generation2HardwareFeatures.fromPartial(object.generation2Features) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(HardwareGeneration.$type, HardwareGeneration); + +const baseLegacyHardwareFeatures: object = { + $type: "yandex.cloud.compute.v1.LegacyHardwareFeatures", + pciTopology: 0, +}; + +export const LegacyHardwareFeatures = { + $type: "yandex.cloud.compute.v1.LegacyHardwareFeatures" as const, + + encode( + message: LegacyHardwareFeatures, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.pciTopology !== 0) { + writer.uint32(8).int32(message.pciTopology); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): LegacyHardwareFeatures { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLegacyHardwareFeatures } as LegacyHardwareFeatures; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pciTopology = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LegacyHardwareFeatures { + const message = { ...baseLegacyHardwareFeatures } as LegacyHardwareFeatures; + message.pciTopology = + object.pciTopology !== undefined && object.pciTopology !== null + ? pCITopologyFromJSON(object.pciTopology) + : 0; + return message; + }, + + toJSON(message: LegacyHardwareFeatures): unknown { + const obj: any = {}; + message.pciTopology !== undefined && + (obj.pciTopology = pCITopologyToJSON(message.pciTopology)); + return obj; + }, + + fromPartial, I>>( + object: I + ): LegacyHardwareFeatures { + const message = { ...baseLegacyHardwareFeatures } as LegacyHardwareFeatures; + message.pciTopology = object.pciTopology ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(LegacyHardwareFeatures.$type, LegacyHardwareFeatures); + +const baseGeneration2HardwareFeatures: object = { + $type: "yandex.cloud.compute.v1.Generation2HardwareFeatures", +}; + +export const Generation2HardwareFeatures = { + $type: "yandex.cloud.compute.v1.Generation2HardwareFeatures" as const, + + encode( + _: Generation2HardwareFeatures, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Generation2HardwareFeatures { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGeneration2HardwareFeatures, + } as Generation2HardwareFeatures; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): Generation2HardwareFeatures { + const message = { + ...baseGeneration2HardwareFeatures, + } as Generation2HardwareFeatures; + return message; + }, + + toJSON(_: Generation2HardwareFeatures): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): Generation2HardwareFeatures { + const message = { + ...baseGeneration2HardwareFeatures, + } as Generation2HardwareFeatures; + return message; + }, +}; + +messageTypeRegistry.set( + Generation2HardwareFeatures.$type, + Generation2HardwareFeatures +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/compute/v1/host_group.ts b/src/generated/yandex/cloud/compute/v1/host_group.ts index a473121f..5e744593 100644 --- a/src/generated/yandex/cloud/compute/v1/host_group.ts +++ b/src/generated/yandex/cloud/compute/v1/host_group.ts @@ -2,50 +2,15 @@ import { messageTypeRegistry } from "../../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; +import { + MaintenancePolicy, + maintenancePolicyFromJSON, + maintenancePolicyToJSON, +} from "../../../../yandex/cloud/compute/v1/maintenance"; import { Timestamp } from "../../../../google/protobuf/timestamp"; export const protobufPackage = "yandex.cloud.compute.v1"; -export enum MaintenancePolicy { - MAINTENANCE_POLICY_UNSPECIFIED = 0, - /** RESTART - Restart instances on the same host after maintenance event. */ - RESTART = 1, - /** MIGRATE - Migrate instances to another host before maintenance event. */ - MIGRATE = 2, - UNRECOGNIZED = -1, -} - -export function maintenancePolicyFromJSON(object: any): MaintenancePolicy { - switch (object) { - case 0: - case "MAINTENANCE_POLICY_UNSPECIFIED": - return MaintenancePolicy.MAINTENANCE_POLICY_UNSPECIFIED; - case 1: - case "RESTART": - return MaintenancePolicy.RESTART; - case 2: - case "MIGRATE": - return MaintenancePolicy.MIGRATE; - case -1: - case "UNRECOGNIZED": - default: - return MaintenancePolicy.UNRECOGNIZED; - } -} - -export function maintenancePolicyToJSON(object: MaintenancePolicy): string { - switch (object) { - case MaintenancePolicy.MAINTENANCE_POLICY_UNSPECIFIED: - return "MAINTENANCE_POLICY_UNSPECIFIED"; - case MaintenancePolicy.RESTART: - return "RESTART"; - case MaintenancePolicy.MIGRATE: - return "MIGRATE"; - default: - return "UNKNOWN"; - } -} - /** Represents group of dedicated hosts */ export interface HostGroup { $type: "yandex.cloud.compute.v1.HostGroup"; @@ -138,6 +103,8 @@ export interface Host { status: Host_Status; /** ID of the physical server that the host belongs to. */ serverId: string; + /** Set temporarily if maintenance is planned for this host, and a new host was provided as a replacement. */ + replacement?: Replacement; } export enum Host_Status { @@ -188,6 +155,14 @@ export interface ScalePolicy_FixedScale { size: number; } +export interface Replacement { + $type: "yandex.cloud.compute.v1.Replacement"; + /** ID of the host which replaces this one. */ + hostId: string; + /** The date and time when this host will be automatically freed of instances. */ + deadlineAt?: Date; +} + const baseHostGroup: object = { $type: "yandex.cloud.compute.v1.HostGroup", id: "", @@ -517,6 +492,12 @@ export const Host = { if (message.serverId !== "") { writer.uint32(26).string(message.serverId); } + if (message.replacement !== undefined) { + Replacement.encode( + message.replacement, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -536,6 +517,9 @@ export const Host = { case 3: message.serverId = reader.string(); break; + case 4: + message.replacement = Replacement.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -556,6 +540,10 @@ export const Host = { object.serverId !== undefined && object.serverId !== null ? String(object.serverId) : ""; + message.replacement = + object.replacement !== undefined && object.replacement !== null + ? Replacement.fromJSON(object.replacement) + : undefined; return message; }, @@ -565,6 +553,10 @@ export const Host = { message.status !== undefined && (obj.status = host_StatusToJSON(message.status)); message.serverId !== undefined && (obj.serverId = message.serverId); + message.replacement !== undefined && + (obj.replacement = message.replacement + ? Replacement.toJSON(message.replacement) + : undefined); return obj; }, @@ -573,6 +565,10 @@ export const Host = { message.id = object.id ?? ""; message.status = object.status ?? 0; message.serverId = object.serverId ?? ""; + message.replacement = + object.replacement !== undefined && object.replacement !== null + ? Replacement.fromPartial(object.replacement) + : undefined; return message; }, }; @@ -717,6 +713,86 @@ export const ScalePolicy_FixedScale = { messageTypeRegistry.set(ScalePolicy_FixedScale.$type, ScalePolicy_FixedScale); +const baseReplacement: object = { + $type: "yandex.cloud.compute.v1.Replacement", + hostId: "", +}; + +export const Replacement = { + $type: "yandex.cloud.compute.v1.Replacement" as const, + + encode( + message: Replacement, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.hostId !== "") { + writer.uint32(10).string(message.hostId); + } + if (message.deadlineAt !== undefined) { + Timestamp.encode( + toTimestamp(message.deadlineAt), + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Replacement { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseReplacement } as Replacement; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hostId = reader.string(); + break; + case 2: + message.deadlineAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Replacement { + const message = { ...baseReplacement } as Replacement; + message.hostId = + object.hostId !== undefined && object.hostId !== null + ? String(object.hostId) + : ""; + message.deadlineAt = + object.deadlineAt !== undefined && object.deadlineAt !== null + ? fromJsonTimestamp(object.deadlineAt) + : undefined; + return message; + }, + + toJSON(message: Replacement): unknown { + const obj: any = {}; + message.hostId !== undefined && (obj.hostId = message.hostId); + message.deadlineAt !== undefined && + (obj.deadlineAt = message.deadlineAt.toISOString()); + return obj; + }, + + fromPartial, I>>( + object: I + ): Replacement { + const message = { ...baseReplacement } as Replacement; + message.hostId = object.hostId ?? ""; + message.deadlineAt = object.deadlineAt ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Replacement.$type, Replacement); + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/generated/yandex/cloud/compute/v1/host_group_service.ts b/src/generated/yandex/cloud/compute/v1/host_group_service.ts index 0b22cbce..b05c8867 100644 --- a/src/generated/yandex/cloud/compute/v1/host_group_service.ts +++ b/src/generated/yandex/cloud/compute/v1/host_group_service.ts @@ -16,15 +16,24 @@ import { import _m0 from "protobufjs/minimal"; import { MaintenancePolicy, + maintenancePolicyFromJSON, + maintenancePolicyToJSON, +} from "../../../../yandex/cloud/compute/v1/maintenance"; +import { ScalePolicy, HostGroup, Host, - maintenancePolicyFromJSON, - maintenancePolicyToJSON, } from "../../../../yandex/cloud/compute/v1/host_group"; import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; import { Instance } from "../../../../yandex/cloud/compute/v1/instance"; import { Operation } from "../../../../yandex/cloud/operation/operation"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../yandex/cloud/access/access"; export const protobufPackage = "yandex.cloud.compute.v1"; @@ -198,7 +207,18 @@ export interface ListHostGroupInstancesRequest { * returned by a previous list request. */ pageToken: string; - /** Filter support is not currently implemented. Any filters are ignored. */ + /** + * A filter expression that filters resources listed in the response. + * The expression consists of one or more conditions united by `AND` operator: ` [AND [<...> AND ]]`. + * + * Each condition has the form ` `, where: + * 1. `` is the field name. Currently you can use filtering only on the limited number of fields. + * 2. `` is a logical operator, one of `=`, `!=`, `IN`, `NOT IN`. + * 3. `` represents a value. + * String values should be written in double (`"`) or single (`'`) quotes. C-style escape sequences are supported (`\"` turns to `"`, `\'` to `'`, `\\` to backslash). + * Currently you can use filtering only on the [Host.id] field. + * To get the host ID, use [HostGroupService.ListHosts] request. + */ filter: string; } @@ -254,6 +274,29 @@ export interface ListHostGroupHostsResponse { nextPageToken: string; } +export interface UpdateHostGroupHostRequest { + $type: "yandex.cloud.compute.v1.UpdateHostGroupHostRequest"; + /** ID of the host group to update. */ + hostGroupId: string; + /** ID of the host to update. */ + hostId: string; + /** Field mask that specifies which fields of the Host are going to be updated. */ + updateMask?: FieldMask; + /** + * The date and time when this host will be automatically freed of instances. + * Timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + deadlineAt?: Date; +} + +export interface UpdateHostGroupHostMetadata { + $type: "yandex.cloud.compute.v1.UpdateHostGroupHostMetadata"; + /** ID of the host group that is being updated. */ + hostGroupId: string; + /** ID of the host that is being updated. */ + hostId: string; +} + export interface ListHostGroupOperationsRequest { $type: "yandex.cloud.compute.v1.ListHostGroupOperationsRequest"; /** @@ -1790,6 +1833,218 @@ messageTypeRegistry.set( ListHostGroupHostsResponse ); +const baseUpdateHostGroupHostRequest: object = { + $type: "yandex.cloud.compute.v1.UpdateHostGroupHostRequest", + hostGroupId: "", + hostId: "", +}; + +export const UpdateHostGroupHostRequest = { + $type: "yandex.cloud.compute.v1.UpdateHostGroupHostRequest" as const, + + encode( + message: UpdateHostGroupHostRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.hostGroupId !== "") { + writer.uint32(10).string(message.hostGroupId); + } + if (message.hostId !== "") { + writer.uint32(18).string(message.hostId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(26).fork()).ldelim(); + } + if (message.deadlineAt !== undefined) { + Timestamp.encode( + toTimestamp(message.deadlineAt), + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateHostGroupHostRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateHostGroupHostRequest, + } as UpdateHostGroupHostRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hostGroupId = reader.string(); + break; + case 2: + message.hostId = reader.string(); + break; + case 3: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 4: + message.deadlineAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateHostGroupHostRequest { + const message = { + ...baseUpdateHostGroupHostRequest, + } as UpdateHostGroupHostRequest; + message.hostGroupId = + object.hostGroupId !== undefined && object.hostGroupId !== null + ? String(object.hostGroupId) + : ""; + message.hostId = + object.hostId !== undefined && object.hostId !== null + ? String(object.hostId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.deadlineAt = + object.deadlineAt !== undefined && object.deadlineAt !== null + ? fromJsonTimestamp(object.deadlineAt) + : undefined; + return message; + }, + + toJSON(message: UpdateHostGroupHostRequest): unknown { + const obj: any = {}; + message.hostGroupId !== undefined && + (obj.hostGroupId = message.hostGroupId); + message.hostId !== undefined && (obj.hostId = message.hostId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.deadlineAt !== undefined && + (obj.deadlineAt = message.deadlineAt.toISOString()); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateHostGroupHostRequest { + const message = { + ...baseUpdateHostGroupHostRequest, + } as UpdateHostGroupHostRequest; + message.hostGroupId = object.hostGroupId ?? ""; + message.hostId = object.hostId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.deadlineAt = object.deadlineAt ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateHostGroupHostRequest.$type, + UpdateHostGroupHostRequest +); + +const baseUpdateHostGroupHostMetadata: object = { + $type: "yandex.cloud.compute.v1.UpdateHostGroupHostMetadata", + hostGroupId: "", + hostId: "", +}; + +export const UpdateHostGroupHostMetadata = { + $type: "yandex.cloud.compute.v1.UpdateHostGroupHostMetadata" as const, + + encode( + message: UpdateHostGroupHostMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.hostGroupId !== "") { + writer.uint32(10).string(message.hostGroupId); + } + if (message.hostId !== "") { + writer.uint32(18).string(message.hostId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateHostGroupHostMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateHostGroupHostMetadata, + } as UpdateHostGroupHostMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hostGroupId = reader.string(); + break; + case 2: + message.hostId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateHostGroupHostMetadata { + const message = { + ...baseUpdateHostGroupHostMetadata, + } as UpdateHostGroupHostMetadata; + message.hostGroupId = + object.hostGroupId !== undefined && object.hostGroupId !== null + ? String(object.hostGroupId) + : ""; + message.hostId = + object.hostId !== undefined && object.hostId !== null + ? String(object.hostId) + : ""; + return message; + }, + + toJSON(message: UpdateHostGroupHostMetadata): unknown { + const obj: any = {}; + message.hostGroupId !== undefined && + (obj.hostGroupId = message.hostGroupId); + message.hostId !== undefined && (obj.hostId = message.hostId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateHostGroupHostMetadata { + const message = { + ...baseUpdateHostGroupHostMetadata, + } as UpdateHostGroupHostMetadata; + message.hostGroupId = object.hostGroupId ?? ""; + message.hostId = object.hostId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateHostGroupHostMetadata.$type, + UpdateHostGroupHostMetadata +); + const baseListHostGroupOperationsRequest: object = { $type: "yandex.cloud.compute.v1.ListHostGroupOperationsRequest", hostGroupId: "", @@ -2091,6 +2346,59 @@ export const HostGroupServiceService = { responseDeserialize: (value: Buffer) => ListHostGroupHostsResponse.decode(value), }, + /** Update host */ + updateHost: { + path: "/yandex.cloud.compute.v1.HostGroupService/UpdateHost", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateHostGroupHostRequest) => + Buffer.from(UpdateHostGroupHostRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateHostGroupHostRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Lists access bindings for the host group. */ + listAccessBindings: { + path: "/yandex.cloud.compute.v1.HostGroupService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the host group. */ + setAccessBindings: { + path: "/yandex.cloud.compute.v1.HostGroupService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the host group. */ + updateAccessBindings: { + path: "/yandex.cloud.compute.v1.HostGroupService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface HostGroupServiceServer extends UntypedServiceImplementation { @@ -2119,6 +2427,17 @@ export interface HostGroupServiceServer extends UntypedServiceImplementation { ListHostGroupHostsRequest, ListHostGroupHostsResponse >; + /** Update host */ + updateHost: handleUnaryCall; + /** Lists access bindings for the host group. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the host group. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the host group. */ + updateAccessBindings: handleUnaryCall; } export interface HostGroupServiceClient extends Client { @@ -2286,6 +2605,79 @@ export interface HostGroupServiceClient extends Client { response: ListHostGroupHostsResponse ) => void ): ClientUnaryCall; + /** Update host */ + updateHost( + request: UpdateHostGroupHostRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateHost( + request: UpdateHostGroupHostRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateHost( + request: UpdateHostGroupHostRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Lists access bindings for the host group. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the host group. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the host group. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const HostGroupServiceClient = makeGenericClientConstructor( @@ -2338,6 +2730,28 @@ export type Exact = P extends Builtin never >; +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); diff --git a/src/generated/yandex/cloud/compute/v1/image.ts b/src/generated/yandex/cloud/compute/v1/image.ts index 766c98aa..bf7f3555 100644 --- a/src/generated/yandex/cloud/compute/v1/image.ts +++ b/src/generated/yandex/cloud/compute/v1/image.ts @@ -2,6 +2,7 @@ import { messageTypeRegistry } from "../../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; +import { HardwareGeneration } from "../../../../yandex/cloud/compute/v1/hardware_generation"; import { Timestamp } from "../../../../google/protobuf/timestamp"; export const protobufPackage = "yandex.cloud.compute.v1"; @@ -49,6 +50,11 @@ export interface Image { os?: Os; /** When true, indicates there is an image pool for fast creation disks from the image. */ pooled: boolean; + /** + * If specified, forces the same HardwareGeneration features to be applied to the instance + * created using this image as a source for the boot disk. Otherwise the current default will be used. + */ + hardwareGeneration?: HardwareGeneration; } export enum Image_Status { @@ -228,6 +234,12 @@ export const Image = { if (message.pooled === true) { writer.uint32(104).bool(message.pooled); } + if (message.hardwareGeneration !== undefined) { + HardwareGeneration.encode( + message.hardwareGeneration, + writer.uint32(114).fork() + ).ldelim(); + } return writer; }, @@ -284,6 +296,12 @@ export const Image = { case 13: message.pooled = reader.bool(); break; + case 14: + message.hardwareGeneration = HardwareGeneration.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -343,6 +361,11 @@ export const Image = { object.pooled !== undefined && object.pooled !== null ? Boolean(object.pooled) : false; + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromJSON(object.hardwareGeneration) + : undefined; return message; }, @@ -376,6 +399,10 @@ export const Image = { message.os !== undefined && (obj.os = message.os ? Os.toJSON(message.os) : undefined); message.pooled !== undefined && (obj.pooled = message.pooled); + message.hardwareGeneration !== undefined && + (obj.hardwareGeneration = message.hardwareGeneration + ? HardwareGeneration.toJSON(message.hardwareGeneration) + : undefined); return obj; }, @@ -404,6 +431,11 @@ export const Image = { ? Os.fromPartial(object.os) : undefined; message.pooled = object.pooled ?? false; + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromPartial(object.hardwareGeneration) + : undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/compute/v1/image_service.ts b/src/generated/yandex/cloud/compute/v1/image_service.ts index 17c933ca..65195bf1 100644 --- a/src/generated/yandex/cloud/compute/v1/image_service.ts +++ b/src/generated/yandex/cloud/compute/v1/image_service.ts @@ -15,8 +15,15 @@ import { } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; import { Os, Image } from "../../../../yandex/cloud/compute/v1/image"; +import { HardwareGeneration } from "../../../../yandex/cloud/compute/v1/hardware_generation"; import { FieldMask } from "../../../../google/protobuf/field_mask"; import { Operation } from "../../../../yandex/cloud/operation/operation"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../yandex/cloud/access/access"; export const protobufPackage = "yandex.cloud.compute.v1"; @@ -148,6 +155,11 @@ export interface CreateImageRequest { os?: Os; /** When true, an image pool will be created for fast creation disks from the image. */ pooled: boolean; + /** + * Specify the overrides to hardware_generation of a source disk, image or snapshot, + * or to the default values if the source does not define it. + */ + hardwareGeneration?: HardwareGeneration; } export interface CreateImageRequest_LabelsEntry { @@ -650,6 +662,12 @@ export const CreateImageRequest = { if (message.pooled === true) { writer.uint32(136).bool(message.pooled); } + if (message.hardwareGeneration !== undefined) { + HardwareGeneration.encode( + message.hardwareGeneration, + writer.uint32(146).fork() + ).ldelim(); + } return writer; }, @@ -707,6 +725,12 @@ export const CreateImageRequest = { case 17: message.pooled = reader.bool(); break; + case 18: + message.hardwareGeneration = HardwareGeneration.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -768,6 +792,11 @@ export const CreateImageRequest = { object.pooled !== undefined && object.pooled !== null ? Boolean(object.pooled) : false; + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromJSON(object.hardwareGeneration) + : undefined; return message; }, @@ -798,6 +827,10 @@ export const CreateImageRequest = { message.os !== undefined && (obj.os = message.os ? Os.toJSON(message.os) : undefined); message.pooled !== undefined && (obj.pooled = message.pooled); + message.hardwareGeneration !== undefined && + (obj.hardwareGeneration = message.hardwareGeneration + ? HardwareGeneration.toJSON(message.hardwareGeneration) + : undefined); return obj; }, @@ -828,6 +861,11 @@ export const CreateImageRequest = { ? Os.fromPartial(object.os) : undefined; message.pooled = object.pooled ?? false; + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromPartial(object.hardwareGeneration) + : undefined; return message; }, }; @@ -1710,6 +1748,46 @@ export const ImageServiceService = { responseDeserialize: (value: Buffer) => ListImageOperationsResponse.decode(value), }, + /** Lists access bindings for the image. */ + listAccessBindings: { + path: "/yandex.cloud.compute.v1.ImageService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the image. */ + setAccessBindings: { + path: "/yandex.cloud.compute.v1.ImageService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the image. */ + updateAccessBindings: { + path: "/yandex.cloud.compute.v1.ImageService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface ImageServiceServer extends UntypedServiceImplementation { @@ -1743,6 +1821,15 @@ export interface ImageServiceServer extends UntypedServiceImplementation { ListImageOperationsRequest, ListImageOperationsResponse >; + /** Lists access bindings for the image. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the image. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the image. */ + updateAccessBindings: handleUnaryCall; } export interface ImageServiceClient extends Client { @@ -1880,6 +1967,63 @@ export interface ImageServiceClient extends Client { response: ListImageOperationsResponse ) => void ): ClientUnaryCall; + /** Lists access bindings for the image. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the image. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the image. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const ImageServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/compute/v1/instance.ts b/src/generated/yandex/cloud/compute/v1/instance.ts index 31188be7..7e6b5c6e 100644 --- a/src/generated/yandex/cloud/compute/v1/instance.ts +++ b/src/generated/yandex/cloud/compute/v1/instance.ts @@ -2,6 +2,13 @@ import { messageTypeRegistry } from "../../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; +import { + MaintenancePolicy, + maintenancePolicyFromJSON, + maintenancePolicyToJSON, +} from "../../../../yandex/cloud/compute/v1/maintenance"; +import { Duration } from "../../../../google/protobuf/duration"; +import { HardwareGeneration } from "../../../../yandex/cloud/compute/v1/hardware_generation"; import { Timestamp } from "../../../../google/protobuf/timestamp"; export const protobufPackage = "yandex.cloud.compute.v1"; @@ -127,6 +134,8 @@ export interface Instance { filesystems: AttachedFilesystem[]; /** Array of network interfaces that are attached to the instance. */ networkInterfaces: NetworkInterface[]; + /** Serial port settings */ + serialPortSettings?: SerialPortSettings; /** GPU settings */ gpuSettings?: GpuSettings; /** @@ -150,6 +159,12 @@ export interface Instance { hostGroupId: string; /** ID of the dedicated host that the instance belongs to. */ hostId: string; + /** Behaviour on maintenance events */ + maintenancePolicy: MaintenancePolicy; + /** Time between notification via metadata service and maintenance */ + maintenanceGracePeriod?: Duration; + /** This feature set is inherited from the image/disk used as a boot one at the creation of the instance. */ + hardwareGeneration?: HardwareGeneration; } export enum Instance_Status { @@ -406,10 +421,7 @@ export function attachedFilesystem_ModeToJSON( export interface NetworkInterface { $type: "yandex.cloud.compute.v1.NetworkInterface"; - /** - * The index of the network interface, generated by the server, 0,1,2... etc. - * Currently only one network interface is supported per instance. - */ + /** The index of the network interface, will be generated by the server, 0,1,2... etc if not specified. */ index: string; /** MAC address that is assigned to the network interface. */ macAddress: string; @@ -602,6 +614,56 @@ export interface MetadataOptions { awsV1HttpToken: MetadataOption; } +export interface SerialPortSettings { + $type: "yandex.cloud.compute.v1.SerialPortSettings"; + /** Authentication and authorization in serial console when using SSH protocol */ + sshAuthorization: SerialPortSettings_SSHAuthorization; +} + +export enum SerialPortSettings_SSHAuthorization { + SSH_AUTHORIZATION_UNSPECIFIED = 0, + /** INSTANCE_METADATA - Authentication and authorization using SSH keys in instance metadata */ + INSTANCE_METADATA = 1, + /** OS_LOGIN - Authentication and authorization using Oslogin service */ + OS_LOGIN = 2, + UNRECOGNIZED = -1, +} + +export function serialPortSettings_SSHAuthorizationFromJSON( + object: any +): SerialPortSettings_SSHAuthorization { + switch (object) { + case 0: + case "SSH_AUTHORIZATION_UNSPECIFIED": + return SerialPortSettings_SSHAuthorization.SSH_AUTHORIZATION_UNSPECIFIED; + case 1: + case "INSTANCE_METADATA": + return SerialPortSettings_SSHAuthorization.INSTANCE_METADATA; + case 2: + case "OS_LOGIN": + return SerialPortSettings_SSHAuthorization.OS_LOGIN; + case -1: + case "UNRECOGNIZED": + default: + return SerialPortSettings_SSHAuthorization.UNRECOGNIZED; + } +} + +export function serialPortSettings_SSHAuthorizationToJSON( + object: SerialPortSettings_SSHAuthorization +): string { + switch (object) { + case SerialPortSettings_SSHAuthorization.SSH_AUTHORIZATION_UNSPECIFIED: + return "SSH_AUTHORIZATION_UNSPECIFIED"; + case SerialPortSettings_SSHAuthorization.INSTANCE_METADATA: + return "INSTANCE_METADATA"; + case SerialPortSettings_SSHAuthorization.OS_LOGIN: + return "OS_LOGIN"; + default: + return "UNKNOWN"; + } +} + const baseInstance: object = { $type: "yandex.cloud.compute.v1.Instance", id: "", @@ -615,6 +677,7 @@ const baseInstance: object = { serviceAccountId: "", hostGroupId: "", hostId: "", + maintenancePolicy: 0, }; export const Instance = { @@ -695,6 +758,12 @@ export const Instance = { for (const v of message.networkInterfaces) { NetworkInterface.encode(v!, writer.uint32(114).fork()).ldelim(); } + if (message.serialPortSettings !== undefined) { + SerialPortSettings.encode( + message.serialPortSettings, + writer.uint32(194).fork() + ).ldelim(); + } if (message.gpuSettings !== undefined) { GpuSettings.encode( message.gpuSettings, @@ -731,6 +800,21 @@ export const Instance = { if (message.hostId !== "") { writer.uint32(226).string(message.hostId); } + if (message.maintenancePolicy !== 0) { + writer.uint32(232).int32(message.maintenancePolicy); + } + if (message.maintenanceGracePeriod !== undefined) { + Duration.encode( + message.maintenanceGracePeriod, + writer.uint32(242).fork() + ).ldelim(); + } + if (message.hardwareGeneration !== undefined) { + HardwareGeneration.encode( + message.hardwareGeneration, + writer.uint32(250).fork() + ).ldelim(); + } return writer; }, @@ -820,6 +904,12 @@ export const Instance = { NetworkInterface.decode(reader, reader.uint32()) ); break; + case 24: + message.serialPortSettings = SerialPortSettings.decode( + reader, + reader.uint32() + ); + break; case 26: message.gpuSettings = GpuSettings.decode(reader, reader.uint32()); break; @@ -853,6 +943,21 @@ export const Instance = { case 28: message.hostId = reader.string(); break; + case 29: + message.maintenancePolicy = reader.int32() as any; + break; + case 30: + message.maintenanceGracePeriod = Duration.decode( + reader, + reader.uint32() + ); + break; + case 31: + message.hardwareGeneration = HardwareGeneration.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -929,6 +1034,11 @@ export const Instance = { message.networkInterfaces = (object.networkInterfaces ?? []).map((e: any) => NetworkInterface.fromJSON(e) ); + message.serialPortSettings = + object.serialPortSettings !== undefined && + object.serialPortSettings !== null + ? SerialPortSettings.fromJSON(object.serialPortSettings) + : undefined; message.gpuSettings = object.gpuSettings !== undefined && object.gpuSettings !== null ? GpuSettings.fromJSON(object.gpuSettings) @@ -961,6 +1071,21 @@ export const Instance = { object.hostId !== undefined && object.hostId !== null ? String(object.hostId) : ""; + message.maintenancePolicy = + object.maintenancePolicy !== undefined && + object.maintenancePolicy !== null + ? maintenancePolicyFromJSON(object.maintenancePolicy) + : 0; + message.maintenanceGracePeriod = + object.maintenanceGracePeriod !== undefined && + object.maintenanceGracePeriod !== null + ? Duration.fromJSON(object.maintenanceGracePeriod) + : undefined; + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromJSON(object.hardwareGeneration) + : undefined; return message; }, @@ -1029,6 +1154,10 @@ export const Instance = { } else { obj.networkInterfaces = []; } + message.serialPortSettings !== undefined && + (obj.serialPortSettings = message.serialPortSettings + ? SerialPortSettings.toJSON(message.serialPortSettings) + : undefined); message.gpuSettings !== undefined && (obj.gpuSettings = message.gpuSettings ? GpuSettings.toJSON(message.gpuSettings) @@ -1051,6 +1180,18 @@ export const Instance = { message.hostGroupId !== undefined && (obj.hostGroupId = message.hostGroupId); message.hostId !== undefined && (obj.hostId = message.hostId); + message.maintenancePolicy !== undefined && + (obj.maintenancePolicy = maintenancePolicyToJSON( + message.maintenancePolicy + )); + message.maintenanceGracePeriod !== undefined && + (obj.maintenanceGracePeriod = message.maintenanceGracePeriod + ? Duration.toJSON(message.maintenanceGracePeriod) + : undefined); + message.hardwareGeneration !== undefined && + (obj.hardwareGeneration = message.hardwareGeneration + ? HardwareGeneration.toJSON(message.hardwareGeneration) + : undefined); return obj; }, @@ -1101,6 +1242,11 @@ export const Instance = { message.networkInterfaces = object.networkInterfaces?.map((e) => NetworkInterface.fromPartial(e)) || []; + message.serialPortSettings = + object.serialPortSettings !== undefined && + object.serialPortSettings !== null + ? SerialPortSettings.fromPartial(object.serialPortSettings) + : undefined; message.gpuSettings = object.gpuSettings !== undefined && object.gpuSettings !== null ? GpuSettings.fromPartial(object.gpuSettings) @@ -1121,6 +1267,17 @@ export const Instance = { : undefined; message.hostGroupId = object.hostGroupId ?? ""; message.hostId = object.hostId ?? ""; + message.maintenancePolicy = object.maintenancePolicy ?? 0; + message.maintenanceGracePeriod = + object.maintenanceGracePeriod !== undefined && + object.maintenanceGracePeriod !== null + ? Duration.fromPartial(object.maintenanceGracePeriod) + : undefined; + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromPartial(object.hardwareGeneration) + : undefined; return message; }, }; @@ -2601,6 +2758,71 @@ export const MetadataOptions = { messageTypeRegistry.set(MetadataOptions.$type, MetadataOptions); +const baseSerialPortSettings: object = { + $type: "yandex.cloud.compute.v1.SerialPortSettings", + sshAuthorization: 0, +}; + +export const SerialPortSettings = { + $type: "yandex.cloud.compute.v1.SerialPortSettings" as const, + + encode( + message: SerialPortSettings, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.sshAuthorization !== 0) { + writer.uint32(8).int32(message.sshAuthorization); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SerialPortSettings { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSerialPortSettings } as SerialPortSettings; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sshAuthorization = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SerialPortSettings { + const message = { ...baseSerialPortSettings } as SerialPortSettings; + message.sshAuthorization = + object.sshAuthorization !== undefined && object.sshAuthorization !== null + ? serialPortSettings_SSHAuthorizationFromJSON(object.sshAuthorization) + : 0; + return message; + }, + + toJSON(message: SerialPortSettings): unknown { + const obj: any = {}; + message.sshAuthorization !== undefined && + (obj.sshAuthorization = serialPortSettings_SSHAuthorizationToJSON( + message.sshAuthorization + )); + return obj; + }, + + fromPartial, I>>( + object: I + ): SerialPortSettings { + const message = { ...baseSerialPortSettings } as SerialPortSettings; + message.sshAuthorization = object.sshAuthorization ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(SerialPortSettings.$type, SerialPortSettings); + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/generated/yandex/cloud/compute/v1/instance_service.ts b/src/generated/yandex/cloud/compute/v1/instance_service.ts index ce627eb3..0042fb02 100644 --- a/src/generated/yandex/cloud/compute/v1/instance_service.ts +++ b/src/generated/yandex/cloud/compute/v1/instance_service.ts @@ -18,15 +18,25 @@ import { MetadataOptions, SchedulingPolicy, NetworkSettings, - GpuSettings, PlacementPolicy, + GpuSettings, + SerialPortSettings, IpVersion, Instance, ipVersionFromJSON, ipVersionToJSON, } from "../../../../yandex/cloud/compute/v1/instance"; +import { + MaintenancePolicy, + maintenancePolicyFromJSON, + maintenancePolicyToJSON, +} from "../../../../yandex/cloud/compute/v1/maintenance"; +import { Duration } from "../../../../google/protobuf/duration"; import { FieldMask } from "../../../../google/protobuf/field_mask"; -import { DiskPlacementPolicy } from "../../../../yandex/cloud/compute/v1/disk"; +import { + DiskPlacementPolicy, + DiskPlacementPolicyChange, +} from "../../../../yandex/cloud/compute/v1/disk"; import { Operation } from "../../../../yandex/cloud/operation/operation"; import { ListAccessBindingsRequest, @@ -199,7 +209,6 @@ export interface CreateInstanceRequest { /** * Network configuration for the instance. Specifies how the network interface is configured * to interact with other services on the internal network and on the internet. - * Currently only one network interface is supported per instance. */ networkInterfaceSpecs: NetworkInterfaceSpec[]; /** @@ -219,10 +228,16 @@ export interface CreateInstanceRequest { serviceAccountId: string; /** Network settings. */ networkSettings?: NetworkSettings; - /** GPU settings. */ - gpuSettings?: GpuSettings; /** Placement policy configuration. */ placementPolicy?: PlacementPolicy; + /** GPU settings. */ + gpuSettings?: GpuSettings; + /** Behaviour on maintenance events */ + maintenancePolicy: MaintenancePolicy; + /** Time between notification via metadata service and maintenance */ + maintenanceGracePeriod?: Duration; + /** Serial port settings */ + serialPortSettings?: SerialPortSettings; } export interface CreateInstanceRequest_LabelsEntry { @@ -302,6 +317,12 @@ export interface UpdateInstanceRequest { placementPolicy?: PlacementPolicy; /** Scheduling policy configuration. */ schedulingPolicy?: SchedulingPolicy; + /** Behaviour on maintenance events */ + maintenancePolicy: MaintenancePolicy; + /** Time between notification via metadata service and maintenance */ + maintenanceGracePeriod?: Duration; + /** Serial port settings */ + serialPortSettings?: SerialPortSettings; } export interface UpdateInstanceRequest_LabelsEntry { @@ -506,6 +527,43 @@ export interface DetachInstanceFilesystemMetadata { filesystemId: string; } +export interface AttachInstanceNetworkInterfaceRequest { + $type: "yandex.cloud.compute.v1.AttachInstanceNetworkInterfaceRequest"; + /** ID of the instance that in which network interface is being attached to. */ + instanceId: string; + /** The index of the network interface */ + networkInterfaceIndex: string; + /** ID of the subnet. */ + subnetId: string; + /** Primary IPv4 address that will be assigned to the instance for this network interface. */ + primaryV4AddressSpec?: PrimaryAddressSpec; + /** ID's of security groups attached to the interface. */ + securityGroupIds: string[]; +} + +export interface AttachInstanceNetworkInterfaceMetadata { + $type: "yandex.cloud.compute.v1.AttachInstanceNetworkInterfaceMetadata"; + /** ID of the instant network interface that is being updated. */ + instanceId: string; + networkInterfaceIndex: string; +} + +export interface DetachInstanceNetworkInterfaceRequest { + $type: "yandex.cloud.compute.v1.DetachInstanceNetworkInterfaceRequest"; + /** ID of the instance that in which network interface is being attached to. */ + instanceId: string; + /** The index of the network interface. */ + networkInterfaceIndex: string; +} + +export interface DetachInstanceNetworkInterfaceMetadata { + $type: "yandex.cloud.compute.v1.DetachInstanceNetworkInterfaceMetadata"; + /** ID of the instant network interface that is being updated. */ + instanceId: string; + /** The index of the network interface. */ + networkInterfaceIndex: string; +} + /** Enables One-to-one NAT on the network interface. */ export interface AddInstanceOneToOneNatRequest { $type: "yandex.cloud.compute.v1.AddInstanceOneToOneNatRequest"; @@ -546,7 +604,7 @@ export interface RemoveInstanceOneToOneNatMetadata { export interface UpdateInstanceNetworkInterfaceRequest { $type: "yandex.cloud.compute.v1.UpdateInstanceNetworkInterfaceRequest"; - /** ID of the network interface that is being updated. */ + /** ID of the instance that is being updated. */ instanceId: string; /** The index of the network interface to be updated. */ networkInterfaceIndex: string; @@ -570,6 +628,16 @@ export interface UpdateInstanceNetworkInterfaceMetadata { networkInterfaceIndex: string; } +export interface SimulateInstanceMaintenanceEventRequest { + $type: "yandex.cloud.compute.v1.SimulateInstanceMaintenanceEventRequest"; + instanceId: string; +} + +export interface SimulateInstanceMaintenanceEventMetadata { + $type: "yandex.cloud.compute.v1.SimulateInstanceMaintenanceEventMetadata"; + instanceId: string; +} + export interface ListInstanceOperationsRequest { $type: "yandex.cloud.compute.v1.ListInstanceOperationsRequest"; /** ID of the Instance resource to list operations for. */ @@ -782,6 +850,8 @@ export interface NetworkInterfaceSpec { primaryV6AddressSpec?: PrimaryAddressSpec; /** ID's of security groups attached to the interface */ securityGroupIds: string[]; + /** The index of the network interface, will be generated by the server, 0,1,2... etc if not specified. */ + index: string; } export interface PrimaryAddressSpec { @@ -862,6 +932,16 @@ export interface RelocateInstanceRequest { * To get the zone ID, make a [ZoneService.List] request. */ destinationZoneId: string; + /** + * Network configuration for the instance. Specifies how the network interface is configured + * to interact with other services on the internal network and on the internet. + * Currently only one network interface is supported per instance. + */ + networkInterfaceSpecs: NetworkInterfaceSpec[]; + /** Boot disk placement policy configuration in target zone. Must be specified if disk has placement policy. */ + bootDiskPlacement?: DiskPlacementPolicy; + /** Secondary disk placement policy configurations in target zone. Must be specified for each disk that has placement policy. */ + secondaryDiskPlacements: DiskPlacementPolicyChange[]; } export interface RelocateInstanceMetadata { @@ -1179,6 +1259,7 @@ const baseCreateInstanceRequest: object = { platformId: "", hostname: "", serviceAccountId: "", + maintenancePolicy: 0, }; export const CreateInstanceRequest = { @@ -1271,16 +1352,31 @@ export const CreateInstanceRequest = { writer.uint32(122).fork() ).ldelim(); } + if (message.placementPolicy !== undefined) { + PlacementPolicy.encode( + message.placementPolicy, + writer.uint32(130).fork() + ).ldelim(); + } if (message.gpuSettings !== undefined) { GpuSettings.encode( message.gpuSettings, writer.uint32(162).fork() ).ldelim(); } - if (message.placementPolicy !== undefined) { - PlacementPolicy.encode( - message.placementPolicy, - writer.uint32(130).fork() + if (message.maintenancePolicy !== 0) { + writer.uint32(168).int32(message.maintenancePolicy); + } + if (message.maintenanceGracePeriod !== undefined) { + Duration.encode( + message.maintenanceGracePeriod, + writer.uint32(178).fork() + ).ldelim(); + } + if (message.serialPortSettings !== undefined) { + SerialPortSettings.encode( + message.serialPortSettings, + writer.uint32(186).fork() ).ldelim(); } return writer; @@ -1388,11 +1484,26 @@ export const CreateInstanceRequest = { reader.uint32() ); break; + case 16: + message.placementPolicy = PlacementPolicy.decode( + reader, + reader.uint32() + ); + break; case 20: message.gpuSettings = GpuSettings.decode(reader, reader.uint32()); break; - case 16: - message.placementPolicy = PlacementPolicy.decode( + case 21: + message.maintenancePolicy = reader.int32() as any; + break; + case 22: + message.maintenanceGracePeriod = Duration.decode( + reader, + reader.uint32() + ); + break; + case 23: + message.serialPortSettings = SerialPortSettings.decode( reader, reader.uint32() ); @@ -1479,13 +1590,28 @@ export const CreateInstanceRequest = { object.networkSettings !== undefined && object.networkSettings !== null ? NetworkSettings.fromJSON(object.networkSettings) : undefined; + message.placementPolicy = + object.placementPolicy !== undefined && object.placementPolicy !== null + ? PlacementPolicy.fromJSON(object.placementPolicy) + : undefined; message.gpuSettings = object.gpuSettings !== undefined && object.gpuSettings !== null ? GpuSettings.fromJSON(object.gpuSettings) : undefined; - message.placementPolicy = - object.placementPolicy !== undefined && object.placementPolicy !== null - ? PlacementPolicy.fromJSON(object.placementPolicy) + message.maintenancePolicy = + object.maintenancePolicy !== undefined && + object.maintenancePolicy !== null + ? maintenancePolicyFromJSON(object.maintenancePolicy) + : 0; + message.maintenanceGracePeriod = + object.maintenanceGracePeriod !== undefined && + object.maintenanceGracePeriod !== null + ? Duration.fromJSON(object.maintenanceGracePeriod) + : undefined; + message.serialPortSettings = + object.serialPortSettings !== undefined && + object.serialPortSettings !== null + ? SerialPortSettings.fromJSON(object.serialPortSettings) : undefined; return message; }, @@ -1561,13 +1687,25 @@ export const CreateInstanceRequest = { (obj.networkSettings = message.networkSettings ? NetworkSettings.toJSON(message.networkSettings) : undefined); + message.placementPolicy !== undefined && + (obj.placementPolicy = message.placementPolicy + ? PlacementPolicy.toJSON(message.placementPolicy) + : undefined); message.gpuSettings !== undefined && (obj.gpuSettings = message.gpuSettings ? GpuSettings.toJSON(message.gpuSettings) : undefined); - message.placementPolicy !== undefined && - (obj.placementPolicy = message.placementPolicy - ? PlacementPolicy.toJSON(message.placementPolicy) + message.maintenancePolicy !== undefined && + (obj.maintenancePolicy = maintenancePolicyToJSON( + message.maintenancePolicy + )); + message.maintenanceGracePeriod !== undefined && + (obj.maintenanceGracePeriod = message.maintenanceGracePeriod + ? Duration.toJSON(message.maintenanceGracePeriod) + : undefined); + message.serialPortSettings !== undefined && + (obj.serialPortSettings = message.serialPortSettings + ? SerialPortSettings.toJSON(message.serialPortSettings) : undefined); return obj; }, @@ -1633,13 +1771,24 @@ export const CreateInstanceRequest = { object.networkSettings !== undefined && object.networkSettings !== null ? NetworkSettings.fromPartial(object.networkSettings) : undefined; + message.placementPolicy = + object.placementPolicy !== undefined && object.placementPolicy !== null + ? PlacementPolicy.fromPartial(object.placementPolicy) + : undefined; message.gpuSettings = object.gpuSettings !== undefined && object.gpuSettings !== null ? GpuSettings.fromPartial(object.gpuSettings) : undefined; - message.placementPolicy = - object.placementPolicy !== undefined && object.placementPolicy !== null - ? PlacementPolicy.fromPartial(object.placementPolicy) + message.maintenancePolicy = object.maintenancePolicy ?? 0; + message.maintenanceGracePeriod = + object.maintenanceGracePeriod !== undefined && + object.maintenanceGracePeriod !== null + ? Duration.fromPartial(object.maintenanceGracePeriod) + : undefined; + message.serialPortSettings = + object.serialPortSettings !== undefined && + object.serialPortSettings !== null + ? SerialPortSettings.fromPartial(object.serialPortSettings) : undefined; return message; }, @@ -1889,6 +2038,7 @@ const baseUpdateInstanceRequest: object = { description: "", platformId: "", serviceAccountId: "", + maintenancePolicy: 0, }; export const UpdateInstanceRequest = { @@ -1966,6 +2116,21 @@ export const UpdateInstanceRequest = { writer.uint32(98).fork() ).ldelim(); } + if (message.maintenancePolicy !== 0) { + writer.uint32(112).int32(message.maintenancePolicy); + } + if (message.maintenanceGracePeriod !== undefined) { + Duration.encode( + message.maintenanceGracePeriod, + writer.uint32(122).fork() + ).ldelim(); + } + if (message.serialPortSettings !== undefined) { + SerialPortSettings.encode( + message.serialPortSettings, + writer.uint32(130).fork() + ).ldelim(); + } return writer; }, @@ -2044,6 +2209,21 @@ export const UpdateInstanceRequest = { reader.uint32() ); break; + case 14: + message.maintenancePolicy = reader.int32() as any; + break; + case 15: + message.maintenanceGracePeriod = Duration.decode( + reader, + reader.uint32() + ); + break; + case 16: + message.serialPortSettings = SerialPortSettings.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2110,6 +2290,21 @@ export const UpdateInstanceRequest = { object.schedulingPolicy !== undefined && object.schedulingPolicy !== null ? SchedulingPolicy.fromJSON(object.schedulingPolicy) : undefined; + message.maintenancePolicy = + object.maintenancePolicy !== undefined && + object.maintenancePolicy !== null + ? maintenancePolicyFromJSON(object.maintenancePolicy) + : 0; + message.maintenanceGracePeriod = + object.maintenanceGracePeriod !== undefined && + object.maintenanceGracePeriod !== null + ? Duration.fromJSON(object.maintenanceGracePeriod) + : undefined; + message.serialPortSettings = + object.serialPortSettings !== undefined && + object.serialPortSettings !== null + ? SerialPortSettings.fromJSON(object.serialPortSettings) + : undefined; return message; }, @@ -2158,6 +2353,18 @@ export const UpdateInstanceRequest = { (obj.schedulingPolicy = message.schedulingPolicy ? SchedulingPolicy.toJSON(message.schedulingPolicy) : undefined); + message.maintenancePolicy !== undefined && + (obj.maintenancePolicy = maintenancePolicyToJSON( + message.maintenancePolicy + )); + message.maintenanceGracePeriod !== undefined && + (obj.maintenanceGracePeriod = message.maintenanceGracePeriod + ? Duration.toJSON(message.maintenanceGracePeriod) + : undefined); + message.serialPortSettings !== undefined && + (obj.serialPortSettings = message.serialPortSettings + ? SerialPortSettings.toJSON(message.serialPortSettings) + : undefined); return obj; }, @@ -2210,6 +2417,17 @@ export const UpdateInstanceRequest = { object.schedulingPolicy !== undefined && object.schedulingPolicy !== null ? SchedulingPolicy.fromPartial(object.schedulingPolicy) : undefined; + message.maintenancePolicy = object.maintenancePolicy ?? 0; + message.maintenanceGracePeriod = + object.maintenanceGracePeriod !== undefined && + object.maintenanceGracePeriod !== null + ? Duration.fromPartial(object.maintenanceGracePeriod) + : undefined; + message.serialPortSettings = + object.serialPortSettings !== undefined && + object.serialPortSettings !== null + ? SerialPortSettings.fromPartial(object.serialPortSettings) + : undefined; return message; }, }; @@ -4170,18 +4388,20 @@ messageTypeRegistry.set( DetachInstanceFilesystemMetadata ); -const baseAddInstanceOneToOneNatRequest: object = { - $type: "yandex.cloud.compute.v1.AddInstanceOneToOneNatRequest", +const baseAttachInstanceNetworkInterfaceRequest: object = { + $type: "yandex.cloud.compute.v1.AttachInstanceNetworkInterfaceRequest", instanceId: "", networkInterfaceIndex: "", - internalAddress: "", + subnetId: "", + securityGroupIds: "", }; -export const AddInstanceOneToOneNatRequest = { - $type: "yandex.cloud.compute.v1.AddInstanceOneToOneNatRequest" as const, +export const AttachInstanceNetworkInterfaceRequest = { + $type: + "yandex.cloud.compute.v1.AttachInstanceNetworkInterfaceRequest" as const, encode( - message: AddInstanceOneToOneNatRequest, + message: AttachInstanceNetworkInterfaceRequest, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.instanceId !== "") { @@ -4190,27 +4410,31 @@ export const AddInstanceOneToOneNatRequest = { if (message.networkInterfaceIndex !== "") { writer.uint32(18).string(message.networkInterfaceIndex); } - if (message.internalAddress !== "") { - writer.uint32(26).string(message.internalAddress); + if (message.subnetId !== "") { + writer.uint32(26).string(message.subnetId); } - if (message.oneToOneNatSpec !== undefined) { - OneToOneNatSpec.encode( - message.oneToOneNatSpec, + if (message.primaryV4AddressSpec !== undefined) { + PrimaryAddressSpec.encode( + message.primaryV4AddressSpec, writer.uint32(34).fork() ).ldelim(); } + for (const v of message.securityGroupIds) { + writer.uint32(50).string(v!); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): AddInstanceOneToOneNatRequest { + ): AttachInstanceNetworkInterfaceRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseAddInstanceOneToOneNatRequest, - } as AddInstanceOneToOneNatRequest; + ...baseAttachInstanceNetworkInterfaceRequest, + } as AttachInstanceNetworkInterfaceRequest; + message.securityGroupIds = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4221,14 +4445,17 @@ export const AddInstanceOneToOneNatRequest = { message.networkInterfaceIndex = reader.string(); break; case 3: - message.internalAddress = reader.string(); + message.subnetId = reader.string(); break; case 4: - message.oneToOneNatSpec = OneToOneNatSpec.decode( + message.primaryV4AddressSpec = PrimaryAddressSpec.decode( reader, reader.uint32() ); break; + case 6: + message.securityGroupIds.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -4237,10 +4464,10 @@ export const AddInstanceOneToOneNatRequest = { return message; }, - fromJSON(object: any): AddInstanceOneToOneNatRequest { + fromJSON(object: any): AttachInstanceNetworkInterfaceRequest { const message = { - ...baseAddInstanceOneToOneNatRequest, - } as AddInstanceOneToOneNatRequest; + ...baseAttachInstanceNetworkInterfaceRequest, + } as AttachInstanceNetworkInterfaceRequest; message.instanceId = object.instanceId !== undefined && object.instanceId !== null ? String(object.instanceId) @@ -4250,86 +4477,104 @@ export const AddInstanceOneToOneNatRequest = { object.networkInterfaceIndex !== null ? String(object.networkInterfaceIndex) : ""; - message.internalAddress = - object.internalAddress !== undefined && object.internalAddress !== null - ? String(object.internalAddress) + message.subnetId = + object.subnetId !== undefined && object.subnetId !== null + ? String(object.subnetId) : ""; - message.oneToOneNatSpec = - object.oneToOneNatSpec !== undefined && object.oneToOneNatSpec !== null - ? OneToOneNatSpec.fromJSON(object.oneToOneNatSpec) + message.primaryV4AddressSpec = + object.primaryV4AddressSpec !== undefined && + object.primaryV4AddressSpec !== null + ? PrimaryAddressSpec.fromJSON(object.primaryV4AddressSpec) : undefined; + message.securityGroupIds = (object.securityGroupIds ?? []).map((e: any) => + String(e) + ); return message; }, - toJSON(message: AddInstanceOneToOneNatRequest): unknown { + toJSON(message: AttachInstanceNetworkInterfaceRequest): unknown { const obj: any = {}; message.instanceId !== undefined && (obj.instanceId = message.instanceId); message.networkInterfaceIndex !== undefined && (obj.networkInterfaceIndex = message.networkInterfaceIndex); - message.internalAddress !== undefined && - (obj.internalAddress = message.internalAddress); - message.oneToOneNatSpec !== undefined && - (obj.oneToOneNatSpec = message.oneToOneNatSpec - ? OneToOneNatSpec.toJSON(message.oneToOneNatSpec) + message.subnetId !== undefined && (obj.subnetId = message.subnetId); + message.primaryV4AddressSpec !== undefined && + (obj.primaryV4AddressSpec = message.primaryV4AddressSpec + ? PrimaryAddressSpec.toJSON(message.primaryV4AddressSpec) : undefined); + if (message.securityGroupIds) { + obj.securityGroupIds = message.securityGroupIds.map((e) => e); + } else { + obj.securityGroupIds = []; + } return obj; }, - fromPartial, I>>( - object: I - ): AddInstanceOneToOneNatRequest { + fromPartial< + I extends Exact, I> + >(object: I): AttachInstanceNetworkInterfaceRequest { const message = { - ...baseAddInstanceOneToOneNatRequest, - } as AddInstanceOneToOneNatRequest; + ...baseAttachInstanceNetworkInterfaceRequest, + } as AttachInstanceNetworkInterfaceRequest; message.instanceId = object.instanceId ?? ""; message.networkInterfaceIndex = object.networkInterfaceIndex ?? ""; - message.internalAddress = object.internalAddress ?? ""; - message.oneToOneNatSpec = - object.oneToOneNatSpec !== undefined && object.oneToOneNatSpec !== null - ? OneToOneNatSpec.fromPartial(object.oneToOneNatSpec) + message.subnetId = object.subnetId ?? ""; + message.primaryV4AddressSpec = + object.primaryV4AddressSpec !== undefined && + object.primaryV4AddressSpec !== null + ? PrimaryAddressSpec.fromPartial(object.primaryV4AddressSpec) : undefined; + message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; return message; }, }; messageTypeRegistry.set( - AddInstanceOneToOneNatRequest.$type, - AddInstanceOneToOneNatRequest + AttachInstanceNetworkInterfaceRequest.$type, + AttachInstanceNetworkInterfaceRequest ); -const baseAddInstanceOneToOneNatMetadata: object = { - $type: "yandex.cloud.compute.v1.AddInstanceOneToOneNatMetadata", +const baseAttachInstanceNetworkInterfaceMetadata: object = { + $type: "yandex.cloud.compute.v1.AttachInstanceNetworkInterfaceMetadata", instanceId: "", + networkInterfaceIndex: "", }; -export const AddInstanceOneToOneNatMetadata = { - $type: "yandex.cloud.compute.v1.AddInstanceOneToOneNatMetadata" as const, +export const AttachInstanceNetworkInterfaceMetadata = { + $type: + "yandex.cloud.compute.v1.AttachInstanceNetworkInterfaceMetadata" as const, encode( - message: AddInstanceOneToOneNatMetadata, + message: AttachInstanceNetworkInterfaceMetadata, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.instanceId !== "") { writer.uint32(10).string(message.instanceId); } + if (message.networkInterfaceIndex !== "") { + writer.uint32(18).string(message.networkInterfaceIndex); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): AddInstanceOneToOneNatMetadata { + ): AttachInstanceNetworkInterfaceMetadata { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseAddInstanceOneToOneNatMetadata, - } as AddInstanceOneToOneNatMetadata; + ...baseAttachInstanceNetworkInterfaceMetadata, + } as AttachInstanceNetworkInterfaceMetadata; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.instanceId = reader.string(); break; + case 2: + message.networkInterfaceIndex = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -4338,51 +4583,59 @@ export const AddInstanceOneToOneNatMetadata = { return message; }, - fromJSON(object: any): AddInstanceOneToOneNatMetadata { + fromJSON(object: any): AttachInstanceNetworkInterfaceMetadata { const message = { - ...baseAddInstanceOneToOneNatMetadata, - } as AddInstanceOneToOneNatMetadata; + ...baseAttachInstanceNetworkInterfaceMetadata, + } as AttachInstanceNetworkInterfaceMetadata; message.instanceId = object.instanceId !== undefined && object.instanceId !== null ? String(object.instanceId) : ""; + message.networkInterfaceIndex = + object.networkInterfaceIndex !== undefined && + object.networkInterfaceIndex !== null + ? String(object.networkInterfaceIndex) + : ""; return message; }, - toJSON(message: AddInstanceOneToOneNatMetadata): unknown { + toJSON(message: AttachInstanceNetworkInterfaceMetadata): unknown { const obj: any = {}; message.instanceId !== undefined && (obj.instanceId = message.instanceId); + message.networkInterfaceIndex !== undefined && + (obj.networkInterfaceIndex = message.networkInterfaceIndex); return obj; }, - fromPartial, I>>( - object: I - ): AddInstanceOneToOneNatMetadata { + fromPartial< + I extends Exact, I> + >(object: I): AttachInstanceNetworkInterfaceMetadata { const message = { - ...baseAddInstanceOneToOneNatMetadata, - } as AddInstanceOneToOneNatMetadata; + ...baseAttachInstanceNetworkInterfaceMetadata, + } as AttachInstanceNetworkInterfaceMetadata; message.instanceId = object.instanceId ?? ""; + message.networkInterfaceIndex = object.networkInterfaceIndex ?? ""; return message; }, }; messageTypeRegistry.set( - AddInstanceOneToOneNatMetadata.$type, - AddInstanceOneToOneNatMetadata + AttachInstanceNetworkInterfaceMetadata.$type, + AttachInstanceNetworkInterfaceMetadata ); -const baseRemoveInstanceOneToOneNatRequest: object = { - $type: "yandex.cloud.compute.v1.RemoveInstanceOneToOneNatRequest", +const baseDetachInstanceNetworkInterfaceRequest: object = { + $type: "yandex.cloud.compute.v1.DetachInstanceNetworkInterfaceRequest", instanceId: "", networkInterfaceIndex: "", - internalAddress: "", }; -export const RemoveInstanceOneToOneNatRequest = { - $type: "yandex.cloud.compute.v1.RemoveInstanceOneToOneNatRequest" as const, +export const DetachInstanceNetworkInterfaceRequest = { + $type: + "yandex.cloud.compute.v1.DetachInstanceNetworkInterfaceRequest" as const, encode( - message: RemoveInstanceOneToOneNatRequest, + message: DetachInstanceNetworkInterfaceRequest, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.instanceId !== "") { @@ -4391,16 +4644,397 @@ export const RemoveInstanceOneToOneNatRequest = { if (message.networkInterfaceIndex !== "") { writer.uint32(18).string(message.networkInterfaceIndex); } - if (message.internalAddress !== "") { - writer.uint32(26).string(message.internalAddress); - } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): RemoveInstanceOneToOneNatRequest { + ): DetachInstanceNetworkInterfaceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDetachInstanceNetworkInterfaceRequest, + } as DetachInstanceNetworkInterfaceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.instanceId = reader.string(); + break; + case 2: + message.networkInterfaceIndex = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DetachInstanceNetworkInterfaceRequest { + const message = { + ...baseDetachInstanceNetworkInterfaceRequest, + } as DetachInstanceNetworkInterfaceRequest; + message.instanceId = + object.instanceId !== undefined && object.instanceId !== null + ? String(object.instanceId) + : ""; + message.networkInterfaceIndex = + object.networkInterfaceIndex !== undefined && + object.networkInterfaceIndex !== null + ? String(object.networkInterfaceIndex) + : ""; + return message; + }, + + toJSON(message: DetachInstanceNetworkInterfaceRequest): unknown { + const obj: any = {}; + message.instanceId !== undefined && (obj.instanceId = message.instanceId); + message.networkInterfaceIndex !== undefined && + (obj.networkInterfaceIndex = message.networkInterfaceIndex); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): DetachInstanceNetworkInterfaceRequest { + const message = { + ...baseDetachInstanceNetworkInterfaceRequest, + } as DetachInstanceNetworkInterfaceRequest; + message.instanceId = object.instanceId ?? ""; + message.networkInterfaceIndex = object.networkInterfaceIndex ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DetachInstanceNetworkInterfaceRequest.$type, + DetachInstanceNetworkInterfaceRequest +); + +const baseDetachInstanceNetworkInterfaceMetadata: object = { + $type: "yandex.cloud.compute.v1.DetachInstanceNetworkInterfaceMetadata", + instanceId: "", + networkInterfaceIndex: "", +}; + +export const DetachInstanceNetworkInterfaceMetadata = { + $type: + "yandex.cloud.compute.v1.DetachInstanceNetworkInterfaceMetadata" as const, + + encode( + message: DetachInstanceNetworkInterfaceMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.instanceId !== "") { + writer.uint32(10).string(message.instanceId); + } + if (message.networkInterfaceIndex !== "") { + writer.uint32(18).string(message.networkInterfaceIndex); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DetachInstanceNetworkInterfaceMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDetachInstanceNetworkInterfaceMetadata, + } as DetachInstanceNetworkInterfaceMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.instanceId = reader.string(); + break; + case 2: + message.networkInterfaceIndex = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DetachInstanceNetworkInterfaceMetadata { + const message = { + ...baseDetachInstanceNetworkInterfaceMetadata, + } as DetachInstanceNetworkInterfaceMetadata; + message.instanceId = + object.instanceId !== undefined && object.instanceId !== null + ? String(object.instanceId) + : ""; + message.networkInterfaceIndex = + object.networkInterfaceIndex !== undefined && + object.networkInterfaceIndex !== null + ? String(object.networkInterfaceIndex) + : ""; + return message; + }, + + toJSON(message: DetachInstanceNetworkInterfaceMetadata): unknown { + const obj: any = {}; + message.instanceId !== undefined && (obj.instanceId = message.instanceId); + message.networkInterfaceIndex !== undefined && + (obj.networkInterfaceIndex = message.networkInterfaceIndex); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): DetachInstanceNetworkInterfaceMetadata { + const message = { + ...baseDetachInstanceNetworkInterfaceMetadata, + } as DetachInstanceNetworkInterfaceMetadata; + message.instanceId = object.instanceId ?? ""; + message.networkInterfaceIndex = object.networkInterfaceIndex ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DetachInstanceNetworkInterfaceMetadata.$type, + DetachInstanceNetworkInterfaceMetadata +); + +const baseAddInstanceOneToOneNatRequest: object = { + $type: "yandex.cloud.compute.v1.AddInstanceOneToOneNatRequest", + instanceId: "", + networkInterfaceIndex: "", + internalAddress: "", +}; + +export const AddInstanceOneToOneNatRequest = { + $type: "yandex.cloud.compute.v1.AddInstanceOneToOneNatRequest" as const, + + encode( + message: AddInstanceOneToOneNatRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.instanceId !== "") { + writer.uint32(10).string(message.instanceId); + } + if (message.networkInterfaceIndex !== "") { + writer.uint32(18).string(message.networkInterfaceIndex); + } + if (message.internalAddress !== "") { + writer.uint32(26).string(message.internalAddress); + } + if (message.oneToOneNatSpec !== undefined) { + OneToOneNatSpec.encode( + message.oneToOneNatSpec, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AddInstanceOneToOneNatRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAddInstanceOneToOneNatRequest, + } as AddInstanceOneToOneNatRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.instanceId = reader.string(); + break; + case 2: + message.networkInterfaceIndex = reader.string(); + break; + case 3: + message.internalAddress = reader.string(); + break; + case 4: + message.oneToOneNatSpec = OneToOneNatSpec.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AddInstanceOneToOneNatRequest { + const message = { + ...baseAddInstanceOneToOneNatRequest, + } as AddInstanceOneToOneNatRequest; + message.instanceId = + object.instanceId !== undefined && object.instanceId !== null + ? String(object.instanceId) + : ""; + message.networkInterfaceIndex = + object.networkInterfaceIndex !== undefined && + object.networkInterfaceIndex !== null + ? String(object.networkInterfaceIndex) + : ""; + message.internalAddress = + object.internalAddress !== undefined && object.internalAddress !== null + ? String(object.internalAddress) + : ""; + message.oneToOneNatSpec = + object.oneToOneNatSpec !== undefined && object.oneToOneNatSpec !== null + ? OneToOneNatSpec.fromJSON(object.oneToOneNatSpec) + : undefined; + return message; + }, + + toJSON(message: AddInstanceOneToOneNatRequest): unknown { + const obj: any = {}; + message.instanceId !== undefined && (obj.instanceId = message.instanceId); + message.networkInterfaceIndex !== undefined && + (obj.networkInterfaceIndex = message.networkInterfaceIndex); + message.internalAddress !== undefined && + (obj.internalAddress = message.internalAddress); + message.oneToOneNatSpec !== undefined && + (obj.oneToOneNatSpec = message.oneToOneNatSpec + ? OneToOneNatSpec.toJSON(message.oneToOneNatSpec) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): AddInstanceOneToOneNatRequest { + const message = { + ...baseAddInstanceOneToOneNatRequest, + } as AddInstanceOneToOneNatRequest; + message.instanceId = object.instanceId ?? ""; + message.networkInterfaceIndex = object.networkInterfaceIndex ?? ""; + message.internalAddress = object.internalAddress ?? ""; + message.oneToOneNatSpec = + object.oneToOneNatSpec !== undefined && object.oneToOneNatSpec !== null + ? OneToOneNatSpec.fromPartial(object.oneToOneNatSpec) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + AddInstanceOneToOneNatRequest.$type, + AddInstanceOneToOneNatRequest +); + +const baseAddInstanceOneToOneNatMetadata: object = { + $type: "yandex.cloud.compute.v1.AddInstanceOneToOneNatMetadata", + instanceId: "", +}; + +export const AddInstanceOneToOneNatMetadata = { + $type: "yandex.cloud.compute.v1.AddInstanceOneToOneNatMetadata" as const, + + encode( + message: AddInstanceOneToOneNatMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.instanceId !== "") { + writer.uint32(10).string(message.instanceId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AddInstanceOneToOneNatMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAddInstanceOneToOneNatMetadata, + } as AddInstanceOneToOneNatMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.instanceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AddInstanceOneToOneNatMetadata { + const message = { + ...baseAddInstanceOneToOneNatMetadata, + } as AddInstanceOneToOneNatMetadata; + message.instanceId = + object.instanceId !== undefined && object.instanceId !== null + ? String(object.instanceId) + : ""; + return message; + }, + + toJSON(message: AddInstanceOneToOneNatMetadata): unknown { + const obj: any = {}; + message.instanceId !== undefined && (obj.instanceId = message.instanceId); + return obj; + }, + + fromPartial, I>>( + object: I + ): AddInstanceOneToOneNatMetadata { + const message = { + ...baseAddInstanceOneToOneNatMetadata, + } as AddInstanceOneToOneNatMetadata; + message.instanceId = object.instanceId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + AddInstanceOneToOneNatMetadata.$type, + AddInstanceOneToOneNatMetadata +); + +const baseRemoveInstanceOneToOneNatRequest: object = { + $type: "yandex.cloud.compute.v1.RemoveInstanceOneToOneNatRequest", + instanceId: "", + networkInterfaceIndex: "", + internalAddress: "", +}; + +export const RemoveInstanceOneToOneNatRequest = { + $type: "yandex.cloud.compute.v1.RemoveInstanceOneToOneNatRequest" as const, + + encode( + message: RemoveInstanceOneToOneNatRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.instanceId !== "") { + writer.uint32(10).string(message.instanceId); + } + if (message.networkInterfaceIndex !== "") { + writer.uint32(18).string(message.networkInterfaceIndex); + } + if (message.internalAddress !== "") { + writer.uint32(26).string(message.internalAddress); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RemoveInstanceOneToOneNatRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { @@ -4642,143 +5276,301 @@ export const UpdateInstanceNetworkInterfaceRequest = { return message; }, - fromJSON(object: any): UpdateInstanceNetworkInterfaceRequest { + fromJSON(object: any): UpdateInstanceNetworkInterfaceRequest { + const message = { + ...baseUpdateInstanceNetworkInterfaceRequest, + } as UpdateInstanceNetworkInterfaceRequest; + message.instanceId = + object.instanceId !== undefined && object.instanceId !== null + ? String(object.instanceId) + : ""; + message.networkInterfaceIndex = + object.networkInterfaceIndex !== undefined && + object.networkInterfaceIndex !== null + ? String(object.networkInterfaceIndex) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.subnetId = + object.subnetId !== undefined && object.subnetId !== null + ? String(object.subnetId) + : ""; + message.primaryV4AddressSpec = + object.primaryV4AddressSpec !== undefined && + object.primaryV4AddressSpec !== null + ? PrimaryAddressSpec.fromJSON(object.primaryV4AddressSpec) + : undefined; + message.primaryV6AddressSpec = + object.primaryV6AddressSpec !== undefined && + object.primaryV6AddressSpec !== null + ? PrimaryAddressSpec.fromJSON(object.primaryV6AddressSpec) + : undefined; + message.securityGroupIds = (object.securityGroupIds ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: UpdateInstanceNetworkInterfaceRequest): unknown { + const obj: any = {}; + message.instanceId !== undefined && (obj.instanceId = message.instanceId); + message.networkInterfaceIndex !== undefined && + (obj.networkInterfaceIndex = message.networkInterfaceIndex); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.subnetId !== undefined && (obj.subnetId = message.subnetId); + message.primaryV4AddressSpec !== undefined && + (obj.primaryV4AddressSpec = message.primaryV4AddressSpec + ? PrimaryAddressSpec.toJSON(message.primaryV4AddressSpec) + : undefined); + message.primaryV6AddressSpec !== undefined && + (obj.primaryV6AddressSpec = message.primaryV6AddressSpec + ? PrimaryAddressSpec.toJSON(message.primaryV6AddressSpec) + : undefined); + if (message.securityGroupIds) { + obj.securityGroupIds = message.securityGroupIds.map((e) => e); + } else { + obj.securityGroupIds = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateInstanceNetworkInterfaceRequest { + const message = { + ...baseUpdateInstanceNetworkInterfaceRequest, + } as UpdateInstanceNetworkInterfaceRequest; + message.instanceId = object.instanceId ?? ""; + message.networkInterfaceIndex = object.networkInterfaceIndex ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.subnetId = object.subnetId ?? ""; + message.primaryV4AddressSpec = + object.primaryV4AddressSpec !== undefined && + object.primaryV4AddressSpec !== null + ? PrimaryAddressSpec.fromPartial(object.primaryV4AddressSpec) + : undefined; + message.primaryV6AddressSpec = + object.primaryV6AddressSpec !== undefined && + object.primaryV6AddressSpec !== null + ? PrimaryAddressSpec.fromPartial(object.primaryV6AddressSpec) + : undefined; + message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateInstanceNetworkInterfaceRequest.$type, + UpdateInstanceNetworkInterfaceRequest +); + +const baseUpdateInstanceNetworkInterfaceMetadata: object = { + $type: "yandex.cloud.compute.v1.UpdateInstanceNetworkInterfaceMetadata", + instanceId: "", + networkInterfaceIndex: "", +}; + +export const UpdateInstanceNetworkInterfaceMetadata = { + $type: + "yandex.cloud.compute.v1.UpdateInstanceNetworkInterfaceMetadata" as const, + + encode( + message: UpdateInstanceNetworkInterfaceMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.instanceId !== "") { + writer.uint32(10).string(message.instanceId); + } + if (message.networkInterfaceIndex !== "") { + writer.uint32(18).string(message.networkInterfaceIndex); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateInstanceNetworkInterfaceMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateInstanceNetworkInterfaceMetadata, + } as UpdateInstanceNetworkInterfaceMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.instanceId = reader.string(); + break; + case 2: + message.networkInterfaceIndex = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateInstanceNetworkInterfaceMetadata { + const message = { + ...baseUpdateInstanceNetworkInterfaceMetadata, + } as UpdateInstanceNetworkInterfaceMetadata; + message.instanceId = + object.instanceId !== undefined && object.instanceId !== null + ? String(object.instanceId) + : ""; + message.networkInterfaceIndex = + object.networkInterfaceIndex !== undefined && + object.networkInterfaceIndex !== null + ? String(object.networkInterfaceIndex) + : ""; + return message; + }, + + toJSON(message: UpdateInstanceNetworkInterfaceMetadata): unknown { + const obj: any = {}; + message.instanceId !== undefined && (obj.instanceId = message.instanceId); + message.networkInterfaceIndex !== undefined && + (obj.networkInterfaceIndex = message.networkInterfaceIndex); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateInstanceNetworkInterfaceMetadata { + const message = { + ...baseUpdateInstanceNetworkInterfaceMetadata, + } as UpdateInstanceNetworkInterfaceMetadata; + message.instanceId = object.instanceId ?? ""; + message.networkInterfaceIndex = object.networkInterfaceIndex ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateInstanceNetworkInterfaceMetadata.$type, + UpdateInstanceNetworkInterfaceMetadata +); + +const baseSimulateInstanceMaintenanceEventRequest: object = { + $type: "yandex.cloud.compute.v1.SimulateInstanceMaintenanceEventRequest", + instanceId: "", +}; + +export const SimulateInstanceMaintenanceEventRequest = { + $type: + "yandex.cloud.compute.v1.SimulateInstanceMaintenanceEventRequest" as const, + + encode( + message: SimulateInstanceMaintenanceEventRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.instanceId !== "") { + writer.uint32(10).string(message.instanceId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SimulateInstanceMaintenanceEventRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSimulateInstanceMaintenanceEventRequest, + } as SimulateInstanceMaintenanceEventRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.instanceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SimulateInstanceMaintenanceEventRequest { const message = { - ...baseUpdateInstanceNetworkInterfaceRequest, - } as UpdateInstanceNetworkInterfaceRequest; + ...baseSimulateInstanceMaintenanceEventRequest, + } as SimulateInstanceMaintenanceEventRequest; message.instanceId = object.instanceId !== undefined && object.instanceId !== null ? String(object.instanceId) : ""; - message.networkInterfaceIndex = - object.networkInterfaceIndex !== undefined && - object.networkInterfaceIndex !== null - ? String(object.networkInterfaceIndex) - : ""; - message.updateMask = - object.updateMask !== undefined && object.updateMask !== null - ? FieldMask.fromJSON(object.updateMask) - : undefined; - message.subnetId = - object.subnetId !== undefined && object.subnetId !== null - ? String(object.subnetId) - : ""; - message.primaryV4AddressSpec = - object.primaryV4AddressSpec !== undefined && - object.primaryV4AddressSpec !== null - ? PrimaryAddressSpec.fromJSON(object.primaryV4AddressSpec) - : undefined; - message.primaryV6AddressSpec = - object.primaryV6AddressSpec !== undefined && - object.primaryV6AddressSpec !== null - ? PrimaryAddressSpec.fromJSON(object.primaryV6AddressSpec) - : undefined; - message.securityGroupIds = (object.securityGroupIds ?? []).map((e: any) => - String(e) - ); return message; }, - toJSON(message: UpdateInstanceNetworkInterfaceRequest): unknown { + toJSON(message: SimulateInstanceMaintenanceEventRequest): unknown { const obj: any = {}; message.instanceId !== undefined && (obj.instanceId = message.instanceId); - message.networkInterfaceIndex !== undefined && - (obj.networkInterfaceIndex = message.networkInterfaceIndex); - message.updateMask !== undefined && - (obj.updateMask = message.updateMask - ? FieldMask.toJSON(message.updateMask) - : undefined); - message.subnetId !== undefined && (obj.subnetId = message.subnetId); - message.primaryV4AddressSpec !== undefined && - (obj.primaryV4AddressSpec = message.primaryV4AddressSpec - ? PrimaryAddressSpec.toJSON(message.primaryV4AddressSpec) - : undefined); - message.primaryV6AddressSpec !== undefined && - (obj.primaryV6AddressSpec = message.primaryV6AddressSpec - ? PrimaryAddressSpec.toJSON(message.primaryV6AddressSpec) - : undefined); - if (message.securityGroupIds) { - obj.securityGroupIds = message.securityGroupIds.map((e) => e); - } else { - obj.securityGroupIds = []; - } return obj; }, fromPartial< - I extends Exact, I> - >(object: I): UpdateInstanceNetworkInterfaceRequest { + I extends Exact, I> + >(object: I): SimulateInstanceMaintenanceEventRequest { const message = { - ...baseUpdateInstanceNetworkInterfaceRequest, - } as UpdateInstanceNetworkInterfaceRequest; + ...baseSimulateInstanceMaintenanceEventRequest, + } as SimulateInstanceMaintenanceEventRequest; message.instanceId = object.instanceId ?? ""; - message.networkInterfaceIndex = object.networkInterfaceIndex ?? ""; - message.updateMask = - object.updateMask !== undefined && object.updateMask !== null - ? FieldMask.fromPartial(object.updateMask) - : undefined; - message.subnetId = object.subnetId ?? ""; - message.primaryV4AddressSpec = - object.primaryV4AddressSpec !== undefined && - object.primaryV4AddressSpec !== null - ? PrimaryAddressSpec.fromPartial(object.primaryV4AddressSpec) - : undefined; - message.primaryV6AddressSpec = - object.primaryV6AddressSpec !== undefined && - object.primaryV6AddressSpec !== null - ? PrimaryAddressSpec.fromPartial(object.primaryV6AddressSpec) - : undefined; - message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; return message; }, }; messageTypeRegistry.set( - UpdateInstanceNetworkInterfaceRequest.$type, - UpdateInstanceNetworkInterfaceRequest + SimulateInstanceMaintenanceEventRequest.$type, + SimulateInstanceMaintenanceEventRequest ); -const baseUpdateInstanceNetworkInterfaceMetadata: object = { - $type: "yandex.cloud.compute.v1.UpdateInstanceNetworkInterfaceMetadata", +const baseSimulateInstanceMaintenanceEventMetadata: object = { + $type: "yandex.cloud.compute.v1.SimulateInstanceMaintenanceEventMetadata", instanceId: "", - networkInterfaceIndex: "", }; -export const UpdateInstanceNetworkInterfaceMetadata = { +export const SimulateInstanceMaintenanceEventMetadata = { $type: - "yandex.cloud.compute.v1.UpdateInstanceNetworkInterfaceMetadata" as const, + "yandex.cloud.compute.v1.SimulateInstanceMaintenanceEventMetadata" as const, encode( - message: UpdateInstanceNetworkInterfaceMetadata, + message: SimulateInstanceMaintenanceEventMetadata, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.instanceId !== "") { writer.uint32(10).string(message.instanceId); } - if (message.networkInterfaceIndex !== "") { - writer.uint32(18).string(message.networkInterfaceIndex); - } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): UpdateInstanceNetworkInterfaceMetadata { + ): SimulateInstanceMaintenanceEventMetadata { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseUpdateInstanceNetworkInterfaceMetadata, - } as UpdateInstanceNetworkInterfaceMetadata; + ...baseSimulateInstanceMaintenanceEventMetadata, + } as SimulateInstanceMaintenanceEventMetadata; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.instanceId = reader.string(); break; - case 2: - message.networkInterfaceIndex = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -4787,45 +5579,37 @@ export const UpdateInstanceNetworkInterfaceMetadata = { return message; }, - fromJSON(object: any): UpdateInstanceNetworkInterfaceMetadata { + fromJSON(object: any): SimulateInstanceMaintenanceEventMetadata { const message = { - ...baseUpdateInstanceNetworkInterfaceMetadata, - } as UpdateInstanceNetworkInterfaceMetadata; + ...baseSimulateInstanceMaintenanceEventMetadata, + } as SimulateInstanceMaintenanceEventMetadata; message.instanceId = object.instanceId !== undefined && object.instanceId !== null ? String(object.instanceId) : ""; - message.networkInterfaceIndex = - object.networkInterfaceIndex !== undefined && - object.networkInterfaceIndex !== null - ? String(object.networkInterfaceIndex) - : ""; return message; }, - toJSON(message: UpdateInstanceNetworkInterfaceMetadata): unknown { + toJSON(message: SimulateInstanceMaintenanceEventMetadata): unknown { const obj: any = {}; message.instanceId !== undefined && (obj.instanceId = message.instanceId); - message.networkInterfaceIndex !== undefined && - (obj.networkInterfaceIndex = message.networkInterfaceIndex); return obj; }, fromPartial< - I extends Exact, I> - >(object: I): UpdateInstanceNetworkInterfaceMetadata { + I extends Exact, I> + >(object: I): SimulateInstanceMaintenanceEventMetadata { const message = { - ...baseUpdateInstanceNetworkInterfaceMetadata, - } as UpdateInstanceNetworkInterfaceMetadata; + ...baseSimulateInstanceMaintenanceEventMetadata, + } as SimulateInstanceMaintenanceEventMetadata; message.instanceId = object.instanceId ?? ""; - message.networkInterfaceIndex = object.networkInterfaceIndex ?? ""; return message; }, }; messageTypeRegistry.set( - UpdateInstanceNetworkInterfaceMetadata.$type, - UpdateInstanceNetworkInterfaceMetadata + SimulateInstanceMaintenanceEventMetadata.$type, + SimulateInstanceMaintenanceEventMetadata ); const baseListInstanceOperationsRequest: object = { @@ -5590,6 +6374,7 @@ const baseNetworkInterfaceSpec: object = { $type: "yandex.cloud.compute.v1.NetworkInterfaceSpec", subnetId: "", securityGroupIds: "", + index: "", }; export const NetworkInterfaceSpec = { @@ -5617,6 +6402,9 @@ export const NetworkInterfaceSpec = { for (const v of message.securityGroupIds) { writer.uint32(50).string(v!); } + if (message.index !== "") { + writer.uint32(58).string(message.index); + } return writer; }, @@ -5649,6 +6437,9 @@ export const NetworkInterfaceSpec = { case 6: message.securityGroupIds.push(reader.string()); break; + case 7: + message.index = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -5676,6 +6467,10 @@ export const NetworkInterfaceSpec = { message.securityGroupIds = (object.securityGroupIds ?? []).map((e: any) => String(e) ); + message.index = + object.index !== undefined && object.index !== null + ? String(object.index) + : ""; return message; }, @@ -5695,6 +6490,7 @@ export const NetworkInterfaceSpec = { } else { obj.securityGroupIds = []; } + message.index !== undefined && (obj.index = message.index); return obj; }, @@ -5714,6 +6510,7 @@ export const NetworkInterfaceSpec = { ? PrimaryAddressSpec.fromPartial(object.primaryV6AddressSpec) : undefined; message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; + message.index = object.index ?? ""; return message; }, }; @@ -6213,6 +7010,18 @@ export const RelocateInstanceRequest = { if (message.destinationZoneId !== "") { writer.uint32(18).string(message.destinationZoneId); } + for (const v of message.networkInterfaceSpecs) { + NetworkInterfaceSpec.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.bootDiskPlacement !== undefined) { + DiskPlacementPolicy.encode( + message.bootDiskPlacement, + writer.uint32(34).fork() + ).ldelim(); + } + for (const v of message.secondaryDiskPlacements) { + DiskPlacementPolicyChange.encode(v!, writer.uint32(42).fork()).ldelim(); + } return writer; }, @@ -6225,6 +7034,8 @@ export const RelocateInstanceRequest = { const message = { ...baseRelocateInstanceRequest, } as RelocateInstanceRequest; + message.networkInterfaceSpecs = []; + message.secondaryDiskPlacements = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6234,6 +7045,22 @@ export const RelocateInstanceRequest = { case 2: message.destinationZoneId = reader.string(); break; + case 3: + message.networkInterfaceSpecs.push( + NetworkInterfaceSpec.decode(reader, reader.uint32()) + ); + break; + case 4: + message.bootDiskPlacement = DiskPlacementPolicy.decode( + reader, + reader.uint32() + ); + break; + case 5: + message.secondaryDiskPlacements.push( + DiskPlacementPolicyChange.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -6255,6 +7082,17 @@ export const RelocateInstanceRequest = { object.destinationZoneId !== null ? String(object.destinationZoneId) : ""; + message.networkInterfaceSpecs = (object.networkInterfaceSpecs ?? []).map( + (e: any) => NetworkInterfaceSpec.fromJSON(e) + ); + message.bootDiskPlacement = + object.bootDiskPlacement !== undefined && + object.bootDiskPlacement !== null + ? DiskPlacementPolicy.fromJSON(object.bootDiskPlacement) + : undefined; + message.secondaryDiskPlacements = ( + object.secondaryDiskPlacements ?? [] + ).map((e: any) => DiskPlacementPolicyChange.fromJSON(e)); return message; }, @@ -6263,6 +7101,24 @@ export const RelocateInstanceRequest = { message.instanceId !== undefined && (obj.instanceId = message.instanceId); message.destinationZoneId !== undefined && (obj.destinationZoneId = message.destinationZoneId); + if (message.networkInterfaceSpecs) { + obj.networkInterfaceSpecs = message.networkInterfaceSpecs.map((e) => + e ? NetworkInterfaceSpec.toJSON(e) : undefined + ); + } else { + obj.networkInterfaceSpecs = []; + } + message.bootDiskPlacement !== undefined && + (obj.bootDiskPlacement = message.bootDiskPlacement + ? DiskPlacementPolicy.toJSON(message.bootDiskPlacement) + : undefined); + if (message.secondaryDiskPlacements) { + obj.secondaryDiskPlacements = message.secondaryDiskPlacements.map((e) => + e ? DiskPlacementPolicyChange.toJSON(e) : undefined + ); + } else { + obj.secondaryDiskPlacements = []; + } return obj; }, @@ -6274,6 +7130,19 @@ export const RelocateInstanceRequest = { } as RelocateInstanceRequest; message.instanceId = object.instanceId ?? ""; message.destinationZoneId = object.destinationZoneId ?? ""; + message.networkInterfaceSpecs = + object.networkInterfaceSpecs?.map((e) => + NetworkInterfaceSpec.fromPartial(e) + ) || []; + message.bootDiskPlacement = + object.bootDiskPlacement !== undefined && + object.bootDiskPlacement !== null + ? DiskPlacementPolicy.fromPartial(object.bootDiskPlacement) + : undefined; + message.secondaryDiskPlacements = + object.secondaryDiskPlacements?.map((e) => + DiskPlacementPolicyChange.fromPartial(e) + ) || []; return message; }, }; @@ -6760,10 +7629,6 @@ export const InstanceServiceService = { * * The instance and the filesystem must reside in the same availability zone. * - * To attach a filesystem, the instance must have a `STOPPED` status ([Instance.status]). - * To check the instance status, make a [InstanceService.Get] request. - * To stop the running instance, make a [InstanceService.Stop] request. - * * To use the instance with an attached filesystem, the latter must be mounted. * For details, see [documentation](/docs/compute/operations/filesystem/attach-to-vm). */ @@ -6779,13 +7644,7 @@ export const InstanceServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, - /** - * Detaches the filesystem from the instance. - * - * To detach a filesystem, the instance must have a `STOPPED` status ([Instance.status]). - * To check the instance status, make a [InstanceService.Get] request. - * To stop the running instance, make a [InstanceService.Stop] request. - */ + /** Detaches the filesystem from the instance. */ detachFilesystem: { path: "/yandex.cloud.compute.v1.InstanceService/DetachFilesystem", requestStream: false, @@ -6798,6 +7657,44 @@ export const InstanceServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** + * Attaches the network-interface to the instance. + * + * To attach a network-interface, the instance must have a `STOPPED` status ([Instance.status]). + * To check the instance status, make a [InstanceService.Get] request. + * To stop the running instance, make a [InstanceService.Stop] request. + */ + attachNetworkInterface: { + path: "/yandex.cloud.compute.v1.InstanceService/AttachNetworkInterface", + requestStream: false, + responseStream: false, + requestSerialize: (value: AttachInstanceNetworkInterfaceRequest) => + Buffer.from(AttachInstanceNetworkInterfaceRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + AttachInstanceNetworkInterfaceRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** + * Detaches the network-interface to the instance. + * + * To Detach a network-interface, the instance must have a `STOPPED` status ([Instance.status]). + * To check the instance status, make a [InstanceService.Get] request. + * To stop the running instance, make a [InstanceService.Stop] request. + */ + detachNetworkInterface: { + path: "/yandex.cloud.compute.v1.InstanceService/DetachNetworkInterface", + requestStream: false, + responseStream: false, + requestSerialize: (value: DetachInstanceNetworkInterfaceRequest) => + Buffer.from(DetachInstanceNetworkInterfaceRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DetachInstanceNetworkInterfaceRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, /** Enables One-to-one NAT on the network interface. */ addOneToOneNat: { path: "/yandex.cloud.compute.v1.InstanceService/AddOneToOneNat", @@ -6887,6 +7784,20 @@ export const InstanceServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + simulateMaintenanceEvent: { + path: "/yandex.cloud.compute.v1.InstanceService/SimulateMaintenanceEvent", + requestStream: false, + responseStream: false, + requestSerialize: (value: SimulateInstanceMaintenanceEventRequest) => + Buffer.from( + SimulateInstanceMaintenanceEventRequest.encode(value).finish() + ), + requestDeserialize: (value: Buffer) => + SimulateInstanceMaintenanceEventRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, /** Lists access bindings for the instance. */ listAccessBindings: { path: "/yandex.cloud.compute.v1.InstanceService/ListAccessBindings", @@ -6973,22 +7884,34 @@ export interface InstanceServiceServer extends UntypedServiceImplementation { * * The instance and the filesystem must reside in the same availability zone. * - * To attach a filesystem, the instance must have a `STOPPED` status ([Instance.status]). - * To check the instance status, make a [InstanceService.Get] request. - * To stop the running instance, make a [InstanceService.Stop] request. - * * To use the instance with an attached filesystem, the latter must be mounted. * For details, see [documentation](/docs/compute/operations/filesystem/attach-to-vm). */ attachFilesystem: handleUnaryCall; + /** Detaches the filesystem from the instance. */ + detachFilesystem: handleUnaryCall; /** - * Detaches the filesystem from the instance. + * Attaches the network-interface to the instance. * - * To detach a filesystem, the instance must have a `STOPPED` status ([Instance.status]). + * To attach a network-interface, the instance must have a `STOPPED` status ([Instance.status]). * To check the instance status, make a [InstanceService.Get] request. * To stop the running instance, make a [InstanceService.Stop] request. */ - detachFilesystem: handleUnaryCall; + attachNetworkInterface: handleUnaryCall< + AttachInstanceNetworkInterfaceRequest, + Operation + >; + /** + * Detaches the network-interface to the instance. + * + * To Detach a network-interface, the instance must have a `STOPPED` status ([Instance.status]). + * To check the instance status, make a [InstanceService.Get] request. + * To stop the running instance, make a [InstanceService.Stop] request. + */ + detachNetworkInterface: handleUnaryCall< + DetachInstanceNetworkInterfaceRequest, + Operation + >; /** Enables One-to-one NAT on the network interface. */ addOneToOneNat: handleUnaryCall; /** Removes One-to-one NAT from the network interface. */ @@ -7021,6 +7944,10 @@ export interface InstanceServiceServer extends UntypedServiceImplementation { * Running instance will be restarted during this operation. */ relocate: handleUnaryCall; + simulateMaintenanceEvent: handleUnaryCall< + SimulateInstanceMaintenanceEventRequest, + Operation + >; /** Lists access bindings for the instance. */ listAccessBindings: handleUnaryCall< ListAccessBindingsRequest, @@ -7259,10 +8186,6 @@ export interface InstanceServiceClient extends Client { * * The instance and the filesystem must reside in the same availability zone. * - * To attach a filesystem, the instance must have a `STOPPED` status ([Instance.status]). - * To check the instance status, make a [InstanceService.Get] request. - * To stop the running instance, make a [InstanceService.Stop] request. - * * To use the instance with an attached filesystem, the latter must be mounted. * For details, see [documentation](/docs/compute/operations/filesystem/attach-to-vm). */ @@ -7281,13 +8204,7 @@ export interface InstanceServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; - /** - * Detaches the filesystem from the instance. - * - * To detach a filesystem, the instance must have a `STOPPED` status ([Instance.status]). - * To check the instance status, make a [InstanceService.Get] request. - * To stop the running instance, make a [InstanceService.Stop] request. - */ + /** Detaches the filesystem from the instance. */ detachFilesystem( request: DetachInstanceFilesystemRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -7303,6 +8220,50 @@ export interface InstanceServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** + * Attaches the network-interface to the instance. + * + * To attach a network-interface, the instance must have a `STOPPED` status ([Instance.status]). + * To check the instance status, make a [InstanceService.Get] request. + * To stop the running instance, make a [InstanceService.Stop] request. + */ + attachNetworkInterface( + request: AttachInstanceNetworkInterfaceRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + attachNetworkInterface( + request: AttachInstanceNetworkInterfaceRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + attachNetworkInterface( + request: AttachInstanceNetworkInterfaceRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** + * Detaches the network-interface to the instance. + * + * To Detach a network-interface, the instance must have a `STOPPED` status ([Instance.status]). + * To check the instance status, make a [InstanceService.Get] request. + * To stop the running instance, make a [InstanceService.Stop] request. + */ + detachNetworkInterface( + request: DetachInstanceNetworkInterfaceRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + detachNetworkInterface( + request: DetachInstanceNetworkInterfaceRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + detachNetworkInterface( + request: DetachInstanceNetworkInterfaceRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; /** Enables One-to-one NAT on the network interface. */ addOneToOneNat( request: AddInstanceOneToOneNatRequest, @@ -7419,6 +8380,21 @@ export interface InstanceServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + simulateMaintenanceEvent( + request: SimulateInstanceMaintenanceEventRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + simulateMaintenanceEvent( + request: SimulateInstanceMaintenanceEventRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + simulateMaintenanceEvent( + request: SimulateInstanceMaintenanceEventRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; /** Lists access bindings for the instance. */ listAccessBindings( request: ListAccessBindingsRequest, diff --git a/src/generated/yandex/cloud/compute/v1/instancegroup/instance_group.ts b/src/generated/yandex/cloud/compute/v1/instancegroup/instance_group.ts index 4b72c9e0..0943e94e 100644 --- a/src/generated/yandex/cloud/compute/v1/instancegroup/instance_group.ts +++ b/src/generated/yandex/cloud/compute/v1/instancegroup/instance_group.ts @@ -47,6 +47,46 @@ export function ipVersionToJSON(object: IpVersion): string { } } +export enum MetadataOption { + METADATA_OPTION_UNSPECIFIED = 0, + /** ENABLED - Option is enabled */ + ENABLED = 1, + /** DISABLED - Option is disabled */ + DISABLED = 2, + UNRECOGNIZED = -1, +} + +export function metadataOptionFromJSON(object: any): MetadataOption { + switch (object) { + case 0: + case "METADATA_OPTION_UNSPECIFIED": + return MetadataOption.METADATA_OPTION_UNSPECIFIED; + case 1: + case "ENABLED": + return MetadataOption.ENABLED; + case 2: + case "DISABLED": + return MetadataOption.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return MetadataOption.UNRECOGNIZED; + } +} + +export function metadataOptionToJSON(object: MetadataOption): string { + switch (object) { + case MetadataOption.METADATA_OPTION_UNSPECIFIED: + return "METADATA_OPTION_UNSPECIFIED"; + case MetadataOption.ENABLED: + return "ENABLED"; + case MetadataOption.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } +} + export interface InstanceGroup { $type: "yandex.cloud.compute.v1.instancegroup.InstanceGroup"; /** ID of the instance group. */ @@ -114,6 +154,8 @@ export interface InstanceGroup { * Returned if there is a working load balancer that the target group is connected to. */ applicationLoadBalancerState?: ApplicationLoadBalancerState; + /** AutoHealingPolicy policy of the instance group. */ + autoHealingPolicy?: AutoHealingPolicy; } export enum InstanceGroup_Status { @@ -559,6 +601,11 @@ export interface DeployPolicy { startupDuration?: Duration; /** Affects the lifecycle of the instance during deployment. */ strategy: DeployPolicy_Strategy; + /** + * If instance update requires a less disruptive action than [minimal_action], + * Instance Groups performs [minimal_action] to execute the update + */ + minimalAction: DeployPolicy_MinimalAction; } export enum DeployPolicy_Strategy { @@ -608,6 +655,57 @@ export function deployPolicy_StrategyToJSON( } } +export enum DeployPolicy_MinimalAction { + MINIMAL_ACTION_UNSPECIFIED = 0, + /** LIVE_UPDATE - Updating an instance without stopping. This is the default. */ + LIVE_UPDATE = 1, + /** RESTART - Updating an instance with restart: stopping and then starting the instance. */ + RESTART = 2, + /** RECREATE - Re-creating an instance: deleting an instance and creating a new one. */ + RECREATE = 3, + UNRECOGNIZED = -1, +} + +export function deployPolicy_MinimalActionFromJSON( + object: any +): DeployPolicy_MinimalAction { + switch (object) { + case 0: + case "MINIMAL_ACTION_UNSPECIFIED": + return DeployPolicy_MinimalAction.MINIMAL_ACTION_UNSPECIFIED; + case 1: + case "LIVE_UPDATE": + return DeployPolicy_MinimalAction.LIVE_UPDATE; + case 2: + case "RESTART": + return DeployPolicy_MinimalAction.RESTART; + case 3: + case "RECREATE": + return DeployPolicy_MinimalAction.RECREATE; + case -1: + case "UNRECOGNIZED": + default: + return DeployPolicy_MinimalAction.UNRECOGNIZED; + } +} + +export function deployPolicy_MinimalActionToJSON( + object: DeployPolicy_MinimalAction +): string { + switch (object) { + case DeployPolicy_MinimalAction.MINIMAL_ACTION_UNSPECIFIED: + return "MINIMAL_ACTION_UNSPECIFIED"; + case DeployPolicy_MinimalAction.LIVE_UPDATE: + return "LIVE_UPDATE"; + case DeployPolicy_MinimalAction.RESTART: + return "RESTART"; + case DeployPolicy_MinimalAction.RECREATE: + return "RECREATE"; + default: + return "UNKNOWN"; + } +} + export interface AllocationPolicy { $type: "yandex.cloud.compute.v1.instancegroup.AllocationPolicy"; /** List of availability zones. */ @@ -712,6 +810,8 @@ export interface InstanceTemplate { * For details, see [documentation](/docs/compute/operations/filesystem/attach-to-vm). */ filesystemSpecs: AttachedFilesystemSpec[]; + /** Metadata options for the instance */ + metadataOptions?: MetadataOptions; } export interface InstanceTemplate_LabelsEntry { @@ -1325,10 +1425,7 @@ export function managedInstance_StatusToJSON( export interface NetworkInterface { $type: "yandex.cloud.compute.v1.instancegroup.NetworkInterface"; - /** - * The index of the network interface, generated by the server, 0,1,2... etc. - * Currently only one network interface is supported per instance. - */ + /** The index of the network interface, generated by the server, 0,1,2... etc. */ index: string; /** MAC address that is assigned to the network interface. */ macAddress: string; @@ -1386,6 +1483,75 @@ export interface LogRecord { message: string; } +export interface AutoHealingPolicy { + $type: "yandex.cloud.compute.v1.instancegroup.AutoHealingPolicy"; + /** Instance Groups performs [auto_healing_action] when instance becomes unhealthy. */ + autoHealingAction: AutoHealingPolicy_AutoHealingAction; +} + +export enum AutoHealingPolicy_AutoHealingAction { + AUTO_HEALING_ACTION_UNSPECIFIED = 0, + /** RESTART - Re-starting an instance with restart: stopping and then starting the instance. */ + RESTART = 1, + /** RECREATE - Re-creating an instance: deleting an instance and creating a new one. */ + RECREATE = 2, + /** NONE - No action */ + NONE = 3, + UNRECOGNIZED = -1, +} + +export function autoHealingPolicy_AutoHealingActionFromJSON( + object: any +): AutoHealingPolicy_AutoHealingAction { + switch (object) { + case 0: + case "AUTO_HEALING_ACTION_UNSPECIFIED": + return AutoHealingPolicy_AutoHealingAction.AUTO_HEALING_ACTION_UNSPECIFIED; + case 1: + case "RESTART": + return AutoHealingPolicy_AutoHealingAction.RESTART; + case 2: + case "RECREATE": + return AutoHealingPolicy_AutoHealingAction.RECREATE; + case 3: + case "NONE": + return AutoHealingPolicy_AutoHealingAction.NONE; + case -1: + case "UNRECOGNIZED": + default: + return AutoHealingPolicy_AutoHealingAction.UNRECOGNIZED; + } +} + +export function autoHealingPolicy_AutoHealingActionToJSON( + object: AutoHealingPolicy_AutoHealingAction +): string { + switch (object) { + case AutoHealingPolicy_AutoHealingAction.AUTO_HEALING_ACTION_UNSPECIFIED: + return "AUTO_HEALING_ACTION_UNSPECIFIED"; + case AutoHealingPolicy_AutoHealingAction.RESTART: + return "RESTART"; + case AutoHealingPolicy_AutoHealingAction.RECREATE: + return "RECREATE"; + case AutoHealingPolicy_AutoHealingAction.NONE: + return "NONE"; + default: + return "UNKNOWN"; + } +} + +export interface MetadataOptions { + $type: "yandex.cloud.compute.v1.instancegroup.MetadataOptions"; + /** Enabled access to GCE flavored metadata */ + gceHttpEndpoint: MetadataOption; + /** Enabled access to AWS flavored metadata (IMDSv1) */ + awsV1HttpEndpoint: MetadataOption; + /** Enabled access to IAM credentials with GCE flavored metadata */ + gceHttpToken: MetadataOption; + /** Enabled access to IAM credentials with AWS flavored metadata (IMDSv1) */ + awsV1HttpToken: MetadataOption; +} + const baseInstanceGroup: object = { $type: "yandex.cloud.compute.v1.instancegroup.InstanceGroup", id: "", @@ -1505,6 +1671,12 @@ export const InstanceGroup = { writer.uint32(170).fork() ).ldelim(); } + if (message.autoHealingPolicy !== undefined) { + AutoHealingPolicy.encode( + message.autoHealingPolicy, + writer.uint32(178).fork() + ).ldelim(); + } return writer; }, @@ -1605,6 +1777,12 @@ export const InstanceGroup = { message.applicationLoadBalancerState = ApplicationLoadBalancerState.decode(reader, reader.uint32()); break; + case 22: + message.autoHealingPolicy = AutoHealingPolicy.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1703,6 +1881,11 @@ export const InstanceGroup = { object.applicationLoadBalancerState ) : undefined; + message.autoHealingPolicy = + object.autoHealingPolicy !== undefined && + object.autoHealingPolicy !== null + ? AutoHealingPolicy.fromJSON(object.autoHealingPolicy) + : undefined; return message; }, @@ -1778,6 +1961,10 @@ export const InstanceGroup = { message.applicationLoadBalancerState ) : undefined); + message.autoHealingPolicy !== undefined && + (obj.autoHealingPolicy = message.autoHealingPolicy + ? AutoHealingPolicy.toJSON(message.autoHealingPolicy) + : undefined); return obj; }, @@ -1851,6 +2038,11 @@ export const InstanceGroup = { object.applicationLoadBalancerState ) : undefined; + message.autoHealingPolicy = + object.autoHealingPolicy !== undefined && + object.autoHealingPolicy !== null + ? AutoHealingPolicy.fromPartial(object.autoHealingPolicy) + : undefined; return message; }, }; @@ -3257,6 +3449,7 @@ const baseDeployPolicy: object = { maxCreating: 0, maxExpansion: 0, strategy: 0, + minimalAction: 0, }; export const DeployPolicy = { @@ -3287,6 +3480,9 @@ export const DeployPolicy = { if (message.strategy !== 0) { writer.uint32(64).int32(message.strategy); } + if (message.minimalAction !== 0) { + writer.uint32(112).int32(message.minimalAction); + } return writer; }, @@ -3315,6 +3511,9 @@ export const DeployPolicy = { case 8: message.strategy = reader.int32() as any; break; + case 14: + message.minimalAction = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3349,6 +3548,10 @@ export const DeployPolicy = { object.strategy !== undefined && object.strategy !== null ? deployPolicy_StrategyFromJSON(object.strategy) : 0; + message.minimalAction = + object.minimalAction !== undefined && object.minimalAction !== null + ? deployPolicy_MinimalActionFromJSON(object.minimalAction) + : 0; return message; }, @@ -3368,6 +3571,10 @@ export const DeployPolicy = { : undefined); message.strategy !== undefined && (obj.strategy = deployPolicy_StrategyToJSON(message.strategy)); + message.minimalAction !== undefined && + (obj.minimalAction = deployPolicy_MinimalActionToJSON( + message.minimalAction + )); return obj; }, @@ -3384,6 +3591,7 @@ export const DeployPolicy = { ? Duration.fromPartial(object.startupDuration) : undefined; message.strategy = object.strategy ?? 0; + message.minimalAction = object.minimalAction ?? 0; return message; }, }; @@ -3634,6 +3842,12 @@ export const InstanceTemplate = { for (const v of message.filesystemSpecs) { AttachedFilesystemSpec.encode(v!, writer.uint32(122).fork()).ldelim(); } + if (message.metadataOptions !== undefined) { + MetadataOptions.encode( + message.metadataOptions, + writer.uint32(130).fork() + ).ldelim(); + } return writer; }, @@ -3724,6 +3938,12 @@ export const InstanceTemplate = { AttachedFilesystemSpec.decode(reader, reader.uint32()) ); break; + case 16: + message.metadataOptions = MetadataOptions.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3795,6 +4015,10 @@ export const InstanceTemplate = { message.filesystemSpecs = (object.filesystemSpecs ?? []).map((e: any) => AttachedFilesystemSpec.fromJSON(e) ); + message.metadataOptions = + object.metadataOptions !== undefined && object.metadataOptions !== null + ? MetadataOptions.fromJSON(object.metadataOptions) + : undefined; return message; }, @@ -3860,6 +4084,10 @@ export const InstanceTemplate = { } else { obj.filesystemSpecs = []; } + message.metadataOptions !== undefined && + (obj.metadataOptions = message.metadataOptions + ? MetadataOptions.toJSON(message.metadataOptions) + : undefined); return obj; }, @@ -3919,6 +4147,10 @@ export const InstanceTemplate = { object.filesystemSpecs?.map((e) => AttachedFilesystemSpec.fromPartial(e) ) || []; + message.metadataOptions = + object.metadataOptions !== undefined && object.metadataOptions !== null + ? MetadataOptions.fromPartial(object.metadataOptions) + : undefined; return message; }, }; @@ -7119,6 +7351,178 @@ export const LogRecord = { messageTypeRegistry.set(LogRecord.$type, LogRecord); +const baseAutoHealingPolicy: object = { + $type: "yandex.cloud.compute.v1.instancegroup.AutoHealingPolicy", + autoHealingAction: 0, +}; + +export const AutoHealingPolicy = { + $type: "yandex.cloud.compute.v1.instancegroup.AutoHealingPolicy" as const, + + encode( + message: AutoHealingPolicy, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.autoHealingAction !== 0) { + writer.uint32(8).int32(message.autoHealingAction); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AutoHealingPolicy { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAutoHealingPolicy } as AutoHealingPolicy; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.autoHealingAction = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AutoHealingPolicy { + const message = { ...baseAutoHealingPolicy } as AutoHealingPolicy; + message.autoHealingAction = + object.autoHealingAction !== undefined && + object.autoHealingAction !== null + ? autoHealingPolicy_AutoHealingActionFromJSON(object.autoHealingAction) + : 0; + return message; + }, + + toJSON(message: AutoHealingPolicy): unknown { + const obj: any = {}; + message.autoHealingAction !== undefined && + (obj.autoHealingAction = autoHealingPolicy_AutoHealingActionToJSON( + message.autoHealingAction + )); + return obj; + }, + + fromPartial, I>>( + object: I + ): AutoHealingPolicy { + const message = { ...baseAutoHealingPolicy } as AutoHealingPolicy; + message.autoHealingAction = object.autoHealingAction ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(AutoHealingPolicy.$type, AutoHealingPolicy); + +const baseMetadataOptions: object = { + $type: "yandex.cloud.compute.v1.instancegroup.MetadataOptions", + gceHttpEndpoint: 0, + awsV1HttpEndpoint: 0, + gceHttpToken: 0, + awsV1HttpToken: 0, +}; + +export const MetadataOptions = { + $type: "yandex.cloud.compute.v1.instancegroup.MetadataOptions" as const, + + encode( + message: MetadataOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.gceHttpEndpoint !== 0) { + writer.uint32(8).int32(message.gceHttpEndpoint); + } + if (message.awsV1HttpEndpoint !== 0) { + writer.uint32(16).int32(message.awsV1HttpEndpoint); + } + if (message.gceHttpToken !== 0) { + writer.uint32(24).int32(message.gceHttpToken); + } + if (message.awsV1HttpToken !== 0) { + writer.uint32(32).int32(message.awsV1HttpToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MetadataOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMetadataOptions } as MetadataOptions; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gceHttpEndpoint = reader.int32() as any; + break; + case 2: + message.awsV1HttpEndpoint = reader.int32() as any; + break; + case 3: + message.gceHttpToken = reader.int32() as any; + break; + case 4: + message.awsV1HttpToken = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MetadataOptions { + const message = { ...baseMetadataOptions } as MetadataOptions; + message.gceHttpEndpoint = + object.gceHttpEndpoint !== undefined && object.gceHttpEndpoint !== null + ? metadataOptionFromJSON(object.gceHttpEndpoint) + : 0; + message.awsV1HttpEndpoint = + object.awsV1HttpEndpoint !== undefined && + object.awsV1HttpEndpoint !== null + ? metadataOptionFromJSON(object.awsV1HttpEndpoint) + : 0; + message.gceHttpToken = + object.gceHttpToken !== undefined && object.gceHttpToken !== null + ? metadataOptionFromJSON(object.gceHttpToken) + : 0; + message.awsV1HttpToken = + object.awsV1HttpToken !== undefined && object.awsV1HttpToken !== null + ? metadataOptionFromJSON(object.awsV1HttpToken) + : 0; + return message; + }, + + toJSON(message: MetadataOptions): unknown { + const obj: any = {}; + message.gceHttpEndpoint !== undefined && + (obj.gceHttpEndpoint = metadataOptionToJSON(message.gceHttpEndpoint)); + message.awsV1HttpEndpoint !== undefined && + (obj.awsV1HttpEndpoint = metadataOptionToJSON(message.awsV1HttpEndpoint)); + message.gceHttpToken !== undefined && + (obj.gceHttpToken = metadataOptionToJSON(message.gceHttpToken)); + message.awsV1HttpToken !== undefined && + (obj.awsV1HttpToken = metadataOptionToJSON(message.awsV1HttpToken)); + return obj; + }, + + fromPartial, I>>( + object: I + ): MetadataOptions { + const message = { ...baseMetadataOptions } as MetadataOptions; + message.gceHttpEndpoint = object.gceHttpEndpoint ?? 0; + message.awsV1HttpEndpoint = object.awsV1HttpEndpoint ?? 0; + message.gceHttpToken = object.gceHttpToken ?? 0; + message.awsV1HttpToken = object.awsV1HttpToken ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(MetadataOptions.$type, MetadataOptions); + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/generated/yandex/cloud/compute/v1/maintenance.ts b/src/generated/yandex/cloud/compute/v1/maintenance.ts new file mode 100644 index 00000000..f78597b1 --- /dev/null +++ b/src/generated/yandex/cloud/compute/v1/maintenance.ts @@ -0,0 +1,50 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.compute.v1"; + +export enum MaintenancePolicy { + MAINTENANCE_POLICY_UNSPECIFIED = 0, + /** RESTART - Restart instance to move it to another host during maintenance */ + RESTART = 1, + /** MIGRATE - Use live migration to move instance to another host during maintenance */ + MIGRATE = 2, + UNRECOGNIZED = -1, +} + +export function maintenancePolicyFromJSON(object: any): MaintenancePolicy { + switch (object) { + case 0: + case "MAINTENANCE_POLICY_UNSPECIFIED": + return MaintenancePolicy.MAINTENANCE_POLICY_UNSPECIFIED; + case 1: + case "RESTART": + return MaintenancePolicy.RESTART; + case 2: + case "MIGRATE": + return MaintenancePolicy.MIGRATE; + case -1: + case "UNRECOGNIZED": + default: + return MaintenancePolicy.UNRECOGNIZED; + } +} + +export function maintenancePolicyToJSON(object: MaintenancePolicy): string { + switch (object) { + case MaintenancePolicy.MAINTENANCE_POLICY_UNSPECIFIED: + return "MAINTENANCE_POLICY_UNSPECIFIED"; + case MaintenancePolicy.RESTART: + return "RESTART"; + case MaintenancePolicy.MIGRATE: + return "MIGRATE"; + default: + return "UNKNOWN"; + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/compute/v1/placement_group_service.ts b/src/generated/yandex/cloud/compute/v1/placement_group_service.ts index 6b6ab38b..51cd0db3 100644 --- a/src/generated/yandex/cloud/compute/v1/placement_group_service.ts +++ b/src/generated/yandex/cloud/compute/v1/placement_group_service.ts @@ -22,6 +22,12 @@ import { } from "../../../../yandex/cloud/compute/v1/placement_group"; import { Instance } from "../../../../yandex/cloud/compute/v1/instance"; import { Operation } from "../../../../yandex/cloud/operation/operation"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../yandex/cloud/access/access"; export const protobufPackage = "yandex.cloud.compute.v1"; @@ -1860,6 +1866,46 @@ export const PlacementGroupServiceService = { responseDeserialize: (value: Buffer) => ListPlacementGroupOperationsResponse.decode(value), }, + /** Lists access bindings for the placement group. */ + listAccessBindings: { + path: "/yandex.cloud.compute.v1.PlacementGroupService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the placement group. */ + setAccessBindings: { + path: "/yandex.cloud.compute.v1.PlacementGroupService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the placement group. */ + updateAccessBindings: { + path: "/yandex.cloud.compute.v1.PlacementGroupService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface PlacementGroupServiceServer @@ -1891,6 +1937,15 @@ export interface PlacementGroupServiceServer ListPlacementGroupOperationsRequest, ListPlacementGroupOperationsResponse >; + /** Lists access bindings for the placement group. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the placement group. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the placement group. */ + updateAccessBindings: handleUnaryCall; } export interface PlacementGroupServiceClient extends Client { @@ -2037,6 +2092,63 @@ export interface PlacementGroupServiceClient extends Client { response: ListPlacementGroupOperationsResponse ) => void ): ClientUnaryCall; + /** Lists access bindings for the placement group. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the placement group. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the placement group. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const PlacementGroupServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/compute/v1/snapshot.ts b/src/generated/yandex/cloud/compute/v1/snapshot.ts index b70c2c2f..cad7679e 100644 --- a/src/generated/yandex/cloud/compute/v1/snapshot.ts +++ b/src/generated/yandex/cloud/compute/v1/snapshot.ts @@ -2,6 +2,7 @@ import { messageTypeRegistry } from "../../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; +import { HardwareGeneration } from "../../../../yandex/cloud/compute/v1/hardware_generation"; import { Timestamp } from "../../../../google/protobuf/timestamp"; export const protobufPackage = "yandex.cloud.compute.v1"; @@ -39,6 +40,11 @@ export interface Snapshot { status: Snapshot_Status; /** ID of the source disk used to create this snapshot. */ sourceDiskId: string; + /** + * If specified, forces the same HardwareGeneration features to be applied to the instance + * created using this snapshot as source for the boot disk. Otherwise the current default will be used. + */ + hardwareGeneration?: HardwareGeneration; } export enum Snapshot_Status { @@ -164,6 +170,12 @@ export const Snapshot = { if (message.sourceDiskId !== "") { writer.uint32(90).string(message.sourceDiskId); } + if (message.hardwareGeneration !== undefined) { + HardwareGeneration.encode( + message.hardwareGeneration, + writer.uint32(98).fork() + ).ldelim(); + } return writer; }, @@ -214,6 +226,12 @@ export const Snapshot = { case 11: message.sourceDiskId = reader.string(); break; + case 12: + message.hardwareGeneration = HardwareGeneration.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -265,6 +283,11 @@ export const Snapshot = { object.sourceDiskId !== undefined && object.sourceDiskId !== null ? String(object.sourceDiskId) : ""; + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromJSON(object.hardwareGeneration) + : undefined; return message; }, @@ -296,6 +319,10 @@ export const Snapshot = { (obj.status = snapshot_StatusToJSON(message.status)); message.sourceDiskId !== undefined && (obj.sourceDiskId = message.sourceDiskId); + message.hardwareGeneration !== undefined && + (obj.hardwareGeneration = message.hardwareGeneration + ? HardwareGeneration.toJSON(message.hardwareGeneration) + : undefined); return obj; }, @@ -319,6 +346,11 @@ export const Snapshot = { message.productIds = object.productIds?.map((e) => e) || []; message.status = object.status ?? 0; message.sourceDiskId = object.sourceDiskId ?? ""; + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromPartial(object.hardwareGeneration) + : undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/compute/v1/snapshot_schedule_service.ts b/src/generated/yandex/cloud/compute/v1/snapshot_schedule_service.ts index dc61591f..413be0ff 100644 --- a/src/generated/yandex/cloud/compute/v1/snapshot_schedule_service.ts +++ b/src/generated/yandex/cloud/compute/v1/snapshot_schedule_service.ts @@ -24,6 +24,12 @@ import { Duration } from "../../../../google/protobuf/duration"; import { Operation } from "../../../../yandex/cloud/operation/operation"; import { Snapshot } from "../../../../yandex/cloud/compute/v1/snapshot"; import { Disk } from "../../../../yandex/cloud/compute/v1/disk"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../yandex/cloud/access/access"; export const protobufPackage = "yandex.cloud.compute.v1"; @@ -2902,6 +2908,46 @@ export const SnapshotScheduleServiceService = { responseDeserialize: (value: Buffer) => ListSnapshotScheduleDisksResponse.decode(value), }, + /** Lists access bindings for the snapshot schedule. */ + listAccessBindings: { + path: "/yandex.cloud.compute.v1.SnapshotScheduleService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the snapshot schedule. */ + setAccessBindings: { + path: "/yandex.cloud.compute.v1.SnapshotScheduleService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the snapshot schedule. */ + updateAccessBindings: { + path: "/yandex.cloud.compute.v1.SnapshotScheduleService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface SnapshotScheduleServiceServer @@ -2971,6 +3017,15 @@ export interface SnapshotScheduleServiceServer ListSnapshotScheduleDisksRequest, ListSnapshotScheduleDisksResponse >; + /** Lists access bindings for the snapshot schedule. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the snapshot schedule. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the snapshot schedule. */ + updateAccessBindings: handleUnaryCall; } export interface SnapshotScheduleServiceClient extends Client { @@ -3217,6 +3272,63 @@ export interface SnapshotScheduleServiceClient extends Client { response: ListSnapshotScheduleDisksResponse ) => void ): ClientUnaryCall; + /** Lists access bindings for the snapshot schedule. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the snapshot schedule. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the snapshot schedule. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const SnapshotScheduleServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/compute/v1/snapshot_service.ts b/src/generated/yandex/cloud/compute/v1/snapshot_service.ts index 03d3aa03..434a279b 100644 --- a/src/generated/yandex/cloud/compute/v1/snapshot_service.ts +++ b/src/generated/yandex/cloud/compute/v1/snapshot_service.ts @@ -14,9 +14,16 @@ import { ServiceError, } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; +import { HardwareGeneration } from "../../../../yandex/cloud/compute/v1/hardware_generation"; import { FieldMask } from "../../../../google/protobuf/field_mask"; import { Snapshot } from "../../../../yandex/cloud/compute/v1/snapshot"; import { Operation } from "../../../../yandex/cloud/operation/operation"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../yandex/cloud/access/access"; export const protobufPackage = "yandex.cloud.compute.v1"; @@ -100,6 +107,11 @@ export interface CreateSnapshotRequest { description: string; /** Resource labels as `key:value` pairs. */ labels: { [key: string]: string }; + /** + * Specify the overrides to hardware_generation of a source disk, image or snapshot, + * or to the default values if the source does not define it. + */ + hardwareGeneration?: HardwareGeneration; } export interface CreateSnapshotRequest_LabelsEntry { @@ -496,6 +508,12 @@ export const CreateSnapshotRequest = { writer.uint32(50).fork() ).ldelim(); }); + if (message.hardwareGeneration !== undefined) { + HardwareGeneration.encode( + message.hardwareGeneration, + writer.uint32(58).fork() + ).ldelim(); + } return writer; }, @@ -531,6 +549,12 @@ export const CreateSnapshotRequest = { message.labels[entry6.key] = entry6.value; } break; + case 7: + message.hardwareGeneration = HardwareGeneration.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -563,6 +587,11 @@ export const CreateSnapshotRequest = { acc[key] = String(value); return acc; }, {}); + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromJSON(object.hardwareGeneration) + : undefined; return message; }, @@ -579,6 +608,10 @@ export const CreateSnapshotRequest = { obj.labels[k] = v; }); } + message.hardwareGeneration !== undefined && + (obj.hardwareGeneration = message.hardwareGeneration + ? HardwareGeneration.toJSON(message.hardwareGeneration) + : undefined); return obj; }, @@ -598,6 +631,11 @@ export const CreateSnapshotRequest = { } return acc; }, {}); + message.hardwareGeneration = + object.hardwareGeneration !== undefined && + object.hardwareGeneration !== null + ? HardwareGeneration.fromPartial(object.hardwareGeneration) + : undefined; return message; }, }; @@ -1480,6 +1518,46 @@ export const SnapshotServiceService = { responseDeserialize: (value: Buffer) => ListSnapshotOperationsResponse.decode(value), }, + /** Lists access bindings for the snapshot. */ + listAccessBindings: { + path: "/yandex.cloud.compute.v1.SnapshotService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the snapshot. */ + setAccessBindings: { + path: "/yandex.cloud.compute.v1.SnapshotService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the snapshot. */ + updateAccessBindings: { + path: "/yandex.cloud.compute.v1.SnapshotService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface SnapshotServiceServer extends UntypedServiceImplementation { @@ -1510,6 +1588,15 @@ export interface SnapshotServiceServer extends UntypedServiceImplementation { ListSnapshotOperationsRequest, ListSnapshotOperationsResponse >; + /** Lists access bindings for the snapshot. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the snapshot. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the snapshot. */ + updateAccessBindings: handleUnaryCall; } export interface SnapshotServiceClient extends Client { @@ -1639,6 +1726,63 @@ export interface SnapshotServiceClient extends Client { response: ListSnapshotOperationsResponse ) => void ): ClientUnaryCall; + /** Lists access bindings for the snapshot. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the snapshot. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the snapshot. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const SnapshotServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/containerregistry/index.ts b/src/generated/yandex/cloud/containerregistry/index.ts index a185598e..21e3f45a 100644 --- a/src/generated/yandex/cloud/containerregistry/index.ts +++ b/src/generated/yandex/cloud/containerregistry/index.ts @@ -1,14 +1,14 @@ -export * as blob from './v1/blob' -export * as image from './v1/image' -export * as image_service from './v1/image_service' -export * as ip_permission from './v1/ip_permission' -export * as lifecycle_policy from './v1/lifecycle_policy' -export * as lifecycle_policy_service from './v1/lifecycle_policy_service' -export * as registry from './v1/registry' -export * as registry_service from './v1/registry_service' -export * as repository from './v1/repository' -export * as repository_service from './v1/repository_service' -export * as scan_policy from './v1/scan_policy' -export * as scan_policy_service from './v1/scan_policy_service' -export * as scanner from './v1/scanner' -export * as scanner_service from './v1/scanner_service' \ No newline at end of file +export * as v1_blob from './v1/blob' +export * as v1_image from './v1/image' +export * as v1_image_service from './v1/image_service' +export * as v1_ip_permission from './v1/ip_permission' +export * as v1_lifecycle_policy from './v1/lifecycle_policy' +export * as v1_lifecycle_policy_service from './v1/lifecycle_policy_service' +export * as v1_registry from './v1/registry' +export * as v1_registry_service from './v1/registry_service' +export * as v1_repository from './v1/repository' +export * as v1_repository_service from './v1/repository_service' +export * as v1_scan_policy from './v1/scan_policy' +export * as v1_scan_policy_service from './v1/scan_policy_service' +export * as v1_scanner from './v1/scanner' +export * as v1_scanner_service from './v1/scanner_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/containerregistry/v1/registry_service.ts b/src/generated/yandex/cloud/containerregistry/v1/registry_service.ts index 4471daea..77767cc4 100644 --- a/src/generated/yandex/cloud/containerregistry/v1/registry_service.ts +++ b/src/generated/yandex/cloud/containerregistry/v1/registry_service.ts @@ -102,6 +102,8 @@ export interface CreateRegistryRequest { name: string; /** Resource labels as `key:value` pairs. */ labels: { [key: string]: string }; + /** If true, registry will be created with pre-setup scanning policy (on push and on schedule every 7 days) */ + secure: boolean; } export interface CreateRegistryRequest_LabelsEntry { @@ -460,6 +462,7 @@ const baseCreateRegistryRequest: object = { $type: "yandex.cloud.containerregistry.v1.CreateRegistryRequest", folderId: "", name: "", + secure: false, }; export const CreateRegistryRequest = { @@ -486,6 +489,9 @@ export const CreateRegistryRequest = { writer.uint32(26).fork() ).ldelim(); }); + if (message.secure === true) { + writer.uint32(32).bool(message.secure); + } return writer; }, @@ -515,6 +521,9 @@ export const CreateRegistryRequest = { message.labels[entry3.key] = entry3.value; } break; + case 4: + message.secure = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -539,6 +548,10 @@ export const CreateRegistryRequest = { acc[key] = String(value); return acc; }, {}); + message.secure = + object.secure !== undefined && object.secure !== null + ? Boolean(object.secure) + : false; return message; }, @@ -552,6 +565,7 @@ export const CreateRegistryRequest = { obj.labels[k] = v; }); } + message.secure !== undefined && (obj.secure = message.secure); return obj; }, @@ -569,6 +583,7 @@ export const CreateRegistryRequest = { } return acc; }, {}); + message.secure = object.secure ?? false; return message; }, }; diff --git a/src/generated/yandex/cloud/containerregistry/v1/scanner.ts b/src/generated/yandex/cloud/containerregistry/v1/scanner.ts index 052f002c..d8c32191 100644 --- a/src/generated/yandex/cloud/containerregistry/v1/scanner.ts +++ b/src/generated/yandex/cloud/containerregistry/v1/scanner.ts @@ -201,6 +201,10 @@ export interface PackageVulnerability { version: string; /** The version of the package where vulnerability has been fixed. */ fixedBy: string; + /** The place where vulnerability is originated (OS, lang package, etc.) */ + origin: string; + /** The type of vulnerability origin - name of OS if origin="os" or package type (jar, gobinary, etc.) if origin="lang" */ + type: string; } const baseScanResult: object = { @@ -555,6 +559,8 @@ const basePackageVulnerability: object = { source: "", version: "", fixedBy: "", + origin: "", + type: "", }; export const PackageVulnerability = { @@ -582,6 +588,12 @@ export const PackageVulnerability = { if (message.fixedBy !== "") { writer.uint32(50).string(message.fixedBy); } + if (message.origin !== "") { + writer.uint32(58).string(message.origin); + } + if (message.type !== "") { + writer.uint32(66).string(message.type); + } return writer; }, @@ -613,6 +625,12 @@ export const PackageVulnerability = { case 6: message.fixedBy = reader.string(); break; + case 7: + message.origin = reader.string(); + break; + case 8: + message.type = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -647,6 +665,14 @@ export const PackageVulnerability = { object.fixedBy !== undefined && object.fixedBy !== null ? String(object.fixedBy) : ""; + message.origin = + object.origin !== undefined && object.origin !== null + ? String(object.origin) + : ""; + message.type = + object.type !== undefined && object.type !== null + ? String(object.type) + : ""; return message; }, @@ -658,6 +684,8 @@ export const PackageVulnerability = { message.source !== undefined && (obj.source = message.source); message.version !== undefined && (obj.version = message.version); message.fixedBy !== undefined && (obj.fixedBy = message.fixedBy); + message.origin !== undefined && (obj.origin = message.origin); + message.type !== undefined && (obj.type = message.type); return obj; }, @@ -671,6 +699,8 @@ export const PackageVulnerability = { message.source = object.source ?? ""; message.version = object.version ?? ""; message.fixedBy = object.fixedBy ?? ""; + message.origin = object.origin ?? ""; + message.type = object.type ?? ""; return message; }, }; diff --git a/src/generated/yandex/cloud/dataproc/index.ts b/src/generated/yandex/cloud/dataproc/index.ts index 33ee314f..92d2579a 100644 --- a/src/generated/yandex/cloud/dataproc/index.ts +++ b/src/generated/yandex/cloud/dataproc/index.ts @@ -1,12 +1,12 @@ -export * as cluster from './v1/cluster' -export * as cluster_service from './v1/cluster_service' -export * as common from './v1/common' -export * as job from './v1/job' -export * as job_service from './v1/job_service' -export * as resource_preset from './v1/resource_preset' -export * as resource_preset_service from './v1/resource_preset_service' -export * as subcluster from './v1/subcluster' -export * as subcluster_service from './v1/subcluster_service' -export * as manager_job from './manager/v1/job' -export * as manager_job_service from './manager/v1/job_service' -export * as manager_service from './manager/v1/manager_service' \ No newline at end of file +export * as v1_cluster from './v1/cluster' +export * as v1_cluster_service from './v1/cluster_service' +export * as v1_common from './v1/common' +export * as v1_job from './v1/job' +export * as v1_job_service from './v1/job_service' +export * as v1_resource_preset from './v1/resource_preset' +export * as v1_resource_preset_service from './v1/resource_preset_service' +export * as v1_subcluster from './v1/subcluster' +export * as v1_subcluster_service from './v1/subcluster_service' +export * as manager_v1_job from './manager/v1/job' +export * as manager_v1_job_service from './manager/v1/job_service' +export * as manager_v1_manager_service from './manager/v1/manager_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/dataproc/manager/v1/job.ts b/src/generated/yandex/cloud/dataproc/manager/v1/job.ts index 3ee43a40..de213fbc 100644 --- a/src/generated/yandex/cloud/dataproc/manager/v1/job.ts +++ b/src/generated/yandex/cloud/dataproc/manager/v1/job.ts @@ -243,6 +243,107 @@ export interface HiveJob_ScriptVariablesEntry { value: string; } +/** Data Proc support job. */ +export interface SupportJob { + $type: "yandex.cloud.dataproc.manager.v1.SupportJob"; + /** + * Required. Unique ID of the Data Proc job. + * This ID is assigned by MDB in the process of creating Data Proc job. + */ + id: string; + /** Required. Unique ID of the Data Proc cluster. */ + clusterId: string; + /** The time when the Data Proc job was created. */ + createdAt?: Date; + /** The time when the Data Proc job was started. */ + startedAt?: Date; + /** The time when the Data Proc job was finished. */ + finishedAt?: Date; + /** Status. */ + status: SupportJob_Status; + /** Command. */ + cmd: string; + /** Execution timeout in seconds. */ + timeout: number; + /** The id of the user who created the job */ + createdBy: string; +} + +export enum SupportJob_Status { + STATUS_UNSPECIFIED = 0, + /** PROVISIONING - Job created in metadb and is waiting agent to acquire. */ + PROVISIONING = 1, + /** PENDING - Job acquired by agent and is waiting for execution. */ + PENDING = 2, + /** RUNNING - Job is running. */ + RUNNING = 3, + /** ERROR - Job failed. */ + ERROR = 4, + /** DONE - Job finished. */ + DONE = 5, + /** CANCELLED - Job cancelled. */ + CANCELLED = 6, + /** CANCELLING - Job is waiting for cancellation. */ + CANCELLING = 7, + UNRECOGNIZED = -1, +} + +export function supportJob_StatusFromJSON(object: any): SupportJob_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return SupportJob_Status.STATUS_UNSPECIFIED; + case 1: + case "PROVISIONING": + return SupportJob_Status.PROVISIONING; + case 2: + case "PENDING": + return SupportJob_Status.PENDING; + case 3: + case "RUNNING": + return SupportJob_Status.RUNNING; + case 4: + case "ERROR": + return SupportJob_Status.ERROR; + case 5: + case "DONE": + return SupportJob_Status.DONE; + case 6: + case "CANCELLED": + return SupportJob_Status.CANCELLED; + case 7: + case "CANCELLING": + return SupportJob_Status.CANCELLING; + case -1: + case "UNRECOGNIZED": + default: + return SupportJob_Status.UNRECOGNIZED; + } +} + +export function supportJob_StatusToJSON(object: SupportJob_Status): string { + switch (object) { + case SupportJob_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case SupportJob_Status.PROVISIONING: + return "PROVISIONING"; + case SupportJob_Status.PENDING: + return "PENDING"; + case SupportJob_Status.RUNNING: + return "RUNNING"; + case SupportJob_Status.ERROR: + return "ERROR"; + case SupportJob_Status.DONE: + return "DONE"; + case SupportJob_Status.CANCELLED: + return "CANCELLED"; + case SupportJob_Status.CANCELLING: + return "CANCELLING"; + default: + return "UNKNOWN"; + } +} + const baseJob: object = { $type: "yandex.cloud.dataproc.manager.v1.Job", id: "", @@ -1966,6 +2067,196 @@ messageTypeRegistry.set( HiveJob_ScriptVariablesEntry ); +const baseSupportJob: object = { + $type: "yandex.cloud.dataproc.manager.v1.SupportJob", + id: "", + clusterId: "", + status: 0, + cmd: "", + timeout: 0, + createdBy: "", +}; + +export const SupportJob = { + $type: "yandex.cloud.dataproc.manager.v1.SupportJob" as const, + + encode( + message: SupportJob, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.clusterId !== "") { + writer.uint32(18).string(message.clusterId); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(26).fork() + ).ldelim(); + } + if (message.startedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.startedAt), + writer.uint32(34).fork() + ).ldelim(); + } + if (message.finishedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.finishedAt), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.status !== 0) { + writer.uint32(48).int32(message.status); + } + if (message.cmd !== "") { + writer.uint32(58).string(message.cmd); + } + if (message.timeout !== 0) { + writer.uint32(64).int64(message.timeout); + } + if (message.createdBy !== "") { + writer.uint32(74).string(message.createdBy); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SupportJob { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSupportJob } as SupportJob; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.clusterId = reader.string(); + break; + case 3: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 4: + message.startedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 5: + message.finishedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + message.status = reader.int32() as any; + break; + case 7: + message.cmd = reader.string(); + break; + case 8: + message.timeout = longToNumber(reader.int64() as Long); + break; + case 9: + message.createdBy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SupportJob { + const message = { ...baseSupportJob } as SupportJob; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.startedAt = + object.startedAt !== undefined && object.startedAt !== null + ? fromJsonTimestamp(object.startedAt) + : undefined; + message.finishedAt = + object.finishedAt !== undefined && object.finishedAt !== null + ? fromJsonTimestamp(object.finishedAt) + : undefined; + message.status = + object.status !== undefined && object.status !== null + ? supportJob_StatusFromJSON(object.status) + : 0; + message.cmd = + object.cmd !== undefined && object.cmd !== null ? String(object.cmd) : ""; + message.timeout = + object.timeout !== undefined && object.timeout !== null + ? Number(object.timeout) + : 0; + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + return message; + }, + + toJSON(message: SupportJob): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.startedAt !== undefined && + (obj.startedAt = message.startedAt.toISOString()); + message.finishedAt !== undefined && + (obj.finishedAt = message.finishedAt.toISOString()); + message.status !== undefined && + (obj.status = supportJob_StatusToJSON(message.status)); + message.cmd !== undefined && (obj.cmd = message.cmd); + message.timeout !== undefined && + (obj.timeout = Math.round(message.timeout)); + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + return obj; + }, + + fromPartial, I>>( + object: I + ): SupportJob { + const message = { ...baseSupportJob } as SupportJob; + message.id = object.id ?? ""; + message.clusterId = object.clusterId ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.startedAt = object.startedAt ?? undefined; + message.finishedAt = object.finishedAt ?? undefined; + message.status = object.status ?? 0; + message.cmd = object.cmd ?? ""; + message.timeout = object.timeout ?? 0; + message.createdBy = object.createdBy ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(SupportJob.$type, SupportJob); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + type Builtin = | Date | Function @@ -2015,6 +2306,13 @@ function fromJsonTimestamp(o: any): Date { } } +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/src/generated/yandex/cloud/dataproc/manager/v1/job_service.ts b/src/generated/yandex/cloud/dataproc/manager/v1/job_service.ts index 7a730e79..7fcad944 100644 --- a/src/generated/yandex/cloud/dataproc/manager/v1/job_service.ts +++ b/src/generated/yandex/cloud/dataproc/manager/v1/job_service.ts @@ -17,9 +17,13 @@ import _m0 from "protobufjs/minimal"; import { Job_Status, ApplicationInfo, + SupportJob_Status, Job, + SupportJob, job_StatusFromJSON, job_StatusToJSON, + supportJob_StatusFromJSON, + supportJob_StatusToJSON, } from "../../../../../yandex/cloud/dataproc/manager/v1/job"; export const protobufPackage = "yandex.cloud.dataproc.manager.v1"; @@ -74,6 +78,44 @@ export interface UpdateJobStatusResponse { $type: "yandex.cloud.dataproc.manager.v1.UpdateJobStatusResponse"; } +export interface ListSupportJobsResponse { + $type: "yandex.cloud.dataproc.manager.v1.ListSupportJobsResponse"; + /** Requested list of Data Proc jobs. */ + jobs: SupportJob[]; + /** + * This token allows you to get the next page of results for ListJobs requests, + * if the number of results is larger than `page_size` specified in the request. + * To get the next page, specify the value of `next_page_token` as a value for + * the `page_token` parameter in the next ListClusters request. Subsequent ListClusters + * requests will have their own `next_page_token` to continue paging through the results. + */ + nextPageToken: string; +} + +export interface UpdateSupportJobStatusRequest { + $type: "yandex.cloud.dataproc.manager.v1.UpdateSupportJobStatusRequest"; + /** Required. ID of the Data Proc cluster. */ + clusterId: string; + /** Required. ID of the Data Proc job to update. */ + jobId: string; + /** Required. New status of the job. */ + status: SupportJob_Status; +} + +export interface SaveSupportJobLogRequest { + $type: "yandex.cloud.dataproc.manager.v1.SaveSupportJobLogRequest"; + /** ID of the cluster. */ + clusterId: string; + /** ID of the support job. */ + jobId: string; + /** Job output. */ + output: string; +} + +export interface SaveSupportJobLogResponse { + $type: "yandex.cloud.dataproc.manager.v1.SaveSupportJobLogResponse"; +} + const baseListJobsRequest: object = { $type: "yandex.cloud.dataproc.manager.v1.ListJobsRequest", clusterId: "", @@ -427,6 +469,357 @@ export const UpdateJobStatusResponse = { messageTypeRegistry.set(UpdateJobStatusResponse.$type, UpdateJobStatusResponse); +const baseListSupportJobsResponse: object = { + $type: "yandex.cloud.dataproc.manager.v1.ListSupportJobsResponse", + nextPageToken: "", +}; + +export const ListSupportJobsResponse = { + $type: "yandex.cloud.dataproc.manager.v1.ListSupportJobsResponse" as const, + + encode( + message: ListSupportJobsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.jobs) { + SupportJob.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListSupportJobsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListSupportJobsResponse, + } as ListSupportJobsResponse; + message.jobs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobs.push(SupportJob.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListSupportJobsResponse { + const message = { + ...baseListSupportJobsResponse, + } as ListSupportJobsResponse; + message.jobs = (object.jobs ?? []).map((e: any) => SupportJob.fromJSON(e)); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListSupportJobsResponse): unknown { + const obj: any = {}; + if (message.jobs) { + obj.jobs = message.jobs.map((e) => + e ? SupportJob.toJSON(e) : undefined + ); + } else { + obj.jobs = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListSupportJobsResponse { + const message = { + ...baseListSupportJobsResponse, + } as ListSupportJobsResponse; + message.jobs = object.jobs?.map((e) => SupportJob.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListSupportJobsResponse.$type, ListSupportJobsResponse); + +const baseUpdateSupportJobStatusRequest: object = { + $type: "yandex.cloud.dataproc.manager.v1.UpdateSupportJobStatusRequest", + clusterId: "", + jobId: "", + status: 0, +}; + +export const UpdateSupportJobStatusRequest = { + $type: + "yandex.cloud.dataproc.manager.v1.UpdateSupportJobStatusRequest" as const, + + encode( + message: UpdateSupportJobStatusRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.jobId !== "") { + writer.uint32(18).string(message.jobId); + } + if (message.status !== 0) { + writer.uint32(24).int32(message.status); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateSupportJobStatusRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateSupportJobStatusRequest, + } as UpdateSupportJobStatusRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.jobId = reader.string(); + break; + case 3: + message.status = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateSupportJobStatusRequest { + const message = { + ...baseUpdateSupportJobStatusRequest, + } as UpdateSupportJobStatusRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + message.status = + object.status !== undefined && object.status !== null + ? supportJob_StatusFromJSON(object.status) + : 0; + return message; + }, + + toJSON(message: UpdateSupportJobStatusRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.jobId !== undefined && (obj.jobId = message.jobId); + message.status !== undefined && + (obj.status = supportJob_StatusToJSON(message.status)); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateSupportJobStatusRequest { + const message = { + ...baseUpdateSupportJobStatusRequest, + } as UpdateSupportJobStatusRequest; + message.clusterId = object.clusterId ?? ""; + message.jobId = object.jobId ?? ""; + message.status = object.status ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateSupportJobStatusRequest.$type, + UpdateSupportJobStatusRequest +); + +const baseSaveSupportJobLogRequest: object = { + $type: "yandex.cloud.dataproc.manager.v1.SaveSupportJobLogRequest", + clusterId: "", + jobId: "", + output: "", +}; + +export const SaveSupportJobLogRequest = { + $type: "yandex.cloud.dataproc.manager.v1.SaveSupportJobLogRequest" as const, + + encode( + message: SaveSupportJobLogRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.jobId !== "") { + writer.uint32(18).string(message.jobId); + } + if (message.output !== "") { + writer.uint32(26).string(message.output); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SaveSupportJobLogRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSaveSupportJobLogRequest, + } as SaveSupportJobLogRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.jobId = reader.string(); + break; + case 3: + message.output = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SaveSupportJobLogRequest { + const message = { + ...baseSaveSupportJobLogRequest, + } as SaveSupportJobLogRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + message.output = + object.output !== undefined && object.output !== null + ? String(object.output) + : ""; + return message; + }, + + toJSON(message: SaveSupportJobLogRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.jobId !== undefined && (obj.jobId = message.jobId); + message.output !== undefined && (obj.output = message.output); + return obj; + }, + + fromPartial, I>>( + object: I + ): SaveSupportJobLogRequest { + const message = { + ...baseSaveSupportJobLogRequest, + } as SaveSupportJobLogRequest; + message.clusterId = object.clusterId ?? ""; + message.jobId = object.jobId ?? ""; + message.output = object.output ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + SaveSupportJobLogRequest.$type, + SaveSupportJobLogRequest +); + +const baseSaveSupportJobLogResponse: object = { + $type: "yandex.cloud.dataproc.manager.v1.SaveSupportJobLogResponse", +}; + +export const SaveSupportJobLogResponse = { + $type: "yandex.cloud.dataproc.manager.v1.SaveSupportJobLogResponse" as const, + + encode( + _: SaveSupportJobLogResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SaveSupportJobLogResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSaveSupportJobLogResponse, + } as SaveSupportJobLogResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): SaveSupportJobLogResponse { + const message = { + ...baseSaveSupportJobLogResponse, + } as SaveSupportJobLogResponse; + return message; + }, + + toJSON(_: SaveSupportJobLogResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): SaveSupportJobLogResponse { + const message = { + ...baseSaveSupportJobLogResponse, + } as SaveSupportJobLogResponse; + return message; + }, +}; + +messageTypeRegistry.set( + SaveSupportJobLogResponse.$type, + SaveSupportJobLogResponse +); + export const JobServiceService = { /** Retrieves a list of jobs for Data Proc cluster. */ listActive: { @@ -453,6 +846,47 @@ export const JobServiceService = { responseDeserialize: (value: Buffer) => UpdateJobStatusResponse.decode(value), }, + /** Retrieves a list of support jobs for Data Proc cluster. */ + listSupportActive: { + path: "/yandex.cloud.dataproc.manager.v1.JobService/ListSupportActive", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListJobsRequest) => + Buffer.from(ListJobsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListJobsRequest.decode(value), + responseSerialize: (value: ListSupportJobsResponse) => + Buffer.from(ListSupportJobsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListSupportJobsResponse.decode(value), + }, + /** Currently used to update support job status. */ + updateSupportStatus: { + path: "/yandex.cloud.dataproc.manager.v1.JobService/UpdateSupportStatus", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateSupportJobStatusRequest) => + Buffer.from(UpdateSupportJobStatusRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateSupportJobStatusRequest.decode(value), + responseSerialize: (value: UpdateJobStatusResponse) => + Buffer.from(UpdateJobStatusResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + UpdateJobStatusResponse.decode(value), + }, + /** Save support job output. */ + saveSupportLog: { + path: "/yandex.cloud.dataproc.manager.v1.JobService/SaveSupportLog", + requestStream: false, + responseStream: false, + requestSerialize: (value: SaveSupportJobLogRequest) => + Buffer.from(SaveSupportJobLogRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SaveSupportJobLogRequest.decode(value), + responseSerialize: (value: SaveSupportJobLogResponse) => + Buffer.from(SaveSupportJobLogResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + SaveSupportJobLogResponse.decode(value), + }, } as const; export interface JobServiceServer extends UntypedServiceImplementation { @@ -463,6 +897,18 @@ export interface JobServiceServer extends UntypedServiceImplementation { UpdateJobStatusRequest, UpdateJobStatusResponse >; + /** Retrieves a list of support jobs for Data Proc cluster. */ + listSupportActive: handleUnaryCall; + /** Currently used to update support job status. */ + updateSupportStatus: handleUnaryCall< + UpdateSupportJobStatusRequest, + UpdateJobStatusResponse + >; + /** Save support job output. */ + saveSupportLog: handleUnaryCall< + SaveSupportJobLogRequest, + SaveSupportJobLogResponse + >; } export interface JobServiceClient extends Client { @@ -507,6 +953,81 @@ export interface JobServiceClient extends Client { response: UpdateJobStatusResponse ) => void ): ClientUnaryCall; + /** Retrieves a list of support jobs for Data Proc cluster. */ + listSupportActive( + request: ListJobsRequest, + callback: ( + error: ServiceError | null, + response: ListSupportJobsResponse + ) => void + ): ClientUnaryCall; + listSupportActive( + request: ListJobsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListSupportJobsResponse + ) => void + ): ClientUnaryCall; + listSupportActive( + request: ListJobsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListSupportJobsResponse + ) => void + ): ClientUnaryCall; + /** Currently used to update support job status. */ + updateSupportStatus( + request: UpdateSupportJobStatusRequest, + callback: ( + error: ServiceError | null, + response: UpdateJobStatusResponse + ) => void + ): ClientUnaryCall; + updateSupportStatus( + request: UpdateSupportJobStatusRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: UpdateJobStatusResponse + ) => void + ): ClientUnaryCall; + updateSupportStatus( + request: UpdateSupportJobStatusRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: UpdateJobStatusResponse + ) => void + ): ClientUnaryCall; + /** Save support job output. */ + saveSupportLog( + request: SaveSupportJobLogRequest, + callback: ( + error: ServiceError | null, + response: SaveSupportJobLogResponse + ) => void + ): ClientUnaryCall; + saveSupportLog( + request: SaveSupportJobLogRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: SaveSupportJobLogResponse + ) => void + ): ClientUnaryCall; + saveSupportLog( + request: SaveSupportJobLogRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: SaveSupportJobLogResponse + ) => void + ): ClientUnaryCall; } export const JobServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/datasphere/index.ts b/src/generated/yandex/cloud/datasphere/index.ts index 39b19444..76f3e65f 100644 --- a/src/generated/yandex/cloud/datasphere/index.ts +++ b/src/generated/yandex/cloud/datasphere/index.ts @@ -1,12 +1,21 @@ -export * as app_token_service from './v1/app_token_service' -export * as folder_budget_service from './v1/folder_budget_service' -export * as node_execution_error_details from './v1/node_execution_error_details' -export * as node_service from './v1/node_service' -export * as project_data_service from './v1/project_data_service' -export * as community from './v2/community' -export * as community_service from './v2/community_service' -export * as dataset from './v2/dataset' -export * as project from './v2/project' -export * as project_service from './v2/project_service' -export * as secret from './v2/secret' -export * as user from './v2/user' +export * as v1_app_token_service from './v1/app_token_service' +export * as v1_folder_budget_service from './v1/folder_budget_service' +export * as v1_node_execution_error_details from './v1/node_execution_error_details' +export * as v1_node_service from './v1/node_service' +export * as v1_project from './v1/project' +export * as v1_project_data_service from './v1/project_data_service' +export * as v1_project_service from './v1/project_service' +export * as v2_community from './v2/community' +export * as v2_community_service from './v2/community_service' +export * as v2_dataset from './v2/dataset' +export * as v2_dataset_service from './v2/dataset_service' +export * as v2_docker_image_service from './v2/docker_image_service' +export * as v2_project from './v2/project' +export * as v2_project_service from './v2/project_service' +export * as v2_resource_types from './v2/resource_types' +export * as v2_restrictions from './v2/restrictions' +export * as v2_s3_service from './v2/s3_service' +export * as v2_secret from './v2/secret' +export * as v2_user from './v2/user' +export * as v2_jobs_jobs from './v2/jobs/jobs' +export * as v2_jobs_project_job_service from './v2/jobs/project_job_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/datasphere/v2/community.ts b/src/generated/yandex/cloud/datasphere/v2/community.ts index 6dc88c51..08cc55ac 100644 --- a/src/generated/yandex/cloud/datasphere/v2/community.ts +++ b/src/generated/yandex/cloud/datasphere/v2/community.ts @@ -22,6 +22,8 @@ export interface Community { createdById: string; /** ID of the organization to which community belongs. */ organizationId: string; + /** ID of the zone where this community was created */ + zoneId: string; } export interface Community_LabelsEntry { @@ -37,6 +39,7 @@ const baseCommunity: object = { description: "", createdById: "", organizationId: "", + zoneId: "", }; export const Community = { @@ -77,6 +80,9 @@ export const Community = { if (message.organizationId !== "") { writer.uint32(82).string(message.organizationId); } + if (message.zoneId !== "") { + writer.uint32(90).string(message.zoneId); + } return writer; }, @@ -114,6 +120,9 @@ export const Community = { case 10: message.organizationId = reader.string(); break; + case 11: + message.zoneId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -152,6 +161,10 @@ export const Community = { object.organizationId !== undefined && object.organizationId !== null ? String(object.organizationId) : ""; + message.zoneId = + object.zoneId !== undefined && object.zoneId !== null + ? String(object.zoneId) + : ""; return message; }, @@ -173,6 +186,7 @@ export const Community = { (obj.createdById = message.createdById); message.organizationId !== undefined && (obj.organizationId = message.organizationId); + message.zoneId !== undefined && (obj.zoneId = message.zoneId); return obj; }, @@ -194,6 +208,7 @@ export const Community = { }, {}); message.createdById = object.createdById ?? ""; message.organizationId = object.organizationId ?? ""; + message.zoneId = object.zoneId ?? ""; return message; }, }; diff --git a/src/generated/yandex/cloud/datasphere/v2/community_service.ts b/src/generated/yandex/cloud/datasphere/v2/community_service.ts index ec00b284..1ff651fa 100644 --- a/src/generated/yandex/cloud/datasphere/v2/community_service.ts +++ b/src/generated/yandex/cloud/datasphere/v2/community_service.ts @@ -15,7 +15,17 @@ import { } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { + ResourceType, + resourceTypeFromJSON, + resourceTypeToJSON, +} from "../../../../yandex/cloud/datasphere/v2/resource_types"; import { Community } from "../../../../yandex/cloud/datasphere/v2/community"; +import { + Restriction, + GetRestrictionsMetaResponse, + RestrictionsResponse, +} from "../../../../yandex/cloud/datasphere/v2/restrictions"; import { Operation } from "../../../../yandex/cloud/operation/operation"; import { ListAccessBindingsRequest, @@ -23,6 +33,7 @@ import { SetAccessBindingsRequest, UpdateAccessBindingsRequest, } from "../../../../yandex/cloud/access/access"; +import { Empty } from "../../../../google/protobuf/empty"; export const protobufPackage = "yandex.cloud.datasphere.v2"; @@ -38,6 +49,8 @@ export interface CreateCommunityRequest { billingAccountId: string; /** Labels of the community. */ labels: { [key: string]: string }; + /** ID of the zone where community will be created (all projects and other resources will be in this zone) */ + zoneId: string; } export interface CreateCommunityRequest_LabelsEntry { @@ -150,12 +163,41 @@ export interface UpdateCommunityAccessBindingsMetadata { communityId: string; } +export interface AddCommunityResourceRequest { + $type: "yandex.cloud.datasphere.v2.AddCommunityResourceRequest"; + communityId: string; + resourceType: ResourceType; + resourceId: string; +} + +export interface RemoveCommunityResourceRequest { + $type: "yandex.cloud.datasphere.v2.RemoveCommunityResourceRequest"; + communityId: string; + resourceType: ResourceType; + resourceId: string; +} + +export interface GetCommunityRestrictionsRequest { + $type: "yandex.cloud.datasphere.v2.GetCommunityRestrictionsRequest"; + /** ID of the community. */ + communityId: string; +} + +export interface SetCommunityRestrictionsRequest { + $type: "yandex.cloud.datasphere.v2.SetCommunityRestrictionsRequest"; + /** ID of the community. */ + communityId: string; + /** List of restrictions to set. */ + restrictions: Restriction[]; +} + const baseCreateCommunityRequest: object = { $type: "yandex.cloud.datasphere.v2.CreateCommunityRequest", name: "", description: "", organizationId: "", billingAccountId: "", + zoneId: "", }; export const CreateCommunityRequest = { @@ -188,6 +230,9 @@ export const CreateCommunityRequest = { writer.uint32(42).fork() ).ldelim(); }); + if (message.zoneId !== "") { + writer.uint32(50).string(message.zoneId); + } return writer; }, @@ -223,6 +268,9 @@ export const CreateCommunityRequest = { message.labels[entry5.key] = entry5.value; } break; + case 6: + message.zoneId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -255,6 +303,10 @@ export const CreateCommunityRequest = { acc[key] = String(value); return acc; }, {}); + message.zoneId = + object.zoneId !== undefined && object.zoneId !== null + ? String(object.zoneId) + : ""; return message; }, @@ -273,6 +325,7 @@ export const CreateCommunityRequest = { obj.labels[k] = v; }); } + message.zoneId !== undefined && (obj.zoneId = message.zoneId); return obj; }, @@ -292,6 +345,7 @@ export const CreateCommunityRequest = { } return acc; }, {}); + message.zoneId = object.zoneId ?? ""; return message; }, }; @@ -1344,6 +1398,382 @@ messageTypeRegistry.set( UpdateCommunityAccessBindingsMetadata ); +const baseAddCommunityResourceRequest: object = { + $type: "yandex.cloud.datasphere.v2.AddCommunityResourceRequest", + communityId: "", + resourceType: 0, + resourceId: "", +}; + +export const AddCommunityResourceRequest = { + $type: "yandex.cloud.datasphere.v2.AddCommunityResourceRequest" as const, + + encode( + message: AddCommunityResourceRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.communityId !== "") { + writer.uint32(10).string(message.communityId); + } + if (message.resourceType !== 0) { + writer.uint32(16).int32(message.resourceType); + } + if (message.resourceId !== "") { + writer.uint32(26).string(message.resourceId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AddCommunityResourceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAddCommunityResourceRequest, + } as AddCommunityResourceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.communityId = reader.string(); + break; + case 2: + message.resourceType = reader.int32() as any; + break; + case 3: + message.resourceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AddCommunityResourceRequest { + const message = { + ...baseAddCommunityResourceRequest, + } as AddCommunityResourceRequest; + message.communityId = + object.communityId !== undefined && object.communityId !== null + ? String(object.communityId) + : ""; + message.resourceType = + object.resourceType !== undefined && object.resourceType !== null + ? resourceTypeFromJSON(object.resourceType) + : 0; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + return message; + }, + + toJSON(message: AddCommunityResourceRequest): unknown { + const obj: any = {}; + message.communityId !== undefined && + (obj.communityId = message.communityId); + message.resourceType !== undefined && + (obj.resourceType = resourceTypeToJSON(message.resourceType)); + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + return obj; + }, + + fromPartial, I>>( + object: I + ): AddCommunityResourceRequest { + const message = { + ...baseAddCommunityResourceRequest, + } as AddCommunityResourceRequest; + message.communityId = object.communityId ?? ""; + message.resourceType = object.resourceType ?? 0; + message.resourceId = object.resourceId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + AddCommunityResourceRequest.$type, + AddCommunityResourceRequest +); + +const baseRemoveCommunityResourceRequest: object = { + $type: "yandex.cloud.datasphere.v2.RemoveCommunityResourceRequest", + communityId: "", + resourceType: 0, + resourceId: "", +}; + +export const RemoveCommunityResourceRequest = { + $type: "yandex.cloud.datasphere.v2.RemoveCommunityResourceRequest" as const, + + encode( + message: RemoveCommunityResourceRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.communityId !== "") { + writer.uint32(10).string(message.communityId); + } + if (message.resourceType !== 0) { + writer.uint32(16).int32(message.resourceType); + } + if (message.resourceId !== "") { + writer.uint32(26).string(message.resourceId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RemoveCommunityResourceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRemoveCommunityResourceRequest, + } as RemoveCommunityResourceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.communityId = reader.string(); + break; + case 2: + message.resourceType = reader.int32() as any; + break; + case 3: + message.resourceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RemoveCommunityResourceRequest { + const message = { + ...baseRemoveCommunityResourceRequest, + } as RemoveCommunityResourceRequest; + message.communityId = + object.communityId !== undefined && object.communityId !== null + ? String(object.communityId) + : ""; + message.resourceType = + object.resourceType !== undefined && object.resourceType !== null + ? resourceTypeFromJSON(object.resourceType) + : 0; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + return message; + }, + + toJSON(message: RemoveCommunityResourceRequest): unknown { + const obj: any = {}; + message.communityId !== undefined && + (obj.communityId = message.communityId); + message.resourceType !== undefined && + (obj.resourceType = resourceTypeToJSON(message.resourceType)); + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + return obj; + }, + + fromPartial, I>>( + object: I + ): RemoveCommunityResourceRequest { + const message = { + ...baseRemoveCommunityResourceRequest, + } as RemoveCommunityResourceRequest; + message.communityId = object.communityId ?? ""; + message.resourceType = object.resourceType ?? 0; + message.resourceId = object.resourceId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + RemoveCommunityResourceRequest.$type, + RemoveCommunityResourceRequest +); + +const baseGetCommunityRestrictionsRequest: object = { + $type: "yandex.cloud.datasphere.v2.GetCommunityRestrictionsRequest", + communityId: "", +}; + +export const GetCommunityRestrictionsRequest = { + $type: "yandex.cloud.datasphere.v2.GetCommunityRestrictionsRequest" as const, + + encode( + message: GetCommunityRestrictionsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.communityId !== "") { + writer.uint32(10).string(message.communityId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetCommunityRestrictionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetCommunityRestrictionsRequest, + } as GetCommunityRestrictionsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.communityId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetCommunityRestrictionsRequest { + const message = { + ...baseGetCommunityRestrictionsRequest, + } as GetCommunityRestrictionsRequest; + message.communityId = + object.communityId !== undefined && object.communityId !== null + ? String(object.communityId) + : ""; + return message; + }, + + toJSON(message: GetCommunityRestrictionsRequest): unknown { + const obj: any = {}; + message.communityId !== undefined && + (obj.communityId = message.communityId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetCommunityRestrictionsRequest { + const message = { + ...baseGetCommunityRestrictionsRequest, + } as GetCommunityRestrictionsRequest; + message.communityId = object.communityId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetCommunityRestrictionsRequest.$type, + GetCommunityRestrictionsRequest +); + +const baseSetCommunityRestrictionsRequest: object = { + $type: "yandex.cloud.datasphere.v2.SetCommunityRestrictionsRequest", + communityId: "", +}; + +export const SetCommunityRestrictionsRequest = { + $type: "yandex.cloud.datasphere.v2.SetCommunityRestrictionsRequest" as const, + + encode( + message: SetCommunityRestrictionsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.communityId !== "") { + writer.uint32(10).string(message.communityId); + } + for (const v of message.restrictions) { + Restriction.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SetCommunityRestrictionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSetCommunityRestrictionsRequest, + } as SetCommunityRestrictionsRequest; + message.restrictions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.communityId = reader.string(); + break; + case 2: + message.restrictions.push( + Restriction.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SetCommunityRestrictionsRequest { + const message = { + ...baseSetCommunityRestrictionsRequest, + } as SetCommunityRestrictionsRequest; + message.communityId = + object.communityId !== undefined && object.communityId !== null + ? String(object.communityId) + : ""; + message.restrictions = (object.restrictions ?? []).map((e: any) => + Restriction.fromJSON(e) + ); + return message; + }, + + toJSON(message: SetCommunityRestrictionsRequest): unknown { + const obj: any = {}; + message.communityId !== undefined && + (obj.communityId = message.communityId); + if (message.restrictions) { + obj.restrictions = message.restrictions.map((e) => + e ? Restriction.toJSON(e) : undefined + ); + } else { + obj.restrictions = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): SetCommunityRestrictionsRequest { + const message = { + ...baseSetCommunityRestrictionsRequest, + } as SetCommunityRestrictionsRequest; + message.communityId = object.communityId ?? ""; + message.restrictions = + object.restrictions?.map((e) => Restriction.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + SetCommunityRestrictionsRequest.$type, + SetCommunityRestrictionsRequest +); + +/** A set of methods for managing Community resources. */ export const CommunityServiceService = { /** Creates community in specified organization. */ create: { @@ -1446,6 +1876,71 @@ export const CommunityServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Adds shared resource to community */ + addResource: { + path: "/yandex.cloud.datasphere.v2.CommunityService/AddResource", + requestStream: false, + responseStream: false, + requestSerialize: (value: AddCommunityResourceRequest) => + Buffer.from(AddCommunityResourceRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + AddCommunityResourceRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Removes shared resource from community */ + removeResource: { + path: "/yandex.cloud.datasphere.v2.CommunityService/RemoveResource", + requestStream: false, + responseStream: false, + requestSerialize: (value: RemoveCommunityResourceRequest) => + Buffer.from(RemoveCommunityResourceRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + RemoveCommunityResourceRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Get meta information about available restrictions. */ + getRestrictionsMeta: { + path: "/yandex.cloud.datasphere.v2.CommunityService/GetRestrictionsMeta", + requestStream: false, + responseStream: false, + requestSerialize: (value: Empty) => + Buffer.from(Empty.encode(value).finish()), + requestDeserialize: (value: Buffer) => Empty.decode(value), + responseSerialize: (value: GetRestrictionsMetaResponse) => + Buffer.from(GetRestrictionsMetaResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + GetRestrictionsMetaResponse.decode(value), + }, + /** Get current community restrictions. */ + getRestrictions: { + path: "/yandex.cloud.datasphere.v2.CommunityService/GetRestrictions", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetCommunityRestrictionsRequest) => + Buffer.from(GetCommunityRestrictionsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetCommunityRestrictionsRequest.decode(value), + responseSerialize: (value: RestrictionsResponse) => + Buffer.from(RestrictionsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => RestrictionsResponse.decode(value), + }, + /** Set community restrictions. */ + setRestrictions: { + path: "/yandex.cloud.datasphere.v2.CommunityService/SetRestrictions", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetCommunityRestrictionsRequest) => + Buffer.from(SetCommunityRestrictionsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetCommunityRestrictionsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface CommunityServiceServer extends UntypedServiceImplementation { @@ -1468,6 +1963,19 @@ export interface CommunityServiceServer extends UntypedServiceImplementation { setAccessBindings: handleUnaryCall; /** Updates access bindings for specified community. */ updateAccessBindings: handleUnaryCall; + /** Adds shared resource to community */ + addResource: handleUnaryCall; + /** Removes shared resource from community */ + removeResource: handleUnaryCall; + /** Get meta information about available restrictions. */ + getRestrictionsMeta: handleUnaryCall; + /** Get current community restrictions. */ + getRestrictions: handleUnaryCall< + GetCommunityRestrictionsRequest, + RestrictionsResponse + >; + /** Set community restrictions. */ + setRestrictions: handleUnaryCall; } export interface CommunityServiceClient extends Client { @@ -1617,6 +2125,104 @@ export interface CommunityServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Adds shared resource to community */ + addResource( + request: AddCommunityResourceRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + addResource( + request: AddCommunityResourceRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + addResource( + request: AddCommunityResourceRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Removes shared resource from community */ + removeResource( + request: RemoveCommunityResourceRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + removeResource( + request: RemoveCommunityResourceRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + removeResource( + request: RemoveCommunityResourceRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Get meta information about available restrictions. */ + getRestrictionsMeta( + request: Empty, + callback: ( + error: ServiceError | null, + response: GetRestrictionsMetaResponse + ) => void + ): ClientUnaryCall; + getRestrictionsMeta( + request: Empty, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: GetRestrictionsMetaResponse + ) => void + ): ClientUnaryCall; + getRestrictionsMeta( + request: Empty, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: GetRestrictionsMetaResponse + ) => void + ): ClientUnaryCall; + /** Get current community restrictions. */ + getRestrictions( + request: GetCommunityRestrictionsRequest, + callback: ( + error: ServiceError | null, + response: RestrictionsResponse + ) => void + ): ClientUnaryCall; + getRestrictions( + request: GetCommunityRestrictionsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: RestrictionsResponse + ) => void + ): ClientUnaryCall; + getRestrictions( + request: GetCommunityRestrictionsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: RestrictionsResponse + ) => void + ): ClientUnaryCall; + /** Set community restrictions. */ + setRestrictions( + request: SetCommunityRestrictionsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setRestrictions( + request: SetCommunityRestrictionsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setRestrictions( + request: SetCommunityRestrictionsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const CommunityServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/datasphere/v2/dataset_service.ts b/src/generated/yandex/cloud/datasphere/v2/dataset_service.ts new file mode 100644 index 00000000..056f5876 --- /dev/null +++ b/src/generated/yandex/cloud/datasphere/v2/dataset_service.ts @@ -0,0 +1,311 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.datasphere.v2"; + +export interface ActivateDatasetRequest { + $type: "yandex.cloud.datasphere.v2.ActivateDatasetRequest"; + datasetId: string; + projectId: string; +} + +export interface DeactivateDatasetRequest { + $type: "yandex.cloud.datasphere.v2.DeactivateDatasetRequest"; + datasetId: string; + projectId: string; +} + +const baseActivateDatasetRequest: object = { + $type: "yandex.cloud.datasphere.v2.ActivateDatasetRequest", + datasetId: "", + projectId: "", +}; + +export const ActivateDatasetRequest = { + $type: "yandex.cloud.datasphere.v2.ActivateDatasetRequest" as const, + + encode( + message: ActivateDatasetRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.datasetId !== "") { + writer.uint32(10).string(message.datasetId); + } + if (message.projectId !== "") { + writer.uint32(18).string(message.projectId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ActivateDatasetRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseActivateDatasetRequest } as ActivateDatasetRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.datasetId = reader.string(); + break; + case 2: + message.projectId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ActivateDatasetRequest { + const message = { ...baseActivateDatasetRequest } as ActivateDatasetRequest; + message.datasetId = + object.datasetId !== undefined && object.datasetId !== null + ? String(object.datasetId) + : ""; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + return message; + }, + + toJSON(message: ActivateDatasetRequest): unknown { + const obj: any = {}; + message.datasetId !== undefined && (obj.datasetId = message.datasetId); + message.projectId !== undefined && (obj.projectId = message.projectId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ActivateDatasetRequest { + const message = { ...baseActivateDatasetRequest } as ActivateDatasetRequest; + message.datasetId = object.datasetId ?? ""; + message.projectId = object.projectId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ActivateDatasetRequest.$type, ActivateDatasetRequest); + +const baseDeactivateDatasetRequest: object = { + $type: "yandex.cloud.datasphere.v2.DeactivateDatasetRequest", + datasetId: "", + projectId: "", +}; + +export const DeactivateDatasetRequest = { + $type: "yandex.cloud.datasphere.v2.DeactivateDatasetRequest" as const, + + encode( + message: DeactivateDatasetRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.datasetId !== "") { + writer.uint32(10).string(message.datasetId); + } + if (message.projectId !== "") { + writer.uint32(18).string(message.projectId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeactivateDatasetRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeactivateDatasetRequest, + } as DeactivateDatasetRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.datasetId = reader.string(); + break; + case 2: + message.projectId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeactivateDatasetRequest { + const message = { + ...baseDeactivateDatasetRequest, + } as DeactivateDatasetRequest; + message.datasetId = + object.datasetId !== undefined && object.datasetId !== null + ? String(object.datasetId) + : ""; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + return message; + }, + + toJSON(message: DeactivateDatasetRequest): unknown { + const obj: any = {}; + message.datasetId !== undefined && (obj.datasetId = message.datasetId); + message.projectId !== undefined && (obj.projectId = message.projectId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeactivateDatasetRequest { + const message = { + ...baseDeactivateDatasetRequest, + } as DeactivateDatasetRequest; + message.datasetId = object.datasetId ?? ""; + message.projectId = object.projectId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeactivateDatasetRequest.$type, + DeactivateDatasetRequest +); + +/** A set of methods for managing Datasets. */ +export const DatasetServiceService = { + /** Activates shared dataset for project */ + activate: { + path: "/yandex.cloud.datasphere.v2.DatasetService/Activate", + requestStream: false, + responseStream: false, + requestSerialize: (value: ActivateDatasetRequest) => + Buffer.from(ActivateDatasetRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ActivateDatasetRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deactivates shared dataset for project */ + deactivate: { + path: "/yandex.cloud.datasphere.v2.DatasetService/Deactivate", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeactivateDatasetRequest) => + Buffer.from(DeactivateDatasetRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeactivateDatasetRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface DatasetServiceServer extends UntypedServiceImplementation { + /** Activates shared dataset for project */ + activate: handleUnaryCall; + /** Deactivates shared dataset for project */ + deactivate: handleUnaryCall; +} + +export interface DatasetServiceClient extends Client { + /** Activates shared dataset for project */ + activate( + request: ActivateDatasetRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + activate( + request: ActivateDatasetRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + activate( + request: ActivateDatasetRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deactivates shared dataset for project */ + deactivate( + request: DeactivateDatasetRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deactivate( + request: DeactivateDatasetRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deactivate( + request: DeactivateDatasetRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const DatasetServiceClient = makeGenericClientConstructor( + DatasetServiceService, + "yandex.cloud.datasphere.v2.DatasetService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): DatasetServiceClient; + service: typeof DatasetServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/datasphere/v2/docker_image_service.ts b/src/generated/yandex/cloud/datasphere/v2/docker_image_service.ts new file mode 100644 index 00000000..2d92610b --- /dev/null +++ b/src/generated/yandex/cloud/datasphere/v2/docker_image_service.ts @@ -0,0 +1,197 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.datasphere.v2"; + +export interface ActivateDockerImageRequest { + $type: "yandex.cloud.datasphere.v2.ActivateDockerImageRequest"; + projectId: string; + dockerId: string; +} + +const baseActivateDockerImageRequest: object = { + $type: "yandex.cloud.datasphere.v2.ActivateDockerImageRequest", + projectId: "", + dockerId: "", +}; + +export const ActivateDockerImageRequest = { + $type: "yandex.cloud.datasphere.v2.ActivateDockerImageRequest" as const, + + encode( + message: ActivateDockerImageRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.projectId !== "") { + writer.uint32(10).string(message.projectId); + } + if (message.dockerId !== "") { + writer.uint32(18).string(message.dockerId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ActivateDockerImageRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseActivateDockerImageRequest, + } as ActivateDockerImageRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 2: + message.dockerId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ActivateDockerImageRequest { + const message = { + ...baseActivateDockerImageRequest, + } as ActivateDockerImageRequest; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + message.dockerId = + object.dockerId !== undefined && object.dockerId !== null + ? String(object.dockerId) + : ""; + return message; + }, + + toJSON(message: ActivateDockerImageRequest): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = message.projectId); + message.dockerId !== undefined && (obj.dockerId = message.dockerId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ActivateDockerImageRequest { + const message = { + ...baseActivateDockerImageRequest, + } as ActivateDockerImageRequest; + message.projectId = object.projectId ?? ""; + message.dockerId = object.dockerId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ActivateDockerImageRequest.$type, + ActivateDockerImageRequest +); + +/** A set of methods for managing Docker Images. */ +export const DockerImageServiceService = { + /** Activates shared docker image in project */ + activate: { + path: "/yandex.cloud.datasphere.v2.DockerImageService/Activate", + requestStream: false, + responseStream: false, + requestSerialize: (value: ActivateDockerImageRequest) => + Buffer.from(ActivateDockerImageRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ActivateDockerImageRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface DockerImageServiceServer extends UntypedServiceImplementation { + /** Activates shared docker image in project */ + activate: handleUnaryCall; +} + +export interface DockerImageServiceClient extends Client { + /** Activates shared docker image in project */ + activate( + request: ActivateDockerImageRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + activate( + request: ActivateDockerImageRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + activate( + request: ActivateDockerImageRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const DockerImageServiceClient = makeGenericClientConstructor( + DockerImageServiceService, + "yandex.cloud.datasphere.v2.DockerImageService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): DockerImageServiceClient; + service: typeof DockerImageServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/datasphere/v2/jobs/jobs.ts b/src/generated/yandex/cloud/datasphere/v2/jobs/jobs.ts new file mode 100644 index 00000000..0cc5ede6 --- /dev/null +++ b/src/generated/yandex/cloud/datasphere/v2/jobs/jobs.ts @@ -0,0 +1,2531 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Duration } from "../../../../../google/protobuf/duration"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.datasphere.v2.jobs"; + +export enum FileCompressionType { + FILE_COMPRESSION_TYPE_UNSPECIFIED = 0, + NONE = 1, + ZIP = 2, + UNRECOGNIZED = -1, +} + +export function fileCompressionTypeFromJSON(object: any): FileCompressionType { + switch (object) { + case 0: + case "FILE_COMPRESSION_TYPE_UNSPECIFIED": + return FileCompressionType.FILE_COMPRESSION_TYPE_UNSPECIFIED; + case 1: + case "NONE": + return FileCompressionType.NONE; + case 2: + case "ZIP": + return FileCompressionType.ZIP; + case -1: + case "UNRECOGNIZED": + default: + return FileCompressionType.UNRECOGNIZED; + } +} + +export function fileCompressionTypeToJSON(object: FileCompressionType): string { + switch (object) { + case FileCompressionType.FILE_COMPRESSION_TYPE_UNSPECIFIED: + return "FILE_COMPRESSION_TYPE_UNSPECIFIED"; + case FileCompressionType.NONE: + return "NONE"; + case FileCompressionType.ZIP: + return "ZIP"; + default: + return "UNKNOWN"; + } +} + +export enum JobStatus { + JOB_STATUS_UNSPECIFIED = 0, + CREATING = 1, + EXECUTING = 2, + UPLOADING_OUTPUT = 3, + SUCCESS = 4, + ERROR = 5, + CANCELLED = 6, + CANCELLING = 7, + UNRECOGNIZED = -1, +} + +export function jobStatusFromJSON(object: any): JobStatus { + switch (object) { + case 0: + case "JOB_STATUS_UNSPECIFIED": + return JobStatus.JOB_STATUS_UNSPECIFIED; + case 1: + case "CREATING": + return JobStatus.CREATING; + case 2: + case "EXECUTING": + return JobStatus.EXECUTING; + case 3: + case "UPLOADING_OUTPUT": + return JobStatus.UPLOADING_OUTPUT; + case 4: + case "SUCCESS": + return JobStatus.SUCCESS; + case 5: + case "ERROR": + return JobStatus.ERROR; + case 6: + case "CANCELLED": + return JobStatus.CANCELLED; + case 7: + case "CANCELLING": + return JobStatus.CANCELLING; + case -1: + case "UNRECOGNIZED": + default: + return JobStatus.UNRECOGNIZED; + } +} + +export function jobStatusToJSON(object: JobStatus): string { + switch (object) { + case JobStatus.JOB_STATUS_UNSPECIFIED: + return "JOB_STATUS_UNSPECIFIED"; + case JobStatus.CREATING: + return "CREATING"; + case JobStatus.EXECUTING: + return "EXECUTING"; + case JobStatus.UPLOADING_OUTPUT: + return "UPLOADING_OUTPUT"; + case JobStatus.SUCCESS: + return "SUCCESS"; + case JobStatus.ERROR: + return "ERROR"; + case JobStatus.CANCELLED: + return "CANCELLED"; + case JobStatus.CANCELLING: + return "CANCELLING"; + default: + return "UNKNOWN"; + } +} + +/** Job parameters. */ +export interface JobParameters { + $type: "yandex.cloud.datasphere.v2.jobs.JobParameters"; + /** List of input files. */ + inputFiles: File[]; + /** List of output files descriptions. */ + outputFiles: FileDesc[]; + /** List of DataSphere S3 mount ids. */ + s3MountIds: string[]; + /** List of DataSphere dataset ids. */ + datasetIds: string[]; + /** Job run command. */ + cmd: string; + /** Job environment description. */ + env?: Environment; + /** Should project disk be attached to VM. */ + attachProjectDisk: boolean; + /** VM specification. */ + cloudInstanceTypes: CloudInstanceType[]; + /** Extended working storage configuration. */ + extendedWorkingStorage?: ExtendedWorkingStorage; + /** List of literal arguments. */ + arguments: Argument[]; + /** List of DataSets descriptions to create. */ + outputDatasets: OutputDatasetDesc[]; + /** Graceful shutdown settings. */ + gracefulShutdownParameters?: GracefulShutdownParameters; +} + +export interface CloudInstanceType { + $type: "yandex.cloud.datasphere.v2.jobs.CloudInstanceType"; + /** Name of DataSphere VM configuration. */ + name: string; +} + +/** Extended working storage configuration. */ +export interface ExtendedWorkingStorage { + $type: "yandex.cloud.datasphere.v2.jobs.ExtendedWorkingStorage"; + type: ExtendedWorkingStorage_StorageType; + sizeGb: number; +} + +export enum ExtendedWorkingStorage_StorageType { + STORAGE_TYPE_UNSPECIFIED = 0, + SSD = 1, + UNRECOGNIZED = -1, +} + +export function extendedWorkingStorage_StorageTypeFromJSON( + object: any +): ExtendedWorkingStorage_StorageType { + switch (object) { + case 0: + case "STORAGE_TYPE_UNSPECIFIED": + return ExtendedWorkingStorage_StorageType.STORAGE_TYPE_UNSPECIFIED; + case 1: + case "SSD": + return ExtendedWorkingStorage_StorageType.SSD; + case -1: + case "UNRECOGNIZED": + default: + return ExtendedWorkingStorage_StorageType.UNRECOGNIZED; + } +} + +export function extendedWorkingStorage_StorageTypeToJSON( + object: ExtendedWorkingStorage_StorageType +): string { + switch (object) { + case ExtendedWorkingStorage_StorageType.STORAGE_TYPE_UNSPECIFIED: + return "STORAGE_TYPE_UNSPECIFIED"; + case ExtendedWorkingStorage_StorageType.SSD: + return "SSD"; + default: + return "UNKNOWN"; + } +} + +export interface Argument { + $type: "yandex.cloud.datasphere.v2.jobs.Argument"; + name: string; + value: string; +} + +export interface File { + $type: "yandex.cloud.datasphere.v2.jobs.File"; + desc?: FileDesc; + /** SHA256 of the file. */ + sha256: string; + /** File size in bytes. */ + sizeBytes: number; + /** File compression info */ + compressionType: FileCompressionType; +} + +export interface StorageFile { + $type: "yandex.cloud.datasphere.v2.jobs.StorageFile"; + file?: File; + /** File URL. */ + url: string; +} + +export interface FileDesc { + $type: "yandex.cloud.datasphere.v2.jobs.FileDesc"; + /** Path of the file on filesystem. */ + path: string; + /** Variable to use in cmd substitution. */ + var: string; +} + +export interface FileUploadError { + $type: "yandex.cloud.datasphere.v2.jobs.FileUploadError"; + outputFileDesc?: FileDesc | undefined; + logFileName: string | undefined; + description: string; +} + +export interface Environment { + $type: "yandex.cloud.datasphere.v2.jobs.Environment"; + /** Environment variables. */ + vars: { [key: string]: string }; + /** DS docker image id. */ + dockerImageResourceId: string | undefined; + dockerImageSpec?: DockerImageSpec | undefined; + pythonEnv?: PythonEnv; +} + +export interface Environment_VarsEntry { + $type: "yandex.cloud.datasphere.v2.jobs.Environment.VarsEntry"; + key: string; + value: string; +} + +export interface DockerImageSpec { + $type: "yandex.cloud.datasphere.v2.jobs.DockerImageSpec"; + /** Docker image URL. */ + imageUrl: string; + /** Username for container registry. */ + username: string; + /** Plaintext password. */ + passwordPlainText: string | undefined; + /** ID of DataSphere secret containing password. */ + passwordDsSecretName: string | undefined; +} + +export interface PythonEnv { + $type: "yandex.cloud.datasphere.v2.jobs.PythonEnv"; + /** Conda YAML. */ + condaYaml: string; + /** List of local modules descriptions. */ + localModules: File[]; +} + +export interface OutputDatasetDesc { + $type: "yandex.cloud.datasphere.v2.jobs.OutputDatasetDesc"; + /** Name to create dataset with */ + name: string; + /** Description to show in UI */ + description: string; + labels: { [key: string]: string }; + /** Size of dataset to create */ + sizeGb: number; + /** Var name to replace in cmd, like in FileDesc */ + var: string; +} + +export interface OutputDatasetDesc_LabelsEntry { + $type: "yandex.cloud.datasphere.v2.jobs.OutputDatasetDesc.LabelsEntry"; + key: string; + value: string; +} + +export interface OutputDataset { + $type: "yandex.cloud.datasphere.v2.jobs.OutputDataset"; + /** Dataset description */ + desc?: OutputDatasetDesc; + /** Id of created dataset */ + id: string; +} + +/** Instance of the job. */ +export interface Job { + $type: "yandex.cloud.datasphere.v2.jobs.Job"; + /** ID of the job. */ + id: string; + /** Name of the job. */ + name: string; + /** Description of the job. */ + desc: string; + /** Create job timestamp. */ + createdAt?: Date; + /** Finish job timestamp. */ + finishedAt?: Date; + /** Status of the job. */ + status: JobStatus; + /** Config of the job, copied from configuration file. */ + config: string; + /** ID of the user who created the job. */ + createdById: string; + /** ID of the project. */ + projectId: string; + jobParameters?: JobParameters; + /** Job data expiration timestamp. */ + dataExpiresAt?: Date; + /** Marks if the job data has been cleared. */ + dataCleared: boolean; + /** Output files of the job. */ + outputFiles: File[]; + /** Job log files. */ + logFiles: File[]; + /** Job diagnostics files. */ + diagnosticFiles: File[]; + /** Job total data size. */ + dataSizeBytes: number; + /** Start job timestamp. */ + startedAt?: Date; + /** Details. */ + statusDetails: string; + /** Actual VM instance type, job is running on. */ + actualCloudInstanceType?: CloudInstanceType; + /** Reference to the parent job. */ + parentJobId: string; + /** Failed uploads. */ + fileErrors: FileUploadError[]; + /** Created datasets. */ + outputDatasets: OutputDataset[]; +} + +export interface JobResult { + $type: "yandex.cloud.datasphere.v2.jobs.JobResult"; + /** Execution return code. */ + returnCode: number; +} + +export interface GracefulShutdownParameters { + $type: "yandex.cloud.datasphere.v2.jobs.GracefulShutdownParameters"; + timeout?: Duration; + /** default 15 (SIGTERM) */ + signal: number; +} + +const baseJobParameters: object = { + $type: "yandex.cloud.datasphere.v2.jobs.JobParameters", + s3MountIds: "", + datasetIds: "", + cmd: "", + attachProjectDisk: false, +}; + +export const JobParameters = { + $type: "yandex.cloud.datasphere.v2.jobs.JobParameters" as const, + + encode( + message: JobParameters, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.inputFiles) { + File.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.outputFiles) { + FileDesc.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.s3MountIds) { + writer.uint32(26).string(v!); + } + for (const v of message.datasetIds) { + writer.uint32(34).string(v!); + } + if (message.cmd !== "") { + writer.uint32(42).string(message.cmd); + } + if (message.env !== undefined) { + Environment.encode(message.env, writer.uint32(50).fork()).ldelim(); + } + if (message.attachProjectDisk === true) { + writer.uint32(56).bool(message.attachProjectDisk); + } + for (const v of message.cloudInstanceTypes) { + CloudInstanceType.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.extendedWorkingStorage !== undefined) { + ExtendedWorkingStorage.encode( + message.extendedWorkingStorage, + writer.uint32(74).fork() + ).ldelim(); + } + for (const v of message.arguments) { + Argument.encode(v!, writer.uint32(82).fork()).ldelim(); + } + for (const v of message.outputDatasets) { + OutputDatasetDesc.encode(v!, writer.uint32(90).fork()).ldelim(); + } + if (message.gracefulShutdownParameters !== undefined) { + GracefulShutdownParameters.encode( + message.gracefulShutdownParameters, + writer.uint32(98).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): JobParameters { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseJobParameters } as JobParameters; + message.inputFiles = []; + message.outputFiles = []; + message.s3MountIds = []; + message.datasetIds = []; + message.cloudInstanceTypes = []; + message.arguments = []; + message.outputDatasets = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputFiles.push(File.decode(reader, reader.uint32())); + break; + case 2: + message.outputFiles.push(FileDesc.decode(reader, reader.uint32())); + break; + case 3: + message.s3MountIds.push(reader.string()); + break; + case 4: + message.datasetIds.push(reader.string()); + break; + case 5: + message.cmd = reader.string(); + break; + case 6: + message.env = Environment.decode(reader, reader.uint32()); + break; + case 7: + message.attachProjectDisk = reader.bool(); + break; + case 8: + message.cloudInstanceTypes.push( + CloudInstanceType.decode(reader, reader.uint32()) + ); + break; + case 9: + message.extendedWorkingStorage = ExtendedWorkingStorage.decode( + reader, + reader.uint32() + ); + break; + case 10: + message.arguments.push(Argument.decode(reader, reader.uint32())); + break; + case 11: + message.outputDatasets.push( + OutputDatasetDesc.decode(reader, reader.uint32()) + ); + break; + case 12: + message.gracefulShutdownParameters = + GracefulShutdownParameters.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): JobParameters { + const message = { ...baseJobParameters } as JobParameters; + message.inputFiles = (object.inputFiles ?? []).map((e: any) => + File.fromJSON(e) + ); + message.outputFiles = (object.outputFiles ?? []).map((e: any) => + FileDesc.fromJSON(e) + ); + message.s3MountIds = (object.s3MountIds ?? []).map((e: any) => String(e)); + message.datasetIds = (object.datasetIds ?? []).map((e: any) => String(e)); + message.cmd = + object.cmd !== undefined && object.cmd !== null ? String(object.cmd) : ""; + message.env = + object.env !== undefined && object.env !== null + ? Environment.fromJSON(object.env) + : undefined; + message.attachProjectDisk = + object.attachProjectDisk !== undefined && + object.attachProjectDisk !== null + ? Boolean(object.attachProjectDisk) + : false; + message.cloudInstanceTypes = (object.cloudInstanceTypes ?? []).map( + (e: any) => CloudInstanceType.fromJSON(e) + ); + message.extendedWorkingStorage = + object.extendedWorkingStorage !== undefined && + object.extendedWorkingStorage !== null + ? ExtendedWorkingStorage.fromJSON(object.extendedWorkingStorage) + : undefined; + message.arguments = (object.arguments ?? []).map((e: any) => + Argument.fromJSON(e) + ); + message.outputDatasets = (object.outputDatasets ?? []).map((e: any) => + OutputDatasetDesc.fromJSON(e) + ); + message.gracefulShutdownParameters = + object.gracefulShutdownParameters !== undefined && + object.gracefulShutdownParameters !== null + ? GracefulShutdownParameters.fromJSON(object.gracefulShutdownParameters) + : undefined; + return message; + }, + + toJSON(message: JobParameters): unknown { + const obj: any = {}; + if (message.inputFiles) { + obj.inputFiles = message.inputFiles.map((e) => + e ? File.toJSON(e) : undefined + ); + } else { + obj.inputFiles = []; + } + if (message.outputFiles) { + obj.outputFiles = message.outputFiles.map((e) => + e ? FileDesc.toJSON(e) : undefined + ); + } else { + obj.outputFiles = []; + } + if (message.s3MountIds) { + obj.s3MountIds = message.s3MountIds.map((e) => e); + } else { + obj.s3MountIds = []; + } + if (message.datasetIds) { + obj.datasetIds = message.datasetIds.map((e) => e); + } else { + obj.datasetIds = []; + } + message.cmd !== undefined && (obj.cmd = message.cmd); + message.env !== undefined && + (obj.env = message.env ? Environment.toJSON(message.env) : undefined); + message.attachProjectDisk !== undefined && + (obj.attachProjectDisk = message.attachProjectDisk); + if (message.cloudInstanceTypes) { + obj.cloudInstanceTypes = message.cloudInstanceTypes.map((e) => + e ? CloudInstanceType.toJSON(e) : undefined + ); + } else { + obj.cloudInstanceTypes = []; + } + message.extendedWorkingStorage !== undefined && + (obj.extendedWorkingStorage = message.extendedWorkingStorage + ? ExtendedWorkingStorage.toJSON(message.extendedWorkingStorage) + : undefined); + if (message.arguments) { + obj.arguments = message.arguments.map((e) => + e ? Argument.toJSON(e) : undefined + ); + } else { + obj.arguments = []; + } + if (message.outputDatasets) { + obj.outputDatasets = message.outputDatasets.map((e) => + e ? OutputDatasetDesc.toJSON(e) : undefined + ); + } else { + obj.outputDatasets = []; + } + message.gracefulShutdownParameters !== undefined && + (obj.gracefulShutdownParameters = message.gracefulShutdownParameters + ? GracefulShutdownParameters.toJSON(message.gracefulShutdownParameters) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): JobParameters { + const message = { ...baseJobParameters } as JobParameters; + message.inputFiles = + object.inputFiles?.map((e) => File.fromPartial(e)) || []; + message.outputFiles = + object.outputFiles?.map((e) => FileDesc.fromPartial(e)) || []; + message.s3MountIds = object.s3MountIds?.map((e) => e) || []; + message.datasetIds = object.datasetIds?.map((e) => e) || []; + message.cmd = object.cmd ?? ""; + message.env = + object.env !== undefined && object.env !== null + ? Environment.fromPartial(object.env) + : undefined; + message.attachProjectDisk = object.attachProjectDisk ?? false; + message.cloudInstanceTypes = + object.cloudInstanceTypes?.map((e) => CloudInstanceType.fromPartial(e)) || + []; + message.extendedWorkingStorage = + object.extendedWorkingStorage !== undefined && + object.extendedWorkingStorage !== null + ? ExtendedWorkingStorage.fromPartial(object.extendedWorkingStorage) + : undefined; + message.arguments = + object.arguments?.map((e) => Argument.fromPartial(e)) || []; + message.outputDatasets = + object.outputDatasets?.map((e) => OutputDatasetDesc.fromPartial(e)) || []; + message.gracefulShutdownParameters = + object.gracefulShutdownParameters !== undefined && + object.gracefulShutdownParameters !== null + ? GracefulShutdownParameters.fromPartial( + object.gracefulShutdownParameters + ) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(JobParameters.$type, JobParameters); + +const baseCloudInstanceType: object = { + $type: "yandex.cloud.datasphere.v2.jobs.CloudInstanceType", + name: "", +}; + +export const CloudInstanceType = { + $type: "yandex.cloud.datasphere.v2.jobs.CloudInstanceType" as const, + + encode( + message: CloudInstanceType, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CloudInstanceType { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCloudInstanceType } as CloudInstanceType; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CloudInstanceType { + const message = { ...baseCloudInstanceType } as CloudInstanceType; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + return message; + }, + + toJSON(message: CloudInstanceType): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + return obj; + }, + + fromPartial, I>>( + object: I + ): CloudInstanceType { + const message = { ...baseCloudInstanceType } as CloudInstanceType; + message.name = object.name ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CloudInstanceType.$type, CloudInstanceType); + +const baseExtendedWorkingStorage: object = { + $type: "yandex.cloud.datasphere.v2.jobs.ExtendedWorkingStorage", + type: 0, + sizeGb: 0, +}; + +export const ExtendedWorkingStorage = { + $type: "yandex.cloud.datasphere.v2.jobs.ExtendedWorkingStorage" as const, + + encode( + message: ExtendedWorkingStorage, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.sizeGb !== 0) { + writer.uint32(16).int64(message.sizeGb); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ExtendedWorkingStorage { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExtendedWorkingStorage } as ExtendedWorkingStorage; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.sizeGb = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExtendedWorkingStorage { + const message = { ...baseExtendedWorkingStorage } as ExtendedWorkingStorage; + message.type = + object.type !== undefined && object.type !== null + ? extendedWorkingStorage_StorageTypeFromJSON(object.type) + : 0; + message.sizeGb = + object.sizeGb !== undefined && object.sizeGb !== null + ? Number(object.sizeGb) + : 0; + return message; + }, + + toJSON(message: ExtendedWorkingStorage): unknown { + const obj: any = {}; + message.type !== undefined && + (obj.type = extendedWorkingStorage_StorageTypeToJSON(message.type)); + message.sizeGb !== undefined && (obj.sizeGb = Math.round(message.sizeGb)); + return obj; + }, + + fromPartial, I>>( + object: I + ): ExtendedWorkingStorage { + const message = { ...baseExtendedWorkingStorage } as ExtendedWorkingStorage; + message.type = object.type ?? 0; + message.sizeGb = object.sizeGb ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(ExtendedWorkingStorage.$type, ExtendedWorkingStorage); + +const baseArgument: object = { + $type: "yandex.cloud.datasphere.v2.jobs.Argument", + name: "", + value: "", +}; + +export const Argument = { + $type: "yandex.cloud.datasphere.v2.jobs.Argument" as const, + + encode( + message: Argument, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Argument { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseArgument } as Argument; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Argument { + const message = { ...baseArgument } as Argument; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Argument): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>(object: I): Argument { + const message = { ...baseArgument } as Argument; + message.name = object.name ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Argument.$type, Argument); + +const baseFile: object = { + $type: "yandex.cloud.datasphere.v2.jobs.File", + sha256: "", + sizeBytes: 0, + compressionType: 0, +}; + +export const File = { + $type: "yandex.cloud.datasphere.v2.jobs.File" as const, + + encode(message: File, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.desc !== undefined) { + FileDesc.encode(message.desc, writer.uint32(10).fork()).ldelim(); + } + if (message.sha256 !== "") { + writer.uint32(18).string(message.sha256); + } + if (message.sizeBytes !== 0) { + writer.uint32(24).int64(message.sizeBytes); + } + if (message.compressionType !== 0) { + writer.uint32(32).int32(message.compressionType); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): File { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFile } as File; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.desc = FileDesc.decode(reader, reader.uint32()); + break; + case 2: + message.sha256 = reader.string(); + break; + case 3: + message.sizeBytes = longToNumber(reader.int64() as Long); + break; + case 4: + message.compressionType = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): File { + const message = { ...baseFile } as File; + message.desc = + object.desc !== undefined && object.desc !== null + ? FileDesc.fromJSON(object.desc) + : undefined; + message.sha256 = + object.sha256 !== undefined && object.sha256 !== null + ? String(object.sha256) + : ""; + message.sizeBytes = + object.sizeBytes !== undefined && object.sizeBytes !== null + ? Number(object.sizeBytes) + : 0; + message.compressionType = + object.compressionType !== undefined && object.compressionType !== null + ? fileCompressionTypeFromJSON(object.compressionType) + : 0; + return message; + }, + + toJSON(message: File): unknown { + const obj: any = {}; + message.desc !== undefined && + (obj.desc = message.desc ? FileDesc.toJSON(message.desc) : undefined); + message.sha256 !== undefined && (obj.sha256 = message.sha256); + message.sizeBytes !== undefined && + (obj.sizeBytes = Math.round(message.sizeBytes)); + message.compressionType !== undefined && + (obj.compressionType = fileCompressionTypeToJSON( + message.compressionType + )); + return obj; + }, + + fromPartial, I>>(object: I): File { + const message = { ...baseFile } as File; + message.desc = + object.desc !== undefined && object.desc !== null + ? FileDesc.fromPartial(object.desc) + : undefined; + message.sha256 = object.sha256 ?? ""; + message.sizeBytes = object.sizeBytes ?? 0; + message.compressionType = object.compressionType ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(File.$type, File); + +const baseStorageFile: object = { + $type: "yandex.cloud.datasphere.v2.jobs.StorageFile", + url: "", +}; + +export const StorageFile = { + $type: "yandex.cloud.datasphere.v2.jobs.StorageFile" as const, + + encode( + message: StorageFile, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.file !== undefined) { + File.encode(message.file, writer.uint32(10).fork()).ldelim(); + } + if (message.url !== "") { + writer.uint32(18).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StorageFile { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStorageFile } as StorageFile; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file = File.decode(reader, reader.uint32()); + break; + case 2: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StorageFile { + const message = { ...baseStorageFile } as StorageFile; + message.file = + object.file !== undefined && object.file !== null + ? File.fromJSON(object.file) + : undefined; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: StorageFile): unknown { + const obj: any = {}; + message.file !== undefined && + (obj.file = message.file ? File.toJSON(message.file) : undefined); + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial, I>>( + object: I + ): StorageFile { + const message = { ...baseStorageFile } as StorageFile; + message.file = + object.file !== undefined && object.file !== null + ? File.fromPartial(object.file) + : undefined; + message.url = object.url ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StorageFile.$type, StorageFile); + +const baseFileDesc: object = { + $type: "yandex.cloud.datasphere.v2.jobs.FileDesc", + path: "", + var: "", +}; + +export const FileDesc = { + $type: "yandex.cloud.datasphere.v2.jobs.FileDesc" as const, + + encode( + message: FileDesc, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.path !== "") { + writer.uint32(10).string(message.path); + } + if (message.var !== "") { + writer.uint32(18).string(message.var); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileDesc { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDesc } as FileDesc; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.string(); + break; + case 2: + message.var = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDesc { + const message = { ...baseFileDesc } as FileDesc; + message.path = + object.path !== undefined && object.path !== null + ? String(object.path) + : ""; + message.var = + object.var !== undefined && object.var !== null ? String(object.var) : ""; + return message; + }, + + toJSON(message: FileDesc): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = message.path); + message.var !== undefined && (obj.var = message.var); + return obj; + }, + + fromPartial, I>>(object: I): FileDesc { + const message = { ...baseFileDesc } as FileDesc; + message.path = object.path ?? ""; + message.var = object.var ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(FileDesc.$type, FileDesc); + +const baseFileUploadError: object = { + $type: "yandex.cloud.datasphere.v2.jobs.FileUploadError", + description: "", +}; + +export const FileUploadError = { + $type: "yandex.cloud.datasphere.v2.jobs.FileUploadError" as const, + + encode( + message: FileUploadError, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.outputFileDesc !== undefined) { + FileDesc.encode( + message.outputFileDesc, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.logFileName !== undefined) { + writer.uint32(18).string(message.logFileName); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileUploadError { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileUploadError } as FileUploadError; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputFileDesc = FileDesc.decode(reader, reader.uint32()); + break; + case 2: + message.logFileName = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileUploadError { + const message = { ...baseFileUploadError } as FileUploadError; + message.outputFileDesc = + object.outputFileDesc !== undefined && object.outputFileDesc !== null + ? FileDesc.fromJSON(object.outputFileDesc) + : undefined; + message.logFileName = + object.logFileName !== undefined && object.logFileName !== null + ? String(object.logFileName) + : undefined; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + return message; + }, + + toJSON(message: FileUploadError): unknown { + const obj: any = {}; + message.outputFileDesc !== undefined && + (obj.outputFileDesc = message.outputFileDesc + ? FileDesc.toJSON(message.outputFileDesc) + : undefined); + message.logFileName !== undefined && + (obj.logFileName = message.logFileName); + message.description !== undefined && + (obj.description = message.description); + return obj; + }, + + fromPartial, I>>( + object: I + ): FileUploadError { + const message = { ...baseFileUploadError } as FileUploadError; + message.outputFileDesc = + object.outputFileDesc !== undefined && object.outputFileDesc !== null + ? FileDesc.fromPartial(object.outputFileDesc) + : undefined; + message.logFileName = object.logFileName ?? undefined; + message.description = object.description ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(FileUploadError.$type, FileUploadError); + +const baseEnvironment: object = { + $type: "yandex.cloud.datasphere.v2.jobs.Environment", +}; + +export const Environment = { + $type: "yandex.cloud.datasphere.v2.jobs.Environment" as const, + + encode( + message: Environment, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + Object.entries(message.vars).forEach(([key, value]) => { + Environment_VarsEntry.encode( + { + $type: "yandex.cloud.datasphere.v2.jobs.Environment.VarsEntry", + key: key as any, + value, + }, + writer.uint32(10).fork() + ).ldelim(); + }); + if (message.dockerImageResourceId !== undefined) { + writer.uint32(18).string(message.dockerImageResourceId); + } + if (message.dockerImageSpec !== undefined) { + DockerImageSpec.encode( + message.dockerImageSpec, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.pythonEnv !== undefined) { + PythonEnv.encode(message.pythonEnv, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Environment { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnvironment } as Environment; + message.vars = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + const entry1 = Environment_VarsEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.vars[entry1.key] = entry1.value; + } + break; + case 2: + message.dockerImageResourceId = reader.string(); + break; + case 3: + message.dockerImageSpec = DockerImageSpec.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.pythonEnv = PythonEnv.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Environment { + const message = { ...baseEnvironment } as Environment; + message.vars = Object.entries(object.vars ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.dockerImageResourceId = + object.dockerImageResourceId !== undefined && + object.dockerImageResourceId !== null + ? String(object.dockerImageResourceId) + : undefined; + message.dockerImageSpec = + object.dockerImageSpec !== undefined && object.dockerImageSpec !== null + ? DockerImageSpec.fromJSON(object.dockerImageSpec) + : undefined; + message.pythonEnv = + object.pythonEnv !== undefined && object.pythonEnv !== null + ? PythonEnv.fromJSON(object.pythonEnv) + : undefined; + return message; + }, + + toJSON(message: Environment): unknown { + const obj: any = {}; + obj.vars = {}; + if (message.vars) { + Object.entries(message.vars).forEach(([k, v]) => { + obj.vars[k] = v; + }); + } + message.dockerImageResourceId !== undefined && + (obj.dockerImageResourceId = message.dockerImageResourceId); + message.dockerImageSpec !== undefined && + (obj.dockerImageSpec = message.dockerImageSpec + ? DockerImageSpec.toJSON(message.dockerImageSpec) + : undefined); + message.pythonEnv !== undefined && + (obj.pythonEnv = message.pythonEnv + ? PythonEnv.toJSON(message.pythonEnv) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Environment { + const message = { ...baseEnvironment } as Environment; + message.vars = Object.entries(object.vars ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.dockerImageResourceId = object.dockerImageResourceId ?? undefined; + message.dockerImageSpec = + object.dockerImageSpec !== undefined && object.dockerImageSpec !== null + ? DockerImageSpec.fromPartial(object.dockerImageSpec) + : undefined; + message.pythonEnv = + object.pythonEnv !== undefined && object.pythonEnv !== null + ? PythonEnv.fromPartial(object.pythonEnv) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Environment.$type, Environment); + +const baseEnvironment_VarsEntry: object = { + $type: "yandex.cloud.datasphere.v2.jobs.Environment.VarsEntry", + key: "", + value: "", +}; + +export const Environment_VarsEntry = { + $type: "yandex.cloud.datasphere.v2.jobs.Environment.VarsEntry" as const, + + encode( + message: Environment_VarsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Environment_VarsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnvironment_VarsEntry } as Environment_VarsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Environment_VarsEntry { + const message = { ...baseEnvironment_VarsEntry } as Environment_VarsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Environment_VarsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Environment_VarsEntry { + const message = { ...baseEnvironment_VarsEntry } as Environment_VarsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Environment_VarsEntry.$type, Environment_VarsEntry); + +const baseDockerImageSpec: object = { + $type: "yandex.cloud.datasphere.v2.jobs.DockerImageSpec", + imageUrl: "", + username: "", +}; + +export const DockerImageSpec = { + $type: "yandex.cloud.datasphere.v2.jobs.DockerImageSpec" as const, + + encode( + message: DockerImageSpec, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.imageUrl !== "") { + writer.uint32(10).string(message.imageUrl); + } + if (message.username !== "") { + writer.uint32(18).string(message.username); + } + if (message.passwordPlainText !== undefined) { + writer.uint32(26).string(message.passwordPlainText); + } + if (message.passwordDsSecretName !== undefined) { + writer.uint32(34).string(message.passwordDsSecretName); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DockerImageSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDockerImageSpec } as DockerImageSpec; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.imageUrl = reader.string(); + break; + case 2: + message.username = reader.string(); + break; + case 3: + message.passwordPlainText = reader.string(); + break; + case 4: + message.passwordDsSecretName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DockerImageSpec { + const message = { ...baseDockerImageSpec } as DockerImageSpec; + message.imageUrl = + object.imageUrl !== undefined && object.imageUrl !== null + ? String(object.imageUrl) + : ""; + message.username = + object.username !== undefined && object.username !== null + ? String(object.username) + : ""; + message.passwordPlainText = + object.passwordPlainText !== undefined && + object.passwordPlainText !== null + ? String(object.passwordPlainText) + : undefined; + message.passwordDsSecretName = + object.passwordDsSecretName !== undefined && + object.passwordDsSecretName !== null + ? String(object.passwordDsSecretName) + : undefined; + return message; + }, + + toJSON(message: DockerImageSpec): unknown { + const obj: any = {}; + message.imageUrl !== undefined && (obj.imageUrl = message.imageUrl); + message.username !== undefined && (obj.username = message.username); + message.passwordPlainText !== undefined && + (obj.passwordPlainText = message.passwordPlainText); + message.passwordDsSecretName !== undefined && + (obj.passwordDsSecretName = message.passwordDsSecretName); + return obj; + }, + + fromPartial, I>>( + object: I + ): DockerImageSpec { + const message = { ...baseDockerImageSpec } as DockerImageSpec; + message.imageUrl = object.imageUrl ?? ""; + message.username = object.username ?? ""; + message.passwordPlainText = object.passwordPlainText ?? undefined; + message.passwordDsSecretName = object.passwordDsSecretName ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(DockerImageSpec.$type, DockerImageSpec); + +const basePythonEnv: object = { + $type: "yandex.cloud.datasphere.v2.jobs.PythonEnv", + condaYaml: "", +}; + +export const PythonEnv = { + $type: "yandex.cloud.datasphere.v2.jobs.PythonEnv" as const, + + encode( + message: PythonEnv, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.condaYaml !== "") { + writer.uint32(10).string(message.condaYaml); + } + for (const v of message.localModules) { + File.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PythonEnv { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePythonEnv } as PythonEnv; + message.localModules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.condaYaml = reader.string(); + break; + case 2: + message.localModules.push(File.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PythonEnv { + const message = { ...basePythonEnv } as PythonEnv; + message.condaYaml = + object.condaYaml !== undefined && object.condaYaml !== null + ? String(object.condaYaml) + : ""; + message.localModules = (object.localModules ?? []).map((e: any) => + File.fromJSON(e) + ); + return message; + }, + + toJSON(message: PythonEnv): unknown { + const obj: any = {}; + message.condaYaml !== undefined && (obj.condaYaml = message.condaYaml); + if (message.localModules) { + obj.localModules = message.localModules.map((e) => + e ? File.toJSON(e) : undefined + ); + } else { + obj.localModules = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): PythonEnv { + const message = { ...basePythonEnv } as PythonEnv; + message.condaYaml = object.condaYaml ?? ""; + message.localModules = + object.localModules?.map((e) => File.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(PythonEnv.$type, PythonEnv); + +const baseOutputDatasetDesc: object = { + $type: "yandex.cloud.datasphere.v2.jobs.OutputDatasetDesc", + name: "", + description: "", + sizeGb: 0, + var: "", +}; + +export const OutputDatasetDesc = { + $type: "yandex.cloud.datasphere.v2.jobs.OutputDatasetDesc" as const, + + encode( + message: OutputDatasetDesc, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + OutputDatasetDesc_LabelsEntry.encode( + { + $type: + "yandex.cloud.datasphere.v2.jobs.OutputDatasetDesc.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(26).fork() + ).ldelim(); + }); + if (message.sizeGb !== 0) { + writer.uint32(32).int64(message.sizeGb); + } + if (message.var !== "") { + writer.uint32(42).string(message.var); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OutputDatasetDesc { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOutputDatasetDesc } as OutputDatasetDesc; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + const entry3 = OutputDatasetDesc_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry3.value !== undefined) { + message.labels[entry3.key] = entry3.value; + } + break; + case 4: + message.sizeGb = longToNumber(reader.int64() as Long); + break; + case 5: + message.var = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OutputDatasetDesc { + const message = { ...baseOutputDatasetDesc } as OutputDatasetDesc; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.sizeGb = + object.sizeGb !== undefined && object.sizeGb !== null + ? Number(object.sizeGb) + : 0; + message.var = + object.var !== undefined && object.var !== null ? String(object.var) : ""; + return message; + }, + + toJSON(message: OutputDatasetDesc): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.sizeGb !== undefined && (obj.sizeGb = Math.round(message.sizeGb)); + message.var !== undefined && (obj.var = message.var); + return obj; + }, + + fromPartial, I>>( + object: I + ): OutputDatasetDesc { + const message = { ...baseOutputDatasetDesc } as OutputDatasetDesc; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.sizeGb = object.sizeGb ?? 0; + message.var = object.var ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(OutputDatasetDesc.$type, OutputDatasetDesc); + +const baseOutputDatasetDesc_LabelsEntry: object = { + $type: "yandex.cloud.datasphere.v2.jobs.OutputDatasetDesc.LabelsEntry", + key: "", + value: "", +}; + +export const OutputDatasetDesc_LabelsEntry = { + $type: + "yandex.cloud.datasphere.v2.jobs.OutputDatasetDesc.LabelsEntry" as const, + + encode( + message: OutputDatasetDesc_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): OutputDatasetDesc_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseOutputDatasetDesc_LabelsEntry, + } as OutputDatasetDesc_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OutputDatasetDesc_LabelsEntry { + const message = { + ...baseOutputDatasetDesc_LabelsEntry, + } as OutputDatasetDesc_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: OutputDatasetDesc_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): OutputDatasetDesc_LabelsEntry { + const message = { + ...baseOutputDatasetDesc_LabelsEntry, + } as OutputDatasetDesc_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + OutputDatasetDesc_LabelsEntry.$type, + OutputDatasetDesc_LabelsEntry +); + +const baseOutputDataset: object = { + $type: "yandex.cloud.datasphere.v2.jobs.OutputDataset", + id: "", +}; + +export const OutputDataset = { + $type: "yandex.cloud.datasphere.v2.jobs.OutputDataset" as const, + + encode( + message: OutputDataset, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.desc !== undefined) { + OutputDatasetDesc.encode(message.desc, writer.uint32(10).fork()).ldelim(); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OutputDataset { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOutputDataset } as OutputDataset; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.desc = OutputDatasetDesc.decode(reader, reader.uint32()); + break; + case 2: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OutputDataset { + const message = { ...baseOutputDataset } as OutputDataset; + message.desc = + object.desc !== undefined && object.desc !== null + ? OutputDatasetDesc.fromJSON(object.desc) + : undefined; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + return message; + }, + + toJSON(message: OutputDataset): unknown { + const obj: any = {}; + message.desc !== undefined && + (obj.desc = message.desc + ? OutputDatasetDesc.toJSON(message.desc) + : undefined); + message.id !== undefined && (obj.id = message.id); + return obj; + }, + + fromPartial, I>>( + object: I + ): OutputDataset { + const message = { ...baseOutputDataset } as OutputDataset; + message.desc = + object.desc !== undefined && object.desc !== null + ? OutputDatasetDesc.fromPartial(object.desc) + : undefined; + message.id = object.id ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(OutputDataset.$type, OutputDataset); + +const baseJob: object = { + $type: "yandex.cloud.datasphere.v2.jobs.Job", + id: "", + name: "", + desc: "", + status: 0, + config: "", + createdById: "", + projectId: "", + dataCleared: false, + dataSizeBytes: 0, + statusDetails: "", + parentJobId: "", +}; + +export const Job = { + $type: "yandex.cloud.datasphere.v2.jobs.Job" as const, + + encode(message: Job, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.desc !== "") { + writer.uint32(26).string(message.desc); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(34).fork() + ).ldelim(); + } + if (message.finishedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.finishedAt), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.status !== 0) { + writer.uint32(48).int32(message.status); + } + if (message.config !== "") { + writer.uint32(58).string(message.config); + } + if (message.createdById !== "") { + writer.uint32(66).string(message.createdById); + } + if (message.projectId !== "") { + writer.uint32(74).string(message.projectId); + } + if (message.jobParameters !== undefined) { + JobParameters.encode( + message.jobParameters, + writer.uint32(82).fork() + ).ldelim(); + } + if (message.dataExpiresAt !== undefined) { + Timestamp.encode( + toTimestamp(message.dataExpiresAt), + writer.uint32(90).fork() + ).ldelim(); + } + if (message.dataCleared === true) { + writer.uint32(96).bool(message.dataCleared); + } + for (const v of message.outputFiles) { + File.encode(v!, writer.uint32(106).fork()).ldelim(); + } + for (const v of message.logFiles) { + File.encode(v!, writer.uint32(114).fork()).ldelim(); + } + for (const v of message.diagnosticFiles) { + File.encode(v!, writer.uint32(122).fork()).ldelim(); + } + if (message.dataSizeBytes !== 0) { + writer.uint32(128).int64(message.dataSizeBytes); + } + if (message.startedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.startedAt), + writer.uint32(138).fork() + ).ldelim(); + } + if (message.statusDetails !== "") { + writer.uint32(146).string(message.statusDetails); + } + if (message.actualCloudInstanceType !== undefined) { + CloudInstanceType.encode( + message.actualCloudInstanceType, + writer.uint32(154).fork() + ).ldelim(); + } + if (message.parentJobId !== "") { + writer.uint32(162).string(message.parentJobId); + } + for (const v of message.fileErrors) { + FileUploadError.encode(v!, writer.uint32(170).fork()).ldelim(); + } + for (const v of message.outputDatasets) { + OutputDataset.encode(v!, writer.uint32(178).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Job { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseJob } as Job; + message.outputFiles = []; + message.logFiles = []; + message.diagnosticFiles = []; + message.fileErrors = []; + message.outputDatasets = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.desc = reader.string(); + break; + case 4: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 5: + message.finishedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + message.status = reader.int32() as any; + break; + case 7: + message.config = reader.string(); + break; + case 8: + message.createdById = reader.string(); + break; + case 9: + message.projectId = reader.string(); + break; + case 10: + message.jobParameters = JobParameters.decode(reader, reader.uint32()); + break; + case 11: + message.dataExpiresAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 12: + message.dataCleared = reader.bool(); + break; + case 13: + message.outputFiles.push(File.decode(reader, reader.uint32())); + break; + case 14: + message.logFiles.push(File.decode(reader, reader.uint32())); + break; + case 15: + message.diagnosticFiles.push(File.decode(reader, reader.uint32())); + break; + case 16: + message.dataSizeBytes = longToNumber(reader.int64() as Long); + break; + case 17: + message.startedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 18: + message.statusDetails = reader.string(); + break; + case 19: + message.actualCloudInstanceType = CloudInstanceType.decode( + reader, + reader.uint32() + ); + break; + case 20: + message.parentJobId = reader.string(); + break; + case 21: + message.fileErrors.push( + FileUploadError.decode(reader, reader.uint32()) + ); + break; + case 22: + message.outputDatasets.push( + OutputDataset.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Job { + const message = { ...baseJob } as Job; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.desc = + object.desc !== undefined && object.desc !== null + ? String(object.desc) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.finishedAt = + object.finishedAt !== undefined && object.finishedAt !== null + ? fromJsonTimestamp(object.finishedAt) + : undefined; + message.status = + object.status !== undefined && object.status !== null + ? jobStatusFromJSON(object.status) + : 0; + message.config = + object.config !== undefined && object.config !== null + ? String(object.config) + : ""; + message.createdById = + object.createdById !== undefined && object.createdById !== null + ? String(object.createdById) + : ""; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + message.jobParameters = + object.jobParameters !== undefined && object.jobParameters !== null + ? JobParameters.fromJSON(object.jobParameters) + : undefined; + message.dataExpiresAt = + object.dataExpiresAt !== undefined && object.dataExpiresAt !== null + ? fromJsonTimestamp(object.dataExpiresAt) + : undefined; + message.dataCleared = + object.dataCleared !== undefined && object.dataCleared !== null + ? Boolean(object.dataCleared) + : false; + message.outputFiles = (object.outputFiles ?? []).map((e: any) => + File.fromJSON(e) + ); + message.logFiles = (object.logFiles ?? []).map((e: any) => + File.fromJSON(e) + ); + message.diagnosticFiles = (object.diagnosticFiles ?? []).map((e: any) => + File.fromJSON(e) + ); + message.dataSizeBytes = + object.dataSizeBytes !== undefined && object.dataSizeBytes !== null + ? Number(object.dataSizeBytes) + : 0; + message.startedAt = + object.startedAt !== undefined && object.startedAt !== null + ? fromJsonTimestamp(object.startedAt) + : undefined; + message.statusDetails = + object.statusDetails !== undefined && object.statusDetails !== null + ? String(object.statusDetails) + : ""; + message.actualCloudInstanceType = + object.actualCloudInstanceType !== undefined && + object.actualCloudInstanceType !== null + ? CloudInstanceType.fromJSON(object.actualCloudInstanceType) + : undefined; + message.parentJobId = + object.parentJobId !== undefined && object.parentJobId !== null + ? String(object.parentJobId) + : ""; + message.fileErrors = (object.fileErrors ?? []).map((e: any) => + FileUploadError.fromJSON(e) + ); + message.outputDatasets = (object.outputDatasets ?? []).map((e: any) => + OutputDataset.fromJSON(e) + ); + return message; + }, + + toJSON(message: Job): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.name !== undefined && (obj.name = message.name); + message.desc !== undefined && (obj.desc = message.desc); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.finishedAt !== undefined && + (obj.finishedAt = message.finishedAt.toISOString()); + message.status !== undefined && + (obj.status = jobStatusToJSON(message.status)); + message.config !== undefined && (obj.config = message.config); + message.createdById !== undefined && + (obj.createdById = message.createdById); + message.projectId !== undefined && (obj.projectId = message.projectId); + message.jobParameters !== undefined && + (obj.jobParameters = message.jobParameters + ? JobParameters.toJSON(message.jobParameters) + : undefined); + message.dataExpiresAt !== undefined && + (obj.dataExpiresAt = message.dataExpiresAt.toISOString()); + message.dataCleared !== undefined && + (obj.dataCleared = message.dataCleared); + if (message.outputFiles) { + obj.outputFiles = message.outputFiles.map((e) => + e ? File.toJSON(e) : undefined + ); + } else { + obj.outputFiles = []; + } + if (message.logFiles) { + obj.logFiles = message.logFiles.map((e) => + e ? File.toJSON(e) : undefined + ); + } else { + obj.logFiles = []; + } + if (message.diagnosticFiles) { + obj.diagnosticFiles = message.diagnosticFiles.map((e) => + e ? File.toJSON(e) : undefined + ); + } else { + obj.diagnosticFiles = []; + } + message.dataSizeBytes !== undefined && + (obj.dataSizeBytes = Math.round(message.dataSizeBytes)); + message.startedAt !== undefined && + (obj.startedAt = message.startedAt.toISOString()); + message.statusDetails !== undefined && + (obj.statusDetails = message.statusDetails); + message.actualCloudInstanceType !== undefined && + (obj.actualCloudInstanceType = message.actualCloudInstanceType + ? CloudInstanceType.toJSON(message.actualCloudInstanceType) + : undefined); + message.parentJobId !== undefined && + (obj.parentJobId = message.parentJobId); + if (message.fileErrors) { + obj.fileErrors = message.fileErrors.map((e) => + e ? FileUploadError.toJSON(e) : undefined + ); + } else { + obj.fileErrors = []; + } + if (message.outputDatasets) { + obj.outputDatasets = message.outputDatasets.map((e) => + e ? OutputDataset.toJSON(e) : undefined + ); + } else { + obj.outputDatasets = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Job { + const message = { ...baseJob } as Job; + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.desc = object.desc ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.finishedAt = object.finishedAt ?? undefined; + message.status = object.status ?? 0; + message.config = object.config ?? ""; + message.createdById = object.createdById ?? ""; + message.projectId = object.projectId ?? ""; + message.jobParameters = + object.jobParameters !== undefined && object.jobParameters !== null + ? JobParameters.fromPartial(object.jobParameters) + : undefined; + message.dataExpiresAt = object.dataExpiresAt ?? undefined; + message.dataCleared = object.dataCleared ?? false; + message.outputFiles = + object.outputFiles?.map((e) => File.fromPartial(e)) || []; + message.logFiles = object.logFiles?.map((e) => File.fromPartial(e)) || []; + message.diagnosticFiles = + object.diagnosticFiles?.map((e) => File.fromPartial(e)) || []; + message.dataSizeBytes = object.dataSizeBytes ?? 0; + message.startedAt = object.startedAt ?? undefined; + message.statusDetails = object.statusDetails ?? ""; + message.actualCloudInstanceType = + object.actualCloudInstanceType !== undefined && + object.actualCloudInstanceType !== null + ? CloudInstanceType.fromPartial(object.actualCloudInstanceType) + : undefined; + message.parentJobId = object.parentJobId ?? ""; + message.fileErrors = + object.fileErrors?.map((e) => FileUploadError.fromPartial(e)) || []; + message.outputDatasets = + object.outputDatasets?.map((e) => OutputDataset.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Job.$type, Job); + +const baseJobResult: object = { + $type: "yandex.cloud.datasphere.v2.jobs.JobResult", + returnCode: 0, +}; + +export const JobResult = { + $type: "yandex.cloud.datasphere.v2.jobs.JobResult" as const, + + encode( + message: JobResult, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.returnCode !== 0) { + writer.uint32(8).int64(message.returnCode); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): JobResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseJobResult } as JobResult; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.returnCode = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): JobResult { + const message = { ...baseJobResult } as JobResult; + message.returnCode = + object.returnCode !== undefined && object.returnCode !== null + ? Number(object.returnCode) + : 0; + return message; + }, + + toJSON(message: JobResult): unknown { + const obj: any = {}; + message.returnCode !== undefined && + (obj.returnCode = Math.round(message.returnCode)); + return obj; + }, + + fromPartial, I>>( + object: I + ): JobResult { + const message = { ...baseJobResult } as JobResult; + message.returnCode = object.returnCode ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(JobResult.$type, JobResult); + +const baseGracefulShutdownParameters: object = { + $type: "yandex.cloud.datasphere.v2.jobs.GracefulShutdownParameters", + signal: 0, +}; + +export const GracefulShutdownParameters = { + $type: "yandex.cloud.datasphere.v2.jobs.GracefulShutdownParameters" as const, + + encode( + message: GracefulShutdownParameters, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.timeout !== undefined) { + Duration.encode(message.timeout, writer.uint32(10).fork()).ldelim(); + } + if (message.signal !== 0) { + writer.uint32(16).int64(message.signal); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GracefulShutdownParameters { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGracefulShutdownParameters, + } as GracefulShutdownParameters; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timeout = Duration.decode(reader, reader.uint32()); + break; + case 2: + message.signal = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GracefulShutdownParameters { + const message = { + ...baseGracefulShutdownParameters, + } as GracefulShutdownParameters; + message.timeout = + object.timeout !== undefined && object.timeout !== null + ? Duration.fromJSON(object.timeout) + : undefined; + message.signal = + object.signal !== undefined && object.signal !== null + ? Number(object.signal) + : 0; + return message; + }, + + toJSON(message: GracefulShutdownParameters): unknown { + const obj: any = {}; + message.timeout !== undefined && + (obj.timeout = message.timeout + ? Duration.toJSON(message.timeout) + : undefined); + message.signal !== undefined && (obj.signal = Math.round(message.signal)); + return obj; + }, + + fromPartial, I>>( + object: I + ): GracefulShutdownParameters { + const message = { + ...baseGracefulShutdownParameters, + } as GracefulShutdownParameters; + message.timeout = + object.timeout !== undefined && object.timeout !== null + ? Duration.fromPartial(object.timeout) + : undefined; + message.signal = object.signal ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + GracefulShutdownParameters.$type, + GracefulShutdownParameters +); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/datasphere/v2/jobs/project_job_service.ts b/src/generated/yandex/cloud/datasphere/v2/jobs/project_job_service.ts new file mode 100644 index 00000000..9d53a228 --- /dev/null +++ b/src/generated/yandex/cloud/datasphere/v2/jobs/project_job_service.ts @@ -0,0 +1,3623 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + handleServerStreamingCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ClientReadableStream, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + JobParameters, + JobResult, + Job, + StorageFile, + OutputDataset, + File, +} from "../../../../../yandex/cloud/datasphere/v2/jobs/jobs"; +import { Duration } from "../../../../../google/protobuf/duration"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; +import { Empty } from "../../../../../google/protobuf/empty"; + +export const protobufPackage = "yandex.cloud.datasphere.v2.jobs"; + +export enum StandardStream { + STANDARD_STREAM_UNSPECIFIED = 0, + /** OUT - Stdout. */ + OUT = 1, + /** ERR - Stderr. */ + ERR = 2, + UNRECOGNIZED = -1, +} + +export function standardStreamFromJSON(object: any): StandardStream { + switch (object) { + case 0: + case "STANDARD_STREAM_UNSPECIFIED": + return StandardStream.STANDARD_STREAM_UNSPECIFIED; + case 1: + case "OUT": + return StandardStream.OUT; + case 2: + case "ERR": + return StandardStream.ERR; + case -1: + case "UNRECOGNIZED": + default: + return StandardStream.UNRECOGNIZED; + } +} + +export function standardStreamToJSON(object: StandardStream): string { + switch (object) { + case StandardStream.STANDARD_STREAM_UNSPECIFIED: + return "STANDARD_STREAM_UNSPECIFIED"; + case StandardStream.OUT: + return "OUT"; + case StandardStream.ERR: + return "ERR"; + default: + return "UNKNOWN"; + } +} + +export interface CreateProjectJobRequest { + $type: "yandex.cloud.datasphere.v2.jobs.CreateProjectJobRequest"; + /** ID of the project. */ + projectId: string; + /** Parameters of the job. */ + jobParameters?: JobParameters; + /** Config of the job. */ + config: string; + /** Name of the job. */ + name: string; + /** Description of the job. */ + desc: string; + /** Job data TTL. */ + dataTtl?: Duration; +} + +export interface CreateProjectJobMetadata { + $type: "yandex.cloud.datasphere.v2.jobs.CreateProjectJobMetadata"; + /** ID of the project. */ + projectId: string; + /** Job ID. */ + jobId: string; +} + +export interface CreateProjectJobResponse { + $type: "yandex.cloud.datasphere.v2.jobs.CreateProjectJobResponse"; + /** ID of the job. */ + jobId: string; + /** Files to upload with their presigned URLs for upload. */ + uploadFiles: StorageFile[]; +} + +export interface CloneProjectJobRequest { + $type: "yandex.cloud.datasphere.v2.jobs.CloneProjectJobRequest"; + /** ID of job to be cloned. */ + sourceJobId: string; + /** Parameters overrides. */ + jobParametersOverrides?: JobParameters; + /** New job name. */ + name: string; + /** New job description */ + desc: string; + /** Data ttl. */ + dataTtl?: Duration; +} + +export interface CloneProjectJobResponse { + $type: "yandex.cloud.datasphere.v2.jobs.CloneProjectJobResponse"; + /** Job ID. */ + jobId: string; + /** + * Files with presigned URLs generated by server to upload them to storage. Order is arbitrary. + * + * Upload files include input files, executable file (python main script or binary executable) and local modules + * in case of python. + * + * If file was already uploaded, there will be no element for it. + */ + uploadFiles: StorageFile[]; +} + +export interface CloneProjectJobMetadata { + $type: "yandex.cloud.datasphere.v2.jobs.CloneProjectJobMetadata"; + projectId: string; + jobId: string; +} + +export interface ExecuteProjectJobRequest { + $type: "yandex.cloud.datasphere.v2.jobs.ExecuteProjectJobRequest"; + /** ID of the job. */ + jobId: string; +} + +export interface ExecuteProjectJobResponse { + $type: "yandex.cloud.datasphere.v2.jobs.ExecuteProjectJobResponse"; + /** Uploaded output files with URLs. */ + outputFiles: StorageFile[]; + /** Created datasets */ + outputDatasets: OutputDataset[]; + /** Result of the job. */ + result?: JobResult; +} + +export interface ExecuteProjectJobMetadata { + $type: "yandex.cloud.datasphere.v2.jobs.ExecuteProjectJobMetadata"; + /** Instance of the job. */ + job?: Job; +} + +export interface CancelProjectJobRequest { + $type: "yandex.cloud.datasphere.v2.jobs.CancelProjectJobRequest"; + /** ID of the job. */ + jobId: string; + /** Optional cancellation reason. */ + reason: string; + /** If the job is launched with graceful shutdown support, the shutdown will be performed gracefully */ + graceful: boolean; +} + +export interface ReadProjectJobStdLogsRequest { + $type: "yandex.cloud.datasphere.v2.jobs.ReadProjectJobStdLogsRequest"; + /** ID of the job. */ + jobId: string; + /** Log offset. */ + offset: number; +} + +export interface ReadProjectJobStdLogsResponse { + $type: "yandex.cloud.datasphere.v2.jobs.ReadProjectJobStdLogsResponse"; + logs: StdLog[]; + /** Log offset. */ + offset: number; +} + +export interface ReadProjectJobLogsRequest { + $type: "yandex.cloud.datasphere.v2.jobs.ReadProjectJobLogsRequest"; + /** ID of the job. */ + jobId: string; + /** Log offset. */ + offset: number; +} + +export interface ReadProjectJobLogsResponse { + $type: "yandex.cloud.datasphere.v2.jobs.ReadProjectJobLogsResponse"; + logs: LogMessage[]; + /** Log offset. */ + offset: number; +} + +export interface DownloadProjectJobFilesRequest { + $type: "yandex.cloud.datasphere.v2.jobs.DownloadProjectJobFilesRequest"; + jobId: string; + files: File[]; +} + +export interface DownloadProjectJobFilesResponse { + $type: "yandex.cloud.datasphere.v2.jobs.DownloadProjectJobFilesResponse"; + downloadFiles: StorageFile[]; +} + +export interface ListProjectJobRequest { + $type: "yandex.cloud.datasphere.v2.jobs.ListProjectJobRequest"; + /** ID of the project. */ + projectId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], + * the service returns a [ListProjectJobResponse.page_token] + * that can be used to get the next page of results in subsequent list requests. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] to the + * [ListProjectJobResponse.page_token] returned by a previous list request. + */ + pageToken: string; + /** + * restrictions: + * * only `status` field is supported + * * only `IN` operator is supported + * example: + * * only running jobs == "status IN (EXECUTING, UPLOADING_OUTPUT)" + */ + filter: string; +} + +export interface ListProjectJobResponse { + $type: "yandex.cloud.datasphere.v2.jobs.ListProjectJobResponse"; + /** Instances of the jobs. */ + jobs: Job[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListProjectJobRequest.page_size], use + * the [next_page_token] as the value + * for the [ListProjectJobRequest.page_token] query parameter + * in the next list request. Each subsequent list request will have its own + * [page_token] to continue paging through the results. + */ + nextPageToken: string; +} + +export interface GetProjectJobRequest { + $type: "yandex.cloud.datasphere.v2.jobs.GetProjectJobRequest"; + /** ID of the job. */ + jobId: string; +} + +export interface DeleteProjectJobRequest { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobRequest"; + /** ID of the job. */ + jobId: string; +} + +export interface DeleteProjectJobMetadata { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobMetadata"; + /** ID of the job. */ + jobId: string; +} + +export interface DeleteProjectJobDataRequest { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobDataRequest"; + /** ID of the job. */ + jobId: string; +} + +export interface DeleteProjectJobDataMetadata { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobDataMetadata"; + /** ID of the job. */ + jobId: string; +} + +export interface DeleteProjectJobDataResponse { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobDataResponse"; +} + +export interface DeleteAllProjectJobDataRequest { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteAllProjectJobDataRequest"; + projectId: string; +} + +export interface DeleteAllProjectJobDataMetadata { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteAllProjectJobDataMetadata"; + projectId: string; +} + +export interface DeleteAllProjectJobDataResponse { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteAllProjectJobDataResponse"; +} + +export interface SetProjectJobDataTtlRequest { + $type: "yandex.cloud.datasphere.v2.jobs.SetProjectJobDataTtlRequest"; + jobId: string; + ttl?: Duration; +} + +export interface SetProjectJobDataTtlResponse { + $type: "yandex.cloud.datasphere.v2.jobs.SetProjectJobDataTtlResponse"; +} + +export interface StdLog { + $type: "yandex.cloud.datasphere.v2.jobs.StdLog"; + /** Log contents. */ + content: Buffer; + /** Log type. */ + type: StdLog_Type; +} + +export enum StdLog_Type { + TYPE_UNSPECIFIED = 0, + /** OUT - stdout. */ + OUT = 1, + /** ERR - stderr. */ + ERR = 2, + UNRECOGNIZED = -1, +} + +export function stdLog_TypeFromJSON(object: any): StdLog_Type { + switch (object) { + case 0: + case "TYPE_UNSPECIFIED": + return StdLog_Type.TYPE_UNSPECIFIED; + case 1: + case "OUT": + return StdLog_Type.OUT; + case 2: + case "ERR": + return StdLog_Type.ERR; + case -1: + case "UNRECOGNIZED": + default: + return StdLog_Type.UNRECOGNIZED; + } +} + +export function stdLog_TypeToJSON(object: StdLog_Type): string { + switch (object) { + case StdLog_Type.TYPE_UNSPECIFIED: + return "TYPE_UNSPECIFIED"; + case StdLog_Type.OUT: + return "OUT"; + case StdLog_Type.ERR: + return "ERR"; + default: + return "UNKNOWN"; + } +} + +export interface LogMessage { + $type: "yandex.cloud.datasphere.v2.jobs.LogMessage"; + /** Log message contents. */ + content: Buffer; + /** Log message creation timestamp. */ + createdAt?: Date; + /** Program standard streams. */ + standardStream: StandardStream | undefined; + /** System debug log files. */ + filePath: string | undefined; +} + +const baseCreateProjectJobRequest: object = { + $type: "yandex.cloud.datasphere.v2.jobs.CreateProjectJobRequest", + projectId: "", + config: "", + name: "", + desc: "", +}; + +export const CreateProjectJobRequest = { + $type: "yandex.cloud.datasphere.v2.jobs.CreateProjectJobRequest" as const, + + encode( + message: CreateProjectJobRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.projectId !== "") { + writer.uint32(10).string(message.projectId); + } + if (message.jobParameters !== undefined) { + JobParameters.encode( + message.jobParameters, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.config !== "") { + writer.uint32(26).string(message.config); + } + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + if (message.desc !== "") { + writer.uint32(42).string(message.desc); + } + if (message.dataTtl !== undefined) { + Duration.encode(message.dataTtl, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateProjectJobRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateProjectJobRequest, + } as CreateProjectJobRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 2: + message.jobParameters = JobParameters.decode(reader, reader.uint32()); + break; + case 3: + message.config = reader.string(); + break; + case 4: + message.name = reader.string(); + break; + case 5: + message.desc = reader.string(); + break; + case 6: + message.dataTtl = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateProjectJobRequest { + const message = { + ...baseCreateProjectJobRequest, + } as CreateProjectJobRequest; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + message.jobParameters = + object.jobParameters !== undefined && object.jobParameters !== null + ? JobParameters.fromJSON(object.jobParameters) + : undefined; + message.config = + object.config !== undefined && object.config !== null + ? String(object.config) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.desc = + object.desc !== undefined && object.desc !== null + ? String(object.desc) + : ""; + message.dataTtl = + object.dataTtl !== undefined && object.dataTtl !== null + ? Duration.fromJSON(object.dataTtl) + : undefined; + return message; + }, + + toJSON(message: CreateProjectJobRequest): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = message.projectId); + message.jobParameters !== undefined && + (obj.jobParameters = message.jobParameters + ? JobParameters.toJSON(message.jobParameters) + : undefined); + message.config !== undefined && (obj.config = message.config); + message.name !== undefined && (obj.name = message.name); + message.desc !== undefined && (obj.desc = message.desc); + message.dataTtl !== undefined && + (obj.dataTtl = message.dataTtl + ? Duration.toJSON(message.dataTtl) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateProjectJobRequest { + const message = { + ...baseCreateProjectJobRequest, + } as CreateProjectJobRequest; + message.projectId = object.projectId ?? ""; + message.jobParameters = + object.jobParameters !== undefined && object.jobParameters !== null + ? JobParameters.fromPartial(object.jobParameters) + : undefined; + message.config = object.config ?? ""; + message.name = object.name ?? ""; + message.desc = object.desc ?? ""; + message.dataTtl = + object.dataTtl !== undefined && object.dataTtl !== null + ? Duration.fromPartial(object.dataTtl) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CreateProjectJobRequest.$type, CreateProjectJobRequest); + +const baseCreateProjectJobMetadata: object = { + $type: "yandex.cloud.datasphere.v2.jobs.CreateProjectJobMetadata", + projectId: "", + jobId: "", +}; + +export const CreateProjectJobMetadata = { + $type: "yandex.cloud.datasphere.v2.jobs.CreateProjectJobMetadata" as const, + + encode( + message: CreateProjectJobMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.projectId !== "") { + writer.uint32(10).string(message.projectId); + } + if (message.jobId !== "") { + writer.uint32(18).string(message.jobId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateProjectJobMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateProjectJobMetadata, + } as CreateProjectJobMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 2: + message.jobId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateProjectJobMetadata { + const message = { + ...baseCreateProjectJobMetadata, + } as CreateProjectJobMetadata; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + return message; + }, + + toJSON(message: CreateProjectJobMetadata): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = message.projectId); + message.jobId !== undefined && (obj.jobId = message.jobId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateProjectJobMetadata { + const message = { + ...baseCreateProjectJobMetadata, + } as CreateProjectJobMetadata; + message.projectId = object.projectId ?? ""; + message.jobId = object.jobId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateProjectJobMetadata.$type, + CreateProjectJobMetadata +); + +const baseCreateProjectJobResponse: object = { + $type: "yandex.cloud.datasphere.v2.jobs.CreateProjectJobResponse", + jobId: "", +}; + +export const CreateProjectJobResponse = { + $type: "yandex.cloud.datasphere.v2.jobs.CreateProjectJobResponse" as const, + + encode( + message: CreateProjectJobResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobId !== "") { + writer.uint32(10).string(message.jobId); + } + for (const v of message.uploadFiles) { + StorageFile.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateProjectJobResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateProjectJobResponse, + } as CreateProjectJobResponse; + message.uploadFiles = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + case 2: + message.uploadFiles.push(StorageFile.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateProjectJobResponse { + const message = { + ...baseCreateProjectJobResponse, + } as CreateProjectJobResponse; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + message.uploadFiles = (object.uploadFiles ?? []).map((e: any) => + StorageFile.fromJSON(e) + ); + return message; + }, + + toJSON(message: CreateProjectJobResponse): unknown { + const obj: any = {}; + message.jobId !== undefined && (obj.jobId = message.jobId); + if (message.uploadFiles) { + obj.uploadFiles = message.uploadFiles.map((e) => + e ? StorageFile.toJSON(e) : undefined + ); + } else { + obj.uploadFiles = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateProjectJobResponse { + const message = { + ...baseCreateProjectJobResponse, + } as CreateProjectJobResponse; + message.jobId = object.jobId ?? ""; + message.uploadFiles = + object.uploadFiles?.map((e) => StorageFile.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + CreateProjectJobResponse.$type, + CreateProjectJobResponse +); + +const baseCloneProjectJobRequest: object = { + $type: "yandex.cloud.datasphere.v2.jobs.CloneProjectJobRequest", + sourceJobId: "", + name: "", + desc: "", +}; + +export const CloneProjectJobRequest = { + $type: "yandex.cloud.datasphere.v2.jobs.CloneProjectJobRequest" as const, + + encode( + message: CloneProjectJobRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.sourceJobId !== "") { + writer.uint32(10).string(message.sourceJobId); + } + if (message.jobParametersOverrides !== undefined) { + JobParameters.encode( + message.jobParametersOverrides, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.desc !== "") { + writer.uint32(34).string(message.desc); + } + if (message.dataTtl !== undefined) { + Duration.encode(message.dataTtl, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CloneProjectJobRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCloneProjectJobRequest } as CloneProjectJobRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourceJobId = reader.string(); + break; + case 2: + message.jobParametersOverrides = JobParameters.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.desc = reader.string(); + break; + case 5: + message.dataTtl = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CloneProjectJobRequest { + const message = { ...baseCloneProjectJobRequest } as CloneProjectJobRequest; + message.sourceJobId = + object.sourceJobId !== undefined && object.sourceJobId !== null + ? String(object.sourceJobId) + : ""; + message.jobParametersOverrides = + object.jobParametersOverrides !== undefined && + object.jobParametersOverrides !== null + ? JobParameters.fromJSON(object.jobParametersOverrides) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.desc = + object.desc !== undefined && object.desc !== null + ? String(object.desc) + : ""; + message.dataTtl = + object.dataTtl !== undefined && object.dataTtl !== null + ? Duration.fromJSON(object.dataTtl) + : undefined; + return message; + }, + + toJSON(message: CloneProjectJobRequest): unknown { + const obj: any = {}; + message.sourceJobId !== undefined && + (obj.sourceJobId = message.sourceJobId); + message.jobParametersOverrides !== undefined && + (obj.jobParametersOverrides = message.jobParametersOverrides + ? JobParameters.toJSON(message.jobParametersOverrides) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.desc !== undefined && (obj.desc = message.desc); + message.dataTtl !== undefined && + (obj.dataTtl = message.dataTtl + ? Duration.toJSON(message.dataTtl) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CloneProjectJobRequest { + const message = { ...baseCloneProjectJobRequest } as CloneProjectJobRequest; + message.sourceJobId = object.sourceJobId ?? ""; + message.jobParametersOverrides = + object.jobParametersOverrides !== undefined && + object.jobParametersOverrides !== null + ? JobParameters.fromPartial(object.jobParametersOverrides) + : undefined; + message.name = object.name ?? ""; + message.desc = object.desc ?? ""; + message.dataTtl = + object.dataTtl !== undefined && object.dataTtl !== null + ? Duration.fromPartial(object.dataTtl) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CloneProjectJobRequest.$type, CloneProjectJobRequest); + +const baseCloneProjectJobResponse: object = { + $type: "yandex.cloud.datasphere.v2.jobs.CloneProjectJobResponse", + jobId: "", +}; + +export const CloneProjectJobResponse = { + $type: "yandex.cloud.datasphere.v2.jobs.CloneProjectJobResponse" as const, + + encode( + message: CloneProjectJobResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobId !== "") { + writer.uint32(10).string(message.jobId); + } + for (const v of message.uploadFiles) { + StorageFile.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CloneProjectJobResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCloneProjectJobResponse, + } as CloneProjectJobResponse; + message.uploadFiles = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + case 2: + message.uploadFiles.push(StorageFile.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CloneProjectJobResponse { + const message = { + ...baseCloneProjectJobResponse, + } as CloneProjectJobResponse; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + message.uploadFiles = (object.uploadFiles ?? []).map((e: any) => + StorageFile.fromJSON(e) + ); + return message; + }, + + toJSON(message: CloneProjectJobResponse): unknown { + const obj: any = {}; + message.jobId !== undefined && (obj.jobId = message.jobId); + if (message.uploadFiles) { + obj.uploadFiles = message.uploadFiles.map((e) => + e ? StorageFile.toJSON(e) : undefined + ); + } else { + obj.uploadFiles = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): CloneProjectJobResponse { + const message = { + ...baseCloneProjectJobResponse, + } as CloneProjectJobResponse; + message.jobId = object.jobId ?? ""; + message.uploadFiles = + object.uploadFiles?.map((e) => StorageFile.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(CloneProjectJobResponse.$type, CloneProjectJobResponse); + +const baseCloneProjectJobMetadata: object = { + $type: "yandex.cloud.datasphere.v2.jobs.CloneProjectJobMetadata", + projectId: "", + jobId: "", +}; + +export const CloneProjectJobMetadata = { + $type: "yandex.cloud.datasphere.v2.jobs.CloneProjectJobMetadata" as const, + + encode( + message: CloneProjectJobMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.projectId !== "") { + writer.uint32(10).string(message.projectId); + } + if (message.jobId !== "") { + writer.uint32(18).string(message.jobId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CloneProjectJobMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCloneProjectJobMetadata, + } as CloneProjectJobMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 2: + message.jobId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CloneProjectJobMetadata { + const message = { + ...baseCloneProjectJobMetadata, + } as CloneProjectJobMetadata; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + return message; + }, + + toJSON(message: CloneProjectJobMetadata): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = message.projectId); + message.jobId !== undefined && (obj.jobId = message.jobId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CloneProjectJobMetadata { + const message = { + ...baseCloneProjectJobMetadata, + } as CloneProjectJobMetadata; + message.projectId = object.projectId ?? ""; + message.jobId = object.jobId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CloneProjectJobMetadata.$type, CloneProjectJobMetadata); + +const baseExecuteProjectJobRequest: object = { + $type: "yandex.cloud.datasphere.v2.jobs.ExecuteProjectJobRequest", + jobId: "", +}; + +export const ExecuteProjectJobRequest = { + $type: "yandex.cloud.datasphere.v2.jobs.ExecuteProjectJobRequest" as const, + + encode( + message: ExecuteProjectJobRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobId !== "") { + writer.uint32(10).string(message.jobId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ExecuteProjectJobRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseExecuteProjectJobRequest, + } as ExecuteProjectJobRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExecuteProjectJobRequest { + const message = { + ...baseExecuteProjectJobRequest, + } as ExecuteProjectJobRequest; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + return message; + }, + + toJSON(message: ExecuteProjectJobRequest): unknown { + const obj: any = {}; + message.jobId !== undefined && (obj.jobId = message.jobId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ExecuteProjectJobRequest { + const message = { + ...baseExecuteProjectJobRequest, + } as ExecuteProjectJobRequest; + message.jobId = object.jobId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ExecuteProjectJobRequest.$type, + ExecuteProjectJobRequest +); + +const baseExecuteProjectJobResponse: object = { + $type: "yandex.cloud.datasphere.v2.jobs.ExecuteProjectJobResponse", +}; + +export const ExecuteProjectJobResponse = { + $type: "yandex.cloud.datasphere.v2.jobs.ExecuteProjectJobResponse" as const, + + encode( + message: ExecuteProjectJobResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.outputFiles) { + StorageFile.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.outputDatasets) { + OutputDataset.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.result !== undefined) { + JobResult.encode(message.result, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ExecuteProjectJobResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseExecuteProjectJobResponse, + } as ExecuteProjectJobResponse; + message.outputFiles = []; + message.outputDatasets = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputFiles.push(StorageFile.decode(reader, reader.uint32())); + break; + case 3: + message.outputDatasets.push( + OutputDataset.decode(reader, reader.uint32()) + ); + break; + case 2: + message.result = JobResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExecuteProjectJobResponse { + const message = { + ...baseExecuteProjectJobResponse, + } as ExecuteProjectJobResponse; + message.outputFiles = (object.outputFiles ?? []).map((e: any) => + StorageFile.fromJSON(e) + ); + message.outputDatasets = (object.outputDatasets ?? []).map((e: any) => + OutputDataset.fromJSON(e) + ); + message.result = + object.result !== undefined && object.result !== null + ? JobResult.fromJSON(object.result) + : undefined; + return message; + }, + + toJSON(message: ExecuteProjectJobResponse): unknown { + const obj: any = {}; + if (message.outputFiles) { + obj.outputFiles = message.outputFiles.map((e) => + e ? StorageFile.toJSON(e) : undefined + ); + } else { + obj.outputFiles = []; + } + if (message.outputDatasets) { + obj.outputDatasets = message.outputDatasets.map((e) => + e ? OutputDataset.toJSON(e) : undefined + ); + } else { + obj.outputDatasets = []; + } + message.result !== undefined && + (obj.result = message.result + ? JobResult.toJSON(message.result) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ExecuteProjectJobResponse { + const message = { + ...baseExecuteProjectJobResponse, + } as ExecuteProjectJobResponse; + message.outputFiles = + object.outputFiles?.map((e) => StorageFile.fromPartial(e)) || []; + message.outputDatasets = + object.outputDatasets?.map((e) => OutputDataset.fromPartial(e)) || []; + message.result = + object.result !== undefined && object.result !== null + ? JobResult.fromPartial(object.result) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + ExecuteProjectJobResponse.$type, + ExecuteProjectJobResponse +); + +const baseExecuteProjectJobMetadata: object = { + $type: "yandex.cloud.datasphere.v2.jobs.ExecuteProjectJobMetadata", +}; + +export const ExecuteProjectJobMetadata = { + $type: "yandex.cloud.datasphere.v2.jobs.ExecuteProjectJobMetadata" as const, + + encode( + message: ExecuteProjectJobMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.job !== undefined) { + Job.encode(message.job, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ExecuteProjectJobMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseExecuteProjectJobMetadata, + } as ExecuteProjectJobMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.job = Job.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExecuteProjectJobMetadata { + const message = { + ...baseExecuteProjectJobMetadata, + } as ExecuteProjectJobMetadata; + message.job = + object.job !== undefined && object.job !== null + ? Job.fromJSON(object.job) + : undefined; + return message; + }, + + toJSON(message: ExecuteProjectJobMetadata): unknown { + const obj: any = {}; + message.job !== undefined && + (obj.job = message.job ? Job.toJSON(message.job) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ExecuteProjectJobMetadata { + const message = { + ...baseExecuteProjectJobMetadata, + } as ExecuteProjectJobMetadata; + message.job = + object.job !== undefined && object.job !== null + ? Job.fromPartial(object.job) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + ExecuteProjectJobMetadata.$type, + ExecuteProjectJobMetadata +); + +const baseCancelProjectJobRequest: object = { + $type: "yandex.cloud.datasphere.v2.jobs.CancelProjectJobRequest", + jobId: "", + reason: "", + graceful: false, +}; + +export const CancelProjectJobRequest = { + $type: "yandex.cloud.datasphere.v2.jobs.CancelProjectJobRequest" as const, + + encode( + message: CancelProjectJobRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobId !== "") { + writer.uint32(10).string(message.jobId); + } + if (message.reason !== "") { + writer.uint32(18).string(message.reason); + } + if (message.graceful === true) { + writer.uint32(24).bool(message.graceful); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CancelProjectJobRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCancelProjectJobRequest, + } as CancelProjectJobRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + case 2: + message.reason = reader.string(); + break; + case 3: + message.graceful = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CancelProjectJobRequest { + const message = { + ...baseCancelProjectJobRequest, + } as CancelProjectJobRequest; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + message.reason = + object.reason !== undefined && object.reason !== null + ? String(object.reason) + : ""; + message.graceful = + object.graceful !== undefined && object.graceful !== null + ? Boolean(object.graceful) + : false; + return message; + }, + + toJSON(message: CancelProjectJobRequest): unknown { + const obj: any = {}; + message.jobId !== undefined && (obj.jobId = message.jobId); + message.reason !== undefined && (obj.reason = message.reason); + message.graceful !== undefined && (obj.graceful = message.graceful); + return obj; + }, + + fromPartial, I>>( + object: I + ): CancelProjectJobRequest { + const message = { + ...baseCancelProjectJobRequest, + } as CancelProjectJobRequest; + message.jobId = object.jobId ?? ""; + message.reason = object.reason ?? ""; + message.graceful = object.graceful ?? false; + return message; + }, +}; + +messageTypeRegistry.set(CancelProjectJobRequest.$type, CancelProjectJobRequest); + +const baseReadProjectJobStdLogsRequest: object = { + $type: "yandex.cloud.datasphere.v2.jobs.ReadProjectJobStdLogsRequest", + jobId: "", + offset: 0, +}; + +export const ReadProjectJobStdLogsRequest = { + $type: + "yandex.cloud.datasphere.v2.jobs.ReadProjectJobStdLogsRequest" as const, + + encode( + message: ReadProjectJobStdLogsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobId !== "") { + writer.uint32(10).string(message.jobId); + } + if (message.offset !== 0) { + writer.uint32(16).int64(message.offset); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ReadProjectJobStdLogsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseReadProjectJobStdLogsRequest, + } as ReadProjectJobStdLogsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + case 2: + message.offset = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ReadProjectJobStdLogsRequest { + const message = { + ...baseReadProjectJobStdLogsRequest, + } as ReadProjectJobStdLogsRequest; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + message.offset = + object.offset !== undefined && object.offset !== null + ? Number(object.offset) + : 0; + return message; + }, + + toJSON(message: ReadProjectJobStdLogsRequest): unknown { + const obj: any = {}; + message.jobId !== undefined && (obj.jobId = message.jobId); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + return obj; + }, + + fromPartial, I>>( + object: I + ): ReadProjectJobStdLogsRequest { + const message = { + ...baseReadProjectJobStdLogsRequest, + } as ReadProjectJobStdLogsRequest; + message.jobId = object.jobId ?? ""; + message.offset = object.offset ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + ReadProjectJobStdLogsRequest.$type, + ReadProjectJobStdLogsRequest +); + +const baseReadProjectJobStdLogsResponse: object = { + $type: "yandex.cloud.datasphere.v2.jobs.ReadProjectJobStdLogsResponse", + offset: 0, +}; + +export const ReadProjectJobStdLogsResponse = { + $type: + "yandex.cloud.datasphere.v2.jobs.ReadProjectJobStdLogsResponse" as const, + + encode( + message: ReadProjectJobStdLogsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.logs) { + StdLog.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.offset !== 0) { + writer.uint32(16).int64(message.offset); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ReadProjectJobStdLogsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseReadProjectJobStdLogsResponse, + } as ReadProjectJobStdLogsResponse; + message.logs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.logs.push(StdLog.decode(reader, reader.uint32())); + break; + case 2: + message.offset = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ReadProjectJobStdLogsResponse { + const message = { + ...baseReadProjectJobStdLogsResponse, + } as ReadProjectJobStdLogsResponse; + message.logs = (object.logs ?? []).map((e: any) => StdLog.fromJSON(e)); + message.offset = + object.offset !== undefined && object.offset !== null + ? Number(object.offset) + : 0; + return message; + }, + + toJSON(message: ReadProjectJobStdLogsResponse): unknown { + const obj: any = {}; + if (message.logs) { + obj.logs = message.logs.map((e) => (e ? StdLog.toJSON(e) : undefined)); + } else { + obj.logs = []; + } + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + return obj; + }, + + fromPartial, I>>( + object: I + ): ReadProjectJobStdLogsResponse { + const message = { + ...baseReadProjectJobStdLogsResponse, + } as ReadProjectJobStdLogsResponse; + message.logs = object.logs?.map((e) => StdLog.fromPartial(e)) || []; + message.offset = object.offset ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + ReadProjectJobStdLogsResponse.$type, + ReadProjectJobStdLogsResponse +); + +const baseReadProjectJobLogsRequest: object = { + $type: "yandex.cloud.datasphere.v2.jobs.ReadProjectJobLogsRequest", + jobId: "", + offset: 0, +}; + +export const ReadProjectJobLogsRequest = { + $type: "yandex.cloud.datasphere.v2.jobs.ReadProjectJobLogsRequest" as const, + + encode( + message: ReadProjectJobLogsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobId !== "") { + writer.uint32(10).string(message.jobId); + } + if (message.offset !== 0) { + writer.uint32(16).int64(message.offset); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ReadProjectJobLogsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseReadProjectJobLogsRequest, + } as ReadProjectJobLogsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + case 2: + message.offset = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ReadProjectJobLogsRequest { + const message = { + ...baseReadProjectJobLogsRequest, + } as ReadProjectJobLogsRequest; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + message.offset = + object.offset !== undefined && object.offset !== null + ? Number(object.offset) + : 0; + return message; + }, + + toJSON(message: ReadProjectJobLogsRequest): unknown { + const obj: any = {}; + message.jobId !== undefined && (obj.jobId = message.jobId); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + return obj; + }, + + fromPartial, I>>( + object: I + ): ReadProjectJobLogsRequest { + const message = { + ...baseReadProjectJobLogsRequest, + } as ReadProjectJobLogsRequest; + message.jobId = object.jobId ?? ""; + message.offset = object.offset ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + ReadProjectJobLogsRequest.$type, + ReadProjectJobLogsRequest +); + +const baseReadProjectJobLogsResponse: object = { + $type: "yandex.cloud.datasphere.v2.jobs.ReadProjectJobLogsResponse", + offset: 0, +}; + +export const ReadProjectJobLogsResponse = { + $type: "yandex.cloud.datasphere.v2.jobs.ReadProjectJobLogsResponse" as const, + + encode( + message: ReadProjectJobLogsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.logs) { + LogMessage.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.offset !== 0) { + writer.uint32(16).int64(message.offset); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ReadProjectJobLogsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseReadProjectJobLogsResponse, + } as ReadProjectJobLogsResponse; + message.logs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.logs.push(LogMessage.decode(reader, reader.uint32())); + break; + case 2: + message.offset = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ReadProjectJobLogsResponse { + const message = { + ...baseReadProjectJobLogsResponse, + } as ReadProjectJobLogsResponse; + message.logs = (object.logs ?? []).map((e: any) => LogMessage.fromJSON(e)); + message.offset = + object.offset !== undefined && object.offset !== null + ? Number(object.offset) + : 0; + return message; + }, + + toJSON(message: ReadProjectJobLogsResponse): unknown { + const obj: any = {}; + if (message.logs) { + obj.logs = message.logs.map((e) => + e ? LogMessage.toJSON(e) : undefined + ); + } else { + obj.logs = []; + } + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + return obj; + }, + + fromPartial, I>>( + object: I + ): ReadProjectJobLogsResponse { + const message = { + ...baseReadProjectJobLogsResponse, + } as ReadProjectJobLogsResponse; + message.logs = object.logs?.map((e) => LogMessage.fromPartial(e)) || []; + message.offset = object.offset ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + ReadProjectJobLogsResponse.$type, + ReadProjectJobLogsResponse +); + +const baseDownloadProjectJobFilesRequest: object = { + $type: "yandex.cloud.datasphere.v2.jobs.DownloadProjectJobFilesRequest", + jobId: "", +}; + +export const DownloadProjectJobFilesRequest = { + $type: + "yandex.cloud.datasphere.v2.jobs.DownloadProjectJobFilesRequest" as const, + + encode( + message: DownloadProjectJobFilesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobId !== "") { + writer.uint32(10).string(message.jobId); + } + for (const v of message.files) { + File.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DownloadProjectJobFilesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDownloadProjectJobFilesRequest, + } as DownloadProjectJobFilesRequest; + message.files = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + case 2: + message.files.push(File.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DownloadProjectJobFilesRequest { + const message = { + ...baseDownloadProjectJobFilesRequest, + } as DownloadProjectJobFilesRequest; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + message.files = (object.files ?? []).map((e: any) => File.fromJSON(e)); + return message; + }, + + toJSON(message: DownloadProjectJobFilesRequest): unknown { + const obj: any = {}; + message.jobId !== undefined && (obj.jobId = message.jobId); + if (message.files) { + obj.files = message.files.map((e) => (e ? File.toJSON(e) : undefined)); + } else { + obj.files = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): DownloadProjectJobFilesRequest { + const message = { + ...baseDownloadProjectJobFilesRequest, + } as DownloadProjectJobFilesRequest; + message.jobId = object.jobId ?? ""; + message.files = object.files?.map((e) => File.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + DownloadProjectJobFilesRequest.$type, + DownloadProjectJobFilesRequest +); + +const baseDownloadProjectJobFilesResponse: object = { + $type: "yandex.cloud.datasphere.v2.jobs.DownloadProjectJobFilesResponse", +}; + +export const DownloadProjectJobFilesResponse = { + $type: + "yandex.cloud.datasphere.v2.jobs.DownloadProjectJobFilesResponse" as const, + + encode( + message: DownloadProjectJobFilesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.downloadFiles) { + StorageFile.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DownloadProjectJobFilesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDownloadProjectJobFilesResponse, + } as DownloadProjectJobFilesResponse; + message.downloadFiles = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.downloadFiles.push( + StorageFile.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DownloadProjectJobFilesResponse { + const message = { + ...baseDownloadProjectJobFilesResponse, + } as DownloadProjectJobFilesResponse; + message.downloadFiles = (object.downloadFiles ?? []).map((e: any) => + StorageFile.fromJSON(e) + ); + return message; + }, + + toJSON(message: DownloadProjectJobFilesResponse): unknown { + const obj: any = {}; + if (message.downloadFiles) { + obj.downloadFiles = message.downloadFiles.map((e) => + e ? StorageFile.toJSON(e) : undefined + ); + } else { + obj.downloadFiles = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): DownloadProjectJobFilesResponse { + const message = { + ...baseDownloadProjectJobFilesResponse, + } as DownloadProjectJobFilesResponse; + message.downloadFiles = + object.downloadFiles?.map((e) => StorageFile.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + DownloadProjectJobFilesResponse.$type, + DownloadProjectJobFilesResponse +); + +const baseListProjectJobRequest: object = { + $type: "yandex.cloud.datasphere.v2.jobs.ListProjectJobRequest", + projectId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListProjectJobRequest = { + $type: "yandex.cloud.datasphere.v2.jobs.ListProjectJobRequest" as const, + + encode( + message: ListProjectJobRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.projectId !== "") { + writer.uint32(10).string(message.projectId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListProjectJobRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListProjectJobRequest } as ListProjectJobRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListProjectJobRequest { + const message = { ...baseListProjectJobRequest } as ListProjectJobRequest; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListProjectJobRequest): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = message.projectId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListProjectJobRequest { + const message = { ...baseListProjectJobRequest } as ListProjectJobRequest; + message.projectId = object.projectId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListProjectJobRequest.$type, ListProjectJobRequest); + +const baseListProjectJobResponse: object = { + $type: "yandex.cloud.datasphere.v2.jobs.ListProjectJobResponse", + nextPageToken: "", +}; + +export const ListProjectJobResponse = { + $type: "yandex.cloud.datasphere.v2.jobs.ListProjectJobResponse" as const, + + encode( + message: ListProjectJobResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.jobs) { + Job.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListProjectJobResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListProjectJobResponse } as ListProjectJobResponse; + message.jobs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobs.push(Job.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListProjectJobResponse { + const message = { ...baseListProjectJobResponse } as ListProjectJobResponse; + message.jobs = (object.jobs ?? []).map((e: any) => Job.fromJSON(e)); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListProjectJobResponse): unknown { + const obj: any = {}; + if (message.jobs) { + obj.jobs = message.jobs.map((e) => (e ? Job.toJSON(e) : undefined)); + } else { + obj.jobs = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListProjectJobResponse { + const message = { ...baseListProjectJobResponse } as ListProjectJobResponse; + message.jobs = object.jobs?.map((e) => Job.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListProjectJobResponse.$type, ListProjectJobResponse); + +const baseGetProjectJobRequest: object = { + $type: "yandex.cloud.datasphere.v2.jobs.GetProjectJobRequest", + jobId: "", +}; + +export const GetProjectJobRequest = { + $type: "yandex.cloud.datasphere.v2.jobs.GetProjectJobRequest" as const, + + encode( + message: GetProjectJobRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobId !== "") { + writer.uint32(10).string(message.jobId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetProjectJobRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetProjectJobRequest } as GetProjectJobRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetProjectJobRequest { + const message = { ...baseGetProjectJobRequest } as GetProjectJobRequest; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + return message; + }, + + toJSON(message: GetProjectJobRequest): unknown { + const obj: any = {}; + message.jobId !== undefined && (obj.jobId = message.jobId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetProjectJobRequest { + const message = { ...baseGetProjectJobRequest } as GetProjectJobRequest; + message.jobId = object.jobId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetProjectJobRequest.$type, GetProjectJobRequest); + +const baseDeleteProjectJobRequest: object = { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobRequest", + jobId: "", +}; + +export const DeleteProjectJobRequest = { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobRequest" as const, + + encode( + message: DeleteProjectJobRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobId !== "") { + writer.uint32(10).string(message.jobId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteProjectJobRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteProjectJobRequest, + } as DeleteProjectJobRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteProjectJobRequest { + const message = { + ...baseDeleteProjectJobRequest, + } as DeleteProjectJobRequest; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + return message; + }, + + toJSON(message: DeleteProjectJobRequest): unknown { + const obj: any = {}; + message.jobId !== undefined && (obj.jobId = message.jobId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteProjectJobRequest { + const message = { + ...baseDeleteProjectJobRequest, + } as DeleteProjectJobRequest; + message.jobId = object.jobId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteProjectJobRequest.$type, DeleteProjectJobRequest); + +const baseDeleteProjectJobMetadata: object = { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobMetadata", + jobId: "", +}; + +export const DeleteProjectJobMetadata = { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobMetadata" as const, + + encode( + message: DeleteProjectJobMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobId !== "") { + writer.uint32(10).string(message.jobId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteProjectJobMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteProjectJobMetadata, + } as DeleteProjectJobMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteProjectJobMetadata { + const message = { + ...baseDeleteProjectJobMetadata, + } as DeleteProjectJobMetadata; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + return message; + }, + + toJSON(message: DeleteProjectJobMetadata): unknown { + const obj: any = {}; + message.jobId !== undefined && (obj.jobId = message.jobId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteProjectJobMetadata { + const message = { + ...baseDeleteProjectJobMetadata, + } as DeleteProjectJobMetadata; + message.jobId = object.jobId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteProjectJobMetadata.$type, + DeleteProjectJobMetadata +); + +const baseDeleteProjectJobDataRequest: object = { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobDataRequest", + jobId: "", +}; + +export const DeleteProjectJobDataRequest = { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobDataRequest" as const, + + encode( + message: DeleteProjectJobDataRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobId !== "") { + writer.uint32(10).string(message.jobId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteProjectJobDataRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteProjectJobDataRequest, + } as DeleteProjectJobDataRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteProjectJobDataRequest { + const message = { + ...baseDeleteProjectJobDataRequest, + } as DeleteProjectJobDataRequest; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + return message; + }, + + toJSON(message: DeleteProjectJobDataRequest): unknown { + const obj: any = {}; + message.jobId !== undefined && (obj.jobId = message.jobId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteProjectJobDataRequest { + const message = { + ...baseDeleteProjectJobDataRequest, + } as DeleteProjectJobDataRequest; + message.jobId = object.jobId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteProjectJobDataRequest.$type, + DeleteProjectJobDataRequest +); + +const baseDeleteProjectJobDataMetadata: object = { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobDataMetadata", + jobId: "", +}; + +export const DeleteProjectJobDataMetadata = { + $type: + "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobDataMetadata" as const, + + encode( + message: DeleteProjectJobDataMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobId !== "") { + writer.uint32(10).string(message.jobId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteProjectJobDataMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteProjectJobDataMetadata, + } as DeleteProjectJobDataMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteProjectJobDataMetadata { + const message = { + ...baseDeleteProjectJobDataMetadata, + } as DeleteProjectJobDataMetadata; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + return message; + }, + + toJSON(message: DeleteProjectJobDataMetadata): unknown { + const obj: any = {}; + message.jobId !== undefined && (obj.jobId = message.jobId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteProjectJobDataMetadata { + const message = { + ...baseDeleteProjectJobDataMetadata, + } as DeleteProjectJobDataMetadata; + message.jobId = object.jobId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteProjectJobDataMetadata.$type, + DeleteProjectJobDataMetadata +); + +const baseDeleteProjectJobDataResponse: object = { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobDataResponse", +}; + +export const DeleteProjectJobDataResponse = { + $type: + "yandex.cloud.datasphere.v2.jobs.DeleteProjectJobDataResponse" as const, + + encode( + _: DeleteProjectJobDataResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteProjectJobDataResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteProjectJobDataResponse, + } as DeleteProjectJobDataResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): DeleteProjectJobDataResponse { + const message = { + ...baseDeleteProjectJobDataResponse, + } as DeleteProjectJobDataResponse; + return message; + }, + + toJSON(_: DeleteProjectJobDataResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): DeleteProjectJobDataResponse { + const message = { + ...baseDeleteProjectJobDataResponse, + } as DeleteProjectJobDataResponse; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteProjectJobDataResponse.$type, + DeleteProjectJobDataResponse +); + +const baseDeleteAllProjectJobDataRequest: object = { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteAllProjectJobDataRequest", + projectId: "", +}; + +export const DeleteAllProjectJobDataRequest = { + $type: + "yandex.cloud.datasphere.v2.jobs.DeleteAllProjectJobDataRequest" as const, + + encode( + message: DeleteAllProjectJobDataRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.projectId !== "") { + writer.uint32(10).string(message.projectId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteAllProjectJobDataRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteAllProjectJobDataRequest, + } as DeleteAllProjectJobDataRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteAllProjectJobDataRequest { + const message = { + ...baseDeleteAllProjectJobDataRequest, + } as DeleteAllProjectJobDataRequest; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + return message; + }, + + toJSON(message: DeleteAllProjectJobDataRequest): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = message.projectId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteAllProjectJobDataRequest { + const message = { + ...baseDeleteAllProjectJobDataRequest, + } as DeleteAllProjectJobDataRequest; + message.projectId = object.projectId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteAllProjectJobDataRequest.$type, + DeleteAllProjectJobDataRequest +); + +const baseDeleteAllProjectJobDataMetadata: object = { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteAllProjectJobDataMetadata", + projectId: "", +}; + +export const DeleteAllProjectJobDataMetadata = { + $type: + "yandex.cloud.datasphere.v2.jobs.DeleteAllProjectJobDataMetadata" as const, + + encode( + message: DeleteAllProjectJobDataMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.projectId !== "") { + writer.uint32(10).string(message.projectId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteAllProjectJobDataMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteAllProjectJobDataMetadata, + } as DeleteAllProjectJobDataMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteAllProjectJobDataMetadata { + const message = { + ...baseDeleteAllProjectJobDataMetadata, + } as DeleteAllProjectJobDataMetadata; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + return message; + }, + + toJSON(message: DeleteAllProjectJobDataMetadata): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = message.projectId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteAllProjectJobDataMetadata { + const message = { + ...baseDeleteAllProjectJobDataMetadata, + } as DeleteAllProjectJobDataMetadata; + message.projectId = object.projectId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteAllProjectJobDataMetadata.$type, + DeleteAllProjectJobDataMetadata +); + +const baseDeleteAllProjectJobDataResponse: object = { + $type: "yandex.cloud.datasphere.v2.jobs.DeleteAllProjectJobDataResponse", +}; + +export const DeleteAllProjectJobDataResponse = { + $type: + "yandex.cloud.datasphere.v2.jobs.DeleteAllProjectJobDataResponse" as const, + + encode( + _: DeleteAllProjectJobDataResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteAllProjectJobDataResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteAllProjectJobDataResponse, + } as DeleteAllProjectJobDataResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): DeleteAllProjectJobDataResponse { + const message = { + ...baseDeleteAllProjectJobDataResponse, + } as DeleteAllProjectJobDataResponse; + return message; + }, + + toJSON(_: DeleteAllProjectJobDataResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): DeleteAllProjectJobDataResponse { + const message = { + ...baseDeleteAllProjectJobDataResponse, + } as DeleteAllProjectJobDataResponse; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteAllProjectJobDataResponse.$type, + DeleteAllProjectJobDataResponse +); + +const baseSetProjectJobDataTtlRequest: object = { + $type: "yandex.cloud.datasphere.v2.jobs.SetProjectJobDataTtlRequest", + jobId: "", +}; + +export const SetProjectJobDataTtlRequest = { + $type: "yandex.cloud.datasphere.v2.jobs.SetProjectJobDataTtlRequest" as const, + + encode( + message: SetProjectJobDataTtlRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobId !== "") { + writer.uint32(10).string(message.jobId); + } + if (message.ttl !== undefined) { + Duration.encode(message.ttl, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SetProjectJobDataTtlRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSetProjectJobDataTtlRequest, + } as SetProjectJobDataTtlRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobId = reader.string(); + break; + case 2: + message.ttl = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SetProjectJobDataTtlRequest { + const message = { + ...baseSetProjectJobDataTtlRequest, + } as SetProjectJobDataTtlRequest; + message.jobId = + object.jobId !== undefined && object.jobId !== null + ? String(object.jobId) + : ""; + message.ttl = + object.ttl !== undefined && object.ttl !== null + ? Duration.fromJSON(object.ttl) + : undefined; + return message; + }, + + toJSON(message: SetProjectJobDataTtlRequest): unknown { + const obj: any = {}; + message.jobId !== undefined && (obj.jobId = message.jobId); + message.ttl !== undefined && + (obj.ttl = message.ttl ? Duration.toJSON(message.ttl) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): SetProjectJobDataTtlRequest { + const message = { + ...baseSetProjectJobDataTtlRequest, + } as SetProjectJobDataTtlRequest; + message.jobId = object.jobId ?? ""; + message.ttl = + object.ttl !== undefined && object.ttl !== null + ? Duration.fromPartial(object.ttl) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + SetProjectJobDataTtlRequest.$type, + SetProjectJobDataTtlRequest +); + +const baseSetProjectJobDataTtlResponse: object = { + $type: "yandex.cloud.datasphere.v2.jobs.SetProjectJobDataTtlResponse", +}; + +export const SetProjectJobDataTtlResponse = { + $type: + "yandex.cloud.datasphere.v2.jobs.SetProjectJobDataTtlResponse" as const, + + encode( + _: SetProjectJobDataTtlResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SetProjectJobDataTtlResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSetProjectJobDataTtlResponse, + } as SetProjectJobDataTtlResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): SetProjectJobDataTtlResponse { + const message = { + ...baseSetProjectJobDataTtlResponse, + } as SetProjectJobDataTtlResponse; + return message; + }, + + toJSON(_: SetProjectJobDataTtlResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): SetProjectJobDataTtlResponse { + const message = { + ...baseSetProjectJobDataTtlResponse, + } as SetProjectJobDataTtlResponse; + return message; + }, +}; + +messageTypeRegistry.set( + SetProjectJobDataTtlResponse.$type, + SetProjectJobDataTtlResponse +); + +const baseStdLog: object = { + $type: "yandex.cloud.datasphere.v2.jobs.StdLog", + type: 0, +}; + +export const StdLog = { + $type: "yandex.cloud.datasphere.v2.jobs.StdLog" as const, + + encode( + message: StdLog, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.content.length !== 0) { + writer.uint32(10).bytes(message.content); + } + if (message.type !== 0) { + writer.uint32(16).int32(message.type); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StdLog { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStdLog } as StdLog; + message.content = Buffer.alloc(0); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = reader.bytes() as Buffer; + break; + case 2: + message.type = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StdLog { + const message = { ...baseStdLog } as StdLog; + message.content = + object.content !== undefined && object.content !== null + ? Buffer.from(bytesFromBase64(object.content)) + : Buffer.alloc(0); + message.type = + object.type !== undefined && object.type !== null + ? stdLog_TypeFromJSON(object.type) + : 0; + return message; + }, + + toJSON(message: StdLog): unknown { + const obj: any = {}; + message.content !== undefined && + (obj.content = base64FromBytes( + message.content !== undefined ? message.content : Buffer.alloc(0) + )); + message.type !== undefined && (obj.type = stdLog_TypeToJSON(message.type)); + return obj; + }, + + fromPartial, I>>(object: I): StdLog { + const message = { ...baseStdLog } as StdLog; + message.content = object.content ?? Buffer.alloc(0); + message.type = object.type ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(StdLog.$type, StdLog); + +const baseLogMessage: object = { + $type: "yandex.cloud.datasphere.v2.jobs.LogMessage", +}; + +export const LogMessage = { + $type: "yandex.cloud.datasphere.v2.jobs.LogMessage" as const, + + encode( + message: LogMessage, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.content.length !== 0) { + writer.uint32(10).bytes(message.content); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(18).fork() + ).ldelim(); + } + if (message.standardStream !== undefined) { + writer.uint32(24).int32(message.standardStream); + } + if (message.filePath !== undefined) { + writer.uint32(34).string(message.filePath); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LogMessage { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLogMessage } as LogMessage; + message.content = Buffer.alloc(0); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = reader.bytes() as Buffer; + break; + case 2: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 3: + message.standardStream = reader.int32() as any; + break; + case 4: + message.filePath = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LogMessage { + const message = { ...baseLogMessage } as LogMessage; + message.content = + object.content !== undefined && object.content !== null + ? Buffer.from(bytesFromBase64(object.content)) + : Buffer.alloc(0); + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.standardStream = + object.standardStream !== undefined && object.standardStream !== null + ? standardStreamFromJSON(object.standardStream) + : undefined; + message.filePath = + object.filePath !== undefined && object.filePath !== null + ? String(object.filePath) + : undefined; + return message; + }, + + toJSON(message: LogMessage): unknown { + const obj: any = {}; + message.content !== undefined && + (obj.content = base64FromBytes( + message.content !== undefined ? message.content : Buffer.alloc(0) + )); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.standardStream !== undefined && + (obj.standardStream = + message.standardStream !== undefined + ? standardStreamToJSON(message.standardStream) + : undefined); + message.filePath !== undefined && (obj.filePath = message.filePath); + return obj; + }, + + fromPartial, I>>( + object: I + ): LogMessage { + const message = { ...baseLogMessage } as LogMessage; + message.content = object.content ?? Buffer.alloc(0); + message.createdAt = object.createdAt ?? undefined; + message.standardStream = object.standardStream ?? undefined; + message.filePath = object.filePath ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(LogMessage.$type, LogMessage); + +/** + * A set of methods for managing Project Jobs. Do not use these methods manually. + * For working with DataSphere Jobs, install DataSphere CLI via `pip install datasphere`. + */ +export const ProjectJobServiceService = { + /** Creates job. */ + create: { + path: "/yandex.cloud.datasphere.v2.jobs.ProjectJobService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateProjectJobRequest) => + Buffer.from(CreateProjectJobRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CreateProjectJobRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Clone job. */ + clone: { + path: "/yandex.cloud.datasphere.v2.jobs.ProjectJobService/Clone", + requestStream: false, + responseStream: false, + requestSerialize: (value: CloneProjectJobRequest) => + Buffer.from(CloneProjectJobRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CloneProjectJobRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Runs job execution. */ + execute: { + path: "/yandex.cloud.datasphere.v2.jobs.ProjectJobService/Execute", + requestStream: false, + responseStream: false, + requestSerialize: (value: ExecuteProjectJobRequest) => + Buffer.from(ExecuteProjectJobRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ExecuteProjectJobRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Cancels running job. */ + cancel: { + path: "/yandex.cloud.datasphere.v2.jobs.ProjectJobService/Cancel", + requestStream: false, + responseStream: false, + requestSerialize: (value: CancelProjectJobRequest) => + Buffer.from(CancelProjectJobRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CancelProjectJobRequest.decode(value), + responseSerialize: (value: Empty) => + Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, + /** + * Returns stream of job logs. + * + * @deprecated + */ + readStdLogs: { + path: "/yandex.cloud.datasphere.v2.jobs.ProjectJobService/ReadStdLogs", + requestStream: false, + responseStream: true, + requestSerialize: (value: ReadProjectJobStdLogsRequest) => + Buffer.from(ReadProjectJobStdLogsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ReadProjectJobStdLogsRequest.decode(value), + responseSerialize: (value: ReadProjectJobStdLogsResponse) => + Buffer.from(ReadProjectJobStdLogsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ReadProjectJobStdLogsResponse.decode(value), + }, + /** Returns stream of job logs. */ + readLogs: { + path: "/yandex.cloud.datasphere.v2.jobs.ProjectJobService/ReadLogs", + requestStream: false, + responseStream: true, + requestSerialize: (value: ReadProjectJobLogsRequest) => + Buffer.from(ReadProjectJobLogsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ReadProjectJobLogsRequest.decode(value), + responseSerialize: (value: ReadProjectJobLogsResponse) => + Buffer.from(ReadProjectJobLogsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ReadProjectJobLogsResponse.decode(value), + }, + /** Returns download urls for job files. */ + downloadJobFiles: { + path: "/yandex.cloud.datasphere.v2.jobs.ProjectJobService/DownloadJobFiles", + requestStream: false, + responseStream: false, + requestSerialize: (value: DownloadProjectJobFilesRequest) => + Buffer.from(DownloadProjectJobFilesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DownloadProjectJobFilesRequest.decode(value), + responseSerialize: (value: DownloadProjectJobFilesResponse) => + Buffer.from(DownloadProjectJobFilesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + DownloadProjectJobFilesResponse.decode(value), + }, + /** Lists jobs. */ + list: { + path: "/yandex.cloud.datasphere.v2.jobs.ProjectJobService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListProjectJobRequest) => + Buffer.from(ListProjectJobRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListProjectJobRequest.decode(value), + responseSerialize: (value: ListProjectJobResponse) => + Buffer.from(ListProjectJobResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListProjectJobResponse.decode(value), + }, + /** Returns job by id. */ + get: { + path: "/yandex.cloud.datasphere.v2.jobs.ProjectJobService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetProjectJobRequest) => + Buffer.from(GetProjectJobRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetProjectJobRequest.decode(value), + responseSerialize: (value: Job) => Buffer.from(Job.encode(value).finish()), + responseDeserialize: (value: Buffer) => Job.decode(value), + }, + /** Deletes specified job. */ + delete: { + path: "/yandex.cloud.datasphere.v2.jobs.ProjectJobService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteProjectJobRequest) => + Buffer.from(DeleteProjectJobRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteProjectJobRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Delete job data. */ + deleteData: { + path: "/yandex.cloud.datasphere.v2.jobs.ProjectJobService/DeleteData", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteProjectJobDataRequest) => + Buffer.from(DeleteProjectJobDataRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteProjectJobDataRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Delete all jobs data. */ + deleteAllData: { + path: "/yandex.cloud.datasphere.v2.jobs.ProjectJobService/DeleteAllData", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteAllProjectJobDataRequest) => + Buffer.from(DeleteAllProjectJobDataRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteAllProjectJobDataRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Update job data ttl. */ + setDataTtl: { + path: "/yandex.cloud.datasphere.v2.jobs.ProjectJobService/SetDataTtl", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetProjectJobDataTtlRequest) => + Buffer.from(SetProjectJobDataTtlRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetProjectJobDataTtlRequest.decode(value), + responseSerialize: (value: SetProjectJobDataTtlResponse) => + Buffer.from(SetProjectJobDataTtlResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + SetProjectJobDataTtlResponse.decode(value), + }, +} as const; + +export interface ProjectJobServiceServer extends UntypedServiceImplementation { + /** Creates job. */ + create: handleUnaryCall; + /** Clone job. */ + clone: handleUnaryCall; + /** Runs job execution. */ + execute: handleUnaryCall; + /** Cancels running job. */ + cancel: handleUnaryCall; + /** + * Returns stream of job logs. + * + * @deprecated + */ + readStdLogs: handleServerStreamingCall< + ReadProjectJobStdLogsRequest, + ReadProjectJobStdLogsResponse + >; + /** Returns stream of job logs. */ + readLogs: handleServerStreamingCall< + ReadProjectJobLogsRequest, + ReadProjectJobLogsResponse + >; + /** Returns download urls for job files. */ + downloadJobFiles: handleUnaryCall< + DownloadProjectJobFilesRequest, + DownloadProjectJobFilesResponse + >; + /** Lists jobs. */ + list: handleUnaryCall; + /** Returns job by id. */ + get: handleUnaryCall; + /** Deletes specified job. */ + delete: handleUnaryCall; + /** Delete job data. */ + deleteData: handleUnaryCall; + /** Delete all jobs data. */ + deleteAllData: handleUnaryCall; + /** Update job data ttl. */ + setDataTtl: handleUnaryCall< + SetProjectJobDataTtlRequest, + SetProjectJobDataTtlResponse + >; +} + +export interface ProjectJobServiceClient extends Client { + /** Creates job. */ + create( + request: CreateProjectJobRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateProjectJobRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateProjectJobRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Clone job. */ + clone( + request: CloneProjectJobRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + clone( + request: CloneProjectJobRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + clone( + request: CloneProjectJobRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Runs job execution. */ + execute( + request: ExecuteProjectJobRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + execute( + request: ExecuteProjectJobRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + execute( + request: ExecuteProjectJobRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Cancels running job. */ + cancel( + request: CancelProjectJobRequest, + callback: (error: ServiceError | null, response: Empty) => void + ): ClientUnaryCall; + cancel( + request: CancelProjectJobRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Empty) => void + ): ClientUnaryCall; + cancel( + request: CancelProjectJobRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Empty) => void + ): ClientUnaryCall; + /** + * Returns stream of job logs. + * + * @deprecated + */ + readStdLogs( + request: ReadProjectJobStdLogsRequest, + options?: Partial + ): ClientReadableStream; + readStdLogs( + request: ReadProjectJobStdLogsRequest, + metadata?: Metadata, + options?: Partial + ): ClientReadableStream; + /** Returns stream of job logs. */ + readLogs( + request: ReadProjectJobLogsRequest, + options?: Partial + ): ClientReadableStream; + readLogs( + request: ReadProjectJobLogsRequest, + metadata?: Metadata, + options?: Partial + ): ClientReadableStream; + /** Returns download urls for job files. */ + downloadJobFiles( + request: DownloadProjectJobFilesRequest, + callback: ( + error: ServiceError | null, + response: DownloadProjectJobFilesResponse + ) => void + ): ClientUnaryCall; + downloadJobFiles( + request: DownloadProjectJobFilesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: DownloadProjectJobFilesResponse + ) => void + ): ClientUnaryCall; + downloadJobFiles( + request: DownloadProjectJobFilesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: DownloadProjectJobFilesResponse + ) => void + ): ClientUnaryCall; + /** Lists jobs. */ + list( + request: ListProjectJobRequest, + callback: ( + error: ServiceError | null, + response: ListProjectJobResponse + ) => void + ): ClientUnaryCall; + list( + request: ListProjectJobRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListProjectJobResponse + ) => void + ): ClientUnaryCall; + list( + request: ListProjectJobRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListProjectJobResponse + ) => void + ): ClientUnaryCall; + /** Returns job by id. */ + get( + request: GetProjectJobRequest, + callback: (error: ServiceError | null, response: Job) => void + ): ClientUnaryCall; + get( + request: GetProjectJobRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Job) => void + ): ClientUnaryCall; + get( + request: GetProjectJobRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Job) => void + ): ClientUnaryCall; + /** Deletes specified job. */ + delete( + request: DeleteProjectJobRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteProjectJobRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteProjectJobRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Delete job data. */ + deleteData( + request: DeleteProjectJobDataRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deleteData( + request: DeleteProjectJobDataRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deleteData( + request: DeleteProjectJobDataRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Delete all jobs data. */ + deleteAllData( + request: DeleteAllProjectJobDataRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deleteAllData( + request: DeleteAllProjectJobDataRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deleteAllData( + request: DeleteAllProjectJobDataRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Update job data ttl. */ + setDataTtl( + request: SetProjectJobDataTtlRequest, + callback: ( + error: ServiceError | null, + response: SetProjectJobDataTtlResponse + ) => void + ): ClientUnaryCall; + setDataTtl( + request: SetProjectJobDataTtlRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: SetProjectJobDataTtlResponse + ) => void + ): ClientUnaryCall; + setDataTtl( + request: SetProjectJobDataTtlRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: SetProjectJobDataTtlResponse + ) => void + ): ClientUnaryCall; +} + +export const ProjectJobServiceClient = makeGenericClientConstructor( + ProjectJobServiceService, + "yandex.cloud.datasphere.v2.jobs.ProjectJobService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ProjectJobServiceClient; + service: typeof ProjectJobServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (const byte of arr) { + bin.push(String.fromCharCode(byte)); + } + return btoa(bin.join("")); +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/datasphere/v2/project.ts b/src/generated/yandex/cloud/datasphere/v2/project.ts index 23ac65dd..30ca3a83 100644 --- a/src/generated/yandex/cloud/datasphere/v2/project.ts +++ b/src/generated/yandex/cloud/datasphere/v2/project.ts @@ -2,6 +2,7 @@ import { messageTypeRegistry } from "../../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; +import { Duration } from "../../../../google/protobuf/duration"; import { Timestamp } from "../../../../google/protobuf/timestamp"; import { Int64Value } from "../../../../google/protobuf/wrappers"; @@ -50,6 +51,12 @@ export interface Project_Settings { defaultFolderId: string; /** Timeout to automatically stop stale executions. */ staleExecTimeoutMode: Project_Settings_StaleExecutionTimeoutMode; + /** VM allocation mode. */ + ideExecutionMode: Project_Settings_IdeExecutionMode; + /** Timeout for VM deallocation. */ + vmInactivityTimeout?: Duration; + /** Default VM configuration for DEDICATED mode. */ + defaultDedicatedSpec: string; } export enum Project_Settings_CommitMode { @@ -187,6 +194,53 @@ export function project_Settings_StaleExecutionTimeoutModeToJSON( } } +export enum Project_Settings_IdeExecutionMode { + IDE_EXECUTION_MODE_UNSPECIFIED = 0, + /** SERVERLESS - VM is allocated for specific execution and deallocated after the execution ends. */ + SERVERLESS = 1, + /** + * DEDICATED - VM is allocated at the first execution and stays allocated until manually deallocated. + * Or until timeout exceeded. + */ + DEDICATED = 2, + UNRECOGNIZED = -1, +} + +export function project_Settings_IdeExecutionModeFromJSON( + object: any +): Project_Settings_IdeExecutionMode { + switch (object) { + case 0: + case "IDE_EXECUTION_MODE_UNSPECIFIED": + return Project_Settings_IdeExecutionMode.IDE_EXECUTION_MODE_UNSPECIFIED; + case 1: + case "SERVERLESS": + return Project_Settings_IdeExecutionMode.SERVERLESS; + case 2: + case "DEDICATED": + return Project_Settings_IdeExecutionMode.DEDICATED; + case -1: + case "UNRECOGNIZED": + default: + return Project_Settings_IdeExecutionMode.UNRECOGNIZED; + } +} + +export function project_Settings_IdeExecutionModeToJSON( + object: Project_Settings_IdeExecutionMode +): string { + switch (object) { + case Project_Settings_IdeExecutionMode.IDE_EXECUTION_MODE_UNSPECIFIED: + return "IDE_EXECUTION_MODE_UNSPECIFIED"; + case Project_Settings_IdeExecutionMode.SERVERLESS: + return "SERVERLESS"; + case Project_Settings_IdeExecutionMode.DEDICATED: + return "DEDICATED"; + default: + return "UNKNOWN"; + } +} + export interface Project_Limits { $type: "yandex.cloud.datasphere.v2.Project.Limits"; /** The number of units that can be spent per hour. */ @@ -419,6 +473,8 @@ const baseProject_Settings: object = { ide: 0, defaultFolderId: "", staleExecTimeoutMode: 0, + ideExecutionMode: 0, + defaultDedicatedSpec: "", }; export const Project_Settings = { @@ -455,6 +511,18 @@ export const Project_Settings = { if (message.staleExecTimeoutMode !== 0) { writer.uint32(72).int32(message.staleExecTimeoutMode); } + if (message.ideExecutionMode !== 0) { + writer.uint32(80).int32(message.ideExecutionMode); + } + if (message.vmInactivityTimeout !== undefined) { + Duration.encode( + message.vmInactivityTimeout, + writer.uint32(90).fork() + ).ldelim(); + } + if (message.defaultDedicatedSpec !== "") { + writer.uint32(98).string(message.defaultDedicatedSpec); + } return writer; }, @@ -493,6 +561,18 @@ export const Project_Settings = { case 9: message.staleExecTimeoutMode = reader.int32() as any; break; + case 10: + message.ideExecutionMode = reader.int32() as any; + break; + case 11: + message.vmInactivityTimeout = Duration.decode( + reader, + reader.uint32() + ); + break; + case 12: + message.defaultDedicatedSpec = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -542,6 +622,20 @@ export const Project_Settings = { object.staleExecTimeoutMode ) : 0; + message.ideExecutionMode = + object.ideExecutionMode !== undefined && object.ideExecutionMode !== null + ? project_Settings_IdeExecutionModeFromJSON(object.ideExecutionMode) + : 0; + message.vmInactivityTimeout = + object.vmInactivityTimeout !== undefined && + object.vmInactivityTimeout !== null + ? Duration.fromJSON(object.vmInactivityTimeout) + : undefined; + message.defaultDedicatedSpec = + object.defaultDedicatedSpec !== undefined && + object.defaultDedicatedSpec !== null + ? String(object.defaultDedicatedSpec) + : ""; return message; }, @@ -570,6 +664,16 @@ export const Project_Settings = { project_Settings_StaleExecutionTimeoutModeToJSON( message.staleExecTimeoutMode )); + message.ideExecutionMode !== undefined && + (obj.ideExecutionMode = project_Settings_IdeExecutionModeToJSON( + message.ideExecutionMode + )); + message.vmInactivityTimeout !== undefined && + (obj.vmInactivityTimeout = message.vmInactivityTimeout + ? Duration.toJSON(message.vmInactivityTimeout) + : undefined); + message.defaultDedicatedSpec !== undefined && + (obj.defaultDedicatedSpec = message.defaultDedicatedSpec); return obj; }, @@ -586,6 +690,13 @@ export const Project_Settings = { message.ide = object.ide ?? 0; message.defaultFolderId = object.defaultFolderId ?? ""; message.staleExecTimeoutMode = object.staleExecTimeoutMode ?? 0; + message.ideExecutionMode = object.ideExecutionMode ?? 0; + message.vmInactivityTimeout = + object.vmInactivityTimeout !== undefined && + object.vmInactivityTimeout !== null + ? Duration.fromPartial(object.vmInactivityTimeout) + : undefined; + message.defaultDedicatedSpec = object.defaultDedicatedSpec ?? ""; return message; }, }; diff --git a/src/generated/yandex/cloud/datasphere/v2/project_service.ts b/src/generated/yandex/cloud/datasphere/v2/project_service.ts index 6ca9f5c1..813e324d 100644 --- a/src/generated/yandex/cloud/datasphere/v2/project_service.ts +++ b/src/generated/yandex/cloud/datasphere/v2/project_service.ts @@ -20,7 +20,17 @@ import { Project, } from "../../../../yandex/cloud/datasphere/v2/project"; import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { + ResourceType, + resourceTypeFromJSON, + resourceTypeToJSON, +} from "../../../../yandex/cloud/datasphere/v2/resource_types"; import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { + Restriction, + GetRestrictionsMetaResponse, + RestrictionsResponse, +} from "../../../../yandex/cloud/datasphere/v2/restrictions"; import { Operation } from "../../../../yandex/cloud/operation/operation"; import { ListAccessBindingsRequest, @@ -28,6 +38,7 @@ import { SetAccessBindingsRequest, UpdateAccessBindingsRequest, } from "../../../../yandex/cloud/access/access"; +import { Empty } from "../../../../google/protobuf/empty"; import { Int64Value } from "../../../../google/protobuf/wrappers"; import { Struct } from "../../../../google/protobuf/struct"; @@ -258,7 +269,7 @@ export interface OpenProjectResponse { * URL of the project that is being opened. * Make GET request to [project_url] with sessionToken query parameter equals to [session_token] * or POST request to [project_url] with sessionToken body parameter equals to [session_token] - * to fetch Datasphere web interface. + * to fetch DataSphere web interface. */ projectUrl: string; /** Session token of the project that is being opened. */ @@ -347,14 +358,27 @@ export interface ProjectExecutionRequest { $type: "yandex.cloud.datasphere.v2.ProjectExecutionRequest"; /** ID of the project to execute notebook/cell in. */ projectId: string; - /** ID of the notebook to execute. */ + /** + * The path to the executable notebook in the project storage. The maximum string length is 200 characters. + * + * To get the path, right-click on the notebook in JupyterLab and select `Copy path`. + */ notebookId: string | undefined; - /** ID of the cell to execute. */ + /** + * ID of the cell to execute. + * Deprecated + * + * @deprecated + */ cellId: string | undefined; - /** Values of input variables. */ + /** Values of input variables. Input variables will be available in the project as environment variables. */ inputVariables?: { [key: string]: any }; /** Names of output variables. */ outputVariableNames: string[]; + /** Specification of the VM */ + spec: string; + /** ID of the Spark Connector */ + sparkConnectorId: string; } export interface ProjectExecutionMetadata { @@ -371,7 +395,12 @@ export interface ProjectExecutionResponse { $type: "yandex.cloud.datasphere.v2.ProjectExecutionResponse"; /** ID of the checkpoint resulting from the execution. */ checkpointId: string; - /** Values of output variables resulting from the execution. */ + /** + * Values of output variables resulting from the execution. + * Deprecated + * + * @deprecated + */ outputVariables?: { [key: string]: any }; /** Execution final status. */ executionStatus: ExecutionStatus; @@ -425,6 +454,34 @@ export interface UpdateProjectAccessBindingsMetadata { projectId: string; } +export interface AddResourceToProjectRequest { + $type: "yandex.cloud.datasphere.v2.AddResourceToProjectRequest"; + projectId: string; + resourceType: ResourceType; + resourceId: string; +} + +export interface RemoveResourceFromProjectRequest { + $type: "yandex.cloud.datasphere.v2.RemoveResourceFromProjectRequest"; + projectId: string; + resourceType: ResourceType; + resourceId: string; +} + +export interface GetProjectRestrictionsRequest { + $type: "yandex.cloud.datasphere.v2.GetProjectRestrictionsRequest"; + /** ID of the project. */ + projectId: string; +} + +export interface SetProjectRestrictionsRequest { + $type: "yandex.cloud.datasphere.v2.SetProjectRestrictionsRequest"; + /** ID of the project. */ + projectId: string; + /** List of restrictions to set. */ + restrictions: Restriction[]; +} + const baseCreateProjectRequest: object = { $type: "yandex.cloud.datasphere.v2.CreateProjectRequest", communityId: "", @@ -1986,6 +2043,8 @@ const baseProjectExecutionRequest: object = { $type: "yandex.cloud.datasphere.v2.ProjectExecutionRequest", projectId: "", outputVariableNames: "", + spec: "", + sparkConnectorId: "", }; export const ProjectExecutionRequest = { @@ -2013,6 +2072,12 @@ export const ProjectExecutionRequest = { for (const v of message.outputVariableNames) { writer.uint32(42).string(v!); } + if (message.spec !== "") { + writer.uint32(50).string(message.spec); + } + if (message.sparkConnectorId !== "") { + writer.uint32(58).string(message.sparkConnectorId); + } return writer; }, @@ -2046,6 +2111,12 @@ export const ProjectExecutionRequest = { case 5: message.outputVariableNames.push(reader.string()); break; + case 6: + message.spec = reader.string(); + break; + case 7: + message.sparkConnectorId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -2077,6 +2148,14 @@ export const ProjectExecutionRequest = { message.outputVariableNames = (object.outputVariableNames ?? []).map( (e: any) => String(e) ); + message.spec = + object.spec !== undefined && object.spec !== null + ? String(object.spec) + : ""; + message.sparkConnectorId = + object.sparkConnectorId !== undefined && object.sparkConnectorId !== null + ? String(object.sparkConnectorId) + : ""; return message; }, @@ -2092,6 +2171,9 @@ export const ProjectExecutionRequest = { } else { obj.outputVariableNames = []; } + message.spec !== undefined && (obj.spec = message.spec); + message.sparkConnectorId !== undefined && + (obj.sparkConnectorId = message.sparkConnectorId); return obj; }, @@ -2107,6 +2189,8 @@ export const ProjectExecutionRequest = { message.inputVariables = object.inputVariables ?? undefined; message.outputVariableNames = object.outputVariableNames?.map((e) => e) || []; + message.spec = object.spec ?? ""; + message.sparkConnectorId = object.sparkConnectorId ?? ""; return message; }, }; @@ -2832,6 +2916,377 @@ messageTypeRegistry.set( UpdateProjectAccessBindingsMetadata ); +const baseAddResourceToProjectRequest: object = { + $type: "yandex.cloud.datasphere.v2.AddResourceToProjectRequest", + projectId: "", + resourceType: 0, + resourceId: "", +}; + +export const AddResourceToProjectRequest = { + $type: "yandex.cloud.datasphere.v2.AddResourceToProjectRequest" as const, + + encode( + message: AddResourceToProjectRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.projectId !== "") { + writer.uint32(10).string(message.projectId); + } + if (message.resourceType !== 0) { + writer.uint32(16).int32(message.resourceType); + } + if (message.resourceId !== "") { + writer.uint32(26).string(message.resourceId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AddResourceToProjectRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAddResourceToProjectRequest, + } as AddResourceToProjectRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 2: + message.resourceType = reader.int32() as any; + break; + case 3: + message.resourceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AddResourceToProjectRequest { + const message = { + ...baseAddResourceToProjectRequest, + } as AddResourceToProjectRequest; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + message.resourceType = + object.resourceType !== undefined && object.resourceType !== null + ? resourceTypeFromJSON(object.resourceType) + : 0; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + return message; + }, + + toJSON(message: AddResourceToProjectRequest): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = message.projectId); + message.resourceType !== undefined && + (obj.resourceType = resourceTypeToJSON(message.resourceType)); + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + return obj; + }, + + fromPartial, I>>( + object: I + ): AddResourceToProjectRequest { + const message = { + ...baseAddResourceToProjectRequest, + } as AddResourceToProjectRequest; + message.projectId = object.projectId ?? ""; + message.resourceType = object.resourceType ?? 0; + message.resourceId = object.resourceId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + AddResourceToProjectRequest.$type, + AddResourceToProjectRequest +); + +const baseRemoveResourceFromProjectRequest: object = { + $type: "yandex.cloud.datasphere.v2.RemoveResourceFromProjectRequest", + projectId: "", + resourceType: 0, + resourceId: "", +}; + +export const RemoveResourceFromProjectRequest = { + $type: "yandex.cloud.datasphere.v2.RemoveResourceFromProjectRequest" as const, + + encode( + message: RemoveResourceFromProjectRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.projectId !== "") { + writer.uint32(10).string(message.projectId); + } + if (message.resourceType !== 0) { + writer.uint32(16).int32(message.resourceType); + } + if (message.resourceId !== "") { + writer.uint32(26).string(message.resourceId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RemoveResourceFromProjectRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRemoveResourceFromProjectRequest, + } as RemoveResourceFromProjectRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 2: + message.resourceType = reader.int32() as any; + break; + case 3: + message.resourceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RemoveResourceFromProjectRequest { + const message = { + ...baseRemoveResourceFromProjectRequest, + } as RemoveResourceFromProjectRequest; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + message.resourceType = + object.resourceType !== undefined && object.resourceType !== null + ? resourceTypeFromJSON(object.resourceType) + : 0; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + return message; + }, + + toJSON(message: RemoveResourceFromProjectRequest): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = message.projectId); + message.resourceType !== undefined && + (obj.resourceType = resourceTypeToJSON(message.resourceType)); + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): RemoveResourceFromProjectRequest { + const message = { + ...baseRemoveResourceFromProjectRequest, + } as RemoveResourceFromProjectRequest; + message.projectId = object.projectId ?? ""; + message.resourceType = object.resourceType ?? 0; + message.resourceId = object.resourceId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + RemoveResourceFromProjectRequest.$type, + RemoveResourceFromProjectRequest +); + +const baseGetProjectRestrictionsRequest: object = { + $type: "yandex.cloud.datasphere.v2.GetProjectRestrictionsRequest", + projectId: "", +}; + +export const GetProjectRestrictionsRequest = { + $type: "yandex.cloud.datasphere.v2.GetProjectRestrictionsRequest" as const, + + encode( + message: GetProjectRestrictionsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.projectId !== "") { + writer.uint32(10).string(message.projectId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetProjectRestrictionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetProjectRestrictionsRequest, + } as GetProjectRestrictionsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetProjectRestrictionsRequest { + const message = { + ...baseGetProjectRestrictionsRequest, + } as GetProjectRestrictionsRequest; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + return message; + }, + + toJSON(message: GetProjectRestrictionsRequest): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = message.projectId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetProjectRestrictionsRequest { + const message = { + ...baseGetProjectRestrictionsRequest, + } as GetProjectRestrictionsRequest; + message.projectId = object.projectId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetProjectRestrictionsRequest.$type, + GetProjectRestrictionsRequest +); + +const baseSetProjectRestrictionsRequest: object = { + $type: "yandex.cloud.datasphere.v2.SetProjectRestrictionsRequest", + projectId: "", +}; + +export const SetProjectRestrictionsRequest = { + $type: "yandex.cloud.datasphere.v2.SetProjectRestrictionsRequest" as const, + + encode( + message: SetProjectRestrictionsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.projectId !== "") { + writer.uint32(10).string(message.projectId); + } + for (const v of message.restrictions) { + Restriction.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SetProjectRestrictionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSetProjectRestrictionsRequest, + } as SetProjectRestrictionsRequest; + message.restrictions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 2: + message.restrictions.push( + Restriction.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SetProjectRestrictionsRequest { + const message = { + ...baseSetProjectRestrictionsRequest, + } as SetProjectRestrictionsRequest; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + message.restrictions = (object.restrictions ?? []).map((e: any) => + Restriction.fromJSON(e) + ); + return message; + }, + + toJSON(message: SetProjectRestrictionsRequest): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = message.projectId); + if (message.restrictions) { + obj.restrictions = message.restrictions.map((e) => + e ? Restriction.toJSON(e) : undefined + ); + } else { + obj.restrictions = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): SetProjectRestrictionsRequest { + const message = { + ...baseSetProjectRestrictionsRequest, + } as SetProjectRestrictionsRequest; + message.projectId = object.projectId ?? ""; + message.restrictions = + object.restrictions?.map((e) => Restriction.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + SetProjectRestrictionsRequest.$type, + SetProjectRestrictionsRequest +); + /** A set of methods for managing Project resources. */ export const ProjectServiceService = { /** Creates a project in the specified folder. */ @@ -2931,7 +3386,7 @@ export const ProjectServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, - /** Executes code in the specified cell or notebook. */ + /** Executes code of the specified notebook using configuration defined in the project settings. If the default project configuration is not specified, `c1.4` is used. */ execute: { path: "/yandex.cloud.datasphere.v2.ProjectService/Execute", requestStream: false, @@ -2944,7 +3399,10 @@ export const ProjectServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, - /** Returns outputs of the specified cell. */ + /** + * Returns outputs of the specified cell. + * Deprecated + */ getCellOutputs: { path: "/yandex.cloud.datasphere.v2.ProjectService/GetCellOutputs", requestStream: false, @@ -2956,7 +3414,10 @@ export const ProjectServiceService = { Buffer.from(CellOutputsResponse.encode(value).finish()), responseDeserialize: (value: Buffer) => CellOutputsResponse.decode(value), }, - /** Returns state variables of the specified notebook. */ + /** + * Returns state variables of the specified notebook. + * Deprecated + */ getStateVariables: { path: "/yandex.cloud.datasphere.v2.ProjectService/GetStateVariables", requestStream: false, @@ -3010,6 +3471,71 @@ export const ProjectServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Adds shared resource to project */ + addResource: { + path: "/yandex.cloud.datasphere.v2.ProjectService/AddResource", + requestStream: false, + responseStream: false, + requestSerialize: (value: AddResourceToProjectRequest) => + Buffer.from(AddResourceToProjectRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + AddResourceToProjectRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Removes shared resource from project */ + removeResource: { + path: "/yandex.cloud.datasphere.v2.ProjectService/RemoveResource", + requestStream: false, + responseStream: false, + requestSerialize: (value: RemoveResourceFromProjectRequest) => + Buffer.from(RemoveResourceFromProjectRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + RemoveResourceFromProjectRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Get meta information about available restrictions. */ + getRestrictionsMeta: { + path: "/yandex.cloud.datasphere.v2.ProjectService/GetRestrictionsMeta", + requestStream: false, + responseStream: false, + requestSerialize: (value: Empty) => + Buffer.from(Empty.encode(value).finish()), + requestDeserialize: (value: Buffer) => Empty.decode(value), + responseSerialize: (value: GetRestrictionsMetaResponse) => + Buffer.from(GetRestrictionsMetaResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + GetRestrictionsMetaResponse.decode(value), + }, + /** Get current project restrictions. */ + getRestrictions: { + path: "/yandex.cloud.datasphere.v2.ProjectService/GetRestrictions", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetProjectRestrictionsRequest) => + Buffer.from(GetProjectRestrictionsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetProjectRestrictionsRequest.decode(value), + responseSerialize: (value: RestrictionsResponse) => + Buffer.from(RestrictionsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => RestrictionsResponse.decode(value), + }, + /** Set project restrictions. */ + setRestrictions: { + path: "/yandex.cloud.datasphere.v2.ProjectService/SetRestrictions", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetProjectRestrictionsRequest) => + Buffer.from(SetProjectRestrictionsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetProjectRestrictionsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface ProjectServiceServer extends UntypedServiceImplementation { @@ -3032,11 +3558,17 @@ export interface ProjectServiceServer extends UntypedServiceImplementation { >; /** Sets the unit balance of the specified project. */ setUnitBalance: handleUnaryCall; - /** Executes code in the specified cell or notebook. */ + /** Executes code of the specified notebook using configuration defined in the project settings. If the default project configuration is not specified, `c1.4` is used. */ execute: handleUnaryCall; - /** Returns outputs of the specified cell. */ + /** + * Returns outputs of the specified cell. + * Deprecated + */ getCellOutputs: handleUnaryCall; - /** Returns state variables of the specified notebook. */ + /** + * Returns state variables of the specified notebook. + * Deprecated + */ getStateVariables: handleUnaryCall< GetStateVariablesRequest, GetStateVariablesResponse @@ -3050,6 +3582,19 @@ export interface ProjectServiceServer extends UntypedServiceImplementation { setAccessBindings: handleUnaryCall; /** Updates access bindings for the project. */ updateAccessBindings: handleUnaryCall; + /** Adds shared resource to project */ + addResource: handleUnaryCall; + /** Removes shared resource from project */ + removeResource: handleUnaryCall; + /** Get meta information about available restrictions. */ + getRestrictionsMeta: handleUnaryCall; + /** Get current project restrictions. */ + getRestrictions: handleUnaryCall< + GetProjectRestrictionsRequest, + RestrictionsResponse + >; + /** Set project restrictions. */ + setRestrictions: handleUnaryCall; } export interface ProjectServiceClient extends Client { @@ -3199,7 +3744,7 @@ export interface ProjectServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; - /** Executes code in the specified cell or notebook. */ + /** Executes code of the specified notebook using configuration defined in the project settings. If the default project configuration is not specified, `c1.4` is used. */ execute( request: ProjectExecutionRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -3215,7 +3760,10 @@ export interface ProjectServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; - /** Returns outputs of the specified cell. */ + /** + * Returns outputs of the specified cell. + * Deprecated + */ getCellOutputs( request: CellOutputsRequest, callback: ( @@ -3240,7 +3788,10 @@ export interface ProjectServiceClient extends Client { response: CellOutputsResponse ) => void ): ClientUnaryCall; - /** Returns state variables of the specified notebook. */ + /** + * Returns state variables of the specified notebook. + * Deprecated + */ getStateVariables( request: GetStateVariablesRequest, callback: ( @@ -3322,6 +3873,104 @@ export interface ProjectServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Adds shared resource to project */ + addResource( + request: AddResourceToProjectRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + addResource( + request: AddResourceToProjectRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + addResource( + request: AddResourceToProjectRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Removes shared resource from project */ + removeResource( + request: RemoveResourceFromProjectRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + removeResource( + request: RemoveResourceFromProjectRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + removeResource( + request: RemoveResourceFromProjectRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Get meta information about available restrictions. */ + getRestrictionsMeta( + request: Empty, + callback: ( + error: ServiceError | null, + response: GetRestrictionsMetaResponse + ) => void + ): ClientUnaryCall; + getRestrictionsMeta( + request: Empty, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: GetRestrictionsMetaResponse + ) => void + ): ClientUnaryCall; + getRestrictionsMeta( + request: Empty, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: GetRestrictionsMetaResponse + ) => void + ): ClientUnaryCall; + /** Get current project restrictions. */ + getRestrictions( + request: GetProjectRestrictionsRequest, + callback: ( + error: ServiceError | null, + response: RestrictionsResponse + ) => void + ): ClientUnaryCall; + getRestrictions( + request: GetProjectRestrictionsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: RestrictionsResponse + ) => void + ): ClientUnaryCall; + getRestrictions( + request: GetProjectRestrictionsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: RestrictionsResponse + ) => void + ): ClientUnaryCall; + /** Set project restrictions. */ + setRestrictions( + request: SetProjectRestrictionsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setRestrictions( + request: SetProjectRestrictionsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setRestrictions( + request: SetProjectRestrictionsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const ProjectServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/datasphere/v2/resource_types.ts b/src/generated/yandex/cloud/datasphere/v2/resource_types.ts new file mode 100644 index 00000000..d515073b --- /dev/null +++ b/src/generated/yandex/cloud/datasphere/v2/resource_types.ts @@ -0,0 +1,84 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.datasphere.v2"; + +export enum ResourceType { + RESOURCE_TYPE_UNSPECIFIED = 0, + RESOURCE_TYPE_UNPINNED_CHECKPOINT = 1, + RESOURCE_TYPE_SECRET = 2, + RESOURCE_TYPE_DOCKER_IMAGE = 3, + RESOURCE_TYPE_DATASET = 4, + RESOURCE_TYPE_S3 = 5, + RESOURCE_TYPE_NODE = 6, + RESOURCE_TYPE_PINNED_CHECKPOINT = 7, + RESOURCE_TYPE_ALIAS = 8, + UNRECOGNIZED = -1, +} + +export function resourceTypeFromJSON(object: any): ResourceType { + switch (object) { + case 0: + case "RESOURCE_TYPE_UNSPECIFIED": + return ResourceType.RESOURCE_TYPE_UNSPECIFIED; + case 1: + case "RESOURCE_TYPE_UNPINNED_CHECKPOINT": + return ResourceType.RESOURCE_TYPE_UNPINNED_CHECKPOINT; + case 2: + case "RESOURCE_TYPE_SECRET": + return ResourceType.RESOURCE_TYPE_SECRET; + case 3: + case "RESOURCE_TYPE_DOCKER_IMAGE": + return ResourceType.RESOURCE_TYPE_DOCKER_IMAGE; + case 4: + case "RESOURCE_TYPE_DATASET": + return ResourceType.RESOURCE_TYPE_DATASET; + case 5: + case "RESOURCE_TYPE_S3": + return ResourceType.RESOURCE_TYPE_S3; + case 6: + case "RESOURCE_TYPE_NODE": + return ResourceType.RESOURCE_TYPE_NODE; + case 7: + case "RESOURCE_TYPE_PINNED_CHECKPOINT": + return ResourceType.RESOURCE_TYPE_PINNED_CHECKPOINT; + case 8: + case "RESOURCE_TYPE_ALIAS": + return ResourceType.RESOURCE_TYPE_ALIAS; + case -1: + case "UNRECOGNIZED": + default: + return ResourceType.UNRECOGNIZED; + } +} + +export function resourceTypeToJSON(object: ResourceType): string { + switch (object) { + case ResourceType.RESOURCE_TYPE_UNSPECIFIED: + return "RESOURCE_TYPE_UNSPECIFIED"; + case ResourceType.RESOURCE_TYPE_UNPINNED_CHECKPOINT: + return "RESOURCE_TYPE_UNPINNED_CHECKPOINT"; + case ResourceType.RESOURCE_TYPE_SECRET: + return "RESOURCE_TYPE_SECRET"; + case ResourceType.RESOURCE_TYPE_DOCKER_IMAGE: + return "RESOURCE_TYPE_DOCKER_IMAGE"; + case ResourceType.RESOURCE_TYPE_DATASET: + return "RESOURCE_TYPE_DATASET"; + case ResourceType.RESOURCE_TYPE_S3: + return "RESOURCE_TYPE_S3"; + case ResourceType.RESOURCE_TYPE_NODE: + return "RESOURCE_TYPE_NODE"; + case ResourceType.RESOURCE_TYPE_PINNED_CHECKPOINT: + return "RESOURCE_TYPE_PINNED_CHECKPOINT"; + case ResourceType.RESOURCE_TYPE_ALIAS: + return "RESOURCE_TYPE_ALIAS"; + default: + return "UNKNOWN"; + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/datasphere/v2/restrictions.ts b/src/generated/yandex/cloud/datasphere/v2/restrictions.ts new file mode 100644 index 00000000..8c0918a3 --- /dev/null +++ b/src/generated/yandex/cloud/datasphere/v2/restrictions.ts @@ -0,0 +1,494 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.datasphere.v2"; + +export interface RestrictionMeta { + $type: "yandex.cloud.datasphere.v2.RestrictionMeta"; + /** Name of restriction. */ + name: string; + /** Value type of restriction. */ + valueType: RestrictionMeta_RestrictionValueType; +} + +export enum RestrictionMeta_RestrictionValueType { + RESTRICTION_VALUE_TYPE_UNSPECIFIED = 0, + BOOLEAN = 1, + LONG = 2, + STRING = 3, + UNRECOGNIZED = -1, +} + +export function restrictionMeta_RestrictionValueTypeFromJSON( + object: any +): RestrictionMeta_RestrictionValueType { + switch (object) { + case 0: + case "RESTRICTION_VALUE_TYPE_UNSPECIFIED": + return RestrictionMeta_RestrictionValueType.RESTRICTION_VALUE_TYPE_UNSPECIFIED; + case 1: + case "BOOLEAN": + return RestrictionMeta_RestrictionValueType.BOOLEAN; + case 2: + case "LONG": + return RestrictionMeta_RestrictionValueType.LONG; + case 3: + case "STRING": + return RestrictionMeta_RestrictionValueType.STRING; + case -1: + case "UNRECOGNIZED": + default: + return RestrictionMeta_RestrictionValueType.UNRECOGNIZED; + } +} + +export function restrictionMeta_RestrictionValueTypeToJSON( + object: RestrictionMeta_RestrictionValueType +): string { + switch (object) { + case RestrictionMeta_RestrictionValueType.RESTRICTION_VALUE_TYPE_UNSPECIFIED: + return "RESTRICTION_VALUE_TYPE_UNSPECIFIED"; + case RestrictionMeta_RestrictionValueType.BOOLEAN: + return "BOOLEAN"; + case RestrictionMeta_RestrictionValueType.LONG: + return "LONG"; + case RestrictionMeta_RestrictionValueType.STRING: + return "STRING"; + default: + return "UNKNOWN"; + } +} + +export interface Restriction { + $type: "yandex.cloud.datasphere.v2.Restriction"; + /** Name of restriction. */ + name: string; + /** List of boolean restriction values. Empty if value type is not boolean. */ + boolValue: boolean[]; + /** List of long restriction values. Empty if value type is not long. */ + longValue: number[]; + /** List of string restriction values. Empty if value type is not string. */ + stringValue: string[]; +} + +export interface GetRestrictionsMetaResponse { + $type: "yandex.cloud.datasphere.v2.GetRestrictionsMetaResponse"; + /** List of restrictions. */ + restrictionsMeta: RestrictionMeta[]; +} + +export interface RestrictionsResponse { + $type: "yandex.cloud.datasphere.v2.RestrictionsResponse"; + /** List of restrictions. */ + restrictions: Restriction[]; +} + +const baseRestrictionMeta: object = { + $type: "yandex.cloud.datasphere.v2.RestrictionMeta", + name: "", + valueType: 0, +}; + +export const RestrictionMeta = { + $type: "yandex.cloud.datasphere.v2.RestrictionMeta" as const, + + encode( + message: RestrictionMeta, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.valueType !== 0) { + writer.uint32(16).int32(message.valueType); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RestrictionMeta { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRestrictionMeta } as RestrictionMeta; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.valueType = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RestrictionMeta { + const message = { ...baseRestrictionMeta } as RestrictionMeta; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.valueType = + object.valueType !== undefined && object.valueType !== null + ? restrictionMeta_RestrictionValueTypeFromJSON(object.valueType) + : 0; + return message; + }, + + toJSON(message: RestrictionMeta): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.valueType !== undefined && + (obj.valueType = restrictionMeta_RestrictionValueTypeToJSON( + message.valueType + )); + return obj; + }, + + fromPartial, I>>( + object: I + ): RestrictionMeta { + const message = { ...baseRestrictionMeta } as RestrictionMeta; + message.name = object.name ?? ""; + message.valueType = object.valueType ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(RestrictionMeta.$type, RestrictionMeta); + +const baseRestriction: object = { + $type: "yandex.cloud.datasphere.v2.Restriction", + name: "", + boolValue: false, + longValue: 0, + stringValue: "", +}; + +export const Restriction = { + $type: "yandex.cloud.datasphere.v2.Restriction" as const, + + encode( + message: Restriction, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + writer.uint32(18).fork(); + for (const v of message.boolValue) { + writer.bool(v); + } + writer.ldelim(); + writer.uint32(26).fork(); + for (const v of message.longValue) { + writer.int64(v); + } + writer.ldelim(); + for (const v of message.stringValue) { + writer.uint32(34).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Restriction { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRestriction } as Restriction; + message.boolValue = []; + message.longValue = []; + message.stringValue = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.boolValue.push(reader.bool()); + } + } else { + message.boolValue.push(reader.bool()); + } + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.longValue.push(longToNumber(reader.int64() as Long)); + } + } else { + message.longValue.push(longToNumber(reader.int64() as Long)); + } + break; + case 4: + message.stringValue.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Restriction { + const message = { ...baseRestriction } as Restriction; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.boolValue = (object.boolValue ?? []).map((e: any) => Boolean(e)); + message.longValue = (object.longValue ?? []).map((e: any) => Number(e)); + message.stringValue = (object.stringValue ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: Restriction): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.boolValue) { + obj.boolValue = message.boolValue.map((e) => e); + } else { + obj.boolValue = []; + } + if (message.longValue) { + obj.longValue = message.longValue.map((e) => Math.round(e)); + } else { + obj.longValue = []; + } + if (message.stringValue) { + obj.stringValue = message.stringValue.map((e) => e); + } else { + obj.stringValue = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Restriction { + const message = { ...baseRestriction } as Restriction; + message.name = object.name ?? ""; + message.boolValue = object.boolValue?.map((e) => e) || []; + message.longValue = object.longValue?.map((e) => e) || []; + message.stringValue = object.stringValue?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(Restriction.$type, Restriction); + +const baseGetRestrictionsMetaResponse: object = { + $type: "yandex.cloud.datasphere.v2.GetRestrictionsMetaResponse", +}; + +export const GetRestrictionsMetaResponse = { + $type: "yandex.cloud.datasphere.v2.GetRestrictionsMetaResponse" as const, + + encode( + message: GetRestrictionsMetaResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.restrictionsMeta) { + RestrictionMeta.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetRestrictionsMetaResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetRestrictionsMetaResponse, + } as GetRestrictionsMetaResponse; + message.restrictionsMeta = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.restrictionsMeta.push( + RestrictionMeta.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetRestrictionsMetaResponse { + const message = { + ...baseGetRestrictionsMetaResponse, + } as GetRestrictionsMetaResponse; + message.restrictionsMeta = (object.restrictionsMeta ?? []).map((e: any) => + RestrictionMeta.fromJSON(e) + ); + return message; + }, + + toJSON(message: GetRestrictionsMetaResponse): unknown { + const obj: any = {}; + if (message.restrictionsMeta) { + obj.restrictionsMeta = message.restrictionsMeta.map((e) => + e ? RestrictionMeta.toJSON(e) : undefined + ); + } else { + obj.restrictionsMeta = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): GetRestrictionsMetaResponse { + const message = { + ...baseGetRestrictionsMetaResponse, + } as GetRestrictionsMetaResponse; + message.restrictionsMeta = + object.restrictionsMeta?.map((e) => RestrictionMeta.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + GetRestrictionsMetaResponse.$type, + GetRestrictionsMetaResponse +); + +const baseRestrictionsResponse: object = { + $type: "yandex.cloud.datasphere.v2.RestrictionsResponse", +}; + +export const RestrictionsResponse = { + $type: "yandex.cloud.datasphere.v2.RestrictionsResponse" as const, + + encode( + message: RestrictionsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.restrictions) { + Restriction.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RestrictionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRestrictionsResponse } as RestrictionsResponse; + message.restrictions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.restrictions.push( + Restriction.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RestrictionsResponse { + const message = { ...baseRestrictionsResponse } as RestrictionsResponse; + message.restrictions = (object.restrictions ?? []).map((e: any) => + Restriction.fromJSON(e) + ); + return message; + }, + + toJSON(message: RestrictionsResponse): unknown { + const obj: any = {}; + if (message.restrictions) { + obj.restrictions = message.restrictions.map((e) => + e ? Restriction.toJSON(e) : undefined + ); + } else { + obj.restrictions = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): RestrictionsResponse { + const message = { ...baseRestrictionsResponse } as RestrictionsResponse; + message.restrictions = + object.restrictions?.map((e) => Restriction.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(RestrictionsResponse.$type, RestrictionsResponse); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/datasphere/v2/s3_service.ts b/src/generated/yandex/cloud/datasphere/v2/s3_service.ts new file mode 100644 index 00000000..ac086895 --- /dev/null +++ b/src/generated/yandex/cloud/datasphere/v2/s3_service.ts @@ -0,0 +1,295 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.datasphere.v2"; + +export interface ActivateS3Request { + $type: "yandex.cloud.datasphere.v2.ActivateS3Request"; + s3Id: string; + projectId: string; +} + +export interface DeactivateS3Request { + $type: "yandex.cloud.datasphere.v2.DeactivateS3Request"; + s3Id: string; + projectId: string; +} + +const baseActivateS3Request: object = { + $type: "yandex.cloud.datasphere.v2.ActivateS3Request", + s3Id: "", + projectId: "", +}; + +export const ActivateS3Request = { + $type: "yandex.cloud.datasphere.v2.ActivateS3Request" as const, + + encode( + message: ActivateS3Request, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.s3Id !== "") { + writer.uint32(10).string(message.s3Id); + } + if (message.projectId !== "") { + writer.uint32(18).string(message.projectId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ActivateS3Request { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseActivateS3Request } as ActivateS3Request; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.s3Id = reader.string(); + break; + case 2: + message.projectId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ActivateS3Request { + const message = { ...baseActivateS3Request } as ActivateS3Request; + message.s3Id = + object.s3Id !== undefined && object.s3Id !== null + ? String(object.s3Id) + : ""; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + return message; + }, + + toJSON(message: ActivateS3Request): unknown { + const obj: any = {}; + message.s3Id !== undefined && (obj.s3Id = message.s3Id); + message.projectId !== undefined && (obj.projectId = message.projectId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ActivateS3Request { + const message = { ...baseActivateS3Request } as ActivateS3Request; + message.s3Id = object.s3Id ?? ""; + message.projectId = object.projectId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ActivateS3Request.$type, ActivateS3Request); + +const baseDeactivateS3Request: object = { + $type: "yandex.cloud.datasphere.v2.DeactivateS3Request", + s3Id: "", + projectId: "", +}; + +export const DeactivateS3Request = { + $type: "yandex.cloud.datasphere.v2.DeactivateS3Request" as const, + + encode( + message: DeactivateS3Request, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.s3Id !== "") { + writer.uint32(10).string(message.s3Id); + } + if (message.projectId !== "") { + writer.uint32(18).string(message.projectId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeactivateS3Request { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeactivateS3Request } as DeactivateS3Request; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.s3Id = reader.string(); + break; + case 2: + message.projectId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeactivateS3Request { + const message = { ...baseDeactivateS3Request } as DeactivateS3Request; + message.s3Id = + object.s3Id !== undefined && object.s3Id !== null + ? String(object.s3Id) + : ""; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + return message; + }, + + toJSON(message: DeactivateS3Request): unknown { + const obj: any = {}; + message.s3Id !== undefined && (obj.s3Id = message.s3Id); + message.projectId !== undefined && (obj.projectId = message.projectId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeactivateS3Request { + const message = { ...baseDeactivateS3Request } as DeactivateS3Request; + message.s3Id = object.s3Id ?? ""; + message.projectId = object.projectId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeactivateS3Request.$type, DeactivateS3Request); + +/** A set of methods for managing S3 configurations. */ +export const S3ServiceService = { + /** Activates shared s3 for project */ + activate: { + path: "/yandex.cloud.datasphere.v2.S3Service/Activate", + requestStream: false, + responseStream: false, + requestSerialize: (value: ActivateS3Request) => + Buffer.from(ActivateS3Request.encode(value).finish()), + requestDeserialize: (value: Buffer) => ActivateS3Request.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deactivates shared s3 for project */ + deactivate: { + path: "/yandex.cloud.datasphere.v2.S3Service/Deactivate", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeactivateS3Request) => + Buffer.from(DeactivateS3Request.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeactivateS3Request.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface S3ServiceServer extends UntypedServiceImplementation { + /** Activates shared s3 for project */ + activate: handleUnaryCall; + /** Deactivates shared s3 for project */ + deactivate: handleUnaryCall; +} + +export interface S3ServiceClient extends Client { + /** Activates shared s3 for project */ + activate( + request: ActivateS3Request, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + activate( + request: ActivateS3Request, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + activate( + request: ActivateS3Request, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deactivates shared s3 for project */ + deactivate( + request: DeactivateS3Request, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deactivate( + request: DeactivateS3Request, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deactivate( + request: DeactivateS3Request, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const S3ServiceClient = makeGenericClientConstructor( + S3ServiceService, + "yandex.cloud.datasphere.v2.S3Service" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): S3ServiceClient; + service: typeof S3ServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/datatransfer/index.ts b/src/generated/yandex/cloud/datatransfer/index.ts index 21d097cf..79793a70 100644 --- a/src/generated/yandex/cloud/datatransfer/index.ts +++ b/src/generated/yandex/cloud/datatransfer/index.ts @@ -1,13 +1,15 @@ -export * as endpoint from './v1/endpoint' -export * as endpoint_service from './v1/endpoint_service' -export * as transfer from './v1/transfer' -export * as transfer_service from './v1/transfer_service' -export * as clickhouse from './v1/endpoint/clickhouse' -export * as common from './v1/endpoint/common' -export * as kafka from './v1/endpoint/kafka' -export * as mongo from './v1/endpoint/mongo' -export * as mysql from './v1/endpoint/mysql' -export * as parsers from './v1/endpoint/parsers' -export * as postgres from './v1/endpoint/postgres' -export * as serializers from './v1/endpoint/serializers' -export * as ydb from './v1/endpoint/ydb' \ No newline at end of file +export * as v1_endpoint from './v1/endpoint' +export * as v1_endpoint_service from './v1/endpoint_service' +export * as v1_transfer from './v1/transfer' +export * as v1_transfer_service from './v1/transfer_service' +export * as v1_endpoint_clickhouse from './v1/endpoint/clickhouse' +export * as v1_endpoint_common from './v1/endpoint/common' +export * as v1_endpoint_kafka from './v1/endpoint/kafka' +export * as v1_endpoint_metrika from './v1/endpoint/metrika' +export * as v1_endpoint_mongo from './v1/endpoint/mongo' +export * as v1_endpoint_mysql from './v1/endpoint/mysql' +export * as v1_endpoint_parsers from './v1/endpoint/parsers' +export * as v1_endpoint_postgres from './v1/endpoint/postgres' +export * as v1_endpoint_serializers from './v1/endpoint/serializers' +export * as v1_endpoint_ydb from './v1/endpoint/ydb' +export * as v1_endpoint_yds from './v1/endpoint/yds' \ No newline at end of file diff --git a/src/generated/yandex/cloud/datatransfer/v1/endpoint.ts b/src/generated/yandex/cloud/datatransfer/v1/endpoint.ts index 080240a9..d6e17ff3 100644 --- a/src/generated/yandex/cloud/datatransfer/v1/endpoint.ts +++ b/src/generated/yandex/cloud/datatransfer/v1/endpoint.ts @@ -14,6 +14,10 @@ import { YdbSource, YdbTarget, } from "../../../../yandex/cloud/datatransfer/v1/endpoint/ydb"; +import { + YDSSource, + YDSTarget, +} from "../../../../yandex/cloud/datatransfer/v1/endpoint/yds"; import { KafkaSource, KafkaTarget, @@ -26,6 +30,7 @@ import { ClickhouseSource, ClickhouseTarget, } from "../../../../yandex/cloud/datatransfer/v1/endpoint/clickhouse"; +import { MetrikaSource } from "../../../../yandex/cloud/datatransfer/v1/endpoint/metrika"; export const protobufPackage = "yandex.cloud.datatransfer.v1"; @@ -50,6 +55,7 @@ export interface EndpointSettings { mysqlSource?: MysqlSource | undefined; postgresSource?: PostgresSource | undefined; ydbSource?: YdbSource | undefined; + ydsSource?: YDSSource | undefined; kafkaSource?: KafkaSource | undefined; mongoSource?: MongoSource | undefined; clickhouseSource?: ClickhouseSource | undefined; @@ -59,6 +65,8 @@ export interface EndpointSettings { ydbTarget?: YdbTarget | undefined; kafkaTarget?: KafkaTarget | undefined; mongoTarget?: MongoTarget | undefined; + metrikaSource?: MetrikaSource | undefined; + ydsTarget?: YDSTarget | undefined; } const baseEndpoint: object = { @@ -319,6 +327,9 @@ export const EndpointSettings = { if (message.ydbSource !== undefined) { YdbSource.encode(message.ydbSource, writer.uint32(26).fork()).ldelim(); } + if (message.ydsSource !== undefined) { + YDSSource.encode(message.ydsSource, writer.uint32(58).fork()).ldelim(); + } if (message.kafkaSource !== undefined) { KafkaSource.encode( message.kafkaSource, @@ -370,6 +381,15 @@ export const EndpointSettings = { writer.uint32(890).fork() ).ldelim(); } + if (message.metrikaSource !== undefined) { + MetrikaSource.encode( + message.metrikaSource, + writer.uint32(1170).fork() + ).ldelim(); + } + if (message.ydsTarget !== undefined) { + YDSTarget.encode(message.ydsTarget, writer.uint32(1202).fork()).ldelim(); + } return writer; }, @@ -392,6 +412,9 @@ export const EndpointSettings = { case 3: message.ydbSource = YdbSource.decode(reader, reader.uint32()); break; + case 7: + message.ydsSource = YDSSource.decode(reader, reader.uint32()); + break; case 8: message.kafkaSource = KafkaSource.decode(reader, reader.uint32()); break; @@ -428,6 +451,12 @@ export const EndpointSettings = { case 111: message.mongoTarget = MongoTarget.decode(reader, reader.uint32()); break; + case 146: + message.metrikaSource = MetrikaSource.decode(reader, reader.uint32()); + break; + case 150: + message.ydsTarget = YDSTarget.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -450,6 +479,10 @@ export const EndpointSettings = { object.ydbSource !== undefined && object.ydbSource !== null ? YdbSource.fromJSON(object.ydbSource) : undefined; + message.ydsSource = + object.ydsSource !== undefined && object.ydsSource !== null + ? YDSSource.fromJSON(object.ydsSource) + : undefined; message.kafkaSource = object.kafkaSource !== undefined && object.kafkaSource !== null ? KafkaSource.fromJSON(object.kafkaSource) @@ -486,6 +519,14 @@ export const EndpointSettings = { object.mongoTarget !== undefined && object.mongoTarget !== null ? MongoTarget.fromJSON(object.mongoTarget) : undefined; + message.metrikaSource = + object.metrikaSource !== undefined && object.metrikaSource !== null + ? MetrikaSource.fromJSON(object.metrikaSource) + : undefined; + message.ydsTarget = + object.ydsTarget !== undefined && object.ydsTarget !== null + ? YDSTarget.fromJSON(object.ydsTarget) + : undefined; return message; }, @@ -503,6 +544,10 @@ export const EndpointSettings = { (obj.ydbSource = message.ydbSource ? YdbSource.toJSON(message.ydbSource) : undefined); + message.ydsSource !== undefined && + (obj.ydsSource = message.ydsSource + ? YDSSource.toJSON(message.ydsSource) + : undefined); message.kafkaSource !== undefined && (obj.kafkaSource = message.kafkaSource ? KafkaSource.toJSON(message.kafkaSource) @@ -539,6 +584,14 @@ export const EndpointSettings = { (obj.mongoTarget = message.mongoTarget ? MongoTarget.toJSON(message.mongoTarget) : undefined); + message.metrikaSource !== undefined && + (obj.metrikaSource = message.metrikaSource + ? MetrikaSource.toJSON(message.metrikaSource) + : undefined); + message.ydsTarget !== undefined && + (obj.ydsTarget = message.ydsTarget + ? YDSTarget.toJSON(message.ydsTarget) + : undefined); return obj; }, @@ -558,6 +611,10 @@ export const EndpointSettings = { object.ydbSource !== undefined && object.ydbSource !== null ? YdbSource.fromPartial(object.ydbSource) : undefined; + message.ydsSource = + object.ydsSource !== undefined && object.ydsSource !== null + ? YDSSource.fromPartial(object.ydsSource) + : undefined; message.kafkaSource = object.kafkaSource !== undefined && object.kafkaSource !== null ? KafkaSource.fromPartial(object.kafkaSource) @@ -594,6 +651,14 @@ export const EndpointSettings = { object.mongoTarget !== undefined && object.mongoTarget !== null ? MongoTarget.fromPartial(object.mongoTarget) : undefined; + message.metrikaSource = + object.metrikaSource !== undefined && object.metrikaSource !== null + ? MetrikaSource.fromPartial(object.metrikaSource) + : undefined; + message.ydsTarget = + object.ydsTarget !== undefined && object.ydsTarget !== null + ? YDSTarget.fromPartial(object.ydsTarget) + : undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/datatransfer/v1/endpoint/clickhouse.ts b/src/generated/yandex/cloud/datatransfer/v1/endpoint/clickhouse.ts index 0701b50c..7ce103be 100644 --- a/src/generated/yandex/cloud/datatransfer/v1/endpoint/clickhouse.ts +++ b/src/generated/yandex/cloud/datatransfer/v1/endpoint/clickhouse.ts @@ -76,12 +76,12 @@ export interface OnPremiseClickhouse { export interface ClickhouseConnectionOptions { $type: "yandex.cloud.datatransfer.v1.endpoint.ClickhouseConnectionOptions"; - mdbClusterId: string | undefined; onPremise?: OnPremiseClickhouse | undefined; - /** Database */ - database: string; + mdbClusterId: string | undefined; user: string; password?: Secret; + /** Database */ + database: string; } export interface ClickhouseConnection { @@ -94,6 +94,7 @@ export interface ClickhouseSharding { columnValueHash?: ClickhouseSharding_ColumnValueHash | undefined; customMapping?: ClickhouseSharding_ColumnValueMapping | undefined; transferId?: Empty | undefined; + roundRobin?: Empty | undefined; } export interface ClickhouseSharding_ColumnValueHash { @@ -116,8 +117,6 @@ export interface ClickhouseSharding_ColumnValueMapping_ValueToShard { export interface ClickhouseSource { $type: "yandex.cloud.datatransfer.v1.endpoint.ClickhouseSource"; connection?: ClickhouseConnection; - subnetId: string; - securityGroups: string[]; /** * While list of tables for replication. If none or empty list is presented - will * replicate all tables. Can contain * patterns. @@ -128,18 +127,29 @@ export interface ClickhouseSource { * will replicate all tables. Can contain * patterns. */ excludeTables: string[]; + subnetId: string; + securityGroups: string[]; + /** + * Name of the ClickHouse cluster. For Managed ClickHouse that is name of + * ShardGroup. + */ + clickhouseClusterName: string; } export interface ClickhouseTarget { $type: "yandex.cloud.datatransfer.v1.endpoint.ClickhouseTarget"; connection?: ClickhouseConnection; subnetId: string; - securityGroups: string[]; - clickhouseClusterName: string; /** Alternative table names in target */ altNames: AltName[]; - sharding?: ClickhouseSharding; cleanupPolicy: ClickhouseCleanupPolicy; + sharding?: ClickhouseSharding; + /** + * Name of the ClickHouse cluster. For Managed ClickHouse that is name of + * ShardGroup. + */ + clickhouseClusterName: string; + securityGroups: string[]; } const baseClickhouseShard: object = { @@ -335,8 +345,8 @@ messageTypeRegistry.set(OnPremiseClickhouse.$type, OnPremiseClickhouse); const baseClickhouseConnectionOptions: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.ClickhouseConnectionOptions", - database: "", user: "", + database: "", }; export const ClickhouseConnectionOptions = { @@ -347,17 +357,14 @@ export const ClickhouseConnectionOptions = { message: ClickhouseConnectionOptions, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - if (message.mdbClusterId !== undefined) { - writer.uint32(42).string(message.mdbClusterId); - } if (message.onPremise !== undefined) { OnPremiseClickhouse.encode( message.onPremise, writer.uint32(18).fork() ).ldelim(); } - if (message.database !== "") { - writer.uint32(66).string(message.database); + if (message.mdbClusterId !== undefined) { + writer.uint32(42).string(message.mdbClusterId); } if (message.user !== "") { writer.uint32(50).string(message.user); @@ -365,6 +372,9 @@ export const ClickhouseConnectionOptions = { if (message.password !== undefined) { Secret.encode(message.password, writer.uint32(58).fork()).ldelim(); } + if (message.database !== "") { + writer.uint32(66).string(message.database); + } return writer; }, @@ -380,17 +390,14 @@ export const ClickhouseConnectionOptions = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 5: - message.mdbClusterId = reader.string(); - break; case 2: message.onPremise = OnPremiseClickhouse.decode( reader, reader.uint32() ); break; - case 8: - message.database = reader.string(); + case 5: + message.mdbClusterId = reader.string(); break; case 6: message.user = reader.string(); @@ -398,6 +405,9 @@ export const ClickhouseConnectionOptions = { case 7: message.password = Secret.decode(reader, reader.uint32()); break; + case 8: + message.database = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -410,18 +420,14 @@ export const ClickhouseConnectionOptions = { const message = { ...baseClickhouseConnectionOptions, } as ClickhouseConnectionOptions; - message.mdbClusterId = - object.mdbClusterId !== undefined && object.mdbClusterId !== null - ? String(object.mdbClusterId) - : undefined; message.onPremise = object.onPremise !== undefined && object.onPremise !== null ? OnPremiseClickhouse.fromJSON(object.onPremise) : undefined; - message.database = - object.database !== undefined && object.database !== null - ? String(object.database) - : ""; + message.mdbClusterId = + object.mdbClusterId !== undefined && object.mdbClusterId !== null + ? String(object.mdbClusterId) + : undefined; message.user = object.user !== undefined && object.user !== null ? String(object.user) @@ -430,23 +436,27 @@ export const ClickhouseConnectionOptions = { object.password !== undefined && object.password !== null ? Secret.fromJSON(object.password) : undefined; + message.database = + object.database !== undefined && object.database !== null + ? String(object.database) + : ""; return message; }, toJSON(message: ClickhouseConnectionOptions): unknown { const obj: any = {}; - message.mdbClusterId !== undefined && - (obj.mdbClusterId = message.mdbClusterId); message.onPremise !== undefined && (obj.onPremise = message.onPremise ? OnPremiseClickhouse.toJSON(message.onPremise) : undefined); - message.database !== undefined && (obj.database = message.database); + message.mdbClusterId !== undefined && + (obj.mdbClusterId = message.mdbClusterId); message.user !== undefined && (obj.user = message.user); message.password !== undefined && (obj.password = message.password ? Secret.toJSON(message.password) : undefined); + message.database !== undefined && (obj.database = message.database); return obj; }, @@ -456,17 +466,17 @@ export const ClickhouseConnectionOptions = { const message = { ...baseClickhouseConnectionOptions, } as ClickhouseConnectionOptions; - message.mdbClusterId = object.mdbClusterId ?? undefined; message.onPremise = object.onPremise !== undefined && object.onPremise !== null ? OnPremiseClickhouse.fromPartial(object.onPremise) : undefined; - message.database = object.database ?? ""; + message.mdbClusterId = object.mdbClusterId ?? undefined; message.user = object.user ?? ""; message.password = object.password !== undefined && object.password !== null ? Secret.fromPartial(object.password) : undefined; + message.database = object.database ?? ""; return message; }, }; @@ -580,6 +590,9 @@ export const ClickhouseSharding = { if (message.transferId !== undefined) { Empty.encode(message.transferId, writer.uint32(26).fork()).ldelim(); } + if (message.roundRobin !== undefined) { + Empty.encode(message.roundRobin, writer.uint32(34).fork()).ldelim(); + } return writer; }, @@ -605,6 +618,9 @@ export const ClickhouseSharding = { case 3: message.transferId = Empty.decode(reader, reader.uint32()); break; + case 4: + message.roundRobin = Empty.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -627,6 +643,10 @@ export const ClickhouseSharding = { object.transferId !== undefined && object.transferId !== null ? Empty.fromJSON(object.transferId) : undefined; + message.roundRobin = + object.roundRobin !== undefined && object.roundRobin !== null + ? Empty.fromJSON(object.roundRobin) + : undefined; return message; }, @@ -644,6 +664,10 @@ export const ClickhouseSharding = { (obj.transferId = message.transferId ? Empty.toJSON(message.transferId) : undefined); + message.roundRobin !== undefined && + (obj.roundRobin = message.roundRobin + ? Empty.toJSON(message.roundRobin) + : undefined); return obj; }, @@ -665,6 +689,10 @@ export const ClickhouseSharding = { object.transferId !== undefined && object.transferId !== null ? Empty.fromPartial(object.transferId) : undefined; + message.roundRobin = + object.roundRobin !== undefined && object.roundRobin !== null + ? Empty.fromPartial(object.roundRobin) + : undefined; return message; }, }; @@ -956,10 +984,11 @@ messageTypeRegistry.set( const baseClickhouseSource: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.ClickhouseSource", - subnetId: "", - securityGroups: "", includeTables: "", excludeTables: "", + subnetId: "", + securityGroups: "", + clickhouseClusterName: "", }; export const ClickhouseSource = { @@ -975,17 +1004,20 @@ export const ClickhouseSource = { writer.uint32(10).fork() ).ldelim(); } + for (const v of message.includeTables) { + writer.uint32(58).string(v!); + } + for (const v of message.excludeTables) { + writer.uint32(66).string(v!); + } if (message.subnetId !== "") { writer.uint32(74).string(message.subnetId); } for (const v of message.securityGroups) { writer.uint32(82).string(v!); } - for (const v of message.includeTables) { - writer.uint32(58).string(v!); - } - for (const v of message.excludeTables) { - writer.uint32(66).string(v!); + if (message.clickhouseClusterName !== "") { + writer.uint32(90).string(message.clickhouseClusterName); } return writer; }, @@ -994,9 +1026,9 @@ export const ClickhouseSource = { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseClickhouseSource } as ClickhouseSource; - message.securityGroups = []; message.includeTables = []; message.excludeTables = []; + message.securityGroups = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1006,17 +1038,20 @@ export const ClickhouseSource = { reader.uint32() ); break; + case 7: + message.includeTables.push(reader.string()); + break; + case 8: + message.excludeTables.push(reader.string()); + break; case 9: message.subnetId = reader.string(); break; case 10: message.securityGroups.push(reader.string()); break; - case 7: - message.includeTables.push(reader.string()); - break; - case 8: - message.excludeTables.push(reader.string()); + case 11: + message.clickhouseClusterName = reader.string(); break; default: reader.skipType(tag & 7); @@ -1032,6 +1067,12 @@ export const ClickhouseSource = { object.connection !== undefined && object.connection !== null ? ClickhouseConnection.fromJSON(object.connection) : undefined; + message.includeTables = (object.includeTables ?? []).map((e: any) => + String(e) + ); + message.excludeTables = (object.excludeTables ?? []).map((e: any) => + String(e) + ); message.subnetId = object.subnetId !== undefined && object.subnetId !== null ? String(object.subnetId) @@ -1039,12 +1080,11 @@ export const ClickhouseSource = { message.securityGroups = (object.securityGroups ?? []).map((e: any) => String(e) ); - message.includeTables = (object.includeTables ?? []).map((e: any) => - String(e) - ); - message.excludeTables = (object.excludeTables ?? []).map((e: any) => - String(e) - ); + message.clickhouseClusterName = + object.clickhouseClusterName !== undefined && + object.clickhouseClusterName !== null + ? String(object.clickhouseClusterName) + : ""; return message; }, @@ -1054,12 +1094,6 @@ export const ClickhouseSource = { (obj.connection = message.connection ? ClickhouseConnection.toJSON(message.connection) : undefined); - message.subnetId !== undefined && (obj.subnetId = message.subnetId); - if (message.securityGroups) { - obj.securityGroups = message.securityGroups.map((e) => e); - } else { - obj.securityGroups = []; - } if (message.includeTables) { obj.includeTables = message.includeTables.map((e) => e); } else { @@ -1070,6 +1104,14 @@ export const ClickhouseSource = { } else { obj.excludeTables = []; } + message.subnetId !== undefined && (obj.subnetId = message.subnetId); + if (message.securityGroups) { + obj.securityGroups = message.securityGroups.map((e) => e); + } else { + obj.securityGroups = []; + } + message.clickhouseClusterName !== undefined && + (obj.clickhouseClusterName = message.clickhouseClusterName); return obj; }, @@ -1081,10 +1123,11 @@ export const ClickhouseSource = { object.connection !== undefined && object.connection !== null ? ClickhouseConnection.fromPartial(object.connection) : undefined; - message.subnetId = object.subnetId ?? ""; - message.securityGroups = object.securityGroups?.map((e) => e) || []; message.includeTables = object.includeTables?.map((e) => e) || []; message.excludeTables = object.excludeTables?.map((e) => e) || []; + message.subnetId = object.subnetId ?? ""; + message.securityGroups = object.securityGroups?.map((e) => e) || []; + message.clickhouseClusterName = object.clickhouseClusterName ?? ""; return message; }, }; @@ -1094,9 +1137,9 @@ messageTypeRegistry.set(ClickhouseSource.$type, ClickhouseSource); const baseClickhouseTarget: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.ClickhouseTarget", subnetId: "", - securityGroups: "", - clickhouseClusterName: "", cleanupPolicy: 0, + clickhouseClusterName: "", + securityGroups: "", }; export const ClickhouseTarget = { @@ -1115,23 +1158,23 @@ export const ClickhouseTarget = { if (message.subnetId !== "") { writer.uint32(98).string(message.subnetId); } - for (const v of message.securityGroups) { - writer.uint32(410).string(v!); - } - if (message.clickhouseClusterName !== "") { - writer.uint32(402).string(message.clickhouseClusterName); - } for (const v of message.altNames) { AltName.encode(v!, writer.uint32(138).fork()).ldelim(); } + if (message.cleanupPolicy !== 0) { + writer.uint32(168).int32(message.cleanupPolicy); + } if (message.sharding !== undefined) { ClickhouseSharding.encode( message.sharding, writer.uint32(178).fork() ).ldelim(); } - if (message.cleanupPolicy !== 0) { - writer.uint32(168).int32(message.cleanupPolicy); + if (message.clickhouseClusterName !== "") { + writer.uint32(402).string(message.clickhouseClusterName); + } + for (const v of message.securityGroups) { + writer.uint32(410).string(v!); } return writer; }, @@ -1140,8 +1183,8 @@ export const ClickhouseTarget = { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseClickhouseTarget } as ClickhouseTarget; - message.securityGroups = []; message.altNames = []; + message.securityGroups = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1154,20 +1197,20 @@ export const ClickhouseTarget = { case 12: message.subnetId = reader.string(); break; - case 51: - message.securityGroups.push(reader.string()); - break; - case 50: - message.clickhouseClusterName = reader.string(); - break; case 17: message.altNames.push(AltName.decode(reader, reader.uint32())); break; + case 21: + message.cleanupPolicy = reader.int32() as any; + break; case 22: message.sharding = ClickhouseSharding.decode(reader, reader.uint32()); break; - case 21: - message.cleanupPolicy = reader.int32() as any; + case 50: + message.clickhouseClusterName = reader.string(); + break; + case 51: + message.securityGroups.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1187,25 +1230,25 @@ export const ClickhouseTarget = { object.subnetId !== undefined && object.subnetId !== null ? String(object.subnetId) : ""; - message.securityGroups = (object.securityGroups ?? []).map((e: any) => - String(e) - ); - message.clickhouseClusterName = - object.clickhouseClusterName !== undefined && - object.clickhouseClusterName !== null - ? String(object.clickhouseClusterName) - : ""; message.altNames = (object.altNames ?? []).map((e: any) => AltName.fromJSON(e) ); - message.sharding = - object.sharding !== undefined && object.sharding !== null - ? ClickhouseSharding.fromJSON(object.sharding) - : undefined; message.cleanupPolicy = object.cleanupPolicy !== undefined && object.cleanupPolicy !== null ? clickhouseCleanupPolicyFromJSON(object.cleanupPolicy) : 0; + message.sharding = + object.sharding !== undefined && object.sharding !== null + ? ClickhouseSharding.fromJSON(object.sharding) + : undefined; + message.clickhouseClusterName = + object.clickhouseClusterName !== undefined && + object.clickhouseClusterName !== null + ? String(object.clickhouseClusterName) + : ""; + message.securityGroups = (object.securityGroups ?? []).map((e: any) => + String(e) + ); return message; }, @@ -1216,13 +1259,6 @@ export const ClickhouseTarget = { ? ClickhouseConnection.toJSON(message.connection) : undefined); message.subnetId !== undefined && (obj.subnetId = message.subnetId); - if (message.securityGroups) { - obj.securityGroups = message.securityGroups.map((e) => e); - } else { - obj.securityGroups = []; - } - message.clickhouseClusterName !== undefined && - (obj.clickhouseClusterName = message.clickhouseClusterName); if (message.altNames) { obj.altNames = message.altNames.map((e) => e ? AltName.toJSON(e) : undefined @@ -1230,14 +1266,21 @@ export const ClickhouseTarget = { } else { obj.altNames = []; } - message.sharding !== undefined && - (obj.sharding = message.sharding - ? ClickhouseSharding.toJSON(message.sharding) - : undefined); message.cleanupPolicy !== undefined && (obj.cleanupPolicy = clickhouseCleanupPolicyToJSON( message.cleanupPolicy )); + message.sharding !== undefined && + (obj.sharding = message.sharding + ? ClickhouseSharding.toJSON(message.sharding) + : undefined); + message.clickhouseClusterName !== undefined && + (obj.clickhouseClusterName = message.clickhouseClusterName); + if (message.securityGroups) { + obj.securityGroups = message.securityGroups.map((e) => e); + } else { + obj.securityGroups = []; + } return obj; }, @@ -1250,15 +1293,15 @@ export const ClickhouseTarget = { ? ClickhouseConnection.fromPartial(object.connection) : undefined; message.subnetId = object.subnetId ?? ""; - message.securityGroups = object.securityGroups?.map((e) => e) || []; - message.clickhouseClusterName = object.clickhouseClusterName ?? ""; message.altNames = object.altNames?.map((e) => AltName.fromPartial(e)) || []; + message.cleanupPolicy = object.cleanupPolicy ?? 0; message.sharding = object.sharding !== undefined && object.sharding !== null ? ClickhouseSharding.fromPartial(object.sharding) : undefined; - message.cleanupPolicy = object.cleanupPolicy ?? 0; + message.clickhouseClusterName = object.clickhouseClusterName ?? ""; + message.securityGroups = object.securityGroups?.map((e) => e) || []; return message; }, }; diff --git a/src/generated/yandex/cloud/datatransfer/v1/endpoint/common.ts b/src/generated/yandex/cloud/datatransfer/v1/endpoint/common.ts index 079cdcfb..d8f8112a 100644 --- a/src/generated/yandex/cloud/datatransfer/v1/endpoint/common.ts +++ b/src/generated/yandex/cloud/datatransfer/v1/endpoint/common.ts @@ -102,7 +102,6 @@ export function cleanupPolicyToJSON(object: CleanupPolicy): string { export enum ColumnType { COLUMN_TYPE_UNSPECIFIED = 0, - INT64 = 14, INT32 = 1, INT16 = 2, INT8 = 3, @@ -116,6 +115,7 @@ export enum ColumnType { UTF8 = 11, ANY = 12, DATETIME = 13, + INT64 = 14, UNRECOGNIZED = -1, } @@ -124,9 +124,6 @@ export function columnTypeFromJSON(object: any): ColumnType { case 0: case "COLUMN_TYPE_UNSPECIFIED": return ColumnType.COLUMN_TYPE_UNSPECIFIED; - case 14: - case "INT64": - return ColumnType.INT64; case 1: case "INT32": return ColumnType.INT32; @@ -166,6 +163,9 @@ export function columnTypeFromJSON(object: any): ColumnType { case 13: case "DATETIME": return ColumnType.DATETIME; + case 14: + case "INT64": + return ColumnType.INT64; case -1: case "UNRECOGNIZED": default: @@ -177,8 +177,6 @@ export function columnTypeToJSON(object: ColumnType): string { switch (object) { case ColumnType.COLUMN_TYPE_UNSPECIFIED: return "COLUMN_TYPE_UNSPECIFIED"; - case ColumnType.INT64: - return "INT64"; case ColumnType.INT32: return "INT32"; case ColumnType.INT16: @@ -205,6 +203,8 @@ export function columnTypeToJSON(object: ColumnType): string { return "ANY"; case ColumnType.DATETIME: return "DATETIME"; + case ColumnType.INT64: + return "INT64"; default: return "UNKNOWN"; } @@ -260,8 +260,6 @@ export interface DataTransformationOptions { $type: "yandex.cloud.datatransfer.v1.endpoint.DataTransformationOptions"; /** Cloud function */ cloudFunction: string; - /** Service account */ - serviceAccountId: string; /** Number of retries */ numberOfRetries: number; /** Buffer size for function */ @@ -270,6 +268,8 @@ export interface DataTransformationOptions { bufferFlushInterval: string; /** Invocation timeout */ invocationTimeout: string; + /** Service account */ + serviceAccountId: string; } export interface FieldList { @@ -280,8 +280,8 @@ export interface FieldList { export interface DataSchema { $type: "yandex.cloud.datatransfer.v1.endpoint.DataSchema"; - fields?: FieldList | undefined; jsonFields: string | undefined; + fields?: FieldList | undefined; } /** No authentication */ @@ -746,11 +746,11 @@ messageTypeRegistry.set(ColumnValue.$type, ColumnValue); const baseDataTransformationOptions: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.DataTransformationOptions", cloudFunction: "", - serviceAccountId: "", numberOfRetries: 0, bufferSize: "", bufferFlushInterval: "", invocationTimeout: "", + serviceAccountId: "", }; export const DataTransformationOptions = { @@ -764,9 +764,6 @@ export const DataTransformationOptions = { if (message.cloudFunction !== "") { writer.uint32(10).string(message.cloudFunction); } - if (message.serviceAccountId !== "") { - writer.uint32(66).string(message.serviceAccountId); - } if (message.numberOfRetries !== 0) { writer.uint32(16).int64(message.numberOfRetries); } @@ -779,6 +776,9 @@ export const DataTransformationOptions = { if (message.invocationTimeout !== "") { writer.uint32(42).string(message.invocationTimeout); } + if (message.serviceAccountId !== "") { + writer.uint32(66).string(message.serviceAccountId); + } return writer; }, @@ -797,9 +797,6 @@ export const DataTransformationOptions = { case 1: message.cloudFunction = reader.string(); break; - case 8: - message.serviceAccountId = reader.string(); - break; case 2: message.numberOfRetries = longToNumber(reader.int64() as Long); break; @@ -812,6 +809,9 @@ export const DataTransformationOptions = { case 5: message.invocationTimeout = reader.string(); break; + case 8: + message.serviceAccountId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -828,10 +828,6 @@ export const DataTransformationOptions = { object.cloudFunction !== undefined && object.cloudFunction !== null ? String(object.cloudFunction) : ""; - message.serviceAccountId = - object.serviceAccountId !== undefined && object.serviceAccountId !== null - ? String(object.serviceAccountId) - : ""; message.numberOfRetries = object.numberOfRetries !== undefined && object.numberOfRetries !== null ? Number(object.numberOfRetries) @@ -850,6 +846,10 @@ export const DataTransformationOptions = { object.invocationTimeout !== null ? String(object.invocationTimeout) : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; return message; }, @@ -857,8 +857,6 @@ export const DataTransformationOptions = { const obj: any = {}; message.cloudFunction !== undefined && (obj.cloudFunction = message.cloudFunction); - message.serviceAccountId !== undefined && - (obj.serviceAccountId = message.serviceAccountId); message.numberOfRetries !== undefined && (obj.numberOfRetries = Math.round(message.numberOfRetries)); message.bufferSize !== undefined && (obj.bufferSize = message.bufferSize); @@ -866,6 +864,8 @@ export const DataTransformationOptions = { (obj.bufferFlushInterval = message.bufferFlushInterval); message.invocationTimeout !== undefined && (obj.invocationTimeout = message.invocationTimeout); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); return obj; }, @@ -876,11 +876,11 @@ export const DataTransformationOptions = { ...baseDataTransformationOptions, } as DataTransformationOptions; message.cloudFunction = object.cloudFunction ?? ""; - message.serviceAccountId = object.serviceAccountId ?? ""; message.numberOfRetries = object.numberOfRetries ?? 0; message.bufferSize = object.bufferSize ?? ""; message.bufferFlushInterval = object.bufferFlushInterval ?? ""; message.invocationTimeout = object.invocationTimeout ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; return message; }, }; @@ -968,12 +968,12 @@ export const DataSchema = { message: DataSchema, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - if (message.fields !== undefined) { - FieldList.encode(message.fields, writer.uint32(18).fork()).ldelim(); - } if (message.jsonFields !== undefined) { writer.uint32(10).string(message.jsonFields); } + if (message.fields !== undefined) { + FieldList.encode(message.fields, writer.uint32(18).fork()).ldelim(); + } return writer; }, @@ -984,12 +984,12 @@ export const DataSchema = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.fields = FieldList.decode(reader, reader.uint32()); - break; case 1: message.jsonFields = reader.string(); break; + case 2: + message.fields = FieldList.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1000,24 +1000,24 @@ export const DataSchema = { fromJSON(object: any): DataSchema { const message = { ...baseDataSchema } as DataSchema; - message.fields = - object.fields !== undefined && object.fields !== null - ? FieldList.fromJSON(object.fields) - : undefined; message.jsonFields = object.jsonFields !== undefined && object.jsonFields !== null ? String(object.jsonFields) : undefined; + message.fields = + object.fields !== undefined && object.fields !== null + ? FieldList.fromJSON(object.fields) + : undefined; return message; }, toJSON(message: DataSchema): unknown { const obj: any = {}; + message.jsonFields !== undefined && (obj.jsonFields = message.jsonFields); message.fields !== undefined && (obj.fields = message.fields ? FieldList.toJSON(message.fields) : undefined); - message.jsonFields !== undefined && (obj.jsonFields = message.jsonFields); return obj; }, @@ -1025,11 +1025,11 @@ export const DataSchema = { object: I ): DataSchema { const message = { ...baseDataSchema } as DataSchema; + message.jsonFields = object.jsonFields ?? undefined; message.fields = object.fields !== undefined && object.fields !== null ? FieldList.fromPartial(object.fields) : undefined; - message.jsonFields = object.jsonFields ?? undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/datatransfer/v1/endpoint/kafka.ts b/src/generated/yandex/cloud/datatransfer/v1/endpoint/kafka.ts index ae6f6c7f..ed3a931e 100644 --- a/src/generated/yandex/cloud/datatransfer/v1/endpoint/kafka.ts +++ b/src/generated/yandex/cloud/datatransfer/v1/endpoint/kafka.ts @@ -63,10 +63,10 @@ export interface OnPremiseKafka { $type: "yandex.cloud.datatransfer.v1.endpoint.OnPremiseKafka"; /** Kafka broker URLs */ brokerUrls: string[]; - /** TLS settings for broker connection. Disabled by default. */ - tlsMode?: TLSMode; /** Network interface for endpoint. If none will assume public ipv4 */ subnetId: string; + /** TLS settings for broker connection. Disabled by default. */ + tlsMode?: TLSMode; } export interface KafkaAuth { @@ -81,10 +81,10 @@ export interface KafkaSaslSecurity { $type: "yandex.cloud.datatransfer.v1.endpoint.KafkaSaslSecurity"; /** User name */ user: string; - /** Password for user */ - password?: Secret; /** SASL mechanism for authentication */ mechanism: KafkaMechanism; + /** Password for user */ + password?: Secret; } export interface KafkaSource { @@ -95,12 +95,19 @@ export interface KafkaSource { auth?: KafkaAuth; /** Security groups */ securityGroups: string[]; - /** Full source topic name */ + /** + * Full source topic name + * Deprecated in favor of topic names + * + * @deprecated + */ topicName: string; /** Data transformation rules */ transformer?: DataTransformationOptions; /** Data parsing rules */ parser?: Parser; + /** List of topic names to read */ + topicNames: string[]; } export interface KafkaTarget { @@ -243,12 +250,12 @@ export const OnPremiseKafka = { for (const v of message.brokerUrls) { writer.uint32(10).string(v!); } - if (message.tlsMode !== undefined) { - TLSMode.encode(message.tlsMode, writer.uint32(42).fork()).ldelim(); - } if (message.subnetId !== "") { writer.uint32(34).string(message.subnetId); } + if (message.tlsMode !== undefined) { + TLSMode.encode(message.tlsMode, writer.uint32(42).fork()).ldelim(); + } return writer; }, @@ -263,12 +270,12 @@ export const OnPremiseKafka = { case 1: message.brokerUrls.push(reader.string()); break; - case 5: - message.tlsMode = TLSMode.decode(reader, reader.uint32()); - break; case 4: message.subnetId = reader.string(); break; + case 5: + message.tlsMode = TLSMode.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -280,14 +287,14 @@ export const OnPremiseKafka = { fromJSON(object: any): OnPremiseKafka { const message = { ...baseOnPremiseKafka } as OnPremiseKafka; message.brokerUrls = (object.brokerUrls ?? []).map((e: any) => String(e)); - message.tlsMode = - object.tlsMode !== undefined && object.tlsMode !== null - ? TLSMode.fromJSON(object.tlsMode) - : undefined; message.subnetId = object.subnetId !== undefined && object.subnetId !== null ? String(object.subnetId) : ""; + message.tlsMode = + object.tlsMode !== undefined && object.tlsMode !== null + ? TLSMode.fromJSON(object.tlsMode) + : undefined; return message; }, @@ -298,11 +305,11 @@ export const OnPremiseKafka = { } else { obj.brokerUrls = []; } + message.subnetId !== undefined && (obj.subnetId = message.subnetId); message.tlsMode !== undefined && (obj.tlsMode = message.tlsMode ? TLSMode.toJSON(message.tlsMode) : undefined); - message.subnetId !== undefined && (obj.subnetId = message.subnetId); return obj; }, @@ -311,11 +318,11 @@ export const OnPremiseKafka = { ): OnPremiseKafka { const message = { ...baseOnPremiseKafka } as OnPremiseKafka; message.brokerUrls = object.brokerUrls?.map((e) => e) || []; + message.subnetId = object.subnetId ?? ""; message.tlsMode = object.tlsMode !== undefined && object.tlsMode !== null ? TLSMode.fromPartial(object.tlsMode) : undefined; - message.subnetId = object.subnetId ?? ""; return message; }, }; @@ -421,12 +428,12 @@ export const KafkaSaslSecurity = { if (message.user !== "") { writer.uint32(10).string(message.user); } - if (message.password !== undefined) { - Secret.encode(message.password, writer.uint32(34).fork()).ldelim(); - } if (message.mechanism !== 0) { writer.uint32(24).int32(message.mechanism); } + if (message.password !== undefined) { + Secret.encode(message.password, writer.uint32(34).fork()).ldelim(); + } return writer; }, @@ -440,12 +447,12 @@ export const KafkaSaslSecurity = { case 1: message.user = reader.string(); break; - case 4: - message.password = Secret.decode(reader, reader.uint32()); - break; case 3: message.mechanism = reader.int32() as any; break; + case 4: + message.password = Secret.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -460,26 +467,26 @@ export const KafkaSaslSecurity = { object.user !== undefined && object.user !== null ? String(object.user) : ""; - message.password = - object.password !== undefined && object.password !== null - ? Secret.fromJSON(object.password) - : undefined; message.mechanism = object.mechanism !== undefined && object.mechanism !== null ? kafkaMechanismFromJSON(object.mechanism) : 0; + message.password = + object.password !== undefined && object.password !== null + ? Secret.fromJSON(object.password) + : undefined; return message; }, toJSON(message: KafkaSaslSecurity): unknown { const obj: any = {}; message.user !== undefined && (obj.user = message.user); + message.mechanism !== undefined && + (obj.mechanism = kafkaMechanismToJSON(message.mechanism)); message.password !== undefined && (obj.password = message.password ? Secret.toJSON(message.password) : undefined); - message.mechanism !== undefined && - (obj.mechanism = kafkaMechanismToJSON(message.mechanism)); return obj; }, @@ -488,11 +495,11 @@ export const KafkaSaslSecurity = { ): KafkaSaslSecurity { const message = { ...baseKafkaSaslSecurity } as KafkaSaslSecurity; message.user = object.user ?? ""; + message.mechanism = object.mechanism ?? 0; message.password = object.password !== undefined && object.password !== null ? Secret.fromPartial(object.password) : undefined; - message.mechanism = object.mechanism ?? 0; return message; }, }; @@ -503,6 +510,7 @@ const baseKafkaSource: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.KafkaSource", securityGroups: "", topicName: "", + topicNames: "", }; export const KafkaSource = { @@ -536,6 +544,9 @@ export const KafkaSource = { if (message.parser !== undefined) { Parser.encode(message.parser, writer.uint32(58).fork()).ldelim(); } + for (const v of message.topicNames) { + writer.uint32(66).string(v!); + } return writer; }, @@ -544,6 +555,7 @@ export const KafkaSource = { let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseKafkaSource } as KafkaSource; message.securityGroups = []; + message.topicNames = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -571,6 +583,9 @@ export const KafkaSource = { case 7: message.parser = Parser.decode(reader, reader.uint32()); break; + case 8: + message.topicNames.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -604,6 +619,7 @@ export const KafkaSource = { object.parser !== undefined && object.parser !== null ? Parser.fromJSON(object.parser) : undefined; + message.topicNames = (object.topicNames ?? []).map((e: any) => String(e)); return message; }, @@ -627,6 +643,11 @@ export const KafkaSource = { : undefined); message.parser !== undefined && (obj.parser = message.parser ? Parser.toJSON(message.parser) : undefined); + if (message.topicNames) { + obj.topicNames = message.topicNames.map((e) => e); + } else { + obj.topicNames = []; + } return obj; }, @@ -652,6 +673,7 @@ export const KafkaSource = { object.parser !== undefined && object.parser !== null ? Parser.fromPartial(object.parser) : undefined; + message.topicNames = object.topicNames?.map((e) => e) || []; return message; }, }; diff --git a/src/generated/yandex/cloud/datatransfer/v1/endpoint/metrika.ts b/src/generated/yandex/cloud/datatransfer/v1/endpoint/metrika.ts new file mode 100644 index 00000000..8cb36c3b --- /dev/null +++ b/src/generated/yandex/cloud/datatransfer/v1/endpoint/metrika.ts @@ -0,0 +1,300 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Secret } from "../../../../../yandex/cloud/datatransfer/v1/endpoint/common"; + +export const protobufPackage = "yandex.cloud.datatransfer.v1.endpoint"; + +export enum MetrikaStreamType { + METRIKA_STREAM_TYPE_UNSPECIFIED = 0, + METRIKA_STREAM_TYPE_HITS = 1, + METRIKA_STREAM_TYPE_VISITS = 2, + METRIKA_STREAM_TYPE_HITS_V2 = 3, + UNRECOGNIZED = -1, +} + +export function metrikaStreamTypeFromJSON(object: any): MetrikaStreamType { + switch (object) { + case 0: + case "METRIKA_STREAM_TYPE_UNSPECIFIED": + return MetrikaStreamType.METRIKA_STREAM_TYPE_UNSPECIFIED; + case 1: + case "METRIKA_STREAM_TYPE_HITS": + return MetrikaStreamType.METRIKA_STREAM_TYPE_HITS; + case 2: + case "METRIKA_STREAM_TYPE_VISITS": + return MetrikaStreamType.METRIKA_STREAM_TYPE_VISITS; + case 3: + case "METRIKA_STREAM_TYPE_HITS_V2": + return MetrikaStreamType.METRIKA_STREAM_TYPE_HITS_V2; + case -1: + case "UNRECOGNIZED": + default: + return MetrikaStreamType.UNRECOGNIZED; + } +} + +export function metrikaStreamTypeToJSON(object: MetrikaStreamType): string { + switch (object) { + case MetrikaStreamType.METRIKA_STREAM_TYPE_UNSPECIFIED: + return "METRIKA_STREAM_TYPE_UNSPECIFIED"; + case MetrikaStreamType.METRIKA_STREAM_TYPE_HITS: + return "METRIKA_STREAM_TYPE_HITS"; + case MetrikaStreamType.METRIKA_STREAM_TYPE_VISITS: + return "METRIKA_STREAM_TYPE_VISITS"; + case MetrikaStreamType.METRIKA_STREAM_TYPE_HITS_V2: + return "METRIKA_STREAM_TYPE_HITS_V2"; + default: + return "UNKNOWN"; + } +} + +export interface MetrikaStream { + $type: "yandex.cloud.datatransfer.v1.endpoint.MetrikaStream"; + type: MetrikaStreamType; + columns: string[]; +} + +export interface MetrikaSource { + $type: "yandex.cloud.datatransfer.v1.endpoint.MetrikaSource"; + counterIds: number[]; + token?: Secret; + streams: MetrikaStream[]; +} + +const baseMetrikaStream: object = { + $type: "yandex.cloud.datatransfer.v1.endpoint.MetrikaStream", + type: 0, + columns: "", +}; + +export const MetrikaStream = { + $type: "yandex.cloud.datatransfer.v1.endpoint.MetrikaStream" as const, + + encode( + message: MetrikaStream, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + for (const v of message.columns) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MetrikaStream { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMetrikaStream } as MetrikaStream; + message.columns = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.columns.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MetrikaStream { + const message = { ...baseMetrikaStream } as MetrikaStream; + message.type = + object.type !== undefined && object.type !== null + ? metrikaStreamTypeFromJSON(object.type) + : 0; + message.columns = (object.columns ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: MetrikaStream): unknown { + const obj: any = {}; + message.type !== undefined && + (obj.type = metrikaStreamTypeToJSON(message.type)); + if (message.columns) { + obj.columns = message.columns.map((e) => e); + } else { + obj.columns = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): MetrikaStream { + const message = { ...baseMetrikaStream } as MetrikaStream; + message.type = object.type ?? 0; + message.columns = object.columns?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(MetrikaStream.$type, MetrikaStream); + +const baseMetrikaSource: object = { + $type: "yandex.cloud.datatransfer.v1.endpoint.MetrikaSource", + counterIds: 0, +}; + +export const MetrikaSource = { + $type: "yandex.cloud.datatransfer.v1.endpoint.MetrikaSource" as const, + + encode( + message: MetrikaSource, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.counterIds) { + writer.int64(v); + } + writer.ldelim(); + if (message.token !== undefined) { + Secret.encode(message.token, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.streams) { + MetrikaStream.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MetrikaSource { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMetrikaSource } as MetrikaSource; + message.counterIds = []; + message.streams = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.counterIds.push(longToNumber(reader.int64() as Long)); + } + } else { + message.counterIds.push(longToNumber(reader.int64() as Long)); + } + break; + case 2: + message.token = Secret.decode(reader, reader.uint32()); + break; + case 3: + message.streams.push(MetrikaStream.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MetrikaSource { + const message = { ...baseMetrikaSource } as MetrikaSource; + message.counterIds = (object.counterIds ?? []).map((e: any) => Number(e)); + message.token = + object.token !== undefined && object.token !== null + ? Secret.fromJSON(object.token) + : undefined; + message.streams = (object.streams ?? []).map((e: any) => + MetrikaStream.fromJSON(e) + ); + return message; + }, + + toJSON(message: MetrikaSource): unknown { + const obj: any = {}; + if (message.counterIds) { + obj.counterIds = message.counterIds.map((e) => Math.round(e)); + } else { + obj.counterIds = []; + } + message.token !== undefined && + (obj.token = message.token ? Secret.toJSON(message.token) : undefined); + if (message.streams) { + obj.streams = message.streams.map((e) => + e ? MetrikaStream.toJSON(e) : undefined + ); + } else { + obj.streams = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): MetrikaSource { + const message = { ...baseMetrikaSource } as MetrikaSource; + message.counterIds = object.counterIds?.map((e) => e) || []; + message.token = + object.token !== undefined && object.token !== null + ? Secret.fromPartial(object.token) + : undefined; + message.streams = + object.streams?.map((e) => MetrikaStream.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(MetrikaSource.$type, MetrikaSource); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/datatransfer/v1/endpoint/mongo.ts b/src/generated/yandex/cloud/datatransfer/v1/endpoint/mongo.ts index 124522a2..6aab103f 100644 --- a/src/generated/yandex/cloud/datatransfer/v1/endpoint/mongo.ts +++ b/src/generated/yandex/cloud/datatransfer/v1/endpoint/mongo.ts @@ -16,8 +16,8 @@ export interface OnPremiseMongo { $type: "yandex.cloud.datatransfer.v1.endpoint.OnPremiseMongo"; hosts: string[]; port: number; - tlsMode?: TLSMode; replicaSet: string; + tlsMode?: TLSMode; } export interface MongoConnectionOptions { @@ -47,8 +47,6 @@ export interface MongoSource { $type: "yandex.cloud.datatransfer.v1.endpoint.MongoSource"; connection?: MongoConnection; subnetId: string; - /** Security groups */ - securityGroups: string[]; /** * List of collections for replication. Empty list implies replication of all * tables on the deployment. Allowed to use * as collection name. @@ -61,17 +59,19 @@ export interface MongoSource { excludedCollections: MongoCollection[]; /** Read mode for mongo client */ secondaryPreferredMode: boolean; + /** Security groups */ + securityGroups: string[]; } export interface MongoTarget { $type: "yandex.cloud.datatransfer.v1.endpoint.MongoTarget"; connection?: MongoConnection; - subnetId: string; - /** Security groups */ - securityGroups: string[]; /** Database name */ database: string; cleanupPolicy: CleanupPolicy; + subnetId: string; + /** Security groups */ + securityGroups: string[]; } const baseOnPremiseMongo: object = { @@ -94,12 +94,12 @@ export const OnPremiseMongo = { if (message.port !== 0) { writer.uint32(16).int64(message.port); } - if (message.tlsMode !== undefined) { - TLSMode.encode(message.tlsMode, writer.uint32(50).fork()).ldelim(); - } if (message.replicaSet !== "") { writer.uint32(42).string(message.replicaSet); } + if (message.tlsMode !== undefined) { + TLSMode.encode(message.tlsMode, writer.uint32(50).fork()).ldelim(); + } return writer; }, @@ -117,12 +117,12 @@ export const OnPremiseMongo = { case 2: message.port = longToNumber(reader.int64() as Long); break; - case 6: - message.tlsMode = TLSMode.decode(reader, reader.uint32()); - break; case 5: message.replicaSet = reader.string(); break; + case 6: + message.tlsMode = TLSMode.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -138,14 +138,14 @@ export const OnPremiseMongo = { object.port !== undefined && object.port !== null ? Number(object.port) : 0; - message.tlsMode = - object.tlsMode !== undefined && object.tlsMode !== null - ? TLSMode.fromJSON(object.tlsMode) - : undefined; message.replicaSet = object.replicaSet !== undefined && object.replicaSet !== null ? String(object.replicaSet) : ""; + message.tlsMode = + object.tlsMode !== undefined && object.tlsMode !== null + ? TLSMode.fromJSON(object.tlsMode) + : undefined; return message; }, @@ -157,11 +157,11 @@ export const OnPremiseMongo = { obj.hosts = []; } message.port !== undefined && (obj.port = Math.round(message.port)); + message.replicaSet !== undefined && (obj.replicaSet = message.replicaSet); message.tlsMode !== undefined && (obj.tlsMode = message.tlsMode ? TLSMode.toJSON(message.tlsMode) : undefined); - message.replicaSet !== undefined && (obj.replicaSet = message.replicaSet); return obj; }, @@ -171,11 +171,11 @@ export const OnPremiseMongo = { const message = { ...baseOnPremiseMongo } as OnPremiseMongo; message.hosts = object.hosts?.map((e) => e) || []; message.port = object.port ?? 0; + message.replicaSet = object.replicaSet ?? ""; message.tlsMode = object.tlsMode !== undefined && object.tlsMode !== null ? TLSMode.fromPartial(object.tlsMode) : undefined; - message.replicaSet = object.replicaSet ?? ""; return message; }, }; @@ -468,8 +468,8 @@ messageTypeRegistry.set(MongoCollection.$type, MongoCollection); const baseMongoSource: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.MongoSource", subnetId: "", - securityGroups: "", secondaryPreferredMode: false, + securityGroups: "", }; export const MongoSource = { @@ -488,9 +488,6 @@ export const MongoSource = { if (message.subnetId !== "") { writer.uint32(18).string(message.subnetId); } - for (const v of message.securityGroups) { - writer.uint32(90).string(v!); - } for (const v of message.collections) { MongoCollection.encode(v!, writer.uint32(50).fork()).ldelim(); } @@ -500,6 +497,9 @@ export const MongoSource = { if (message.secondaryPreferredMode === true) { writer.uint32(64).bool(message.secondaryPreferredMode); } + for (const v of message.securityGroups) { + writer.uint32(90).string(v!); + } return writer; }, @@ -507,9 +507,9 @@ export const MongoSource = { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMongoSource } as MongoSource; - message.securityGroups = []; message.collections = []; message.excludedCollections = []; + message.securityGroups = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -519,9 +519,6 @@ export const MongoSource = { case 2: message.subnetId = reader.string(); break; - case 11: - message.securityGroups.push(reader.string()); - break; case 6: message.collections.push( MongoCollection.decode(reader, reader.uint32()) @@ -535,6 +532,9 @@ export const MongoSource = { case 8: message.secondaryPreferredMode = reader.bool(); break; + case 11: + message.securityGroups.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -553,9 +553,6 @@ export const MongoSource = { object.subnetId !== undefined && object.subnetId !== null ? String(object.subnetId) : ""; - message.securityGroups = (object.securityGroups ?? []).map((e: any) => - String(e) - ); message.collections = (object.collections ?? []).map((e: any) => MongoCollection.fromJSON(e) ); @@ -567,6 +564,9 @@ export const MongoSource = { object.secondaryPreferredMode !== null ? Boolean(object.secondaryPreferredMode) : false; + message.securityGroups = (object.securityGroups ?? []).map((e: any) => + String(e) + ); return message; }, @@ -577,11 +577,6 @@ export const MongoSource = { ? MongoConnection.toJSON(message.connection) : undefined); message.subnetId !== undefined && (obj.subnetId = message.subnetId); - if (message.securityGroups) { - obj.securityGroups = message.securityGroups.map((e) => e); - } else { - obj.securityGroups = []; - } if (message.collections) { obj.collections = message.collections.map((e) => e ? MongoCollection.toJSON(e) : undefined @@ -598,6 +593,11 @@ export const MongoSource = { } message.secondaryPreferredMode !== undefined && (obj.secondaryPreferredMode = message.secondaryPreferredMode); + if (message.securityGroups) { + obj.securityGroups = message.securityGroups.map((e) => e); + } else { + obj.securityGroups = []; + } return obj; }, @@ -610,13 +610,13 @@ export const MongoSource = { ? MongoConnection.fromPartial(object.connection) : undefined; message.subnetId = object.subnetId ?? ""; - message.securityGroups = object.securityGroups?.map((e) => e) || []; message.collections = object.collections?.map((e) => MongoCollection.fromPartial(e)) || []; message.excludedCollections = object.excludedCollections?.map((e) => MongoCollection.fromPartial(e)) || []; message.secondaryPreferredMode = object.secondaryPreferredMode ?? false; + message.securityGroups = object.securityGroups?.map((e) => e) || []; return message; }, }; @@ -625,10 +625,10 @@ messageTypeRegistry.set(MongoSource.$type, MongoSource); const baseMongoTarget: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.MongoTarget", - subnetId: "", - securityGroups: "", database: "", cleanupPolicy: 0, + subnetId: "", + securityGroups: "", }; export const MongoTarget = { @@ -644,18 +644,18 @@ export const MongoTarget = { writer.uint32(10).fork() ).ldelim(); } - if (message.subnetId !== "") { - writer.uint32(58).string(message.subnetId); - } - for (const v of message.securityGroups) { - writer.uint32(66).string(v!); - } if (message.database !== "") { writer.uint32(18).string(message.database); } if (message.cleanupPolicy !== 0) { writer.uint32(48).int32(message.cleanupPolicy); } + if (message.subnetId !== "") { + writer.uint32(58).string(message.subnetId); + } + for (const v of message.securityGroups) { + writer.uint32(66).string(v!); + } return writer; }, @@ -670,18 +670,18 @@ export const MongoTarget = { case 1: message.connection = MongoConnection.decode(reader, reader.uint32()); break; - case 7: - message.subnetId = reader.string(); - break; - case 8: - message.securityGroups.push(reader.string()); - break; case 2: message.database = reader.string(); break; case 6: message.cleanupPolicy = reader.int32() as any; break; + case 7: + message.subnetId = reader.string(); + break; + case 8: + message.securityGroups.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -696,13 +696,6 @@ export const MongoTarget = { object.connection !== undefined && object.connection !== null ? MongoConnection.fromJSON(object.connection) : undefined; - message.subnetId = - object.subnetId !== undefined && object.subnetId !== null - ? String(object.subnetId) - : ""; - message.securityGroups = (object.securityGroups ?? []).map((e: any) => - String(e) - ); message.database = object.database !== undefined && object.database !== null ? String(object.database) @@ -711,6 +704,13 @@ export const MongoTarget = { object.cleanupPolicy !== undefined && object.cleanupPolicy !== null ? cleanupPolicyFromJSON(object.cleanupPolicy) : 0; + message.subnetId = + object.subnetId !== undefined && object.subnetId !== null + ? String(object.subnetId) + : ""; + message.securityGroups = (object.securityGroups ?? []).map((e: any) => + String(e) + ); return message; }, @@ -720,15 +720,15 @@ export const MongoTarget = { (obj.connection = message.connection ? MongoConnection.toJSON(message.connection) : undefined); + message.database !== undefined && (obj.database = message.database); + message.cleanupPolicy !== undefined && + (obj.cleanupPolicy = cleanupPolicyToJSON(message.cleanupPolicy)); message.subnetId !== undefined && (obj.subnetId = message.subnetId); if (message.securityGroups) { obj.securityGroups = message.securityGroups.map((e) => e); } else { obj.securityGroups = []; } - message.database !== undefined && (obj.database = message.database); - message.cleanupPolicy !== undefined && - (obj.cleanupPolicy = cleanupPolicyToJSON(message.cleanupPolicy)); return obj; }, @@ -740,10 +740,10 @@ export const MongoTarget = { object.connection !== undefined && object.connection !== null ? MongoConnection.fromPartial(object.connection) : undefined; - message.subnetId = object.subnetId ?? ""; - message.securityGroups = object.securityGroups?.map((e) => e) || []; message.database = object.database ?? ""; message.cleanupPolicy = object.cleanupPolicy ?? 0; + message.subnetId = object.subnetId ?? ""; + message.securityGroups = object.securityGroups?.map((e) => e) || []; return message; }, }; diff --git a/src/generated/yandex/cloud/datatransfer/v1/endpoint/mysql.ts b/src/generated/yandex/cloud/datatransfer/v1/endpoint/mysql.ts index 56c36046..8341a2e9 100644 --- a/src/generated/yandex/cloud/datatransfer/v1/endpoint/mysql.ts +++ b/src/generated/yandex/cloud/datatransfer/v1/endpoint/mysql.ts @@ -17,13 +17,13 @@ export const protobufPackage = "yandex.cloud.datatransfer.v1.endpoint"; export interface OnPremiseMysql { $type: "yandex.cloud.datatransfer.v1.endpoint.OnPremiseMysql"; - hosts: string[]; /** Database port */ port: number; - /** TLS settings for server connection. Disabled by default. */ - tlsMode?: TLSMode; /** Network interface for endpoint. If none will assume public ipv4 */ subnetId: string; + hosts: string[]; + /** TLS settings for server connection. Disabled by default. */ + tlsMode?: TLSMode; } export interface MysqlConnection { @@ -61,8 +61,6 @@ export interface MysqlSource { $type: "yandex.cloud.datatransfer.v1.endpoint.MysqlSource"; /** Database connection settings */ connection?: MysqlConnection; - /** Security groups */ - securityGroups: string[]; /** * Database name * @@ -70,19 +68,10 @@ export interface MysqlSource { * databases at the same time from this source. */ database: string; - /** - * Database for service tables - * - * Default: data source database. Here created technical tables (__tm_keeper, - * __tm_gtid_keeper). - */ - serviceDatabase: string; /** User for database access. */ user: string; /** Password for database access. */ password?: Secret; - includeTablesRegex: string[]; - excludeTablesRegex: string[]; /** * Database timezone * @@ -96,14 +85,23 @@ export interface MysqlSource { * Select database objects to be transferred during activation or deactivation. */ objectTransferSettings?: MysqlObjectTransferSettings; + includeTablesRegex: string[]; + excludeTablesRegex: string[]; + /** Security groups */ + securityGroups: string[]; + /** + * Database for service tables + * + * Default: data source database. Here created technical tables (__tm_keeper, + * __tm_gtid_keeper). + */ + serviceDatabase: string; } export interface MysqlTarget { $type: "yandex.cloud.datatransfer.v1.endpoint.MysqlTarget"; /** Database connection settings */ connection?: MysqlConnection; - /** Security groups */ - securityGroups: string[]; /** * Database name * @@ -146,13 +144,15 @@ export interface MysqlTarget { * Default: db name. Here created technical tables (__tm_keeper, __tm_gtid_keeper). */ serviceDatabase: string; + /** Security groups */ + securityGroups: string[]; } const baseOnPremiseMysql: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.OnPremiseMysql", - hosts: "", port: 0, subnetId: "", + hosts: "", }; export const OnPremiseMysql = { @@ -162,18 +162,18 @@ export const OnPremiseMysql = { message: OnPremiseMysql, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - for (const v of message.hosts) { - writer.uint32(42).string(v!); - } if (message.port !== 0) { writer.uint32(16).int64(message.port); } - if (message.tlsMode !== undefined) { - TLSMode.encode(message.tlsMode, writer.uint32(50).fork()).ldelim(); - } if (message.subnetId !== "") { writer.uint32(34).string(message.subnetId); } + for (const v of message.hosts) { + writer.uint32(42).string(v!); + } + if (message.tlsMode !== undefined) { + TLSMode.encode(message.tlsMode, writer.uint32(50).fork()).ldelim(); + } return writer; }, @@ -185,18 +185,18 @@ export const OnPremiseMysql = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 5: - message.hosts.push(reader.string()); - break; case 2: message.port = longToNumber(reader.int64() as Long); break; - case 6: - message.tlsMode = TLSMode.decode(reader, reader.uint32()); - break; case 4: message.subnetId = reader.string(); break; + case 5: + message.hosts.push(reader.string()); + break; + case 6: + message.tlsMode = TLSMode.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -207,35 +207,35 @@ export const OnPremiseMysql = { fromJSON(object: any): OnPremiseMysql { const message = { ...baseOnPremiseMysql } as OnPremiseMysql; - message.hosts = (object.hosts ?? []).map((e: any) => String(e)); message.port = object.port !== undefined && object.port !== null ? Number(object.port) : 0; - message.tlsMode = - object.tlsMode !== undefined && object.tlsMode !== null - ? TLSMode.fromJSON(object.tlsMode) - : undefined; message.subnetId = object.subnetId !== undefined && object.subnetId !== null ? String(object.subnetId) : ""; + message.hosts = (object.hosts ?? []).map((e: any) => String(e)); + message.tlsMode = + object.tlsMode !== undefined && object.tlsMode !== null + ? TLSMode.fromJSON(object.tlsMode) + : undefined; return message; }, toJSON(message: OnPremiseMysql): unknown { const obj: any = {}; + message.port !== undefined && (obj.port = Math.round(message.port)); + message.subnetId !== undefined && (obj.subnetId = message.subnetId); if (message.hosts) { obj.hosts = message.hosts.map((e) => e); } else { obj.hosts = []; } - message.port !== undefined && (obj.port = Math.round(message.port)); message.tlsMode !== undefined && (obj.tlsMode = message.tlsMode ? TLSMode.toJSON(message.tlsMode) : undefined); - message.subnetId !== undefined && (obj.subnetId = message.subnetId); return obj; }, @@ -243,13 +243,13 @@ export const OnPremiseMysql = { object: I ): OnPremiseMysql { const message = { ...baseOnPremiseMysql } as OnPremiseMysql; - message.hosts = object.hosts?.map((e) => e) || []; message.port = object.port ?? 0; + message.subnetId = object.subnetId ?? ""; + message.hosts = object.hosts?.map((e) => e) || []; message.tlsMode = object.tlsMode !== undefined && object.tlsMode !== null ? TLSMode.fromPartial(object.tlsMode) : undefined; - message.subnetId = object.subnetId ?? ""; return message; }, }; @@ -459,13 +459,13 @@ messageTypeRegistry.set( const baseMysqlSource: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.MysqlSource", - securityGroups: "", database: "", - serviceDatabase: "", user: "", + timezone: "", includeTablesRegex: "", excludeTablesRegex: "", - timezone: "", + securityGroups: "", + serviceDatabase: "", }; export const MysqlSource = { @@ -481,27 +481,15 @@ export const MysqlSource = { writer.uint32(10).fork() ).ldelim(); } - for (const v of message.securityGroups) { - writer.uint32(114).string(v!); - } if (message.database !== "") { writer.uint32(18).string(message.database); } - if (message.serviceDatabase !== "") { - writer.uint32(122).string(message.serviceDatabase); - } if (message.user !== "") { writer.uint32(26).string(message.user); } if (message.password !== undefined) { Secret.encode(message.password, writer.uint32(34).fork()).ldelim(); } - for (const v of message.includeTablesRegex) { - writer.uint32(98).string(v!); - } - for (const v of message.excludeTablesRegex) { - writer.uint32(106).string(v!); - } if (message.timezone !== "") { writer.uint32(66).string(message.timezone); } @@ -511,6 +499,18 @@ export const MysqlSource = { writer.uint32(90).fork() ).ldelim(); } + for (const v of message.includeTablesRegex) { + writer.uint32(98).string(v!); + } + for (const v of message.excludeTablesRegex) { + writer.uint32(106).string(v!); + } + for (const v of message.securityGroups) { + writer.uint32(114).string(v!); + } + if (message.serviceDatabase !== "") { + writer.uint32(122).string(message.serviceDatabase); + } return writer; }, @@ -518,36 +518,24 @@ export const MysqlSource = { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseMysqlSource } as MysqlSource; - message.securityGroups = []; message.includeTablesRegex = []; message.excludeTablesRegex = []; + message.securityGroups = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.connection = MysqlConnection.decode(reader, reader.uint32()); break; - case 14: - message.securityGroups.push(reader.string()); - break; case 2: message.database = reader.string(); break; - case 15: - message.serviceDatabase = reader.string(); - break; case 3: message.user = reader.string(); break; case 4: message.password = Secret.decode(reader, reader.uint32()); break; - case 12: - message.includeTablesRegex.push(reader.string()); - break; - case 13: - message.excludeTablesRegex.push(reader.string()); - break; case 8: message.timezone = reader.string(); break; @@ -557,6 +545,18 @@ export const MysqlSource = { reader.uint32() ); break; + case 12: + message.includeTablesRegex.push(reader.string()); + break; + case 13: + message.excludeTablesRegex.push(reader.string()); + break; + case 14: + message.securityGroups.push(reader.string()); + break; + case 15: + message.serviceDatabase = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -571,17 +571,10 @@ export const MysqlSource = { object.connection !== undefined && object.connection !== null ? MysqlConnection.fromJSON(object.connection) : undefined; - message.securityGroups = (object.securityGroups ?? []).map((e: any) => - String(e) - ); message.database = object.database !== undefined && object.database !== null ? String(object.database) : ""; - message.serviceDatabase = - object.serviceDatabase !== undefined && object.serviceDatabase !== null - ? String(object.serviceDatabase) - : ""; message.user = object.user !== undefined && object.user !== null ? String(object.user) @@ -590,12 +583,6 @@ export const MysqlSource = { object.password !== undefined && object.password !== null ? Secret.fromJSON(object.password) : undefined; - message.includeTablesRegex = (object.includeTablesRegex ?? []).map( - (e: any) => String(e) - ); - message.excludeTablesRegex = (object.excludeTablesRegex ?? []).map( - (e: any) => String(e) - ); message.timezone = object.timezone !== undefined && object.timezone !== null ? String(object.timezone) @@ -605,6 +592,19 @@ export const MysqlSource = { object.objectTransferSettings !== null ? MysqlObjectTransferSettings.fromJSON(object.objectTransferSettings) : undefined; + message.includeTablesRegex = (object.includeTablesRegex ?? []).map( + (e: any) => String(e) + ); + message.excludeTablesRegex = (object.excludeTablesRegex ?? []).map( + (e: any) => String(e) + ); + message.securityGroups = (object.securityGroups ?? []).map((e: any) => + String(e) + ); + message.serviceDatabase = + object.serviceDatabase !== undefined && object.serviceDatabase !== null + ? String(object.serviceDatabase) + : ""; return message; }, @@ -614,19 +614,17 @@ export const MysqlSource = { (obj.connection = message.connection ? MysqlConnection.toJSON(message.connection) : undefined); - if (message.securityGroups) { - obj.securityGroups = message.securityGroups.map((e) => e); - } else { - obj.securityGroups = []; - } message.database !== undefined && (obj.database = message.database); - message.serviceDatabase !== undefined && - (obj.serviceDatabase = message.serviceDatabase); message.user !== undefined && (obj.user = message.user); message.password !== undefined && (obj.password = message.password ? Secret.toJSON(message.password) : undefined); + message.timezone !== undefined && (obj.timezone = message.timezone); + message.objectTransferSettings !== undefined && + (obj.objectTransferSettings = message.objectTransferSettings + ? MysqlObjectTransferSettings.toJSON(message.objectTransferSettings) + : undefined); if (message.includeTablesRegex) { obj.includeTablesRegex = message.includeTablesRegex.map((e) => e); } else { @@ -637,11 +635,13 @@ export const MysqlSource = { } else { obj.excludeTablesRegex = []; } - message.timezone !== undefined && (obj.timezone = message.timezone); - message.objectTransferSettings !== undefined && - (obj.objectTransferSettings = message.objectTransferSettings - ? MysqlObjectTransferSettings.toJSON(message.objectTransferSettings) - : undefined); + if (message.securityGroups) { + obj.securityGroups = message.securityGroups.map((e) => e); + } else { + obj.securityGroups = []; + } + message.serviceDatabase !== undefined && + (obj.serviceDatabase = message.serviceDatabase); return obj; }, @@ -653,22 +653,22 @@ export const MysqlSource = { object.connection !== undefined && object.connection !== null ? MysqlConnection.fromPartial(object.connection) : undefined; - message.securityGroups = object.securityGroups?.map((e) => e) || []; message.database = object.database ?? ""; - message.serviceDatabase = object.serviceDatabase ?? ""; message.user = object.user ?? ""; message.password = object.password !== undefined && object.password !== null ? Secret.fromPartial(object.password) : undefined; - message.includeTablesRegex = object.includeTablesRegex?.map((e) => e) || []; - message.excludeTablesRegex = object.excludeTablesRegex?.map((e) => e) || []; message.timezone = object.timezone ?? ""; message.objectTransferSettings = object.objectTransferSettings !== undefined && object.objectTransferSettings !== null ? MysqlObjectTransferSettings.fromPartial(object.objectTransferSettings) : undefined; + message.includeTablesRegex = object.includeTablesRegex?.map((e) => e) || []; + message.excludeTablesRegex = object.excludeTablesRegex?.map((e) => e) || []; + message.securityGroups = object.securityGroups?.map((e) => e) || []; + message.serviceDatabase = object.serviceDatabase ?? ""; return message; }, }; @@ -677,7 +677,6 @@ messageTypeRegistry.set(MysqlSource.$type, MysqlSource); const baseMysqlTarget: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.MysqlTarget", - securityGroups: "", database: "", user: "", sqlMode: "", @@ -685,6 +684,7 @@ const baseMysqlTarget: object = { timezone: "", cleanupPolicy: 0, serviceDatabase: "", + securityGroups: "", }; export const MysqlTarget = { @@ -700,9 +700,6 @@ export const MysqlTarget = { writer.uint32(10).fork() ).ldelim(); } - for (const v of message.securityGroups) { - writer.uint32(130).string(v!); - } if (message.database !== "") { writer.uint32(18).string(message.database); } @@ -727,6 +724,9 @@ export const MysqlTarget = { if (message.serviceDatabase !== "") { writer.uint32(122).string(message.serviceDatabase); } + for (const v of message.securityGroups) { + writer.uint32(130).string(v!); + } return writer; }, @@ -741,9 +741,6 @@ export const MysqlTarget = { case 1: message.connection = MysqlConnection.decode(reader, reader.uint32()); break; - case 16: - message.securityGroups.push(reader.string()); - break; case 2: message.database = reader.string(); break; @@ -768,6 +765,9 @@ export const MysqlTarget = { case 15: message.serviceDatabase = reader.string(); break; + case 16: + message.securityGroups.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -782,9 +782,6 @@ export const MysqlTarget = { object.connection !== undefined && object.connection !== null ? MysqlConnection.fromJSON(object.connection) : undefined; - message.securityGroups = (object.securityGroups ?? []).map((e: any) => - String(e) - ); message.database = object.database !== undefined && object.database !== null ? String(object.database) @@ -818,6 +815,9 @@ export const MysqlTarget = { object.serviceDatabase !== undefined && object.serviceDatabase !== null ? String(object.serviceDatabase) : ""; + message.securityGroups = (object.securityGroups ?? []).map((e: any) => + String(e) + ); return message; }, @@ -827,11 +827,6 @@ export const MysqlTarget = { (obj.connection = message.connection ? MysqlConnection.toJSON(message.connection) : undefined); - if (message.securityGroups) { - obj.securityGroups = message.securityGroups.map((e) => e); - } else { - obj.securityGroups = []; - } message.database !== undefined && (obj.database = message.database); message.user !== undefined && (obj.user = message.user); message.password !== undefined && @@ -846,6 +841,11 @@ export const MysqlTarget = { (obj.cleanupPolicy = cleanupPolicyToJSON(message.cleanupPolicy)); message.serviceDatabase !== undefined && (obj.serviceDatabase = message.serviceDatabase); + if (message.securityGroups) { + obj.securityGroups = message.securityGroups.map((e) => e); + } else { + obj.securityGroups = []; + } return obj; }, @@ -857,7 +857,6 @@ export const MysqlTarget = { object.connection !== undefined && object.connection !== null ? MysqlConnection.fromPartial(object.connection) : undefined; - message.securityGroups = object.securityGroups?.map((e) => e) || []; message.database = object.database ?? ""; message.user = object.user ?? ""; message.password = @@ -869,6 +868,7 @@ export const MysqlTarget = { message.timezone = object.timezone ?? ""; message.cleanupPolicy = object.cleanupPolicy ?? 0; message.serviceDatabase = object.serviceDatabase ?? ""; + message.securityGroups = object.securityGroups?.map((e) => e) || []; return message; }, }; diff --git a/src/generated/yandex/cloud/datatransfer/v1/endpoint/parsers.ts b/src/generated/yandex/cloud/datatransfer/v1/endpoint/parsers.ts index 40c903be..b7b4afe5 100644 --- a/src/generated/yandex/cloud/datatransfer/v1/endpoint/parsers.ts +++ b/src/generated/yandex/cloud/datatransfer/v1/endpoint/parsers.ts @@ -21,6 +21,8 @@ export interface GenericParserCommon { nullKeysAllowed: boolean; /** Will add _rest column for all unknown fields */ addRestColumn: boolean; + /** Unescape string values */ + unescapeStringValues: boolean; } export interface AuditTrailsV1Parser { @@ -182,6 +184,7 @@ const baseGenericParserCommon: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.GenericParserCommon", nullKeysAllowed: false, addRestColumn: false, + unescapeStringValues: false, }; export const GenericParserCommon = { @@ -200,6 +203,9 @@ export const GenericParserCommon = { if (message.addRestColumn === true) { writer.uint32(24).bool(message.addRestColumn); } + if (message.unescapeStringValues === true) { + writer.uint32(56).bool(message.unescapeStringValues); + } return writer; }, @@ -219,6 +225,9 @@ export const GenericParserCommon = { case 3: message.addRestColumn = reader.bool(); break; + case 7: + message.unescapeStringValues = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -241,6 +250,11 @@ export const GenericParserCommon = { object.addRestColumn !== undefined && object.addRestColumn !== null ? Boolean(object.addRestColumn) : false; + message.unescapeStringValues = + object.unescapeStringValues !== undefined && + object.unescapeStringValues !== null + ? Boolean(object.unescapeStringValues) + : false; return message; }, @@ -254,6 +268,8 @@ export const GenericParserCommon = { (obj.nullKeysAllowed = message.nullKeysAllowed); message.addRestColumn !== undefined && (obj.addRestColumn = message.addRestColumn); + message.unescapeStringValues !== undefined && + (obj.unescapeStringValues = message.unescapeStringValues); return obj; }, @@ -267,6 +283,7 @@ export const GenericParserCommon = { : undefined; message.nullKeysAllowed = object.nullKeysAllowed ?? false; message.addRestColumn = object.addRestColumn ?? false; + message.unescapeStringValues = object.unescapeStringValues ?? false; return message; }, }; diff --git a/src/generated/yandex/cloud/datatransfer/v1/endpoint/postgres.ts b/src/generated/yandex/cloud/datatransfer/v1/endpoint/postgres.ts index e070f42f..d5d6a531 100644 --- a/src/generated/yandex/cloud/datatransfer/v1/endpoint/postgres.ts +++ b/src/generated/yandex/cloud/datatransfer/v1/endpoint/postgres.ts @@ -29,8 +29,6 @@ export interface PostgresObjectTransferSettings { * CREATE SEQUENCE ... OWNED BY ... */ sequenceOwnedBy: ObjectTransferStage; - /** */ - sequenceSet: ObjectTransferStage; /** * Tables * @@ -73,12 +71,6 @@ export interface PostgresObjectTransferSettings { * CREATE VIEW ... */ view: ObjectTransferStage; - /** - * Materialized views - * - * CREATE MATERIALIZED VIEW ... - */ - materializedView: ObjectTransferStage; /** * Functions * @@ -121,17 +113,25 @@ export interface PostgresObjectTransferSettings { * CREATE CAST ... */ cast: ObjectTransferStage; + /** + * Materialized views + * + * CREATE MATERIALIZED VIEW ... + */ + materializedView: ObjectTransferStage; + /** */ + sequenceSet: ObjectTransferStage; } export interface OnPremisePostgres { $type: "yandex.cloud.datatransfer.v1.endpoint.OnPremisePostgres"; - hosts: string[]; /** Will be used if the cluster ID is not specified. */ port: number; - /** TLS settings for server connection. Disabled by default. */ - tlsMode?: TLSMode; /** Network interface for endpoint. If none will assume public ipv4 */ subnetId: string; + hosts: string[]; + /** TLS settings for server connection. Disabled by default. */ + tlsMode?: TLSMode; } export interface PostgresConnection { @@ -146,11 +146,9 @@ export interface PostgresSource { $type: "yandex.cloud.datatransfer.v1.endpoint.PostgresSource"; /** Database connection settings */ connection?: PostgresConnection; - /** Security groups */ - securityGroups: string[]; /** Database name */ database: string; - /** User for database access. */ + /** User for database access. not required as may be in connection */ user: string; /** Password for database access. */ password?: Secret; @@ -180,17 +178,17 @@ export interface PostgresSource { serviceSchema: string; /** Select database objects to be transferred during activation or deactivation. */ objectTransferSettings?: PostgresObjectTransferSettings; + /** Security groups */ + securityGroups: string[]; } export interface PostgresTarget { $type: "yandex.cloud.datatransfer.v1.endpoint.PostgresTarget"; /** Database connection settings */ connection?: PostgresConnection; - /** Security groups */ - securityGroups: string[]; /** Database name */ database: string; - /** User for database access. */ + /** User for database access. not required as may be in connection */ user: string; /** Password for database access. */ password?: Secret; @@ -199,13 +197,14 @@ export interface PostgresTarget { * truncate. */ cleanupPolicy: CleanupPolicy; + /** Security groups */ + securityGroups: string[]; } const basePostgresObjectTransferSettings: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.PostgresObjectTransferSettings", sequence: 0, sequenceOwnedBy: 0, - sequenceSet: 0, table: 0, primaryKey: 0, fkConstraint: 0, @@ -213,7 +212,6 @@ const basePostgresObjectTransferSettings: object = { constraint: 0, index: 0, view: 0, - materializedView: 0, function: 0, trigger: 0, type: 0, @@ -221,6 +219,8 @@ const basePostgresObjectTransferSettings: object = { collation: 0, policy: 0, cast: 0, + materializedView: 0, + sequenceSet: 0, }; export const PostgresObjectTransferSettings = { @@ -237,9 +237,6 @@ export const PostgresObjectTransferSettings = { if (message.sequenceOwnedBy !== 0) { writer.uint32(16).int32(message.sequenceOwnedBy); } - if (message.sequenceSet !== 0) { - writer.uint32(144).int32(message.sequenceSet); - } if (message.table !== 0) { writer.uint32(24).int32(message.table); } @@ -261,9 +258,6 @@ export const PostgresObjectTransferSettings = { if (message.view !== 0) { writer.uint32(72).int32(message.view); } - if (message.materializedView !== 0) { - writer.uint32(136).int32(message.materializedView); - } if (message.function !== 0) { writer.uint32(80).int32(message.function); } @@ -285,6 +279,12 @@ export const PostgresObjectTransferSettings = { if (message.cast !== 0) { writer.uint32(128).int32(message.cast); } + if (message.materializedView !== 0) { + writer.uint32(136).int32(message.materializedView); + } + if (message.sequenceSet !== 0) { + writer.uint32(144).int32(message.sequenceSet); + } return writer; }, @@ -306,9 +306,6 @@ export const PostgresObjectTransferSettings = { case 2: message.sequenceOwnedBy = reader.int32() as any; break; - case 18: - message.sequenceSet = reader.int32() as any; - break; case 3: message.table = reader.int32() as any; break; @@ -330,9 +327,6 @@ export const PostgresObjectTransferSettings = { case 9: message.view = reader.int32() as any; break; - case 17: - message.materializedView = reader.int32() as any; - break; case 10: message.function = reader.int32() as any; break; @@ -354,6 +348,12 @@ export const PostgresObjectTransferSettings = { case 16: message.cast = reader.int32() as any; break; + case 17: + message.materializedView = reader.int32() as any; + break; + case 18: + message.sequenceSet = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -374,10 +374,6 @@ export const PostgresObjectTransferSettings = { object.sequenceOwnedBy !== undefined && object.sequenceOwnedBy !== null ? objectTransferStageFromJSON(object.sequenceOwnedBy) : 0; - message.sequenceSet = - object.sequenceSet !== undefined && object.sequenceSet !== null - ? objectTransferStageFromJSON(object.sequenceSet) - : 0; message.table = object.table !== undefined && object.table !== null ? objectTransferStageFromJSON(object.table) @@ -406,10 +402,6 @@ export const PostgresObjectTransferSettings = { object.view !== undefined && object.view !== null ? objectTransferStageFromJSON(object.view) : 0; - message.materializedView = - object.materializedView !== undefined && object.materializedView !== null - ? objectTransferStageFromJSON(object.materializedView) - : 0; message.function = object.function !== undefined && object.function !== null ? objectTransferStageFromJSON(object.function) @@ -438,6 +430,14 @@ export const PostgresObjectTransferSettings = { object.cast !== undefined && object.cast !== null ? objectTransferStageFromJSON(object.cast) : 0; + message.materializedView = + object.materializedView !== undefined && object.materializedView !== null + ? objectTransferStageFromJSON(object.materializedView) + : 0; + message.sequenceSet = + object.sequenceSet !== undefined && object.sequenceSet !== null + ? objectTransferStageFromJSON(object.sequenceSet) + : 0; return message; }, @@ -449,8 +449,6 @@ export const PostgresObjectTransferSettings = { (obj.sequenceOwnedBy = objectTransferStageToJSON( message.sequenceOwnedBy )); - message.sequenceSet !== undefined && - (obj.sequenceSet = objectTransferStageToJSON(message.sequenceSet)); message.table !== undefined && (obj.table = objectTransferStageToJSON(message.table)); message.primaryKey !== undefined && @@ -465,10 +463,6 @@ export const PostgresObjectTransferSettings = { (obj.index = objectTransferStageToJSON(message.index)); message.view !== undefined && (obj.view = objectTransferStageToJSON(message.view)); - message.materializedView !== undefined && - (obj.materializedView = objectTransferStageToJSON( - message.materializedView - )); message.function !== undefined && (obj.function = objectTransferStageToJSON(message.function)); message.trigger !== undefined && @@ -483,6 +477,12 @@ export const PostgresObjectTransferSettings = { (obj.policy = objectTransferStageToJSON(message.policy)); message.cast !== undefined && (obj.cast = objectTransferStageToJSON(message.cast)); + message.materializedView !== undefined && + (obj.materializedView = objectTransferStageToJSON( + message.materializedView + )); + message.sequenceSet !== undefined && + (obj.sequenceSet = objectTransferStageToJSON(message.sequenceSet)); return obj; }, @@ -494,7 +494,6 @@ export const PostgresObjectTransferSettings = { } as PostgresObjectTransferSettings; message.sequence = object.sequence ?? 0; message.sequenceOwnedBy = object.sequenceOwnedBy ?? 0; - message.sequenceSet = object.sequenceSet ?? 0; message.table = object.table ?? 0; message.primaryKey = object.primaryKey ?? 0; message.fkConstraint = object.fkConstraint ?? 0; @@ -502,7 +501,6 @@ export const PostgresObjectTransferSettings = { message.constraint = object.constraint ?? 0; message.index = object.index ?? 0; message.view = object.view ?? 0; - message.materializedView = object.materializedView ?? 0; message.function = object.function ?? 0; message.trigger = object.trigger ?? 0; message.type = object.type ?? 0; @@ -510,6 +508,8 @@ export const PostgresObjectTransferSettings = { message.collation = object.collation ?? 0; message.policy = object.policy ?? 0; message.cast = object.cast ?? 0; + message.materializedView = object.materializedView ?? 0; + message.sequenceSet = object.sequenceSet ?? 0; return message; }, }; @@ -521,9 +521,9 @@ messageTypeRegistry.set( const baseOnPremisePostgres: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.OnPremisePostgres", - hosts: "", port: 0, subnetId: "", + hosts: "", }; export const OnPremisePostgres = { @@ -533,18 +533,18 @@ export const OnPremisePostgres = { message: OnPremisePostgres, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - for (const v of message.hosts) { - writer.uint32(42).string(v!); - } if (message.port !== 0) { writer.uint32(16).int64(message.port); } - if (message.tlsMode !== undefined) { - TLSMode.encode(message.tlsMode, writer.uint32(50).fork()).ldelim(); - } if (message.subnetId !== "") { writer.uint32(34).string(message.subnetId); } + for (const v of message.hosts) { + writer.uint32(42).string(v!); + } + if (message.tlsMode !== undefined) { + TLSMode.encode(message.tlsMode, writer.uint32(50).fork()).ldelim(); + } return writer; }, @@ -556,18 +556,18 @@ export const OnPremisePostgres = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 5: - message.hosts.push(reader.string()); - break; case 2: message.port = longToNumber(reader.int64() as Long); break; - case 6: - message.tlsMode = TLSMode.decode(reader, reader.uint32()); - break; case 4: message.subnetId = reader.string(); break; + case 5: + message.hosts.push(reader.string()); + break; + case 6: + message.tlsMode = TLSMode.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -578,35 +578,35 @@ export const OnPremisePostgres = { fromJSON(object: any): OnPremisePostgres { const message = { ...baseOnPremisePostgres } as OnPremisePostgres; - message.hosts = (object.hosts ?? []).map((e: any) => String(e)); message.port = object.port !== undefined && object.port !== null ? Number(object.port) : 0; - message.tlsMode = - object.tlsMode !== undefined && object.tlsMode !== null - ? TLSMode.fromJSON(object.tlsMode) - : undefined; message.subnetId = object.subnetId !== undefined && object.subnetId !== null ? String(object.subnetId) : ""; + message.hosts = (object.hosts ?? []).map((e: any) => String(e)); + message.tlsMode = + object.tlsMode !== undefined && object.tlsMode !== null + ? TLSMode.fromJSON(object.tlsMode) + : undefined; return message; }, toJSON(message: OnPremisePostgres): unknown { const obj: any = {}; + message.port !== undefined && (obj.port = Math.round(message.port)); + message.subnetId !== undefined && (obj.subnetId = message.subnetId); if (message.hosts) { obj.hosts = message.hosts.map((e) => e); } else { obj.hosts = []; } - message.port !== undefined && (obj.port = Math.round(message.port)); message.tlsMode !== undefined && (obj.tlsMode = message.tlsMode ? TLSMode.toJSON(message.tlsMode) : undefined); - message.subnetId !== undefined && (obj.subnetId = message.subnetId); return obj; }, @@ -614,13 +614,13 @@ export const OnPremisePostgres = { object: I ): OnPremisePostgres { const message = { ...baseOnPremisePostgres } as OnPremisePostgres; - message.hosts = object.hosts?.map((e) => e) || []; message.port = object.port ?? 0; + message.subnetId = object.subnetId ?? ""; + message.hosts = object.hosts?.map((e) => e) || []; message.tlsMode = object.tlsMode !== undefined && object.tlsMode !== null ? TLSMode.fromPartial(object.tlsMode) : undefined; - message.subnetId = object.subnetId ?? ""; return message; }, }; @@ -712,13 +712,13 @@ messageTypeRegistry.set(PostgresConnection.$type, PostgresConnection); const basePostgresSource: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.PostgresSource", - securityGroups: "", database: "", user: "", includeTables: "", excludeTables: "", slotByteLagLimit: 0, serviceSchema: "", + securityGroups: "", }; export const PostgresSource = { @@ -734,9 +734,6 @@ export const PostgresSource = { writer.uint32(10).fork() ).ldelim(); } - for (const v of message.securityGroups) { - writer.uint32(114).string(v!); - } if (message.database !== "") { writer.uint32(18).string(message.database); } @@ -764,6 +761,9 @@ export const PostgresSource = { writer.uint32(106).fork() ).ldelim(); } + for (const v of message.securityGroups) { + writer.uint32(114).string(v!); + } return writer; }, @@ -771,9 +771,9 @@ export const PostgresSource = { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { ...basePostgresSource } as PostgresSource; - message.securityGroups = []; message.includeTables = []; message.excludeTables = []; + message.securityGroups = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -783,9 +783,6 @@ export const PostgresSource = { reader.uint32() ); break; - case 14: - message.securityGroups.push(reader.string()); - break; case 2: message.database = reader.string(); break; @@ -811,6 +808,9 @@ export const PostgresSource = { message.objectTransferSettings = PostgresObjectTransferSettings.decode(reader, reader.uint32()); break; + case 14: + message.securityGroups.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -825,9 +825,6 @@ export const PostgresSource = { object.connection !== undefined && object.connection !== null ? PostgresConnection.fromJSON(object.connection) : undefined; - message.securityGroups = (object.securityGroups ?? []).map((e: any) => - String(e) - ); message.database = object.database !== undefined && object.database !== null ? String(object.database) @@ -859,6 +856,9 @@ export const PostgresSource = { object.objectTransferSettings !== null ? PostgresObjectTransferSettings.fromJSON(object.objectTransferSettings) : undefined; + message.securityGroups = (object.securityGroups ?? []).map((e: any) => + String(e) + ); return message; }, @@ -868,11 +868,6 @@ export const PostgresSource = { (obj.connection = message.connection ? PostgresConnection.toJSON(message.connection) : undefined); - if (message.securityGroups) { - obj.securityGroups = message.securityGroups.map((e) => e); - } else { - obj.securityGroups = []; - } message.database !== undefined && (obj.database = message.database); message.user !== undefined && (obj.user = message.user); message.password !== undefined && @@ -897,6 +892,11 @@ export const PostgresSource = { (obj.objectTransferSettings = message.objectTransferSettings ? PostgresObjectTransferSettings.toJSON(message.objectTransferSettings) : undefined); + if (message.securityGroups) { + obj.securityGroups = message.securityGroups.map((e) => e); + } else { + obj.securityGroups = []; + } return obj; }, @@ -908,7 +908,6 @@ export const PostgresSource = { object.connection !== undefined && object.connection !== null ? PostgresConnection.fromPartial(object.connection) : undefined; - message.securityGroups = object.securityGroups?.map((e) => e) || []; message.database = object.database ?? ""; message.user = object.user ?? ""; message.password = @@ -926,6 +925,7 @@ export const PostgresSource = { object.objectTransferSettings ) : undefined; + message.securityGroups = object.securityGroups?.map((e) => e) || []; return message; }, }; @@ -934,10 +934,10 @@ messageTypeRegistry.set(PostgresSource.$type, PostgresSource); const basePostgresTarget: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.PostgresTarget", - securityGroups: "", database: "", user: "", cleanupPolicy: 0, + securityGroups: "", }; export const PostgresTarget = { @@ -953,9 +953,6 @@ export const PostgresTarget = { writer.uint32(10).fork() ).ldelim(); } - for (const v of message.securityGroups) { - writer.uint32(58).string(v!); - } if (message.database !== "") { writer.uint32(18).string(message.database); } @@ -968,6 +965,9 @@ export const PostgresTarget = { if (message.cleanupPolicy !== 0) { writer.uint32(40).int32(message.cleanupPolicy); } + for (const v of message.securityGroups) { + writer.uint32(58).string(v!); + } return writer; }, @@ -985,9 +985,6 @@ export const PostgresTarget = { reader.uint32() ); break; - case 7: - message.securityGroups.push(reader.string()); - break; case 2: message.database = reader.string(); break; @@ -1000,6 +997,9 @@ export const PostgresTarget = { case 5: message.cleanupPolicy = reader.int32() as any; break; + case 7: + message.securityGroups.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -1014,9 +1014,6 @@ export const PostgresTarget = { object.connection !== undefined && object.connection !== null ? PostgresConnection.fromJSON(object.connection) : undefined; - message.securityGroups = (object.securityGroups ?? []).map((e: any) => - String(e) - ); message.database = object.database !== undefined && object.database !== null ? String(object.database) @@ -1033,6 +1030,9 @@ export const PostgresTarget = { object.cleanupPolicy !== undefined && object.cleanupPolicy !== null ? cleanupPolicyFromJSON(object.cleanupPolicy) : 0; + message.securityGroups = (object.securityGroups ?? []).map((e: any) => + String(e) + ); return message; }, @@ -1042,11 +1042,6 @@ export const PostgresTarget = { (obj.connection = message.connection ? PostgresConnection.toJSON(message.connection) : undefined); - if (message.securityGroups) { - obj.securityGroups = message.securityGroups.map((e) => e); - } else { - obj.securityGroups = []; - } message.database !== undefined && (obj.database = message.database); message.user !== undefined && (obj.user = message.user); message.password !== undefined && @@ -1055,6 +1050,11 @@ export const PostgresTarget = { : undefined); message.cleanupPolicy !== undefined && (obj.cleanupPolicy = cleanupPolicyToJSON(message.cleanupPolicy)); + if (message.securityGroups) { + obj.securityGroups = message.securityGroups.map((e) => e); + } else { + obj.securityGroups = []; + } return obj; }, @@ -1066,7 +1066,6 @@ export const PostgresTarget = { object.connection !== undefined && object.connection !== null ? PostgresConnection.fromPartial(object.connection) : undefined; - message.securityGroups = object.securityGroups?.map((e) => e) || []; message.database = object.database ?? ""; message.user = object.user ?? ""; message.password = @@ -1074,6 +1073,7 @@ export const PostgresTarget = { ? Secret.fromPartial(object.password) : undefined; message.cleanupPolicy = object.cleanupPolicy ?? 0; + message.securityGroups = object.securityGroups?.map((e) => e) || []; return message; }, }; diff --git a/src/generated/yandex/cloud/datatransfer/v1/endpoint/ydb.ts b/src/generated/yandex/cloud/datatransfer/v1/endpoint/ydb.ts index d36bf1c4..4fac6218 100644 --- a/src/generated/yandex/cloud/datatransfer/v1/endpoint/ydb.ts +++ b/src/generated/yandex/cloud/datatransfer/v1/endpoint/ydb.ts @@ -43,20 +43,64 @@ export function ydbCleanupPolicyToJSON(object: YdbCleanupPolicy): string { } } +export enum YdbDefaultCompression { + YDB_DEFAULT_COMPRESSION_UNSPECIFIED = 0, + YDB_DEFAULT_COMPRESSION_DISABLED = 1, + YDB_DEFAULT_COMPRESSION_LZ4 = 2, + UNRECOGNIZED = -1, +} + +export function ydbDefaultCompressionFromJSON( + object: any +): YdbDefaultCompression { + switch (object) { + case 0: + case "YDB_DEFAULT_COMPRESSION_UNSPECIFIED": + return YdbDefaultCompression.YDB_DEFAULT_COMPRESSION_UNSPECIFIED; + case 1: + case "YDB_DEFAULT_COMPRESSION_DISABLED": + return YdbDefaultCompression.YDB_DEFAULT_COMPRESSION_DISABLED; + case 2: + case "YDB_DEFAULT_COMPRESSION_LZ4": + return YdbDefaultCompression.YDB_DEFAULT_COMPRESSION_LZ4; + case -1: + case "UNRECOGNIZED": + default: + return YdbDefaultCompression.UNRECOGNIZED; + } +} + +export function ydbDefaultCompressionToJSON( + object: YdbDefaultCompression +): string { + switch (object) { + case YdbDefaultCompression.YDB_DEFAULT_COMPRESSION_UNSPECIFIED: + return "YDB_DEFAULT_COMPRESSION_UNSPECIFIED"; + case YdbDefaultCompression.YDB_DEFAULT_COMPRESSION_DISABLED: + return "YDB_DEFAULT_COMPRESSION_DISABLED"; + case YdbDefaultCompression.YDB_DEFAULT_COMPRESSION_LZ4: + return "YDB_DEFAULT_COMPRESSION_LZ4"; + default: + return "UNKNOWN"; + } +} + export interface YdbSource { $type: "yandex.cloud.datatransfer.v1.endpoint.YdbSource"; /** Path in YDB where to store tables */ database: string; /** Instance of YDB. example: ydb-ru-prestable.yandex.net:2135 */ instance: string; - serviceAccountId: string; paths: string[]; + serviceAccountId: string; /** Network interface for endpoint. If none will assume public ipv4 */ subnetId: string; - /** Security groups */ - securityGroups: string[]; /** Authorization Key */ saKeyContent: string; + /** Security groups */ + securityGroups: string[]; + /** Pre-created change feed */ + changefeedCustomName: string; } export interface YdbTarget { @@ -65,28 +109,36 @@ export interface YdbTarget { database: string; /** Instance of YDB. example: ydb-ru-prestable.yandex.net:2135 */ instance: string; - serviceAccountId: string; /** Path extension for database, each table will be layouted into this path */ path: string; + serviceAccountId: string; + /** Cleanup policy */ + cleanupPolicy: YdbCleanupPolicy; /** Network interface for endpoint. If none will assume public ipv4 */ subnetId: string; - /** Security groups */ - securityGroups: string[]; /** SA content */ saKeyContent: string; - /** Cleanup policy */ - cleanupPolicy: YdbCleanupPolicy; + /** Security groups */ + securityGroups: string[]; + /** + * Should create column-oriented table (OLAP). By default it creates row-oriented + * (OLTP) + */ + isTableColumnOriented: boolean; + /** Compression that will be used for default columns family on YDB table creation */ + defaultCompression: YdbDefaultCompression; } const baseYdbSource: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.YdbSource", database: "", instance: "", - serviceAccountId: "", paths: "", + serviceAccountId: "", subnetId: "", - securityGroups: "", saKeyContent: "", + securityGroups: "", + changefeedCustomName: "", }; export const YdbSource = { @@ -102,20 +154,23 @@ export const YdbSource = { if (message.instance !== "") { writer.uint32(18).string(message.instance); } - if (message.serviceAccountId !== "") { - writer.uint32(50).string(message.serviceAccountId); - } for (const v of message.paths) { writer.uint32(42).string(v!); } + if (message.serviceAccountId !== "") { + writer.uint32(50).string(message.serviceAccountId); + } if (message.subnetId !== "") { writer.uint32(242).string(message.subnetId); } + if (message.saKeyContent !== "") { + writer.uint32(266).string(message.saKeyContent); + } for (const v of message.securityGroups) { writer.uint32(274).string(v!); } - if (message.saKeyContent !== "") { - writer.uint32(266).string(message.saKeyContent); + if (message.changefeedCustomName !== "") { + writer.uint32(282).string(message.changefeedCustomName); } return writer; }, @@ -135,20 +190,23 @@ export const YdbSource = { case 2: message.instance = reader.string(); break; - case 6: - message.serviceAccountId = reader.string(); - break; case 5: message.paths.push(reader.string()); break; + case 6: + message.serviceAccountId = reader.string(); + break; case 30: message.subnetId = reader.string(); break; + case 33: + message.saKeyContent = reader.string(); + break; case 34: message.securityGroups.push(reader.string()); break; - case 33: - message.saKeyContent = reader.string(); + case 35: + message.changefeedCustomName = reader.string(); break; default: reader.skipType(tag & 7); @@ -168,22 +226,27 @@ export const YdbSource = { object.instance !== undefined && object.instance !== null ? String(object.instance) : ""; + message.paths = (object.paths ?? []).map((e: any) => String(e)); message.serviceAccountId = object.serviceAccountId !== undefined && object.serviceAccountId !== null ? String(object.serviceAccountId) : ""; - message.paths = (object.paths ?? []).map((e: any) => String(e)); message.subnetId = object.subnetId !== undefined && object.subnetId !== null ? String(object.subnetId) : ""; - message.securityGroups = (object.securityGroups ?? []).map((e: any) => - String(e) - ); message.saKeyContent = object.saKeyContent !== undefined && object.saKeyContent !== null ? String(object.saKeyContent) : ""; + message.securityGroups = (object.securityGroups ?? []).map((e: any) => + String(e) + ); + message.changefeedCustomName = + object.changefeedCustomName !== undefined && + object.changefeedCustomName !== null + ? String(object.changefeedCustomName) + : ""; return message; }, @@ -191,21 +254,23 @@ export const YdbSource = { const obj: any = {}; message.database !== undefined && (obj.database = message.database); message.instance !== undefined && (obj.instance = message.instance); - message.serviceAccountId !== undefined && - (obj.serviceAccountId = message.serviceAccountId); if (message.paths) { obj.paths = message.paths.map((e) => e); } else { obj.paths = []; } + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); message.subnetId !== undefined && (obj.subnetId = message.subnetId); + message.saKeyContent !== undefined && + (obj.saKeyContent = message.saKeyContent); if (message.securityGroups) { obj.securityGroups = message.securityGroups.map((e) => e); } else { obj.securityGroups = []; } - message.saKeyContent !== undefined && - (obj.saKeyContent = message.saKeyContent); + message.changefeedCustomName !== undefined && + (obj.changefeedCustomName = message.changefeedCustomName); return obj; }, @@ -215,11 +280,12 @@ export const YdbSource = { const message = { ...baseYdbSource } as YdbSource; message.database = object.database ?? ""; message.instance = object.instance ?? ""; - message.serviceAccountId = object.serviceAccountId ?? ""; message.paths = object.paths?.map((e) => e) || []; + message.serviceAccountId = object.serviceAccountId ?? ""; message.subnetId = object.subnetId ?? ""; - message.securityGroups = object.securityGroups?.map((e) => e) || []; message.saKeyContent = object.saKeyContent ?? ""; + message.securityGroups = object.securityGroups?.map((e) => e) || []; + message.changefeedCustomName = object.changefeedCustomName ?? ""; return message; }, }; @@ -230,12 +296,14 @@ const baseYdbTarget: object = { $type: "yandex.cloud.datatransfer.v1.endpoint.YdbTarget", database: "", instance: "", - serviceAccountId: "", path: "", + serviceAccountId: "", + cleanupPolicy: 0, subnetId: "", - securityGroups: "", saKeyContent: "", - cleanupPolicy: 0, + securityGroups: "", + isTableColumnOriented: false, + defaultCompression: 0, }; export const YdbTarget = { @@ -251,23 +319,29 @@ export const YdbTarget = { if (message.instance !== "") { writer.uint32(18).string(message.instance); } + if (message.path !== "") { + writer.uint32(82).string(message.path); + } if (message.serviceAccountId !== "") { writer.uint32(90).string(message.serviceAccountId); } - if (message.path !== "") { - writer.uint32(82).string(message.path); + if (message.cleanupPolicy !== 0) { + writer.uint32(168).int32(message.cleanupPolicy); } if (message.subnetId !== "") { writer.uint32(242).string(message.subnetId); } + if (message.saKeyContent !== "") { + writer.uint32(258).string(message.saKeyContent); + } for (const v of message.securityGroups) { writer.uint32(266).string(v!); } - if (message.saKeyContent !== "") { - writer.uint32(258).string(message.saKeyContent); + if (message.isTableColumnOriented === true) { + writer.uint32(272).bool(message.isTableColumnOriented); } - if (message.cleanupPolicy !== 0) { - writer.uint32(168).int32(message.cleanupPolicy); + if (message.defaultCompression !== 0) { + writer.uint32(280).int32(message.defaultCompression); } return writer; }, @@ -286,23 +360,29 @@ export const YdbTarget = { case 2: message.instance = reader.string(); break; + case 10: + message.path = reader.string(); + break; case 11: message.serviceAccountId = reader.string(); break; - case 10: - message.path = reader.string(); + case 21: + message.cleanupPolicy = reader.int32() as any; break; case 30: message.subnetId = reader.string(); break; + case 32: + message.saKeyContent = reader.string(); + break; case 33: message.securityGroups.push(reader.string()); break; - case 32: - message.saKeyContent = reader.string(); + case 34: + message.isTableColumnOriented = reader.bool(); break; - case 21: - message.cleanupPolicy = reader.int32() as any; + case 35: + message.defaultCompression = reader.int32() as any; break; default: reader.skipType(tag & 7); @@ -322,28 +402,38 @@ export const YdbTarget = { object.instance !== undefined && object.instance !== null ? String(object.instance) : ""; - message.serviceAccountId = - object.serviceAccountId !== undefined && object.serviceAccountId !== null - ? String(object.serviceAccountId) - : ""; message.path = object.path !== undefined && object.path !== null ? String(object.path) : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.cleanupPolicy = + object.cleanupPolicy !== undefined && object.cleanupPolicy !== null + ? ydbCleanupPolicyFromJSON(object.cleanupPolicy) + : 0; message.subnetId = object.subnetId !== undefined && object.subnetId !== null ? String(object.subnetId) : ""; - message.securityGroups = (object.securityGroups ?? []).map((e: any) => - String(e) - ); message.saKeyContent = object.saKeyContent !== undefined && object.saKeyContent !== null ? String(object.saKeyContent) : ""; - message.cleanupPolicy = - object.cleanupPolicy !== undefined && object.cleanupPolicy !== null - ? ydbCleanupPolicyFromJSON(object.cleanupPolicy) + message.securityGroups = (object.securityGroups ?? []).map((e: any) => + String(e) + ); + message.isTableColumnOriented = + object.isTableColumnOriented !== undefined && + object.isTableColumnOriented !== null + ? Boolean(object.isTableColumnOriented) + : false; + message.defaultCompression = + object.defaultCompression !== undefined && + object.defaultCompression !== null + ? ydbDefaultCompressionFromJSON(object.defaultCompression) : 0; return message; }, @@ -352,19 +442,25 @@ export const YdbTarget = { const obj: any = {}; message.database !== undefined && (obj.database = message.database); message.instance !== undefined && (obj.instance = message.instance); + message.path !== undefined && (obj.path = message.path); message.serviceAccountId !== undefined && (obj.serviceAccountId = message.serviceAccountId); - message.path !== undefined && (obj.path = message.path); + message.cleanupPolicy !== undefined && + (obj.cleanupPolicy = ydbCleanupPolicyToJSON(message.cleanupPolicy)); message.subnetId !== undefined && (obj.subnetId = message.subnetId); + message.saKeyContent !== undefined && + (obj.saKeyContent = message.saKeyContent); if (message.securityGroups) { obj.securityGroups = message.securityGroups.map((e) => e); } else { obj.securityGroups = []; } - message.saKeyContent !== undefined && - (obj.saKeyContent = message.saKeyContent); - message.cleanupPolicy !== undefined && - (obj.cleanupPolicy = ydbCleanupPolicyToJSON(message.cleanupPolicy)); + message.isTableColumnOriented !== undefined && + (obj.isTableColumnOriented = message.isTableColumnOriented); + message.defaultCompression !== undefined && + (obj.defaultCompression = ydbDefaultCompressionToJSON( + message.defaultCompression + )); return obj; }, @@ -374,12 +470,14 @@ export const YdbTarget = { const message = { ...baseYdbTarget } as YdbTarget; message.database = object.database ?? ""; message.instance = object.instance ?? ""; - message.serviceAccountId = object.serviceAccountId ?? ""; message.path = object.path ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.cleanupPolicy = object.cleanupPolicy ?? 0; message.subnetId = object.subnetId ?? ""; - message.securityGroups = object.securityGroups?.map((e) => e) || []; message.saKeyContent = object.saKeyContent ?? ""; - message.cleanupPolicy = object.cleanupPolicy ?? 0; + message.securityGroups = object.securityGroups?.map((e) => e) || []; + message.isTableColumnOriented = object.isTableColumnOriented ?? false; + message.defaultCompression = object.defaultCompression ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/datatransfer/v1/endpoint/yds.ts b/src/generated/yandex/cloud/datatransfer/v1/endpoint/yds.ts new file mode 100644 index 00000000..a842d146 --- /dev/null +++ b/src/generated/yandex/cloud/datatransfer/v1/endpoint/yds.ts @@ -0,0 +1,503 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Parser } from "../../../../../yandex/cloud/datatransfer/v1/endpoint/parsers"; +import { Serializer } from "../../../../../yandex/cloud/datatransfer/v1/endpoint/serializers"; + +export const protobufPackage = "yandex.cloud.datatransfer.v1.endpoint"; + +export enum YdsCompressionCodec { + YDS_COMPRESSION_CODEC_UNSPECIFIED = 0, + YDS_COMPRESSION_CODEC_RAW = 1, + YDS_COMPRESSION_CODEC_GZIP = 2, + YDS_COMPRESSION_CODEC_ZSTD = 4, + UNRECOGNIZED = -1, +} + +export function ydsCompressionCodecFromJSON(object: any): YdsCompressionCodec { + switch (object) { + case 0: + case "YDS_COMPRESSION_CODEC_UNSPECIFIED": + return YdsCompressionCodec.YDS_COMPRESSION_CODEC_UNSPECIFIED; + case 1: + case "YDS_COMPRESSION_CODEC_RAW": + return YdsCompressionCodec.YDS_COMPRESSION_CODEC_RAW; + case 2: + case "YDS_COMPRESSION_CODEC_GZIP": + return YdsCompressionCodec.YDS_COMPRESSION_CODEC_GZIP; + case 4: + case "YDS_COMPRESSION_CODEC_ZSTD": + return YdsCompressionCodec.YDS_COMPRESSION_CODEC_ZSTD; + case -1: + case "UNRECOGNIZED": + default: + return YdsCompressionCodec.UNRECOGNIZED; + } +} + +export function ydsCompressionCodecToJSON(object: YdsCompressionCodec): string { + switch (object) { + case YdsCompressionCodec.YDS_COMPRESSION_CODEC_UNSPECIFIED: + return "YDS_COMPRESSION_CODEC_UNSPECIFIED"; + case YdsCompressionCodec.YDS_COMPRESSION_CODEC_RAW: + return "YDS_COMPRESSION_CODEC_RAW"; + case YdsCompressionCodec.YDS_COMPRESSION_CODEC_GZIP: + return "YDS_COMPRESSION_CODEC_GZIP"; + case YdsCompressionCodec.YDS_COMPRESSION_CODEC_ZSTD: + return "YDS_COMPRESSION_CODEC_ZSTD"; + default: + return "UNKNOWN"; + } +} + +export interface YDSSource { + $type: "yandex.cloud.datatransfer.v1.endpoint.YDSSource"; + /** Database */ + database: string; + /** Stream */ + stream: string; + /** SA which has read access to the stream. */ + serviceAccountId: string; + /** Compression codec */ + supportedCodecs: YdsCompressionCodec[]; + /** Data parsing rules */ + parser?: Parser; + /** + * Should continue working, if consumer read lag exceed TTL of topic + * False: stop the transfer in error state, if detected lost data. True: continue + * working with losing part of data + */ + allowTtlRewind: boolean; + /** for dedicated db */ + endpoint: string; + /** Network interface for endpoint. If none will assume public ipv4 */ + subnetId: string; + /** Security groups */ + securityGroups: string[]; + /** for important streams */ + consumer: string; +} + +export interface YDSTarget { + $type: "yandex.cloud.datatransfer.v1.endpoint.YDSTarget"; + /** Database */ + database: string; + /** Stream */ + stream: string; + /** SA which has read access to the stream. */ + serviceAccountId: string; + /** + * Save transaction order + * Not to split events queue into separate per-table queues. + * Incompatible with setting Topic prefix, only with Topic full name. + */ + saveTxOrder: boolean; + /** Data serialization format */ + serializer?: Serializer; + /** for dedicated db */ + endpoint: string; + /** Network interface for endpoint. If none will assume public ipv4 */ + subnetId: string; + /** Security groups */ + securityGroups: string[]; +} + +const baseYDSSource: object = { + $type: "yandex.cloud.datatransfer.v1.endpoint.YDSSource", + database: "", + stream: "", + serviceAccountId: "", + supportedCodecs: 0, + allowTtlRewind: false, + endpoint: "", + subnetId: "", + securityGroups: "", + consumer: "", +}; + +export const YDSSource = { + $type: "yandex.cloud.datatransfer.v1.endpoint.YDSSource" as const, + + encode( + message: YDSSource, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.database !== "") { + writer.uint32(10).string(message.database); + } + if (message.stream !== "") { + writer.uint32(18).string(message.stream); + } + if (message.serviceAccountId !== "") { + writer.uint32(66).string(message.serviceAccountId); + } + writer.uint32(74).fork(); + for (const v of message.supportedCodecs) { + writer.int32(v); + } + writer.ldelim(); + if (message.parser !== undefined) { + Parser.encode(message.parser, writer.uint32(82).fork()).ldelim(); + } + if (message.allowTtlRewind === true) { + writer.uint32(88).bool(message.allowTtlRewind); + } + if (message.endpoint !== "") { + writer.uint32(162).string(message.endpoint); + } + if (message.subnetId !== "") { + writer.uint32(242).string(message.subnetId); + } + for (const v of message.securityGroups) { + writer.uint32(274).string(v!); + } + if (message.consumer !== "") { + writer.uint32(282).string(message.consumer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): YDSSource { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseYDSSource } as YDSSource; + message.supportedCodecs = []; + message.securityGroups = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.database = reader.string(); + break; + case 2: + message.stream = reader.string(); + break; + case 8: + message.serviceAccountId = reader.string(); + break; + case 9: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.supportedCodecs.push(reader.int32() as any); + } + } else { + message.supportedCodecs.push(reader.int32() as any); + } + break; + case 10: + message.parser = Parser.decode(reader, reader.uint32()); + break; + case 11: + message.allowTtlRewind = reader.bool(); + break; + case 20: + message.endpoint = reader.string(); + break; + case 30: + message.subnetId = reader.string(); + break; + case 34: + message.securityGroups.push(reader.string()); + break; + case 35: + message.consumer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): YDSSource { + const message = { ...baseYDSSource } as YDSSource; + message.database = + object.database !== undefined && object.database !== null + ? String(object.database) + : ""; + message.stream = + object.stream !== undefined && object.stream !== null + ? String(object.stream) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.supportedCodecs = (object.supportedCodecs ?? []).map((e: any) => + ydsCompressionCodecFromJSON(e) + ); + message.parser = + object.parser !== undefined && object.parser !== null + ? Parser.fromJSON(object.parser) + : undefined; + message.allowTtlRewind = + object.allowTtlRewind !== undefined && object.allowTtlRewind !== null + ? Boolean(object.allowTtlRewind) + : false; + message.endpoint = + object.endpoint !== undefined && object.endpoint !== null + ? String(object.endpoint) + : ""; + message.subnetId = + object.subnetId !== undefined && object.subnetId !== null + ? String(object.subnetId) + : ""; + message.securityGroups = (object.securityGroups ?? []).map((e: any) => + String(e) + ); + message.consumer = + object.consumer !== undefined && object.consumer !== null + ? String(object.consumer) + : ""; + return message; + }, + + toJSON(message: YDSSource): unknown { + const obj: any = {}; + message.database !== undefined && (obj.database = message.database); + message.stream !== undefined && (obj.stream = message.stream); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + if (message.supportedCodecs) { + obj.supportedCodecs = message.supportedCodecs.map((e) => + ydsCompressionCodecToJSON(e) + ); + } else { + obj.supportedCodecs = []; + } + message.parser !== undefined && + (obj.parser = message.parser ? Parser.toJSON(message.parser) : undefined); + message.allowTtlRewind !== undefined && + (obj.allowTtlRewind = message.allowTtlRewind); + message.endpoint !== undefined && (obj.endpoint = message.endpoint); + message.subnetId !== undefined && (obj.subnetId = message.subnetId); + if (message.securityGroups) { + obj.securityGroups = message.securityGroups.map((e) => e); + } else { + obj.securityGroups = []; + } + message.consumer !== undefined && (obj.consumer = message.consumer); + return obj; + }, + + fromPartial, I>>( + object: I + ): YDSSource { + const message = { ...baseYDSSource } as YDSSource; + message.database = object.database ?? ""; + message.stream = object.stream ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.supportedCodecs = object.supportedCodecs?.map((e) => e) || []; + message.parser = + object.parser !== undefined && object.parser !== null + ? Parser.fromPartial(object.parser) + : undefined; + message.allowTtlRewind = object.allowTtlRewind ?? false; + message.endpoint = object.endpoint ?? ""; + message.subnetId = object.subnetId ?? ""; + message.securityGroups = object.securityGroups?.map((e) => e) || []; + message.consumer = object.consumer ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(YDSSource.$type, YDSSource); + +const baseYDSTarget: object = { + $type: "yandex.cloud.datatransfer.v1.endpoint.YDSTarget", + database: "", + stream: "", + serviceAccountId: "", + saveTxOrder: false, + endpoint: "", + subnetId: "", + securityGroups: "", +}; + +export const YDSTarget = { + $type: "yandex.cloud.datatransfer.v1.endpoint.YDSTarget" as const, + + encode( + message: YDSTarget, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.database !== "") { + writer.uint32(10).string(message.database); + } + if (message.stream !== "") { + writer.uint32(18).string(message.stream); + } + if (message.serviceAccountId !== "") { + writer.uint32(26).string(message.serviceAccountId); + } + if (message.saveTxOrder === true) { + writer.uint32(32).bool(message.saveTxOrder); + } + if (message.serializer !== undefined) { + Serializer.encode(message.serializer, writer.uint32(66).fork()).ldelim(); + } + if (message.endpoint !== "") { + writer.uint32(162).string(message.endpoint); + } + if (message.subnetId !== "") { + writer.uint32(242).string(message.subnetId); + } + for (const v of message.securityGroups) { + writer.uint32(274).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): YDSTarget { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseYDSTarget } as YDSTarget; + message.securityGroups = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.database = reader.string(); + break; + case 2: + message.stream = reader.string(); + break; + case 3: + message.serviceAccountId = reader.string(); + break; + case 4: + message.saveTxOrder = reader.bool(); + break; + case 8: + message.serializer = Serializer.decode(reader, reader.uint32()); + break; + case 20: + message.endpoint = reader.string(); + break; + case 30: + message.subnetId = reader.string(); + break; + case 34: + message.securityGroups.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): YDSTarget { + const message = { ...baseYDSTarget } as YDSTarget; + message.database = + object.database !== undefined && object.database !== null + ? String(object.database) + : ""; + message.stream = + object.stream !== undefined && object.stream !== null + ? String(object.stream) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.saveTxOrder = + object.saveTxOrder !== undefined && object.saveTxOrder !== null + ? Boolean(object.saveTxOrder) + : false; + message.serializer = + object.serializer !== undefined && object.serializer !== null + ? Serializer.fromJSON(object.serializer) + : undefined; + message.endpoint = + object.endpoint !== undefined && object.endpoint !== null + ? String(object.endpoint) + : ""; + message.subnetId = + object.subnetId !== undefined && object.subnetId !== null + ? String(object.subnetId) + : ""; + message.securityGroups = (object.securityGroups ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: YDSTarget): unknown { + const obj: any = {}; + message.database !== undefined && (obj.database = message.database); + message.stream !== undefined && (obj.stream = message.stream); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.saveTxOrder !== undefined && + (obj.saveTxOrder = message.saveTxOrder); + message.serializer !== undefined && + (obj.serializer = message.serializer + ? Serializer.toJSON(message.serializer) + : undefined); + message.endpoint !== undefined && (obj.endpoint = message.endpoint); + message.subnetId !== undefined && (obj.subnetId = message.subnetId); + if (message.securityGroups) { + obj.securityGroups = message.securityGroups.map((e) => e); + } else { + obj.securityGroups = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): YDSTarget { + const message = { ...baseYDSTarget } as YDSTarget; + message.database = object.database ?? ""; + message.stream = object.stream ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.saveTxOrder = object.saveTxOrder ?? false; + message.serializer = + object.serializer !== undefined && object.serializer !== null + ? Serializer.fromPartial(object.serializer) + : undefined; + message.endpoint = object.endpoint ?? ""; + message.subnetId = object.subnetId ?? ""; + message.securityGroups = object.securityGroups?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(YDSTarget.$type, YDSTarget); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/datatransfer/v1/transfer.ts b/src/generated/yandex/cloud/datatransfer/v1/transfer.ts index 8df44cb8..7c20a39e 100644 --- a/src/generated/yandex/cloud/datatransfer/v1/transfer.ts +++ b/src/generated/yandex/cloud/datatransfer/v1/transfer.ts @@ -145,9 +145,12 @@ export interface Transfer { labels: { [key: string]: string }; source?: Endpoint; target?: Endpoint; + runtime?: Runtime; status: TransferStatus; type: TransferType; warning: string; + transformation?: Transformation; + prestable: boolean; } export interface Transfer_LabelsEntry { @@ -156,6 +159,233 @@ export interface Transfer_LabelsEntry { value: string; } +export interface Runtime { + $type: "yandex.cloud.datatransfer.v1.Runtime"; + ycRuntime?: YcRuntime | undefined; +} + +export interface ShardingUploadParams { + $type: "yandex.cloud.datatransfer.v1.ShardingUploadParams"; + jobCount: number; + processCount: number; +} + +export interface YcRuntime { + $type: "yandex.cloud.datatransfer.v1.YcRuntime"; + jobCount: number; + uploadShardParams?: ShardingUploadParams; +} + +/** Mask function */ +export interface MaskFunction { + $type: "yandex.cloud.datatransfer.v1.MaskFunction"; + /** Hash mask function */ + maskFunctionHash?: MaskFunctionHash | undefined; +} + +/** Hash data using HMAC */ +export interface MaskFunctionHash { + $type: "yandex.cloud.datatransfer.v1.MaskFunctionHash"; + /** + * This string will be used in the HMAC(sha256, salt) function applied to the + * column data. + */ + userDefinedSalt: string; +} + +/** Filter tables using lists of included and excluded tables. */ +export interface TablesFilter { + $type: "yandex.cloud.datatransfer.v1.TablesFilter"; + /** List of tables that will be included to transfer */ + includeTables: string[]; + /** List of tables that will be excluded to transfer */ + excludeTables: string[]; +} + +/** Filter columns using lists of included and excluded columns. */ +export interface ColumnsFilter { + $type: "yandex.cloud.datatransfer.v1.ColumnsFilter"; + /** List of columns that will be included to transfer */ + includeColumns: string[]; + /** List of columns that will be excluded to transfer */ + excludeColumns: string[]; +} + +/** Mask field transformer allows you to hash data */ +export interface MaskFieldTransformer { + $type: "yandex.cloud.datatransfer.v1.MaskFieldTransformer"; + /** List of included and excluded tables */ + tables?: TablesFilter; + /** Specify the name of the column for data masking (a regular expression). */ + columns: string[]; + /** Mask function */ + function?: MaskFunction; +} + +/** Set up a list of table columns to transfer */ +export interface FilterColumnsTransformer { + $type: "yandex.cloud.datatransfer.v1.FilterColumnsTransformer"; + /** List of the tables to filter using lists of included and excluded tables. */ + tables?: TablesFilter; + /** + * List of the columns to transfer to the target tables using lists of included and + * excluded columns. + */ + columns?: ColumnsFilter; +} + +export interface Table { + $type: "yandex.cloud.datatransfer.v1.Table"; + nameSpace: string; + name: string; +} + +/** Specify rule for renaming table */ +export interface RenameTable { + $type: "yandex.cloud.datatransfer.v1.RenameTable"; + /** Specify the current names of the table in the source */ + originalName?: Table; + /** Specify the new names for this table in the target */ + newName?: Table; +} + +/** + * Set rules for renaming tables by specifying the current names of the tables in + * the source and new names for these tables in the target. + */ +export interface RenameTablesTransformer { + $type: "yandex.cloud.datatransfer.v1.RenameTablesTransformer"; + /** List of renaming rules */ + renameTables: RenameTable[]; +} + +/** Override primary keys */ +export interface ReplacePrimaryKeyTransformer { + $type: "yandex.cloud.datatransfer.v1.ReplacePrimaryKeyTransformer"; + /** List of included and excluded tables */ + tables?: TablesFilter; + /** List of columns to be used as primary keys */ + keys: string[]; +} + +/** + * Convert column values to strings + * The values will be converted depending on the source type + * Conversion rules are described here: + * https://cloud.yandex.com/en/docs/data-transfer/concepts/data-transformation#convert-to-string + */ +export interface ToStringTransformer { + $type: "yandex.cloud.datatransfer.v1.ToStringTransformer"; + /** List of included and excluded tables */ + tables?: TablesFilter; + /** List of included and excluded columns */ + columns?: ColumnsFilter; +} + +/** + * Set the number of shards for particular tables and a list of columns whose + * values will be used for calculating a hash to determine a shard. + */ +export interface SharderTransformer { + $type: "yandex.cloud.datatransfer.v1.SharderTransformer"; + /** List of included and excluded tables */ + tables?: TablesFilter; + /** List of included and excluded columns */ + columns?: ColumnsFilter; + /** Number of shards */ + shardsCount: number; +} + +/** + * A transfer splits the X table into multiple tables (X_1, X_2, ..., X_n) based on + * data. + * If a row was located in the X table before it was split, it is now in the X_i + * table, + * where i is determined by the column list and split string parameters. + * Example: + * If the column list has two columns, month of birth and gender, specified and the + * split string states @, + * information about an employee whose name is John and who was born on February + * 11, 1984, + * from the Employees table will get to a new table named Employees@February@male. + */ +export interface TableSplitterTransformer { + $type: "yandex.cloud.datatransfer.v1.TableSplitterTransformer"; + /** List of included and excluded tables */ + tables?: TablesFilter; + /** Specify the columns in the tables to be partitioned. */ + columns: string[]; + /** Specify the split string to be used for merging components in a new table name. */ + splitter: string; +} + +/** + * This filter only applies to transfers with queues (Logbroker or Apache Kafka®) + * as a data source. + * When running a transfer, only the strings meeting the specified criteria remain + * in a changefeed. + */ +export interface FilterRowsTransformer { + $type: "yandex.cloud.datatransfer.v1.FilterRowsTransformer"; + /** List of included and excluded tables. */ + tables?: TablesFilter; + /** + * Filtering criterion. This can be comparison operators for numeric, string, and + * Boolean values, + * comparison to NULL, and checking whether a substring is part of a string. + * Details here: + * https://yandex.cloud/en-ru/docs/data-transfer/concepts/data-transformation#append-only-sources. + * Deprecated: Use filters instead. + * + * @deprecated + */ + filter: string; + /** + * Data is transported if it satisfies at least one of filters. Consider that there + * is OR statement between filters. + * Each filter can be comparison operators for numeric, string, and Boolean values, + * comparison to NULL, and + * checking whether a substring is part of a string. + * Details in docs: + * https://yandex.cloud/en-ru/docs/data-transfer/concepts/data-transformation#append-only-sources. + */ + filters: string[]; +} + +/** + * Some transformers may have limitations and only apply to some source-target + * pairs. + */ +export interface Transformer { + $type: "yandex.cloud.datatransfer.v1.Transformer"; + maskField?: MaskFieldTransformer | undefined; + filterColumns?: FilterColumnsTransformer | undefined; + renameTables?: RenameTablesTransformer | undefined; + replacePrimaryKey?: ReplacePrimaryKeyTransformer | undefined; + convertToString?: ToStringTransformer | undefined; + sharderTransformer?: SharderTransformer | undefined; + tableSplitterTransformer?: TableSplitterTransformer | undefined; + filterRows?: FilterRowsTransformer | undefined; +} + +/** + * Transformation is converting data using special transformer functions. + * These functions are executed on a data stream, applied to each data change item, + * and transform them. + * A transformer can be run at both the metadata and data levels. + * Data can only be transformed if the source and target are of different types. + */ +export interface Transformation { + $type: "yandex.cloud.datatransfer.v1.Transformation"; + /** + * Transformers are set as a list. + * When activating a transfer, a transformation plan is made for the tables that + * match the specified criteria. + * Transformers are applied to the tables in the sequence specified in the list. + */ + transformers: Transformer[]; +} + const baseTransfer: object = { $type: "yandex.cloud.datatransfer.v1.Transfer", id: "", @@ -165,6 +395,7 @@ const baseTransfer: object = { status: 0, type: 0, warning: "", + prestable: false, }; export const Transfer = { @@ -202,6 +433,9 @@ export const Transfer = { if (message.target !== undefined) { Endpoint.encode(message.target, writer.uint32(66).fork()).ldelim(); } + if (message.runtime !== undefined) { + Runtime.encode(message.runtime, writer.uint32(74).fork()).ldelim(); + } if (message.status !== 0) { writer.uint32(80).int32(message.status); } @@ -211,6 +445,15 @@ export const Transfer = { if (message.warning !== "") { writer.uint32(122).string(message.warning); } + if (message.transformation !== undefined) { + Transformation.encode( + message.transformation, + writer.uint32(138).fork() + ).ldelim(); + } + if (message.prestable === true) { + writer.uint32(176).bool(message.prestable); + } return writer; }, @@ -246,6 +489,9 @@ export const Transfer = { case 8: message.target = Endpoint.decode(reader, reader.uint32()); break; + case 9: + message.runtime = Runtime.decode(reader, reader.uint32()); + break; case 10: message.status = reader.int32() as any; break; @@ -255,6 +501,15 @@ export const Transfer = { case 15: message.warning = reader.string(); break; + case 17: + message.transformation = Transformation.decode( + reader, + reader.uint32() + ); + break; + case 22: + message.prestable = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -293,6 +548,10 @@ export const Transfer = { object.target !== undefined && object.target !== null ? Endpoint.fromJSON(object.target) : undefined; + message.runtime = + object.runtime !== undefined && object.runtime !== null + ? Runtime.fromJSON(object.runtime) + : undefined; message.status = object.status !== undefined && object.status !== null ? transferStatusFromJSON(object.status) @@ -305,6 +564,14 @@ export const Transfer = { object.warning !== undefined && object.warning !== null ? String(object.warning) : ""; + message.transformation = + object.transformation !== undefined && object.transformation !== null + ? Transformation.fromJSON(object.transformation) + : undefined; + message.prestable = + object.prestable !== undefined && object.prestable !== null + ? Boolean(object.prestable) + : false; return message; }, @@ -329,10 +596,19 @@ export const Transfer = { (obj.target = message.target ? Endpoint.toJSON(message.target) : undefined); + message.runtime !== undefined && + (obj.runtime = message.runtime + ? Runtime.toJSON(message.runtime) + : undefined); message.status !== undefined && (obj.status = transferStatusToJSON(message.status)); message.type !== undefined && (obj.type = transferTypeToJSON(message.type)); message.warning !== undefined && (obj.warning = message.warning); + message.transformation !== undefined && + (obj.transformation = message.transformation + ? Transformation.toJSON(message.transformation) + : undefined); + message.prestable !== undefined && (obj.prestable = message.prestable); return obj; }, @@ -358,9 +634,18 @@ export const Transfer = { object.target !== undefined && object.target !== null ? Endpoint.fromPartial(object.target) : undefined; + message.runtime = + object.runtime !== undefined && object.runtime !== null + ? Runtime.fromPartial(object.runtime) + : undefined; message.status = object.status ?? 0; message.type = object.type ?? 0; message.warning = object.warning ?? ""; + message.transformation = + object.transformation !== undefined && object.transformation !== null + ? Transformation.fromPartial(object.transformation) + : undefined; + message.prestable = object.prestable ?? false; return message; }, }; @@ -443,32 +728,1818 @@ export const Transfer_LabelsEntry = { messageTypeRegistry.set(Transfer_LabelsEntry.$type, Transfer_LabelsEntry); -type Builtin = - | Date - | Function - | Uint8Array - | string - | number - | boolean - | undefined; +const baseRuntime: object = { $type: "yandex.cloud.datatransfer.v1.Runtime" }; -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in Exclude]?: DeepPartial } - : Partial; +export const Runtime = { + $type: "yandex.cloud.datatransfer.v1.Runtime" as const, -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude | "$type">, - never - >; + encode( + message: Runtime, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ycRuntime !== undefined) { + YcRuntime.encode(message.ycRuntime, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Runtime { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRuntime } as Runtime; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.ycRuntime = YcRuntime.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Runtime { + const message = { ...baseRuntime } as Runtime; + message.ycRuntime = + object.ycRuntime !== undefined && object.ycRuntime !== null + ? YcRuntime.fromJSON(object.ycRuntime) + : undefined; + return message; + }, + + toJSON(message: Runtime): unknown { + const obj: any = {}; + message.ycRuntime !== undefined && + (obj.ycRuntime = message.ycRuntime + ? YcRuntime.toJSON(message.ycRuntime) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Runtime { + const message = { ...baseRuntime } as Runtime; + message.ycRuntime = + object.ycRuntime !== undefined && object.ycRuntime !== null + ? YcRuntime.fromPartial(object.ycRuntime) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Runtime.$type, Runtime); + +const baseShardingUploadParams: object = { + $type: "yandex.cloud.datatransfer.v1.ShardingUploadParams", + jobCount: 0, + processCount: 0, +}; + +export const ShardingUploadParams = { + $type: "yandex.cloud.datatransfer.v1.ShardingUploadParams" as const, + + encode( + message: ShardingUploadParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobCount !== 0) { + writer.uint32(8).int64(message.jobCount); + } + if (message.processCount !== 0) { + writer.uint32(16).int64(message.processCount); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ShardingUploadParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseShardingUploadParams } as ShardingUploadParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobCount = longToNumber(reader.int64() as Long); + break; + case 2: + message.processCount = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ShardingUploadParams { + const message = { ...baseShardingUploadParams } as ShardingUploadParams; + message.jobCount = + object.jobCount !== undefined && object.jobCount !== null + ? Number(object.jobCount) + : 0; + message.processCount = + object.processCount !== undefined && object.processCount !== null + ? Number(object.processCount) + : 0; + return message; + }, + + toJSON(message: ShardingUploadParams): unknown { + const obj: any = {}; + message.jobCount !== undefined && + (obj.jobCount = Math.round(message.jobCount)); + message.processCount !== undefined && + (obj.processCount = Math.round(message.processCount)); + return obj; + }, + + fromPartial, I>>( + object: I + ): ShardingUploadParams { + const message = { ...baseShardingUploadParams } as ShardingUploadParams; + message.jobCount = object.jobCount ?? 0; + message.processCount = object.processCount ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(ShardingUploadParams.$type, ShardingUploadParams); + +const baseYcRuntime: object = { + $type: "yandex.cloud.datatransfer.v1.YcRuntime", + jobCount: 0, +}; + +export const YcRuntime = { + $type: "yandex.cloud.datatransfer.v1.YcRuntime" as const, + + encode( + message: YcRuntime, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jobCount !== 0) { + writer.uint32(8).int64(message.jobCount); + } + if (message.uploadShardParams !== undefined) { + ShardingUploadParams.encode( + message.uploadShardParams, + writer.uint32(66).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): YcRuntime { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseYcRuntime } as YcRuntime; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jobCount = longToNumber(reader.int64() as Long); + break; + case 8: + message.uploadShardParams = ShardingUploadParams.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): YcRuntime { + const message = { ...baseYcRuntime } as YcRuntime; + message.jobCount = + object.jobCount !== undefined && object.jobCount !== null + ? Number(object.jobCount) + : 0; + message.uploadShardParams = + object.uploadShardParams !== undefined && + object.uploadShardParams !== null + ? ShardingUploadParams.fromJSON(object.uploadShardParams) + : undefined; + return message; + }, + + toJSON(message: YcRuntime): unknown { + const obj: any = {}; + message.jobCount !== undefined && + (obj.jobCount = Math.round(message.jobCount)); + message.uploadShardParams !== undefined && + (obj.uploadShardParams = message.uploadShardParams + ? ShardingUploadParams.toJSON(message.uploadShardParams) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): YcRuntime { + const message = { ...baseYcRuntime } as YcRuntime; + message.jobCount = object.jobCount ?? 0; + message.uploadShardParams = + object.uploadShardParams !== undefined && + object.uploadShardParams !== null + ? ShardingUploadParams.fromPartial(object.uploadShardParams) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(YcRuntime.$type, YcRuntime); + +const baseMaskFunction: object = { + $type: "yandex.cloud.datatransfer.v1.MaskFunction", +}; + +export const MaskFunction = { + $type: "yandex.cloud.datatransfer.v1.MaskFunction" as const, + + encode( + message: MaskFunction, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.maskFunctionHash !== undefined) { + MaskFunctionHash.encode( + message.maskFunctionHash, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MaskFunction { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMaskFunction } as MaskFunction; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maskFunctionHash = MaskFunctionHash.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MaskFunction { + const message = { ...baseMaskFunction } as MaskFunction; + message.maskFunctionHash = + object.maskFunctionHash !== undefined && object.maskFunctionHash !== null + ? MaskFunctionHash.fromJSON(object.maskFunctionHash) + : undefined; + return message; + }, + + toJSON(message: MaskFunction): unknown { + const obj: any = {}; + message.maskFunctionHash !== undefined && + (obj.maskFunctionHash = message.maskFunctionHash + ? MaskFunctionHash.toJSON(message.maskFunctionHash) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MaskFunction { + const message = { ...baseMaskFunction } as MaskFunction; + message.maskFunctionHash = + object.maskFunctionHash !== undefined && object.maskFunctionHash !== null + ? MaskFunctionHash.fromPartial(object.maskFunctionHash) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MaskFunction.$type, MaskFunction); + +const baseMaskFunctionHash: object = { + $type: "yandex.cloud.datatransfer.v1.MaskFunctionHash", + userDefinedSalt: "", +}; + +export const MaskFunctionHash = { + $type: "yandex.cloud.datatransfer.v1.MaskFunctionHash" as const, + + encode( + message: MaskFunctionHash, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.userDefinedSalt !== "") { + writer.uint32(10).string(message.userDefinedSalt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MaskFunctionHash { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMaskFunctionHash } as MaskFunctionHash; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userDefinedSalt = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MaskFunctionHash { + const message = { ...baseMaskFunctionHash } as MaskFunctionHash; + message.userDefinedSalt = + object.userDefinedSalt !== undefined && object.userDefinedSalt !== null + ? String(object.userDefinedSalt) + : ""; + return message; + }, + + toJSON(message: MaskFunctionHash): unknown { + const obj: any = {}; + message.userDefinedSalt !== undefined && + (obj.userDefinedSalt = message.userDefinedSalt); + return obj; + }, + + fromPartial, I>>( + object: I + ): MaskFunctionHash { + const message = { ...baseMaskFunctionHash } as MaskFunctionHash; + message.userDefinedSalt = object.userDefinedSalt ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(MaskFunctionHash.$type, MaskFunctionHash); + +const baseTablesFilter: object = { + $type: "yandex.cloud.datatransfer.v1.TablesFilter", + includeTables: "", + excludeTables: "", +}; + +export const TablesFilter = { + $type: "yandex.cloud.datatransfer.v1.TablesFilter" as const, + + encode( + message: TablesFilter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.includeTables) { + writer.uint32(10).string(v!); + } + for (const v of message.excludeTables) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TablesFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTablesFilter } as TablesFilter; + message.includeTables = []; + message.excludeTables = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.includeTables.push(reader.string()); + break; + case 2: + message.excludeTables.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TablesFilter { + const message = { ...baseTablesFilter } as TablesFilter; + message.includeTables = (object.includeTables ?? []).map((e: any) => + String(e) + ); + message.excludeTables = (object.excludeTables ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: TablesFilter): unknown { + const obj: any = {}; + if (message.includeTables) { + obj.includeTables = message.includeTables.map((e) => e); + } else { + obj.includeTables = []; + } + if (message.excludeTables) { + obj.excludeTables = message.excludeTables.map((e) => e); + } else { + obj.excludeTables = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): TablesFilter { + const message = { ...baseTablesFilter } as TablesFilter; + message.includeTables = object.includeTables?.map((e) => e) || []; + message.excludeTables = object.excludeTables?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(TablesFilter.$type, TablesFilter); + +const baseColumnsFilter: object = { + $type: "yandex.cloud.datatransfer.v1.ColumnsFilter", + includeColumns: "", + excludeColumns: "", +}; + +export const ColumnsFilter = { + $type: "yandex.cloud.datatransfer.v1.ColumnsFilter" as const, + + encode( + message: ColumnsFilter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.includeColumns) { + writer.uint32(10).string(v!); + } + for (const v of message.excludeColumns) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ColumnsFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseColumnsFilter } as ColumnsFilter; + message.includeColumns = []; + message.excludeColumns = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.includeColumns.push(reader.string()); + break; + case 2: + message.excludeColumns.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ColumnsFilter { + const message = { ...baseColumnsFilter } as ColumnsFilter; + message.includeColumns = (object.includeColumns ?? []).map((e: any) => + String(e) + ); + message.excludeColumns = (object.excludeColumns ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: ColumnsFilter): unknown { + const obj: any = {}; + if (message.includeColumns) { + obj.includeColumns = message.includeColumns.map((e) => e); + } else { + obj.includeColumns = []; + } + if (message.excludeColumns) { + obj.excludeColumns = message.excludeColumns.map((e) => e); + } else { + obj.excludeColumns = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ColumnsFilter { + const message = { ...baseColumnsFilter } as ColumnsFilter; + message.includeColumns = object.includeColumns?.map((e) => e) || []; + message.excludeColumns = object.excludeColumns?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(ColumnsFilter.$type, ColumnsFilter); + +const baseMaskFieldTransformer: object = { + $type: "yandex.cloud.datatransfer.v1.MaskFieldTransformer", + columns: "", +}; + +export const MaskFieldTransformer = { + $type: "yandex.cloud.datatransfer.v1.MaskFieldTransformer" as const, + + encode( + message: MaskFieldTransformer, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.tables !== undefined) { + TablesFilter.encode(message.tables, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.columns) { + writer.uint32(18).string(v!); + } + if (message.function !== undefined) { + MaskFunction.encode(message.function, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MaskFieldTransformer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMaskFieldTransformer } as MaskFieldTransformer; + message.columns = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tables = TablesFilter.decode(reader, reader.uint32()); + break; + case 2: + message.columns.push(reader.string()); + break; + case 3: + message.function = MaskFunction.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MaskFieldTransformer { + const message = { ...baseMaskFieldTransformer } as MaskFieldTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromJSON(object.tables) + : undefined; + message.columns = (object.columns ?? []).map((e: any) => String(e)); + message.function = + object.function !== undefined && object.function !== null + ? MaskFunction.fromJSON(object.function) + : undefined; + return message; + }, + + toJSON(message: MaskFieldTransformer): unknown { + const obj: any = {}; + message.tables !== undefined && + (obj.tables = message.tables + ? TablesFilter.toJSON(message.tables) + : undefined); + if (message.columns) { + obj.columns = message.columns.map((e) => e); + } else { + obj.columns = []; + } + message.function !== undefined && + (obj.function = message.function + ? MaskFunction.toJSON(message.function) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MaskFieldTransformer { + const message = { ...baseMaskFieldTransformer } as MaskFieldTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromPartial(object.tables) + : undefined; + message.columns = object.columns?.map((e) => e) || []; + message.function = + object.function !== undefined && object.function !== null + ? MaskFunction.fromPartial(object.function) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MaskFieldTransformer.$type, MaskFieldTransformer); + +const baseFilterColumnsTransformer: object = { + $type: "yandex.cloud.datatransfer.v1.FilterColumnsTransformer", +}; + +export const FilterColumnsTransformer = { + $type: "yandex.cloud.datatransfer.v1.FilterColumnsTransformer" as const, + + encode( + message: FilterColumnsTransformer, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.tables !== undefined) { + TablesFilter.encode(message.tables, writer.uint32(10).fork()).ldelim(); + } + if (message.columns !== undefined) { + ColumnsFilter.encode(message.columns, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): FilterColumnsTransformer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseFilterColumnsTransformer, + } as FilterColumnsTransformer; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tables = TablesFilter.decode(reader, reader.uint32()); + break; + case 2: + message.columns = ColumnsFilter.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FilterColumnsTransformer { + const message = { + ...baseFilterColumnsTransformer, + } as FilterColumnsTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromJSON(object.tables) + : undefined; + message.columns = + object.columns !== undefined && object.columns !== null + ? ColumnsFilter.fromJSON(object.columns) + : undefined; + return message; + }, + + toJSON(message: FilterColumnsTransformer): unknown { + const obj: any = {}; + message.tables !== undefined && + (obj.tables = message.tables + ? TablesFilter.toJSON(message.tables) + : undefined); + message.columns !== undefined && + (obj.columns = message.columns + ? ColumnsFilter.toJSON(message.columns) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): FilterColumnsTransformer { + const message = { + ...baseFilterColumnsTransformer, + } as FilterColumnsTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromPartial(object.tables) + : undefined; + message.columns = + object.columns !== undefined && object.columns !== null + ? ColumnsFilter.fromPartial(object.columns) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + FilterColumnsTransformer.$type, + FilterColumnsTransformer +); + +const baseTable: object = { + $type: "yandex.cloud.datatransfer.v1.Table", + nameSpace: "", + name: "", +}; + +export const Table = { + $type: "yandex.cloud.datatransfer.v1.Table" as const, + + encode(message: Table, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nameSpace !== "") { + writer.uint32(10).string(message.nameSpace); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Table { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTable } as Table; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nameSpace = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Table { + const message = { ...baseTable } as Table; + message.nameSpace = + object.nameSpace !== undefined && object.nameSpace !== null + ? String(object.nameSpace) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + return message; + }, + + toJSON(message: Table): unknown { + const obj: any = {}; + message.nameSpace !== undefined && (obj.nameSpace = message.nameSpace); + message.name !== undefined && (obj.name = message.name); + return obj; + }, + + fromPartial, I>>(object: I): Table { + const message = { ...baseTable } as Table; + message.nameSpace = object.nameSpace ?? ""; + message.name = object.name ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Table.$type, Table); + +const baseRenameTable: object = { + $type: "yandex.cloud.datatransfer.v1.RenameTable", +}; + +export const RenameTable = { + $type: "yandex.cloud.datatransfer.v1.RenameTable" as const, + + encode( + message: RenameTable, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.originalName !== undefined) { + Table.encode(message.originalName, writer.uint32(10).fork()).ldelim(); + } + if (message.newName !== undefined) { + Table.encode(message.newName, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RenameTable { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRenameTable } as RenameTable; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.originalName = Table.decode(reader, reader.uint32()); + break; + case 2: + message.newName = Table.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RenameTable { + const message = { ...baseRenameTable } as RenameTable; + message.originalName = + object.originalName !== undefined && object.originalName !== null + ? Table.fromJSON(object.originalName) + : undefined; + message.newName = + object.newName !== undefined && object.newName !== null + ? Table.fromJSON(object.newName) + : undefined; + return message; + }, + + toJSON(message: RenameTable): unknown { + const obj: any = {}; + message.originalName !== undefined && + (obj.originalName = message.originalName + ? Table.toJSON(message.originalName) + : undefined); + message.newName !== undefined && + (obj.newName = message.newName + ? Table.toJSON(message.newName) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): RenameTable { + const message = { ...baseRenameTable } as RenameTable; + message.originalName = + object.originalName !== undefined && object.originalName !== null + ? Table.fromPartial(object.originalName) + : undefined; + message.newName = + object.newName !== undefined && object.newName !== null + ? Table.fromPartial(object.newName) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(RenameTable.$type, RenameTable); + +const baseRenameTablesTransformer: object = { + $type: "yandex.cloud.datatransfer.v1.RenameTablesTransformer", +}; + +export const RenameTablesTransformer = { + $type: "yandex.cloud.datatransfer.v1.RenameTablesTransformer" as const, + + encode( + message: RenameTablesTransformer, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.renameTables) { + RenameTable.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RenameTablesTransformer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRenameTablesTransformer, + } as RenameTablesTransformer; + message.renameTables = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.renameTables.push( + RenameTable.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RenameTablesTransformer { + const message = { + ...baseRenameTablesTransformer, + } as RenameTablesTransformer; + message.renameTables = (object.renameTables ?? []).map((e: any) => + RenameTable.fromJSON(e) + ); + return message; + }, + + toJSON(message: RenameTablesTransformer): unknown { + const obj: any = {}; + if (message.renameTables) { + obj.renameTables = message.renameTables.map((e) => + e ? RenameTable.toJSON(e) : undefined + ); + } else { + obj.renameTables = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): RenameTablesTransformer { + const message = { + ...baseRenameTablesTransformer, + } as RenameTablesTransformer; + message.renameTables = + object.renameTables?.map((e) => RenameTable.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(RenameTablesTransformer.$type, RenameTablesTransformer); + +const baseReplacePrimaryKeyTransformer: object = { + $type: "yandex.cloud.datatransfer.v1.ReplacePrimaryKeyTransformer", + keys: "", +}; + +export const ReplacePrimaryKeyTransformer = { + $type: "yandex.cloud.datatransfer.v1.ReplacePrimaryKeyTransformer" as const, + + encode( + message: ReplacePrimaryKeyTransformer, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.tables !== undefined) { + TablesFilter.encode(message.tables, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.keys) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ReplacePrimaryKeyTransformer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseReplacePrimaryKeyTransformer, + } as ReplacePrimaryKeyTransformer; + message.keys = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tables = TablesFilter.decode(reader, reader.uint32()); + break; + case 2: + message.keys.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ReplacePrimaryKeyTransformer { + const message = { + ...baseReplacePrimaryKeyTransformer, + } as ReplacePrimaryKeyTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromJSON(object.tables) + : undefined; + message.keys = (object.keys ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: ReplacePrimaryKeyTransformer): unknown { + const obj: any = {}; + message.tables !== undefined && + (obj.tables = message.tables + ? TablesFilter.toJSON(message.tables) + : undefined); + if (message.keys) { + obj.keys = message.keys.map((e) => e); + } else { + obj.keys = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ReplacePrimaryKeyTransformer { + const message = { + ...baseReplacePrimaryKeyTransformer, + } as ReplacePrimaryKeyTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromPartial(object.tables) + : undefined; + message.keys = object.keys?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + ReplacePrimaryKeyTransformer.$type, + ReplacePrimaryKeyTransformer +); + +const baseToStringTransformer: object = { + $type: "yandex.cloud.datatransfer.v1.ToStringTransformer", +}; + +export const ToStringTransformer = { + $type: "yandex.cloud.datatransfer.v1.ToStringTransformer" as const, + + encode( + message: ToStringTransformer, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.tables !== undefined) { + TablesFilter.encode(message.tables, writer.uint32(10).fork()).ldelim(); + } + if (message.columns !== undefined) { + ColumnsFilter.encode(message.columns, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ToStringTransformer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseToStringTransformer } as ToStringTransformer; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tables = TablesFilter.decode(reader, reader.uint32()); + break; + case 2: + message.columns = ColumnsFilter.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ToStringTransformer { + const message = { ...baseToStringTransformer } as ToStringTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromJSON(object.tables) + : undefined; + message.columns = + object.columns !== undefined && object.columns !== null + ? ColumnsFilter.fromJSON(object.columns) + : undefined; + return message; + }, + + toJSON(message: ToStringTransformer): unknown { + const obj: any = {}; + message.tables !== undefined && + (obj.tables = message.tables + ? TablesFilter.toJSON(message.tables) + : undefined); + message.columns !== undefined && + (obj.columns = message.columns + ? ColumnsFilter.toJSON(message.columns) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ToStringTransformer { + const message = { ...baseToStringTransformer } as ToStringTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromPartial(object.tables) + : undefined; + message.columns = + object.columns !== undefined && object.columns !== null + ? ColumnsFilter.fromPartial(object.columns) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ToStringTransformer.$type, ToStringTransformer); + +const baseSharderTransformer: object = { + $type: "yandex.cloud.datatransfer.v1.SharderTransformer", + shardsCount: 0, +}; + +export const SharderTransformer = { + $type: "yandex.cloud.datatransfer.v1.SharderTransformer" as const, + + encode( + message: SharderTransformer, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.tables !== undefined) { + TablesFilter.encode(message.tables, writer.uint32(10).fork()).ldelim(); + } + if (message.columns !== undefined) { + ColumnsFilter.encode(message.columns, writer.uint32(18).fork()).ldelim(); + } + if (message.shardsCount !== 0) { + writer.uint32(24).int64(message.shardsCount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SharderTransformer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSharderTransformer } as SharderTransformer; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tables = TablesFilter.decode(reader, reader.uint32()); + break; + case 2: + message.columns = ColumnsFilter.decode(reader, reader.uint32()); + break; + case 3: + message.shardsCount = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SharderTransformer { + const message = { ...baseSharderTransformer } as SharderTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromJSON(object.tables) + : undefined; + message.columns = + object.columns !== undefined && object.columns !== null + ? ColumnsFilter.fromJSON(object.columns) + : undefined; + message.shardsCount = + object.shardsCount !== undefined && object.shardsCount !== null + ? Number(object.shardsCount) + : 0; + return message; + }, + + toJSON(message: SharderTransformer): unknown { + const obj: any = {}; + message.tables !== undefined && + (obj.tables = message.tables + ? TablesFilter.toJSON(message.tables) + : undefined); + message.columns !== undefined && + (obj.columns = message.columns + ? ColumnsFilter.toJSON(message.columns) + : undefined); + message.shardsCount !== undefined && + (obj.shardsCount = Math.round(message.shardsCount)); + return obj; + }, + + fromPartial, I>>( + object: I + ): SharderTransformer { + const message = { ...baseSharderTransformer } as SharderTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromPartial(object.tables) + : undefined; + message.columns = + object.columns !== undefined && object.columns !== null + ? ColumnsFilter.fromPartial(object.columns) + : undefined; + message.shardsCount = object.shardsCount ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(SharderTransformer.$type, SharderTransformer); + +const baseTableSplitterTransformer: object = { + $type: "yandex.cloud.datatransfer.v1.TableSplitterTransformer", + columns: "", + splitter: "", +}; + +export const TableSplitterTransformer = { + $type: "yandex.cloud.datatransfer.v1.TableSplitterTransformer" as const, + + encode( + message: TableSplitterTransformer, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.tables !== undefined) { + TablesFilter.encode(message.tables, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.columns) { + writer.uint32(18).string(v!); + } + if (message.splitter !== "") { + writer.uint32(26).string(message.splitter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): TableSplitterTransformer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTableSplitterTransformer, + } as TableSplitterTransformer; + message.columns = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tables = TablesFilter.decode(reader, reader.uint32()); + break; + case 2: + message.columns.push(reader.string()); + break; + case 3: + message.splitter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TableSplitterTransformer { + const message = { + ...baseTableSplitterTransformer, + } as TableSplitterTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromJSON(object.tables) + : undefined; + message.columns = (object.columns ?? []).map((e: any) => String(e)); + message.splitter = + object.splitter !== undefined && object.splitter !== null + ? String(object.splitter) + : ""; + return message; + }, + + toJSON(message: TableSplitterTransformer): unknown { + const obj: any = {}; + message.tables !== undefined && + (obj.tables = message.tables + ? TablesFilter.toJSON(message.tables) + : undefined); + if (message.columns) { + obj.columns = message.columns.map((e) => e); + } else { + obj.columns = []; + } + message.splitter !== undefined && (obj.splitter = message.splitter); + return obj; + }, + + fromPartial, I>>( + object: I + ): TableSplitterTransformer { + const message = { + ...baseTableSplitterTransformer, + } as TableSplitterTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromPartial(object.tables) + : undefined; + message.columns = object.columns?.map((e) => e) || []; + message.splitter = object.splitter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + TableSplitterTransformer.$type, + TableSplitterTransformer +); + +const baseFilterRowsTransformer: object = { + $type: "yandex.cloud.datatransfer.v1.FilterRowsTransformer", + filter: "", + filters: "", +}; + +export const FilterRowsTransformer = { + $type: "yandex.cloud.datatransfer.v1.FilterRowsTransformer" as const, + + encode( + message: FilterRowsTransformer, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.tables !== undefined) { + TablesFilter.encode(message.tables, writer.uint32(10).fork()).ldelim(); + } + if (message.filter !== "") { + writer.uint32(18).string(message.filter); + } + for (const v of message.filters) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): FilterRowsTransformer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFilterRowsTransformer } as FilterRowsTransformer; + message.filters = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tables = TablesFilter.decode(reader, reader.uint32()); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.filters.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FilterRowsTransformer { + const message = { ...baseFilterRowsTransformer } as FilterRowsTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromJSON(object.tables) + : undefined; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + message.filters = (object.filters ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: FilterRowsTransformer): unknown { + const obj: any = {}; + message.tables !== undefined && + (obj.tables = message.tables + ? TablesFilter.toJSON(message.tables) + : undefined); + message.filter !== undefined && (obj.filter = message.filter); + if (message.filters) { + obj.filters = message.filters.map((e) => e); + } else { + obj.filters = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): FilterRowsTransformer { + const message = { ...baseFilterRowsTransformer } as FilterRowsTransformer; + message.tables = + object.tables !== undefined && object.tables !== null + ? TablesFilter.fromPartial(object.tables) + : undefined; + message.filter = object.filter ?? ""; + message.filters = object.filters?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(FilterRowsTransformer.$type, FilterRowsTransformer); + +const baseTransformer: object = { + $type: "yandex.cloud.datatransfer.v1.Transformer", +}; + +export const Transformer = { + $type: "yandex.cloud.datatransfer.v1.Transformer" as const, + + encode( + message: Transformer, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.maskField !== undefined) { + MaskFieldTransformer.encode( + message.maskField, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.filterColumns !== undefined) { + FilterColumnsTransformer.encode( + message.filterColumns, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.renameTables !== undefined) { + RenameTablesTransformer.encode( + message.renameTables, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.replacePrimaryKey !== undefined) { + ReplacePrimaryKeyTransformer.encode( + message.replacePrimaryKey, + writer.uint32(50).fork() + ).ldelim(); + } + if (message.convertToString !== undefined) { + ToStringTransformer.encode( + message.convertToString, + writer.uint32(58).fork() + ).ldelim(); + } + if (message.sharderTransformer !== undefined) { + SharderTransformer.encode( + message.sharderTransformer, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.tableSplitterTransformer !== undefined) { + TableSplitterTransformer.encode( + message.tableSplitterTransformer, + writer.uint32(106).fork() + ).ldelim(); + } + if (message.filterRows !== undefined) { + FilterRowsTransformer.encode( + message.filterRows, + writer.uint32(114).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Transformer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTransformer } as Transformer; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maskField = MaskFieldTransformer.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.filterColumns = FilterColumnsTransformer.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.renameTables = RenameTablesTransformer.decode( + reader, + reader.uint32() + ); + break; + case 6: + message.replacePrimaryKey = ReplacePrimaryKeyTransformer.decode( + reader, + reader.uint32() + ); + break; + case 7: + message.convertToString = ToStringTransformer.decode( + reader, + reader.uint32() + ); + break; + case 9: + message.sharderTransformer = SharderTransformer.decode( + reader, + reader.uint32() + ); + break; + case 13: + message.tableSplitterTransformer = TableSplitterTransformer.decode( + reader, + reader.uint32() + ); + break; + case 14: + message.filterRows = FilterRowsTransformer.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Transformer { + const message = { ...baseTransformer } as Transformer; + message.maskField = + object.maskField !== undefined && object.maskField !== null + ? MaskFieldTransformer.fromJSON(object.maskField) + : undefined; + message.filterColumns = + object.filterColumns !== undefined && object.filterColumns !== null + ? FilterColumnsTransformer.fromJSON(object.filterColumns) + : undefined; + message.renameTables = + object.renameTables !== undefined && object.renameTables !== null + ? RenameTablesTransformer.fromJSON(object.renameTables) + : undefined; + message.replacePrimaryKey = + object.replacePrimaryKey !== undefined && + object.replacePrimaryKey !== null + ? ReplacePrimaryKeyTransformer.fromJSON(object.replacePrimaryKey) + : undefined; + message.convertToString = + object.convertToString !== undefined && object.convertToString !== null + ? ToStringTransformer.fromJSON(object.convertToString) + : undefined; + message.sharderTransformer = + object.sharderTransformer !== undefined && + object.sharderTransformer !== null + ? SharderTransformer.fromJSON(object.sharderTransformer) + : undefined; + message.tableSplitterTransformer = + object.tableSplitterTransformer !== undefined && + object.tableSplitterTransformer !== null + ? TableSplitterTransformer.fromJSON(object.tableSplitterTransformer) + : undefined; + message.filterRows = + object.filterRows !== undefined && object.filterRows !== null + ? FilterRowsTransformer.fromJSON(object.filterRows) + : undefined; + return message; + }, + + toJSON(message: Transformer): unknown { + const obj: any = {}; + message.maskField !== undefined && + (obj.maskField = message.maskField + ? MaskFieldTransformer.toJSON(message.maskField) + : undefined); + message.filterColumns !== undefined && + (obj.filterColumns = message.filterColumns + ? FilterColumnsTransformer.toJSON(message.filterColumns) + : undefined); + message.renameTables !== undefined && + (obj.renameTables = message.renameTables + ? RenameTablesTransformer.toJSON(message.renameTables) + : undefined); + message.replacePrimaryKey !== undefined && + (obj.replacePrimaryKey = message.replacePrimaryKey + ? ReplacePrimaryKeyTransformer.toJSON(message.replacePrimaryKey) + : undefined); + message.convertToString !== undefined && + (obj.convertToString = message.convertToString + ? ToStringTransformer.toJSON(message.convertToString) + : undefined); + message.sharderTransformer !== undefined && + (obj.sharderTransformer = message.sharderTransformer + ? SharderTransformer.toJSON(message.sharderTransformer) + : undefined); + message.tableSplitterTransformer !== undefined && + (obj.tableSplitterTransformer = message.tableSplitterTransformer + ? TableSplitterTransformer.toJSON(message.tableSplitterTransformer) + : undefined); + message.filterRows !== undefined && + (obj.filterRows = message.filterRows + ? FilterRowsTransformer.toJSON(message.filterRows) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Transformer { + const message = { ...baseTransformer } as Transformer; + message.maskField = + object.maskField !== undefined && object.maskField !== null + ? MaskFieldTransformer.fromPartial(object.maskField) + : undefined; + message.filterColumns = + object.filterColumns !== undefined && object.filterColumns !== null + ? FilterColumnsTransformer.fromPartial(object.filterColumns) + : undefined; + message.renameTables = + object.renameTables !== undefined && object.renameTables !== null + ? RenameTablesTransformer.fromPartial(object.renameTables) + : undefined; + message.replacePrimaryKey = + object.replacePrimaryKey !== undefined && + object.replacePrimaryKey !== null + ? ReplacePrimaryKeyTransformer.fromPartial(object.replacePrimaryKey) + : undefined; + message.convertToString = + object.convertToString !== undefined && object.convertToString !== null + ? ToStringTransformer.fromPartial(object.convertToString) + : undefined; + message.sharderTransformer = + object.sharderTransformer !== undefined && + object.sharderTransformer !== null + ? SharderTransformer.fromPartial(object.sharderTransformer) + : undefined; + message.tableSplitterTransformer = + object.tableSplitterTransformer !== undefined && + object.tableSplitterTransformer !== null + ? TableSplitterTransformer.fromPartial(object.tableSplitterTransformer) + : undefined; + message.filterRows = + object.filterRows !== undefined && object.filterRows !== null + ? FilterRowsTransformer.fromPartial(object.filterRows) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Transformer.$type, Transformer); + +const baseTransformation: object = { + $type: "yandex.cloud.datatransfer.v1.Transformation", +}; + +export const Transformation = { + $type: "yandex.cloud.datatransfer.v1.Transformation" as const, + + encode( + message: Transformation, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.transformers) { + Transformer.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Transformation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTransformation } as Transformation; + message.transformers = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transformers.push( + Transformer.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Transformation { + const message = { ...baseTransformation } as Transformation; + message.transformers = (object.transformers ?? []).map((e: any) => + Transformer.fromJSON(e) + ); + return message; + }, + + toJSON(message: Transformation): unknown { + const obj: any = {}; + if (message.transformers) { + obj.transformers = message.transformers.map((e) => + e ? Transformer.toJSON(e) : undefined + ); + } else { + obj.transformers = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Transformation { + const message = { ...baseTransformation } as Transformation; + message.transformers = + object.transformers?.map((e) => Transformer.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Transformation.$type, Transformation); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/src/generated/yandex/cloud/datatransfer/v1/transfer_service.ts b/src/generated/yandex/cloud/datatransfer/v1/transfer_service.ts index 645886db..1a95700a 100644 --- a/src/generated/yandex/cloud/datatransfer/v1/transfer_service.ts +++ b/src/generated/yandex/cloud/datatransfer/v1/transfer_service.ts @@ -15,7 +15,9 @@ import { } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; import { + Runtime, TransferType, + Transformation, Transfer, transferTypeFromJSON, transferTypeToJSON, @@ -29,11 +31,13 @@ export interface CreateTransferRequest { $type: "yandex.cloud.datatransfer.v1.CreateTransferRequest"; sourceId: string; targetId: string; - name: string; description: string; - labels: { [key: string]: string }; folderId: string; + runtime?: Runtime; type: TransferType; + name: string; + labels: { [key: string]: string }; + transformation?: Transformation; } export interface CreateTransferRequest_LabelsEntry { @@ -53,7 +57,7 @@ export interface UpdateTransferRequest { transferId: string; /** The new description for the transfer. */ description: string; - labels: { [key: string]: string }; + runtime?: Runtime; /** The new transfer name. Must be unique within the folder. */ name: string; /** @@ -64,6 +68,8 @@ export interface UpdateTransferRequest { * the new value replaces the old one instead of being appended to the old one. */ updateMask?: FieldMask; + labels: { [key: string]: string }; + transformation?: Transformation; } export interface UpdateTransferRequest_LabelsEntry { @@ -157,10 +163,10 @@ const baseCreateTransferRequest: object = { $type: "yandex.cloud.datatransfer.v1.CreateTransferRequest", sourceId: "", targetId: "", - name: "", description: "", folderId: "", type: 0, + name: "", }; export const CreateTransferRequest = { @@ -176,12 +182,21 @@ export const CreateTransferRequest = { if (message.targetId !== "") { writer.uint32(18).string(message.targetId); } - if (message.name !== "") { - writer.uint32(58).string(message.name); - } if (message.description !== "") { writer.uint32(26).string(message.description); } + if (message.folderId !== "") { + writer.uint32(34).string(message.folderId); + } + if (message.runtime !== undefined) { + Runtime.encode(message.runtime, writer.uint32(42).fork()).ldelim(); + } + if (message.type !== 0) { + writer.uint32(48).int32(message.type); + } + if (message.name !== "") { + writer.uint32(58).string(message.name); + } Object.entries(message.labels).forEach(([key, value]) => { CreateTransferRequest_LabelsEntry.encode( { @@ -193,11 +208,11 @@ export const CreateTransferRequest = { writer.uint32(66).fork() ).ldelim(); }); - if (message.folderId !== "") { - writer.uint32(34).string(message.folderId); - } - if (message.type !== 0) { - writer.uint32(48).int32(message.type); + if (message.transformation !== undefined) { + Transformation.encode( + message.transformation, + writer.uint32(82).fork() + ).ldelim(); } return writer; }, @@ -219,12 +234,21 @@ export const CreateTransferRequest = { case 2: message.targetId = reader.string(); break; - case 7: - message.name = reader.string(); - break; case 3: message.description = reader.string(); break; + case 4: + message.folderId = reader.string(); + break; + case 5: + message.runtime = Runtime.decode(reader, reader.uint32()); + break; + case 6: + message.type = reader.int32() as any; + break; + case 7: + message.name = reader.string(); + break; case 8: const entry8 = CreateTransferRequest_LabelsEntry.decode( reader, @@ -234,11 +258,11 @@ export const CreateTransferRequest = { message.labels[entry8.key] = entry8.value; } break; - case 4: - message.folderId = reader.string(); - break; - case 6: - message.type = reader.int32() as any; + case 10: + message.transformation = Transformation.decode( + reader, + reader.uint32() + ); break; default: reader.skipType(tag & 7); @@ -258,28 +282,36 @@ export const CreateTransferRequest = { object.targetId !== undefined && object.targetId !== null ? String(object.targetId) : ""; - message.name = - object.name !== undefined && object.name !== null - ? String(object.name) - : ""; message.description = object.description !== undefined && object.description !== null ? String(object.description) : ""; - message.labels = Object.entries(object.labels ?? {}).reduce<{ - [key: string]: string; - }>((acc, [key, value]) => { - acc[key] = String(value); - return acc; - }, {}); message.folderId = object.folderId !== undefined && object.folderId !== null ? String(object.folderId) : ""; + message.runtime = + object.runtime !== undefined && object.runtime !== null + ? Runtime.fromJSON(object.runtime) + : undefined; message.type = object.type !== undefined && object.type !== null ? transferTypeFromJSON(object.type) : 0; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.transformation = + object.transformation !== undefined && object.transformation !== null + ? Transformation.fromJSON(object.transformation) + : undefined; return message; }, @@ -287,17 +319,25 @@ export const CreateTransferRequest = { const obj: any = {}; message.sourceId !== undefined && (obj.sourceId = message.sourceId); message.targetId !== undefined && (obj.targetId = message.targetId); - message.name !== undefined && (obj.name = message.name); message.description !== undefined && (obj.description = message.description); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.runtime !== undefined && + (obj.runtime = message.runtime + ? Runtime.toJSON(message.runtime) + : undefined); + message.type !== undefined && (obj.type = transferTypeToJSON(message.type)); + message.name !== undefined && (obj.name = message.name); obj.labels = {}; if (message.labels) { Object.entries(message.labels).forEach(([k, v]) => { obj.labels[k] = v; }); } - message.folderId !== undefined && (obj.folderId = message.folderId); - message.type !== undefined && (obj.type = transferTypeToJSON(message.type)); + message.transformation !== undefined && + (obj.transformation = message.transformation + ? Transformation.toJSON(message.transformation) + : undefined); return obj; }, @@ -307,8 +347,14 @@ export const CreateTransferRequest = { const message = { ...baseCreateTransferRequest } as CreateTransferRequest; message.sourceId = object.sourceId ?? ""; message.targetId = object.targetId ?? ""; - message.name = object.name ?? ""; message.description = object.description ?? ""; + message.folderId = object.folderId ?? ""; + message.runtime = + object.runtime !== undefined && object.runtime !== null + ? Runtime.fromPartial(object.runtime) + : undefined; + message.type = object.type ?? 0; + message.name = object.name ?? ""; message.labels = Object.entries(object.labels ?? {}).reduce<{ [key: string]: string; }>((acc, [key, value]) => { @@ -317,8 +363,10 @@ export const CreateTransferRequest = { } return acc; }, {}); - message.folderId = object.folderId ?? ""; - message.type = object.type ?? 0; + message.transformation = + object.transformation !== undefined && object.transformation !== null + ? Transformation.fromPartial(object.transformation) + : undefined; return message; }, }; @@ -496,6 +544,15 @@ export const UpdateTransferRequest = { if (message.description !== "") { writer.uint32(18).string(message.description); } + if (message.runtime !== undefined) { + Runtime.encode(message.runtime, writer.uint32(26).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(42).fork()).ldelim(); + } Object.entries(message.labels).forEach(([key, value]) => { UpdateTransferRequest_LabelsEntry.encode( { @@ -507,11 +564,11 @@ export const UpdateTransferRequest = { writer.uint32(50).fork() ).ldelim(); }); - if (message.name !== "") { - writer.uint32(34).string(message.name); - } - if (message.updateMask !== undefined) { - FieldMask.encode(message.updateMask, writer.uint32(42).fork()).ldelim(); + if (message.transformation !== undefined) { + Transformation.encode( + message.transformation, + writer.uint32(66).fork() + ).ldelim(); } return writer; }, @@ -533,6 +590,15 @@ export const UpdateTransferRequest = { case 2: message.description = reader.string(); break; + case 3: + message.runtime = Runtime.decode(reader, reader.uint32()); + break; + case 4: + message.name = reader.string(); + break; + case 5: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; case 6: const entry6 = UpdateTransferRequest_LabelsEntry.decode( reader, @@ -542,11 +608,11 @@ export const UpdateTransferRequest = { message.labels[entry6.key] = entry6.value; } break; - case 4: - message.name = reader.string(); - break; - case 5: - message.updateMask = FieldMask.decode(reader, reader.uint32()); + case 8: + message.transformation = Transformation.decode( + reader, + reader.uint32() + ); break; default: reader.skipType(tag & 7); @@ -566,12 +632,10 @@ export const UpdateTransferRequest = { object.description !== undefined && object.description !== null ? String(object.description) : ""; - message.labels = Object.entries(object.labels ?? {}).reduce<{ - [key: string]: string; - }>((acc, [key, value]) => { - acc[key] = String(value); - return acc; - }, {}); + message.runtime = + object.runtime !== undefined && object.runtime !== null + ? Runtime.fromJSON(object.runtime) + : undefined; message.name = object.name !== undefined && object.name !== null ? String(object.name) @@ -580,6 +644,16 @@ export const UpdateTransferRequest = { object.updateMask !== undefined && object.updateMask !== null ? FieldMask.fromJSON(object.updateMask) : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.transformation = + object.transformation !== undefined && object.transformation !== null + ? Transformation.fromJSON(object.transformation) + : undefined; return message; }, @@ -588,16 +662,24 @@ export const UpdateTransferRequest = { message.transferId !== undefined && (obj.transferId = message.transferId); message.description !== undefined && (obj.description = message.description); + message.runtime !== undefined && + (obj.runtime = message.runtime + ? Runtime.toJSON(message.runtime) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); obj.labels = {}; if (message.labels) { Object.entries(message.labels).forEach(([k, v]) => { obj.labels[k] = v; }); } - message.name !== undefined && (obj.name = message.name); - message.updateMask !== undefined && - (obj.updateMask = message.updateMask - ? FieldMask.toJSON(message.updateMask) + message.transformation !== undefined && + (obj.transformation = message.transformation + ? Transformation.toJSON(message.transformation) : undefined); return obj; }, @@ -608,6 +690,15 @@ export const UpdateTransferRequest = { const message = { ...baseUpdateTransferRequest } as UpdateTransferRequest; message.transferId = object.transferId ?? ""; message.description = object.description ?? ""; + message.runtime = + object.runtime !== undefined && object.runtime !== null + ? Runtime.fromPartial(object.runtime) + : undefined; + message.name = object.name ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; message.labels = Object.entries(object.labels ?? {}).reduce<{ [key: string]: string; }>((acc, [key, value]) => { @@ -616,10 +707,9 @@ export const UpdateTransferRequest = { } return acc; }, {}); - message.name = object.name ?? ""; - message.updateMask = - object.updateMask !== undefined && object.updateMask !== null - ? FieldMask.fromPartial(object.updateMask) + message.transformation = + object.transformation !== undefined && object.transformation !== null + ? Transformation.fromPartial(object.transformation) : undefined; return message; }, diff --git a/src/generated/yandex/cloud/dns/index.ts b/src/generated/yandex/cloud/dns/index.ts index f67da9ef..f62c8b7f 100644 --- a/src/generated/yandex/cloud/dns/index.ts +++ b/src/generated/yandex/cloud/dns/index.ts @@ -1,2 +1,2 @@ -export * as dns_zone from './v1/dns_zone' -export * as dns_zone_service from './v1/dns_zone_service' \ No newline at end of file +export * as v1_dns_zone from './v1/dns_zone' +export * as v1_dns_zone_service from './v1/dns_zone_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/dns/v1/dns_zone.ts b/src/generated/yandex/cloud/dns/v1/dns_zone.ts index c4ff1626..2ad74175 100644 --- a/src/generated/yandex/cloud/dns/v1/dns_zone.ts +++ b/src/generated/yandex/cloud/dns/v1/dns_zone.ts @@ -36,6 +36,8 @@ export interface DnsZone { * Indicates whether records within the zone are publicly visible. */ publicVisibility?: PublicVisibility; + /** Prevents accidental zone removal. */ + deletionProtection: boolean; } export interface DnsZone_LabelsEntry { @@ -76,6 +78,7 @@ const baseDnsZone: object = { name: "", description: "", zone: "", + deletionProtection: false, }; export const DnsZone = { @@ -128,6 +131,9 @@ export const DnsZone = { writer.uint32(74).fork() ).ldelim(); } + if (message.deletionProtection === true) { + writer.uint32(80).bool(message.deletionProtection); + } return writer; }, @@ -177,6 +183,9 @@ export const DnsZone = { reader.uint32() ); break; + case 10: + message.deletionProtection = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -224,6 +233,11 @@ export const DnsZone = { object.publicVisibility !== undefined && object.publicVisibility !== null ? PublicVisibility.fromJSON(object.publicVisibility) : undefined; + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; return message; }, @@ -251,6 +265,8 @@ export const DnsZone = { (obj.publicVisibility = message.publicVisibility ? PublicVisibility.toJSON(message.publicVisibility) : undefined); + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); return obj; }, @@ -279,6 +295,7 @@ export const DnsZone = { object.publicVisibility !== undefined && object.publicVisibility !== null ? PublicVisibility.fromPartial(object.publicVisibility) : undefined; + message.deletionProtection = object.deletionProtection ?? false; return message; }, }; diff --git a/src/generated/yandex/cloud/dns/v1/dns_zone_service.ts b/src/generated/yandex/cloud/dns/v1/dns_zone_service.ts index 33bf2619..d175165d 100644 --- a/src/generated/yandex/cloud/dns/v1/dns_zone_service.ts +++ b/src/generated/yandex/cloud/dns/v1/dns_zone_service.ts @@ -131,6 +131,8 @@ export interface CreateDnsZoneRequest { * At least one of two visibility fields must be set. */ publicVisibility?: PublicVisibility; + /** Prevents accidental zone removal. */ + deletionProtection: boolean; } export interface CreateDnsZoneRequest_LabelsEntry { @@ -176,6 +178,8 @@ export interface UpdateDnsZoneRequest { privateVisibility?: PrivateVisibility; /** Public visibility configuration. */ publicVisibility?: PublicVisibility; + /** Prevents accidental zone removal. */ + deletionProtection: boolean; } export interface UpdateDnsZoneRequest_LabelsEntry { @@ -802,6 +806,7 @@ const baseCreateDnsZoneRequest: object = { name: "", description: "", zone: "", + deletionProtection: false, }; export const CreateDnsZoneRequest = { @@ -845,6 +850,9 @@ export const CreateDnsZoneRequest = { writer.uint32(58).fork() ).ldelim(); } + if (message.deletionProtection === true) { + writer.uint32(64).bool(message.deletionProtection); + } return writer; }, @@ -892,6 +900,9 @@ export const CreateDnsZoneRequest = { reader.uint32() ); break; + case 8: + message.deletionProtection = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -933,6 +944,11 @@ export const CreateDnsZoneRequest = { object.publicVisibility !== undefined && object.publicVisibility !== null ? PublicVisibility.fromJSON(object.publicVisibility) : undefined; + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; return message; }, @@ -957,6 +973,8 @@ export const CreateDnsZoneRequest = { (obj.publicVisibility = message.publicVisibility ? PublicVisibility.toJSON(message.publicVisibility) : undefined); + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); return obj; }, @@ -985,6 +1003,7 @@ export const CreateDnsZoneRequest = { object.publicVisibility !== undefined && object.publicVisibility !== null ? PublicVisibility.fromPartial(object.publicVisibility) : undefined; + message.deletionProtection = object.deletionProtection ?? false; return message; }, }; @@ -1146,6 +1165,7 @@ const baseUpdateDnsZoneRequest: object = { dnsZoneId: "", name: "", description: "", + deletionProtection: false, }; export const UpdateDnsZoneRequest = { @@ -1189,6 +1209,9 @@ export const UpdateDnsZoneRequest = { writer.uint32(58).fork() ).ldelim(); } + if (message.deletionProtection === true) { + writer.uint32(64).bool(message.deletionProtection); + } return writer; }, @@ -1236,6 +1259,9 @@ export const UpdateDnsZoneRequest = { reader.uint32() ); break; + case 8: + message.deletionProtection = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -1277,6 +1303,11 @@ export const UpdateDnsZoneRequest = { object.publicVisibility !== undefined && object.publicVisibility !== null ? PublicVisibility.fromJSON(object.publicVisibility) : undefined; + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; return message; }, @@ -1304,6 +1335,8 @@ export const UpdateDnsZoneRequest = { (obj.publicVisibility = message.publicVisibility ? PublicVisibility.toJSON(message.publicVisibility) : undefined); + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); return obj; }, @@ -1335,6 +1368,7 @@ export const UpdateDnsZoneRequest = { object.publicVisibility !== undefined && object.publicVisibility !== null ? PublicVisibility.fromPartial(object.publicVisibility) : undefined; + message.deletionProtection = object.deletionProtection ?? false; return message; }, }; diff --git a/src/generated/yandex/cloud/iam/index.ts b/src/generated/yandex/cloud/iam/index.ts index 5dc371e0..2506f5ae 100644 --- a/src/generated/yandex/cloud/iam/index.ts +++ b/src/generated/yandex/cloud/iam/index.ts @@ -1,14 +1,23 @@ -export * as api_key from './v1/api_key' -export * as api_key_service from './v1/api_key_service' -export * as iam_token_service from './v1/iam_token_service' -export * as key from './v1/key' -export * as key_service from './v1/key_service' -export * as role from './v1/role' -export * as role_service from './v1/role_service' -export * as service_account from './v1/service_account' -export * as service_account_service from './v1/service_account_service' -export * as user_account from './v1/user_account' -export * as user_account_service from './v1/user_account_service' -export * as yandex_passport_user_account_service from './v1/yandex_passport_user_account_service' -export * as access_key from './v1/awscompatibility/access_key' -export * as access_key_service from './v1/awscompatibility/access_key_service' \ No newline at end of file +export * as v1_api_key from './v1/api_key' +export * as v1_api_key_service from './v1/api_key_service' +export * as v1_iam_token_service from './v1/iam_token_service' +export * as v1_key from './v1/key' +export * as v1_key_service from './v1/key_service' +export * as v1_refresh_token from './v1/refresh_token' +export * as v1_refresh_token_service from './v1/refresh_token_service' +export * as v1_resource from './v1/resource' +export * as v1_role from './v1/role' +export * as v1_role_service from './v1/role_service' +export * as v1_service_account from './v1/service_account' +export * as v1_service_account_service from './v1/service_account_service' +export * as v1_service_control from './v1/service_control' +export * as v1_service_control_service from './v1/service_control_service' +export * as v1_user_account from './v1/user_account' +export * as v1_user_account_service from './v1/user_account_service' +export * as v1_yandex_passport_user_account_service from './v1/yandex_passport_user_account_service' +export * as v1_awscompatibility_access_key from './v1/awscompatibility/access_key' +export * as v1_awscompatibility_access_key_service from './v1/awscompatibility/access_key_service' +export * as v1_workload_federated_credential from './v1/workload/federated_credential' +export * as v1_workload_federated_credential_service from './v1/workload/federated_credential_service' +export * as v1_workload_oidc_federation from './v1/workload/oidc/federation' +export * as v1_workload_oidc_federation_service from './v1/workload/oidc/federation_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/iam/v1/api_key.ts b/src/generated/yandex/cloud/iam/v1/api_key.ts index 1e56be47..da1524b9 100644 --- a/src/generated/yandex/cloud/iam/v1/api_key.ts +++ b/src/generated/yandex/cloud/iam/v1/api_key.ts @@ -17,6 +17,12 @@ export interface ApiKey { createdAt?: Date; /** Description of the API key. 0-256 characters long. */ description: string; + /** Timestamp for the last authentication using this API key. */ + lastUsedAt?: Date; + /** Scope of the API key. 0-256 characters long. */ + scope: string; + /** API key expiration timestamp. */ + expiresAt?: Date; } const baseApiKey: object = { @@ -24,6 +30,7 @@ const baseApiKey: object = { id: "", serviceAccountId: "", description: "", + scope: "", }; export const ApiKey = { @@ -48,6 +55,21 @@ export const ApiKey = { if (message.description !== "") { writer.uint32(34).string(message.description); } + if (message.lastUsedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.lastUsedAt), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.scope !== "") { + writer.uint32(50).string(message.scope); + } + if (message.expiresAt !== undefined) { + Timestamp.encode( + toTimestamp(message.expiresAt), + writer.uint32(58).fork() + ).ldelim(); + } return writer; }, @@ -72,6 +94,19 @@ export const ApiKey = { case 4: message.description = reader.string(); break; + case 5: + message.lastUsedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + message.scope = reader.string(); + break; + case 7: + message.expiresAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -96,6 +131,18 @@ export const ApiKey = { object.description !== undefined && object.description !== null ? String(object.description) : ""; + message.lastUsedAt = + object.lastUsedAt !== undefined && object.lastUsedAt !== null + ? fromJsonTimestamp(object.lastUsedAt) + : undefined; + message.scope = + object.scope !== undefined && object.scope !== null + ? String(object.scope) + : ""; + message.expiresAt = + object.expiresAt !== undefined && object.expiresAt !== null + ? fromJsonTimestamp(object.expiresAt) + : undefined; return message; }, @@ -108,6 +155,11 @@ export const ApiKey = { (obj.createdAt = message.createdAt.toISOString()); message.description !== undefined && (obj.description = message.description); + message.lastUsedAt !== undefined && + (obj.lastUsedAt = message.lastUsedAt.toISOString()); + message.scope !== undefined && (obj.scope = message.scope); + message.expiresAt !== undefined && + (obj.expiresAt = message.expiresAt.toISOString()); return obj; }, @@ -117,6 +169,9 @@ export const ApiKey = { message.serviceAccountId = object.serviceAccountId ?? ""; message.createdAt = object.createdAt ?? undefined; message.description = object.description ?? ""; + message.lastUsedAt = object.lastUsedAt ?? undefined; + message.scope = object.scope ?? ""; + message.expiresAt = object.expiresAt ?? undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/iam/v1/api_key_service.ts b/src/generated/yandex/cloud/iam/v1/api_key_service.ts index 95938b8c..78af77f3 100644 --- a/src/generated/yandex/cloud/iam/v1/api_key_service.ts +++ b/src/generated/yandex/cloud/iam/v1/api_key_service.ts @@ -16,6 +16,7 @@ import { import _m0 from "protobufjs/minimal"; import { ApiKey } from "../../../../yandex/cloud/iam/v1/api_key"; import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; import { Operation } from "../../../../yandex/cloud/operation/operation"; export const protobufPackage = "yandex.cloud.iam.v1"; @@ -78,6 +79,10 @@ export interface CreateApiKeyRequest { serviceAccountId: string; /** Description of the API key. */ description: string; + /** Scope of the API key. */ + scope: string; + /** API key expiration timestamp, if not specified, then the API key doesn't expire */ + expiresAt?: Date; } export interface CreateApiKeyResponse { @@ -154,6 +159,36 @@ export interface ListApiKeyOperationsResponse { nextPageToken: string; } +export interface ListApiKeyScopesRequest { + $type: "yandex.cloud.iam.v1.ListApiKeyScopesRequest"; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], + * the service returns a [ListApiKeyScopesResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] to the + * [ListApiKeyScopesResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; +} + +export interface ListApiKeyScopesResponse { + $type: "yandex.cloud.iam.v1.ListApiKeyScopesResponse"; + /** List of scopes */ + scopes: string[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListApiKeyScopesRequest.page_size], use the [next_page_token] as the value + * for the [ListApiKeyScopesRequest.page_token] query parameter in the next list request. + * Each subsequent list request will have its own [next_page_token] to continue paging through the results. + */ + nextPageToken: string; +} + const baseGetApiKeyRequest: object = { $type: "yandex.cloud.iam.v1.GetApiKeyRequest", apiKeyId: "", @@ -391,6 +426,7 @@ const baseCreateApiKeyRequest: object = { $type: "yandex.cloud.iam.v1.CreateApiKeyRequest", serviceAccountId: "", description: "", + scope: "", }; export const CreateApiKeyRequest = { @@ -406,6 +442,15 @@ export const CreateApiKeyRequest = { if (message.description !== "") { writer.uint32(18).string(message.description); } + if (message.scope !== "") { + writer.uint32(26).string(message.scope); + } + if (message.expiresAt !== undefined) { + Timestamp.encode( + toTimestamp(message.expiresAt), + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -422,6 +467,14 @@ export const CreateApiKeyRequest = { case 2: message.description = reader.string(); break; + case 3: + message.scope = reader.string(); + break; + case 4: + message.expiresAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -440,6 +493,14 @@ export const CreateApiKeyRequest = { object.description !== undefined && object.description !== null ? String(object.description) : ""; + message.scope = + object.scope !== undefined && object.scope !== null + ? String(object.scope) + : ""; + message.expiresAt = + object.expiresAt !== undefined && object.expiresAt !== null + ? fromJsonTimestamp(object.expiresAt) + : undefined; return message; }, @@ -449,6 +510,9 @@ export const CreateApiKeyRequest = { (obj.serviceAccountId = message.serviceAccountId); message.description !== undefined && (obj.description = message.description); + message.scope !== undefined && (obj.scope = message.scope); + message.expiresAt !== undefined && + (obj.expiresAt = message.expiresAt.toISOString()); return obj; }, @@ -458,6 +522,8 @@ export const CreateApiKeyRequest = { const message = { ...baseCreateApiKeyRequest } as CreateApiKeyRequest; message.serviceAccountId = object.serviceAccountId ?? ""; message.description = object.description ?? ""; + message.scope = object.scope ?? ""; + message.expiresAt = object.expiresAt ?? undefined; return message; }, }; @@ -1026,6 +1092,181 @@ messageTypeRegistry.set( ListApiKeyOperationsResponse ); +const baseListApiKeyScopesRequest: object = { + $type: "yandex.cloud.iam.v1.ListApiKeyScopesRequest", + pageSize: 0, + pageToken: "", +}; + +export const ListApiKeyScopesRequest = { + $type: "yandex.cloud.iam.v1.ListApiKeyScopesRequest" as const, + + encode( + message: ListApiKeyScopesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.pageSize !== 0) { + writer.uint32(8).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(18).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListApiKeyScopesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListApiKeyScopesRequest, + } as ListApiKeyScopesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 2: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListApiKeyScopesRequest { + const message = { + ...baseListApiKeyScopesRequest, + } as ListApiKeyScopesRequest; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListApiKeyScopesRequest): unknown { + const obj: any = {}; + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListApiKeyScopesRequest { + const message = { + ...baseListApiKeyScopesRequest, + } as ListApiKeyScopesRequest; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListApiKeyScopesRequest.$type, ListApiKeyScopesRequest); + +const baseListApiKeyScopesResponse: object = { + $type: "yandex.cloud.iam.v1.ListApiKeyScopesResponse", + scopes: "", + nextPageToken: "", +}; + +export const ListApiKeyScopesResponse = { + $type: "yandex.cloud.iam.v1.ListApiKeyScopesResponse" as const, + + encode( + message: ListApiKeyScopesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.scopes) { + writer.uint32(10).string(v!); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListApiKeyScopesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListApiKeyScopesResponse, + } as ListApiKeyScopesResponse; + message.scopes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.scopes.push(reader.string()); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListApiKeyScopesResponse { + const message = { + ...baseListApiKeyScopesResponse, + } as ListApiKeyScopesResponse; + message.scopes = (object.scopes ?? []).map((e: any) => String(e)); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListApiKeyScopesResponse): unknown { + const obj: any = {}; + if (message.scopes) { + obj.scopes = message.scopes.map((e) => e); + } else { + obj.scopes = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListApiKeyScopesResponse { + const message = { + ...baseListApiKeyScopesResponse, + } as ListApiKeyScopesResponse; + message.scopes = object.scopes?.map((e) => e) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListApiKeyScopesResponse.$type, + ListApiKeyScopesResponse +); + /** A set of methods for managing API keys. */ export const ApiKeyServiceService = { /** Retrieves the list of API keys for the specified service account. */ @@ -1106,6 +1347,20 @@ export const ApiKeyServiceService = { responseDeserialize: (value: Buffer) => ListApiKeyOperationsResponse.decode(value), }, + /** Retrieves the list of scopes. */ + listScopes: { + path: "/yandex.cloud.iam.v1.ApiKeyService/ListScopes", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListApiKeyScopesRequest) => + Buffer.from(ListApiKeyScopesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListApiKeyScopesRequest.decode(value), + responseSerialize: (value: ListApiKeyScopesResponse) => + Buffer.from(ListApiKeyScopesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListApiKeyScopesResponse.decode(value), + }, } as const; export interface ApiKeyServiceServer extends UntypedServiceImplementation { @@ -1128,6 +1383,11 @@ export interface ApiKeyServiceServer extends UntypedServiceImplementation { ListApiKeyOperationsRequest, ListApiKeyOperationsResponse >; + /** Retrieves the list of scopes. */ + listScopes: handleUnaryCall< + ListApiKeyScopesRequest, + ListApiKeyScopesResponse + >; } export interface ApiKeyServiceClient extends Client { @@ -1258,6 +1518,31 @@ export interface ApiKeyServiceClient extends Client { response: ListApiKeyOperationsResponse ) => void ): ClientUnaryCall; + /** Retrieves the list of scopes. */ + listScopes( + request: ListApiKeyScopesRequest, + callback: ( + error: ServiceError | null, + response: ListApiKeyScopesResponse + ) => void + ): ClientUnaryCall; + listScopes( + request: ListApiKeyScopesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListApiKeyScopesResponse + ) => void + ): ClientUnaryCall; + listScopes( + request: ListApiKeyScopesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListApiKeyScopesResponse + ) => void + ): ClientUnaryCall; } export const ApiKeyServiceClient = makeGenericClientConstructor( @@ -1310,6 +1595,28 @@ export type Exact = P extends Builtin never >; +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); diff --git a/src/generated/yandex/cloud/iam/v1/awscompatibility/access_key.ts b/src/generated/yandex/cloud/iam/v1/awscompatibility/access_key.ts index 3bb1996f..1e86af47 100644 --- a/src/generated/yandex/cloud/iam/v1/awscompatibility/access_key.ts +++ b/src/generated/yandex/cloud/iam/v1/awscompatibility/access_key.ts @@ -28,6 +28,8 @@ export interface AccessKey { * The key is AWS compatible. */ keyId: string; + /** Timestamp for the last authentication using this Access key. */ + lastUsedAt?: Date; } const baseAccessKey: object = { @@ -63,6 +65,12 @@ export const AccessKey = { if (message.keyId !== "") { writer.uint32(42).string(message.keyId); } + if (message.lastUsedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.lastUsedAt), + writer.uint32(58).fork() + ).ldelim(); + } return writer; }, @@ -90,6 +98,11 @@ export const AccessKey = { case 5: message.keyId = reader.string(); break; + case 7: + message.lastUsedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -118,6 +131,10 @@ export const AccessKey = { object.keyId !== undefined && object.keyId !== null ? String(object.keyId) : ""; + message.lastUsedAt = + object.lastUsedAt !== undefined && object.lastUsedAt !== null + ? fromJsonTimestamp(object.lastUsedAt) + : undefined; return message; }, @@ -131,6 +148,8 @@ export const AccessKey = { message.description !== undefined && (obj.description = message.description); message.keyId !== undefined && (obj.keyId = message.keyId); + message.lastUsedAt !== undefined && + (obj.lastUsedAt = message.lastUsedAt.toISOString()); return obj; }, @@ -143,6 +162,7 @@ export const AccessKey = { message.createdAt = object.createdAt ?? undefined; message.description = object.description ?? ""; message.keyId = object.keyId ?? ""; + message.lastUsedAt = object.lastUsedAt ?? undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/iam/v1/iam_token_service.ts b/src/generated/yandex/cloud/iam/v1/iam_token_service.ts index 7d40e056..ac7c8821 100644 --- a/src/generated/yandex/cloud/iam/v1/iam_token_service.ts +++ b/src/generated/yandex/cloud/iam/v1/iam_token_service.ts @@ -50,6 +50,16 @@ export interface CreateIamTokenForServiceAccountRequest { serviceAccountId: string; } +export interface RevokeIamTokenRequest { + $type: "yandex.cloud.iam.v1.RevokeIamTokenRequest"; + iamToken: string; +} + +export interface RevokeIamTokenResponse { + $type: "yandex.cloud.iam.v1.RevokeIamTokenResponse"; + subjectId: string; +} + const baseCreateIamTokenRequest: object = { $type: "yandex.cloud.iam.v1.CreateIamTokenRequest", }; @@ -287,9 +297,139 @@ messageTypeRegistry.set( CreateIamTokenForServiceAccountRequest ); +const baseRevokeIamTokenRequest: object = { + $type: "yandex.cloud.iam.v1.RevokeIamTokenRequest", + iamToken: "", +}; + +export const RevokeIamTokenRequest = { + $type: "yandex.cloud.iam.v1.RevokeIamTokenRequest" as const, + + encode( + message: RevokeIamTokenRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.iamToken !== "") { + writer.uint32(10).string(message.iamToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RevokeIamTokenRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRevokeIamTokenRequest } as RevokeIamTokenRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.iamToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RevokeIamTokenRequest { + const message = { ...baseRevokeIamTokenRequest } as RevokeIamTokenRequest; + message.iamToken = + object.iamToken !== undefined && object.iamToken !== null + ? String(object.iamToken) + : ""; + return message; + }, + + toJSON(message: RevokeIamTokenRequest): unknown { + const obj: any = {}; + message.iamToken !== undefined && (obj.iamToken = message.iamToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): RevokeIamTokenRequest { + const message = { ...baseRevokeIamTokenRequest } as RevokeIamTokenRequest; + message.iamToken = object.iamToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(RevokeIamTokenRequest.$type, RevokeIamTokenRequest); + +const baseRevokeIamTokenResponse: object = { + $type: "yandex.cloud.iam.v1.RevokeIamTokenResponse", + subjectId: "", +}; + +export const RevokeIamTokenResponse = { + $type: "yandex.cloud.iam.v1.RevokeIamTokenResponse" as const, + + encode( + message: RevokeIamTokenResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.subjectId !== "") { + writer.uint32(10).string(message.subjectId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RevokeIamTokenResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRevokeIamTokenResponse } as RevokeIamTokenResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subjectId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RevokeIamTokenResponse { + const message = { ...baseRevokeIamTokenResponse } as RevokeIamTokenResponse; + message.subjectId = + object.subjectId !== undefined && object.subjectId !== null + ? String(object.subjectId) + : ""; + return message; + }, + + toJSON(message: RevokeIamTokenResponse): unknown { + const obj: any = {}; + message.subjectId !== undefined && (obj.subjectId = message.subjectId); + return obj; + }, + + fromPartial, I>>( + object: I + ): RevokeIamTokenResponse { + const message = { ...baseRevokeIamTokenResponse } as RevokeIamTokenResponse; + message.subjectId = object.subjectId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(RevokeIamTokenResponse.$type, RevokeIamTokenResponse); + /** A set of methods for managing IAM tokens. */ export const IamTokenServiceService = { - /** Creates an IAM token for the specified identity. */ + /** Create an IAM token for the specified identity. */ create: { path: "/yandex.cloud.iam.v1.IamTokenService/Create", requestStream: false, @@ -302,7 +442,7 @@ export const IamTokenServiceService = { responseDeserialize: (value: Buffer) => CreateIamTokenResponse.decode(value), }, - /** Create iam token for service account. */ + /** Create an IAM token for service account. */ createForServiceAccount: { path: "/yandex.cloud.iam.v1.IamTokenService/CreateForServiceAccount", requestStream: false, @@ -318,20 +458,35 @@ export const IamTokenServiceService = { responseDeserialize: (value: Buffer) => CreateIamTokenResponse.decode(value), }, + /** Revoke the IAM token. */ + revoke: { + path: "/yandex.cloud.iam.v1.IamTokenService/Revoke", + requestStream: false, + responseStream: false, + requestSerialize: (value: RevokeIamTokenRequest) => + Buffer.from(RevokeIamTokenRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => RevokeIamTokenRequest.decode(value), + responseSerialize: (value: RevokeIamTokenResponse) => + Buffer.from(RevokeIamTokenResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + RevokeIamTokenResponse.decode(value), + }, } as const; export interface IamTokenServiceServer extends UntypedServiceImplementation { - /** Creates an IAM token for the specified identity. */ + /** Create an IAM token for the specified identity. */ create: handleUnaryCall; - /** Create iam token for service account. */ + /** Create an IAM token for service account. */ createForServiceAccount: handleUnaryCall< CreateIamTokenForServiceAccountRequest, CreateIamTokenResponse >; + /** Revoke the IAM token. */ + revoke: handleUnaryCall; } export interface IamTokenServiceClient extends Client { - /** Creates an IAM token for the specified identity. */ + /** Create an IAM token for the specified identity. */ create( request: CreateIamTokenRequest, callback: ( @@ -356,7 +511,7 @@ export interface IamTokenServiceClient extends Client { response: CreateIamTokenResponse ) => void ): ClientUnaryCall; - /** Create iam token for service account. */ + /** Create an IAM token for service account. */ createForServiceAccount( request: CreateIamTokenForServiceAccountRequest, callback: ( @@ -381,6 +536,31 @@ export interface IamTokenServiceClient extends Client { response: CreateIamTokenResponse ) => void ): ClientUnaryCall; + /** Revoke the IAM token. */ + revoke( + request: RevokeIamTokenRequest, + callback: ( + error: ServiceError | null, + response: RevokeIamTokenResponse + ) => void + ): ClientUnaryCall; + revoke( + request: RevokeIamTokenRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: RevokeIamTokenResponse + ) => void + ): ClientUnaryCall; + revoke( + request: RevokeIamTokenRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: RevokeIamTokenResponse + ) => void + ): ClientUnaryCall; } export const IamTokenServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/iam/v1/key.ts b/src/generated/yandex/cloud/iam/v1/key.ts index 4913f4e5..9ba0d6e2 100644 --- a/src/generated/yandex/cloud/iam/v1/key.ts +++ b/src/generated/yandex/cloud/iam/v1/key.ts @@ -23,6 +23,8 @@ export interface Key { keyAlgorithm: Key_Algorithm; /** A public key of the Key resource. */ publicKey: string; + /** Timestamp for the last use of this key. */ + lastUsedAt?: Date; } export enum Key_Algorithm { @@ -101,6 +103,12 @@ export const Key = { if (message.publicKey !== "") { writer.uint32(58).string(message.publicKey); } + if (message.lastUsedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.lastUsedAt), + writer.uint32(74).fork() + ).ldelim(); + } return writer; }, @@ -134,6 +142,11 @@ export const Key = { case 7: message.publicKey = reader.string(); break; + case 9: + message.lastUsedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -170,6 +183,10 @@ export const Key = { object.publicKey !== undefined && object.publicKey !== null ? String(object.publicKey) : ""; + message.lastUsedAt = + object.lastUsedAt !== undefined && object.lastUsedAt !== null + ? fromJsonTimestamp(object.lastUsedAt) + : undefined; return message; }, @@ -187,6 +204,8 @@ export const Key = { message.keyAlgorithm !== undefined && (obj.keyAlgorithm = key_AlgorithmToJSON(message.keyAlgorithm)); message.publicKey !== undefined && (obj.publicKey = message.publicKey); + message.lastUsedAt !== undefined && + (obj.lastUsedAt = message.lastUsedAt.toISOString()); return obj; }, @@ -199,6 +218,7 @@ export const Key = { message.description = object.description ?? ""; message.keyAlgorithm = object.keyAlgorithm ?? 0; message.publicKey = object.publicKey ?? ""; + message.lastUsedAt = object.lastUsedAt ?? undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/iam/v1/refresh_token.ts b/src/generated/yandex/cloud/iam/v1/refresh_token.ts new file mode 100644 index 00000000..7818ac71 --- /dev/null +++ b/src/generated/yandex/cloud/iam/v1/refresh_token.ts @@ -0,0 +1,308 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.iam.v1"; + +export interface RefreshToken { + $type: "yandex.cloud.iam.v1.RefreshToken"; + /** Refresh Token id. */ + id: string; + /** Information about the app for which the Refresh Token was issued. */ + clientInstanceInfo: string; + /** The OAuth client identifier for which the Refresh Token was issued. */ + clientId: string; + /** The subject identifier for whom the Refresh Token was issued. */ + subjectId: string; + /** Refresh token creation time. */ + createdAt?: Date; + /** Refresh token expiration time. */ + expiresAt?: Date; + /** Timestamp for the last authentication using this Refresh Token. */ + lastUsedAt?: Date; + /** + * Protection level of the refresh token. + * + * It shows whether DPOP was used to protect the Refresh Token and and the level of security of the storage used for the DPOP key. + */ + protectionLevel: RefreshToken_ProtectionLevel; +} + +/** Protection level of the refresh token. */ +export enum RefreshToken_ProtectionLevel { + PROTECTION_LEVEL_UNSPECIFIED = 0, + /** NO_PROTECTION - Refresh token without DPOP */ + NO_PROTECTION = 1, + /** INSECURE_KEY_DPOP - Refresh token with dpop. The dpop key is not a YubiKey PIV key with required pin/touch policy and attestation. */ + INSECURE_KEY_DPOP = 2, + /** SECURE_KEY_DPOP - Refresh token with dpop. The dpop key is a YubiKey PIV key with required pin/touch policy and attestation. */ + SECURE_KEY_DPOP = 3, + UNRECOGNIZED = -1, +} + +export function refreshToken_ProtectionLevelFromJSON( + object: any +): RefreshToken_ProtectionLevel { + switch (object) { + case 0: + case "PROTECTION_LEVEL_UNSPECIFIED": + return RefreshToken_ProtectionLevel.PROTECTION_LEVEL_UNSPECIFIED; + case 1: + case "NO_PROTECTION": + return RefreshToken_ProtectionLevel.NO_PROTECTION; + case 2: + case "INSECURE_KEY_DPOP": + return RefreshToken_ProtectionLevel.INSECURE_KEY_DPOP; + case 3: + case "SECURE_KEY_DPOP": + return RefreshToken_ProtectionLevel.SECURE_KEY_DPOP; + case -1: + case "UNRECOGNIZED": + default: + return RefreshToken_ProtectionLevel.UNRECOGNIZED; + } +} + +export function refreshToken_ProtectionLevelToJSON( + object: RefreshToken_ProtectionLevel +): string { + switch (object) { + case RefreshToken_ProtectionLevel.PROTECTION_LEVEL_UNSPECIFIED: + return "PROTECTION_LEVEL_UNSPECIFIED"; + case RefreshToken_ProtectionLevel.NO_PROTECTION: + return "NO_PROTECTION"; + case RefreshToken_ProtectionLevel.INSECURE_KEY_DPOP: + return "INSECURE_KEY_DPOP"; + case RefreshToken_ProtectionLevel.SECURE_KEY_DPOP: + return "SECURE_KEY_DPOP"; + default: + return "UNKNOWN"; + } +} + +const baseRefreshToken: object = { + $type: "yandex.cloud.iam.v1.RefreshToken", + id: "", + clientInstanceInfo: "", + clientId: "", + subjectId: "", + protectionLevel: 0, +}; + +export const RefreshToken = { + $type: "yandex.cloud.iam.v1.RefreshToken" as const, + + encode( + message: RefreshToken, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.clientInstanceInfo !== "") { + writer.uint32(18).string(message.clientInstanceInfo); + } + if (message.clientId !== "") { + writer.uint32(26).string(message.clientId); + } + if (message.subjectId !== "") { + writer.uint32(34).string(message.subjectId); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.expiresAt !== undefined) { + Timestamp.encode( + toTimestamp(message.expiresAt), + writer.uint32(50).fork() + ).ldelim(); + } + if (message.lastUsedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.lastUsedAt), + writer.uint32(58).fork() + ).ldelim(); + } + if (message.protectionLevel !== 0) { + writer.uint32(64).int32(message.protectionLevel); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RefreshToken { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRefreshToken } as RefreshToken; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.clientInstanceInfo = reader.string(); + break; + case 3: + message.clientId = reader.string(); + break; + case 4: + message.subjectId = reader.string(); + break; + case 5: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + message.expiresAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 7: + message.lastUsedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 8: + message.protectionLevel = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RefreshToken { + const message = { ...baseRefreshToken } as RefreshToken; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.clientInstanceInfo = + object.clientInstanceInfo !== undefined && + object.clientInstanceInfo !== null + ? String(object.clientInstanceInfo) + : ""; + message.clientId = + object.clientId !== undefined && object.clientId !== null + ? String(object.clientId) + : ""; + message.subjectId = + object.subjectId !== undefined && object.subjectId !== null + ? String(object.subjectId) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.expiresAt = + object.expiresAt !== undefined && object.expiresAt !== null + ? fromJsonTimestamp(object.expiresAt) + : undefined; + message.lastUsedAt = + object.lastUsedAt !== undefined && object.lastUsedAt !== null + ? fromJsonTimestamp(object.lastUsedAt) + : undefined; + message.protectionLevel = + object.protectionLevel !== undefined && object.protectionLevel !== null + ? refreshToken_ProtectionLevelFromJSON(object.protectionLevel) + : 0; + return message; + }, + + toJSON(message: RefreshToken): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.clientInstanceInfo !== undefined && + (obj.clientInstanceInfo = message.clientInstanceInfo); + message.clientId !== undefined && (obj.clientId = message.clientId); + message.subjectId !== undefined && (obj.subjectId = message.subjectId); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.expiresAt !== undefined && + (obj.expiresAt = message.expiresAt.toISOString()); + message.lastUsedAt !== undefined && + (obj.lastUsedAt = message.lastUsedAt.toISOString()); + message.protectionLevel !== undefined && + (obj.protectionLevel = refreshToken_ProtectionLevelToJSON( + message.protectionLevel + )); + return obj; + }, + + fromPartial, I>>( + object: I + ): RefreshToken { + const message = { ...baseRefreshToken } as RefreshToken; + message.id = object.id ?? ""; + message.clientInstanceInfo = object.clientInstanceInfo ?? ""; + message.clientId = object.clientId ?? ""; + message.subjectId = object.subjectId ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.expiresAt = object.expiresAt ?? undefined; + message.lastUsedAt = object.lastUsedAt ?? undefined; + message.protectionLevel = object.protectionLevel ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(RefreshToken.$type, RefreshToken); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/iam/v1/refresh_token_service.ts b/src/generated/yandex/cloud/iam/v1/refresh_token_service.ts new file mode 100644 index 00000000..bbf6ddd3 --- /dev/null +++ b/src/generated/yandex/cloud/iam/v1/refresh_token_service.ts @@ -0,0 +1,831 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { RefreshToken } from "../../../../yandex/cloud/iam/v1/refresh_token"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.iam.v1"; + +export interface RevokeRefreshTokenMetadata { + $type: "yandex.cloud.iam.v1.RevokeRefreshTokenMetadata"; + subjectId: string; + /** Id of revoked Refresh Tokens. */ + refreshTokenIds: string[]; +} + +export interface ListRefreshTokensRequest { + $type: "yandex.cloud.iam.v1.ListRefreshTokensRequest"; + subjectId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], + * the service returns a [ListRefreshTokensResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] + * to the [ListRefreshTokensResponse.next_page_token] + * returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters refresh tokens listed in the response. + * + * The expression must specify: + * 1. The field name. Currently you can use filtering only on [RefreshToken.client_instance_info], [RefreshToken.client_id] or [RefreshToken.protection_level] fields. + * 2. The operator. An `=` operator can be used for all fields. An 'IN' operator can be used for [RefreshToken.protection_level]. + * 3. The value. The value must be in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-zA-Z][_-a-zA-Z0-9]{1,61}[a-z0-9]`. + * Example of a filter: `client_instance_info="clientInstanceInfo" AND protection_level IN ("INSECURE_KEY_DPOP", "SECURE_KEY_DPOP")`. + */ + filter: string; +} + +export interface ListRefreshTokensResponse { + $type: "yandex.cloud.iam.v1.ListRefreshTokensResponse"; + /** List of Refresh Tokens */ + refreshTokens: RefreshToken[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListRefreshTokensForSubjectRequest.page_size], use + * the [next_page_token] as the value + * for the [ListRefreshTokensForSubjectRequest.page_token] query parameter + * in the next list request. Each subsequent list request will have its own + * [next_page_token] to continue paging through the results. + */ + nextPageToken: string; +} + +/** + * Revoke Refresh Token request. + * If none of the parameters refresh_token_id, refresh_token, or revoke_filter are provided, all Refresh Tokens for the current subject will be revoked. + */ +export interface RevokeRefreshTokenRequest { + $type: "yandex.cloud.iam.v1.RevokeRefreshTokenRequest"; + /** Identifier of the Refresh Token to be revoked. */ + refreshTokenId: string | undefined; + /** The Refresh Token to be revoked. */ + refreshToken: string | undefined; + /** The filter for revoking Refresh Token */ + revokeFilter?: RevokeFilter | undefined; +} + +/** + * The Filter object allows filtering Refresh Tokens that will be revoked. + * It contains three optional fields. + * When multiple fields are provided, they are combined using a logical AND operation. + */ +export interface RevokeFilter { + $type: "yandex.cloud.iam.v1.RevokeFilter"; + /** The OAuth client identifier for which the Refresh Token was issued. */ + clientId: string; + /** + * The subject identifier for whom the Refresh Token was issued. + * If not specified, it defaults to the subject that made the request. + */ + subjectId: string; + /** Information about the app for which the Refresh Token was issued. */ + clientInstanceInfo: string; +} + +export interface RevokeRefreshTokenResponse { + $type: "yandex.cloud.iam.v1.RevokeRefreshTokenResponse"; + /** Id of revoked Refresh Tokens. */ + refreshTokenIds: string[]; +} + +const baseRevokeRefreshTokenMetadata: object = { + $type: "yandex.cloud.iam.v1.RevokeRefreshTokenMetadata", + subjectId: "", + refreshTokenIds: "", +}; + +export const RevokeRefreshTokenMetadata = { + $type: "yandex.cloud.iam.v1.RevokeRefreshTokenMetadata" as const, + + encode( + message: RevokeRefreshTokenMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.subjectId !== "") { + writer.uint32(10).string(message.subjectId); + } + for (const v of message.refreshTokenIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RevokeRefreshTokenMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRevokeRefreshTokenMetadata, + } as RevokeRefreshTokenMetadata; + message.refreshTokenIds = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subjectId = reader.string(); + break; + case 2: + message.refreshTokenIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RevokeRefreshTokenMetadata { + const message = { + ...baseRevokeRefreshTokenMetadata, + } as RevokeRefreshTokenMetadata; + message.subjectId = + object.subjectId !== undefined && object.subjectId !== null + ? String(object.subjectId) + : ""; + message.refreshTokenIds = (object.refreshTokenIds ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: RevokeRefreshTokenMetadata): unknown { + const obj: any = {}; + message.subjectId !== undefined && (obj.subjectId = message.subjectId); + if (message.refreshTokenIds) { + obj.refreshTokenIds = message.refreshTokenIds.map((e) => e); + } else { + obj.refreshTokenIds = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): RevokeRefreshTokenMetadata { + const message = { + ...baseRevokeRefreshTokenMetadata, + } as RevokeRefreshTokenMetadata; + message.subjectId = object.subjectId ?? ""; + message.refreshTokenIds = object.refreshTokenIds?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + RevokeRefreshTokenMetadata.$type, + RevokeRefreshTokenMetadata +); + +const baseListRefreshTokensRequest: object = { + $type: "yandex.cloud.iam.v1.ListRefreshTokensRequest", + subjectId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListRefreshTokensRequest = { + $type: "yandex.cloud.iam.v1.ListRefreshTokensRequest" as const, + + encode( + message: ListRefreshTokensRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.subjectId !== "") { + writer.uint32(10).string(message.subjectId); + } + if (message.pageSize !== 0) { + writer.uint32(32).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(42).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(50).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListRefreshTokensRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListRefreshTokensRequest, + } as ListRefreshTokensRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subjectId = reader.string(); + break; + case 4: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 5: + message.pageToken = reader.string(); + break; + case 6: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListRefreshTokensRequest { + const message = { + ...baseListRefreshTokensRequest, + } as ListRefreshTokensRequest; + message.subjectId = + object.subjectId !== undefined && object.subjectId !== null + ? String(object.subjectId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListRefreshTokensRequest): unknown { + const obj: any = {}; + message.subjectId !== undefined && (obj.subjectId = message.subjectId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListRefreshTokensRequest { + const message = { + ...baseListRefreshTokensRequest, + } as ListRefreshTokensRequest; + message.subjectId = object.subjectId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListRefreshTokensRequest.$type, + ListRefreshTokensRequest +); + +const baseListRefreshTokensResponse: object = { + $type: "yandex.cloud.iam.v1.ListRefreshTokensResponse", + nextPageToken: "", +}; + +export const ListRefreshTokensResponse = { + $type: "yandex.cloud.iam.v1.ListRefreshTokensResponse" as const, + + encode( + message: ListRefreshTokensResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.refreshTokens) { + RefreshToken.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListRefreshTokensResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListRefreshTokensResponse, + } as ListRefreshTokensResponse; + message.refreshTokens = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.refreshTokens.push( + RefreshToken.decode(reader, reader.uint32()) + ); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListRefreshTokensResponse { + const message = { + ...baseListRefreshTokensResponse, + } as ListRefreshTokensResponse; + message.refreshTokens = (object.refreshTokens ?? []).map((e: any) => + RefreshToken.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListRefreshTokensResponse): unknown { + const obj: any = {}; + if (message.refreshTokens) { + obj.refreshTokens = message.refreshTokens.map((e) => + e ? RefreshToken.toJSON(e) : undefined + ); + } else { + obj.refreshTokens = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListRefreshTokensResponse { + const message = { + ...baseListRefreshTokensResponse, + } as ListRefreshTokensResponse; + message.refreshTokens = + object.refreshTokens?.map((e) => RefreshToken.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListRefreshTokensResponse.$type, + ListRefreshTokensResponse +); + +const baseRevokeRefreshTokenRequest: object = { + $type: "yandex.cloud.iam.v1.RevokeRefreshTokenRequest", +}; + +export const RevokeRefreshTokenRequest = { + $type: "yandex.cloud.iam.v1.RevokeRefreshTokenRequest" as const, + + encode( + message: RevokeRefreshTokenRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.refreshTokenId !== undefined) { + writer.uint32(10).string(message.refreshTokenId); + } + if (message.refreshToken !== undefined) { + writer.uint32(18).string(message.refreshToken); + } + if (message.revokeFilter !== undefined) { + RevokeFilter.encode( + message.revokeFilter, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RevokeRefreshTokenRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRevokeRefreshTokenRequest, + } as RevokeRefreshTokenRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.refreshTokenId = reader.string(); + break; + case 2: + message.refreshToken = reader.string(); + break; + case 3: + message.revokeFilter = RevokeFilter.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RevokeRefreshTokenRequest { + const message = { + ...baseRevokeRefreshTokenRequest, + } as RevokeRefreshTokenRequest; + message.refreshTokenId = + object.refreshTokenId !== undefined && object.refreshTokenId !== null + ? String(object.refreshTokenId) + : undefined; + message.refreshToken = + object.refreshToken !== undefined && object.refreshToken !== null + ? String(object.refreshToken) + : undefined; + message.revokeFilter = + object.revokeFilter !== undefined && object.revokeFilter !== null + ? RevokeFilter.fromJSON(object.revokeFilter) + : undefined; + return message; + }, + + toJSON(message: RevokeRefreshTokenRequest): unknown { + const obj: any = {}; + message.refreshTokenId !== undefined && + (obj.refreshTokenId = message.refreshTokenId); + message.refreshToken !== undefined && + (obj.refreshToken = message.refreshToken); + message.revokeFilter !== undefined && + (obj.revokeFilter = message.revokeFilter + ? RevokeFilter.toJSON(message.revokeFilter) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): RevokeRefreshTokenRequest { + const message = { + ...baseRevokeRefreshTokenRequest, + } as RevokeRefreshTokenRequest; + message.refreshTokenId = object.refreshTokenId ?? undefined; + message.refreshToken = object.refreshToken ?? undefined; + message.revokeFilter = + object.revokeFilter !== undefined && object.revokeFilter !== null + ? RevokeFilter.fromPartial(object.revokeFilter) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + RevokeRefreshTokenRequest.$type, + RevokeRefreshTokenRequest +); + +const baseRevokeFilter: object = { + $type: "yandex.cloud.iam.v1.RevokeFilter", + clientId: "", + subjectId: "", + clientInstanceInfo: "", +}; + +export const RevokeFilter = { + $type: "yandex.cloud.iam.v1.RevokeFilter" as const, + + encode( + message: RevokeFilter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + if (message.subjectId !== "") { + writer.uint32(26).string(message.subjectId); + } + if (message.clientInstanceInfo !== "") { + writer.uint32(34).string(message.clientInstanceInfo); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RevokeFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRevokeFilter } as RevokeFilter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.clientId = reader.string(); + break; + case 3: + message.subjectId = reader.string(); + break; + case 4: + message.clientInstanceInfo = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RevokeFilter { + const message = { ...baseRevokeFilter } as RevokeFilter; + message.clientId = + object.clientId !== undefined && object.clientId !== null + ? String(object.clientId) + : ""; + message.subjectId = + object.subjectId !== undefined && object.subjectId !== null + ? String(object.subjectId) + : ""; + message.clientInstanceInfo = + object.clientInstanceInfo !== undefined && + object.clientInstanceInfo !== null + ? String(object.clientInstanceInfo) + : ""; + return message; + }, + + toJSON(message: RevokeFilter): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.subjectId !== undefined && (obj.subjectId = message.subjectId); + message.clientInstanceInfo !== undefined && + (obj.clientInstanceInfo = message.clientInstanceInfo); + return obj; + }, + + fromPartial, I>>( + object: I + ): RevokeFilter { + const message = { ...baseRevokeFilter } as RevokeFilter; + message.clientId = object.clientId ?? ""; + message.subjectId = object.subjectId ?? ""; + message.clientInstanceInfo = object.clientInstanceInfo ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(RevokeFilter.$type, RevokeFilter); + +const baseRevokeRefreshTokenResponse: object = { + $type: "yandex.cloud.iam.v1.RevokeRefreshTokenResponse", + refreshTokenIds: "", +}; + +export const RevokeRefreshTokenResponse = { + $type: "yandex.cloud.iam.v1.RevokeRefreshTokenResponse" as const, + + encode( + message: RevokeRefreshTokenResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.refreshTokenIds) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RevokeRefreshTokenResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRevokeRefreshTokenResponse, + } as RevokeRefreshTokenResponse; + message.refreshTokenIds = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.refreshTokenIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RevokeRefreshTokenResponse { + const message = { + ...baseRevokeRefreshTokenResponse, + } as RevokeRefreshTokenResponse; + message.refreshTokenIds = (object.refreshTokenIds ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: RevokeRefreshTokenResponse): unknown { + const obj: any = {}; + if (message.refreshTokenIds) { + obj.refreshTokenIds = message.refreshTokenIds.map((e) => e); + } else { + obj.refreshTokenIds = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): RevokeRefreshTokenResponse { + const message = { + ...baseRevokeRefreshTokenResponse, + } as RevokeRefreshTokenResponse; + message.refreshTokenIds = object.refreshTokenIds?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + RevokeRefreshTokenResponse.$type, + RevokeRefreshTokenResponse +); + +/** A set of methods for managing Refresh Tokens. */ +export const RefreshTokenServiceService = { + /** List subjects Refresh Tokens. */ + list: { + path: "/yandex.cloud.iam.v1.RefreshTokenService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListRefreshTokensRequest) => + Buffer.from(ListRefreshTokensRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListRefreshTokensRequest.decode(value), + responseSerialize: (value: ListRefreshTokensResponse) => + Buffer.from(ListRefreshTokensResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListRefreshTokensResponse.decode(value), + }, + /** Revoke Refresh Tokens. Several Refresh Tokens can be revoked by one request. */ + revoke: { + path: "/yandex.cloud.iam.v1.RefreshTokenService/Revoke", + requestStream: false, + responseStream: false, + requestSerialize: (value: RevokeRefreshTokenRequest) => + Buffer.from(RevokeRefreshTokenRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + RevokeRefreshTokenRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface RefreshTokenServiceServer + extends UntypedServiceImplementation { + /** List subjects Refresh Tokens. */ + list: handleUnaryCall; + /** Revoke Refresh Tokens. Several Refresh Tokens can be revoked by one request. */ + revoke: handleUnaryCall; +} + +export interface RefreshTokenServiceClient extends Client { + /** List subjects Refresh Tokens. */ + list( + request: ListRefreshTokensRequest, + callback: ( + error: ServiceError | null, + response: ListRefreshTokensResponse + ) => void + ): ClientUnaryCall; + list( + request: ListRefreshTokensRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListRefreshTokensResponse + ) => void + ): ClientUnaryCall; + list( + request: ListRefreshTokensRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListRefreshTokensResponse + ) => void + ): ClientUnaryCall; + /** Revoke Refresh Tokens. Several Refresh Tokens can be revoked by one request. */ + revoke( + request: RevokeRefreshTokenRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + revoke( + request: RevokeRefreshTokenRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + revoke( + request: RevokeRefreshTokenRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const RefreshTokenServiceClient = makeGenericClientConstructor( + RefreshTokenServiceService, + "yandex.cloud.iam.v1.RefreshTokenService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): RefreshTokenServiceClient; + service: typeof RefreshTokenServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/iam/v1/resource.ts b/src/generated/yandex/cloud/iam/v1/resource.ts new file mode 100644 index 00000000..6aa3b650 --- /dev/null +++ b/src/generated/yandex/cloud/iam/v1/resource.ts @@ -0,0 +1,118 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.iam.v1"; + +/** A Resource. For more information, see [Resource](/docs/iam/concepts/access-control/resources-with-access-control). */ +export interface Resource { + $type: "yandex.cloud.iam.v1.Resource"; + /** ID of the resource. */ + id: string; + /** The type of the resource, e.g. resource-manager.folder, billing.account, compute.snapshot, etc. */ + type: string; +} + +const baseResource: object = { + $type: "yandex.cloud.iam.v1.Resource", + id: "", + type: "", +}; + +export const Resource = { + $type: "yandex.cloud.iam.v1.Resource" as const, + + encode( + message: Resource, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Resource { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResource } as Resource; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Resource { + const message = { ...baseResource } as Resource; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.type = + object.type !== undefined && object.type !== null + ? String(object.type) + : ""; + return message; + }, + + toJSON(message: Resource): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.type !== undefined && (obj.type = message.type); + return obj; + }, + + fromPartial, I>>(object: I): Resource { + const message = { ...baseResource } as Resource; + message.id = object.id ?? ""; + message.type = object.type ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Resource.$type, Resource); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/iam/v1/service_account.ts b/src/generated/yandex/cloud/iam/v1/service_account.ts index eceba064..3f5b460d 100644 --- a/src/generated/yandex/cloud/iam/v1/service_account.ts +++ b/src/generated/yandex/cloud/iam/v1/service_account.ts @@ -24,6 +24,8 @@ export interface ServiceAccount { description: string; /** Resource labels as `` key:value `` pairs. Maximum of 64 per resource. */ labels: { [key: string]: string }; + /** Timestamp for the last authentication of this service account. */ + lastAuthenticatedAt?: Date; } export interface ServiceAccount_LabelsEntry { @@ -75,6 +77,12 @@ export const ServiceAccount = { writer.uint32(50).fork() ).ldelim(); }); + if (message.lastAuthenticatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.lastAuthenticatedAt), + writer.uint32(58).fork() + ).ldelim(); + } return writer; }, @@ -112,6 +120,11 @@ export const ServiceAccount = { message.labels[entry6.key] = entry6.value; } break; + case 7: + message.lastAuthenticatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -146,6 +159,11 @@ export const ServiceAccount = { acc[key] = String(value); return acc; }, {}); + message.lastAuthenticatedAt = + object.lastAuthenticatedAt !== undefined && + object.lastAuthenticatedAt !== null + ? fromJsonTimestamp(object.lastAuthenticatedAt) + : undefined; return message; }, @@ -164,6 +182,8 @@ export const ServiceAccount = { obj.labels[k] = v; }); } + message.lastAuthenticatedAt !== undefined && + (obj.lastAuthenticatedAt = message.lastAuthenticatedAt.toISOString()); return obj; }, @@ -184,6 +204,7 @@ export const ServiceAccount = { } return acc; }, {}); + message.lastAuthenticatedAt = object.lastAuthenticatedAt ?? undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/iam/v1/service_control.ts b/src/generated/yandex/cloud/iam/v1/service_control.ts new file mode 100644 index 00000000..1a3c24fa --- /dev/null +++ b/src/generated/yandex/cloud/iam/v1/service_control.ts @@ -0,0 +1,374 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Resource } from "../../../../yandex/cloud/iam/v1/resource"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.iam.v1"; + +/** A Service. */ +export interface Service { + $type: "yandex.cloud.iam.v1.Service"; + /** ID of the service. */ + serviceId: string; + /** Resource that the service belongs to. */ + resource?: Resource; + /** Time of the last status update of the service. */ + updatedAt?: Date; + /** Current status of the service. */ + status: Service_Status; +} + +export enum Service_Status { + STATUS_UNSPECIFIED = 0, + /** ENABLED - The service is enabled. */ + ENABLED = 1, + /** PAUSED - The service is paused. */ + PAUSED = 2, + /** DISABLED - The service is disabled. */ + DISABLED = 3, + /** ENABLING - The service is being enabled. */ + ENABLING = 4, + /** RESUMING - The service is being resumed. */ + RESUMING = 5, + /** PAUSING - The service is being paused. */ + PAUSING = 6, + /** DISABLING - The service is being disabled. */ + DISABLING = 7, + /** ERROR - The service is in error state. */ + ERROR = 8, + /** DEFAULT - The service could be auto enabled. */ + DEFAULT = 9, + UNRECOGNIZED = -1, +} + +export function service_StatusFromJSON(object: any): Service_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return Service_Status.STATUS_UNSPECIFIED; + case 1: + case "ENABLED": + return Service_Status.ENABLED; + case 2: + case "PAUSED": + return Service_Status.PAUSED; + case 3: + case "DISABLED": + return Service_Status.DISABLED; + case 4: + case "ENABLING": + return Service_Status.ENABLING; + case 5: + case "RESUMING": + return Service_Status.RESUMING; + case 6: + case "PAUSING": + return Service_Status.PAUSING; + case 7: + case "DISABLING": + return Service_Status.DISABLING; + case 8: + case "ERROR": + return Service_Status.ERROR; + case 9: + case "DEFAULT": + return Service_Status.DEFAULT; + case -1: + case "UNRECOGNIZED": + default: + return Service_Status.UNRECOGNIZED; + } +} + +export function service_StatusToJSON(object: Service_Status): string { + switch (object) { + case Service_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case Service_Status.ENABLED: + return "ENABLED"; + case Service_Status.PAUSED: + return "PAUSED"; + case Service_Status.DISABLED: + return "DISABLED"; + case Service_Status.ENABLING: + return "ENABLING"; + case Service_Status.RESUMING: + return "RESUMING"; + case Service_Status.PAUSING: + return "PAUSING"; + case Service_Status.DISABLING: + return "DISABLING"; + case Service_Status.ERROR: + return "ERROR"; + case Service_Status.DEFAULT: + return "DEFAULT"; + default: + return "UNKNOWN"; + } +} + +export interface ServiceAgent { + $type: "yandex.cloud.iam.v1.ServiceAgent"; + /** ID of the agent service account. */ + serviceAccountId: string; + /** ID of the service. */ + serviceId: string; + /** ID of the microservice. */ + microserviceId: string; +} + +const baseService: object = { + $type: "yandex.cloud.iam.v1.Service", + serviceId: "", + status: 0, +}; + +export const Service = { + $type: "yandex.cloud.iam.v1.Service" as const, + + encode( + message: Service, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.serviceId !== "") { + writer.uint32(10).string(message.serviceId); + } + if (message.resource !== undefined) { + Resource.encode(message.resource, writer.uint32(18).fork()).ldelim(); + } + if (message.updatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.updatedAt), + writer.uint32(26).fork() + ).ldelim(); + } + if (message.status !== 0) { + writer.uint32(32).int32(message.status); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Service { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseService } as Service; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceId = reader.string(); + break; + case 2: + message.resource = Resource.decode(reader, reader.uint32()); + break; + case 3: + message.updatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 4: + message.status = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Service { + const message = { ...baseService } as Service; + message.serviceId = + object.serviceId !== undefined && object.serviceId !== null + ? String(object.serviceId) + : ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromJSON(object.resource) + : undefined; + message.updatedAt = + object.updatedAt !== undefined && object.updatedAt !== null + ? fromJsonTimestamp(object.updatedAt) + : undefined; + message.status = + object.status !== undefined && object.status !== null + ? service_StatusFromJSON(object.status) + : 0; + return message; + }, + + toJSON(message: Service): unknown { + const obj: any = {}; + message.serviceId !== undefined && (obj.serviceId = message.serviceId); + message.resource !== undefined && + (obj.resource = message.resource + ? Resource.toJSON(message.resource) + : undefined); + message.updatedAt !== undefined && + (obj.updatedAt = message.updatedAt.toISOString()); + message.status !== undefined && + (obj.status = service_StatusToJSON(message.status)); + return obj; + }, + + fromPartial, I>>(object: I): Service { + const message = { ...baseService } as Service; + message.serviceId = object.serviceId ?? ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromPartial(object.resource) + : undefined; + message.updatedAt = object.updatedAt ?? undefined; + message.status = object.status ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Service.$type, Service); + +const baseServiceAgent: object = { + $type: "yandex.cloud.iam.v1.ServiceAgent", + serviceAccountId: "", + serviceId: "", + microserviceId: "", +}; + +export const ServiceAgent = { + $type: "yandex.cloud.iam.v1.ServiceAgent" as const, + + encode( + message: ServiceAgent, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.serviceAccountId !== "") { + writer.uint32(10).string(message.serviceAccountId); + } + if (message.serviceId !== "") { + writer.uint32(18).string(message.serviceId); + } + if (message.microserviceId !== "") { + writer.uint32(26).string(message.microserviceId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceAgent { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceAgent } as ServiceAgent; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceAccountId = reader.string(); + break; + case 2: + message.serviceId = reader.string(); + break; + case 3: + message.microserviceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceAgent { + const message = { ...baseServiceAgent } as ServiceAgent; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.serviceId = + object.serviceId !== undefined && object.serviceId !== null + ? String(object.serviceId) + : ""; + message.microserviceId = + object.microserviceId !== undefined && object.microserviceId !== null + ? String(object.microserviceId) + : ""; + return message; + }, + + toJSON(message: ServiceAgent): unknown { + const obj: any = {}; + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.serviceId !== undefined && (obj.serviceId = message.serviceId); + message.microserviceId !== undefined && + (obj.microserviceId = message.microserviceId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ServiceAgent { + const message = { ...baseServiceAgent } as ServiceAgent; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.serviceId = object.serviceId ?? ""; + message.microserviceId = object.microserviceId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ServiceAgent.$type, ServiceAgent); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/iam/v1/service_control_service.ts b/src/generated/yandex/cloud/iam/v1/service_control_service.ts new file mode 100644 index 00000000..7eae8e54 --- /dev/null +++ b/src/generated/yandex/cloud/iam/v1/service_control_service.ts @@ -0,0 +1,1067 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { Resource } from "../../../../yandex/cloud/iam/v1/resource"; +import { + Service, + ServiceAgent, +} from "../../../../yandex/cloud/iam/v1/service_control"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.iam.v1"; + +export interface GetServiceRequest { + $type: "yandex.cloud.iam.v1.GetServiceRequest"; + /** ID of the Service. */ + serviceId: string; + /** + * Resource container to get a service information in. + * + * It is supported only resource-manager.cloud resource container now. + */ + resource?: Resource; +} + +export interface ListServicesRequest { + $type: "yandex.cloud.iam.v1.ListServicesRequest"; + /** + * Resource container to list a services. + * + * It is supported only resource-manager.cloud resource container now. + */ + resource?: Resource; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], + * the service returns a [ListServicesResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100 + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] + * to the [ListServicesResponse.next_page_token] + * returned by a previous list request. + */ + pageToken: string; +} + +export interface ListServicesResponse { + $type: "yandex.cloud.iam.v1.ListServicesResponse"; + /** List of Services. */ + services: Service[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListServicesRequest.page_size], use + * the [next_page_token] as the value + * for the [ListServicesRequest.page_token] query parameter + * in the next list request. Each subsequent list request will have its own + * [next_page_token] to continue paging through the results. + */ + nextPageToken: string; +} + +export interface EnableServiceRequest { + $type: "yandex.cloud.iam.v1.EnableServiceRequest"; + /** ID of the Service. */ + serviceId: string; + /** + * Resource container to enable a service in. + * + * It is supported only resource-manager.cloud resource container now. + */ + resource?: Resource; +} + +export interface EnableServiceMetadata { + $type: "yandex.cloud.iam.v1.EnableServiceMetadata"; + /** ID of the Service. */ + serviceId: string; + /** Resource container. */ + resource?: Resource; +} + +export interface DisableServiceRequest { + $type: "yandex.cloud.iam.v1.DisableServiceRequest"; + /** ID of the Service. */ + serviceId: string; + /** + * Resource container to disable a service in. + * + * It is supported only resource-manager.cloud resource container now. + */ + resource?: Resource; +} + +export interface DisableServiceMetadata { + $type: "yandex.cloud.iam.v1.DisableServiceMetadata"; + /** ID of the Service. */ + serviceId: string; + /** Resource container. */ + resource?: Resource; +} + +export interface ResolveServiceAgentRequest { + $type: "yandex.cloud.iam.v1.ResolveServiceAgentRequest"; + /** ID of the Service. */ + serviceId: string; + /** ID of the Microservice. */ + microserviceId: string; + /** Resource container. */ + resource?: Resource; +} + +const baseGetServiceRequest: object = { + $type: "yandex.cloud.iam.v1.GetServiceRequest", + serviceId: "", +}; + +export const GetServiceRequest = { + $type: "yandex.cloud.iam.v1.GetServiceRequest" as const, + + encode( + message: GetServiceRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.serviceId !== "") { + writer.uint32(10).string(message.serviceId); + } + if (message.resource !== undefined) { + Resource.encode(message.resource, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetServiceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetServiceRequest } as GetServiceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceId = reader.string(); + break; + case 2: + message.resource = Resource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetServiceRequest { + const message = { ...baseGetServiceRequest } as GetServiceRequest; + message.serviceId = + object.serviceId !== undefined && object.serviceId !== null + ? String(object.serviceId) + : ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromJSON(object.resource) + : undefined; + return message; + }, + + toJSON(message: GetServiceRequest): unknown { + const obj: any = {}; + message.serviceId !== undefined && (obj.serviceId = message.serviceId); + message.resource !== undefined && + (obj.resource = message.resource + ? Resource.toJSON(message.resource) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetServiceRequest { + const message = { ...baseGetServiceRequest } as GetServiceRequest; + message.serviceId = object.serviceId ?? ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromPartial(object.resource) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GetServiceRequest.$type, GetServiceRequest); + +const baseListServicesRequest: object = { + $type: "yandex.cloud.iam.v1.ListServicesRequest", + pageSize: 0, + pageToken: "", +}; + +export const ListServicesRequest = { + $type: "yandex.cloud.iam.v1.ListServicesRequest" as const, + + encode( + message: ListServicesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resource !== undefined) { + Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListServicesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListServicesRequest } as ListServicesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = Resource.decode(reader, reader.uint32()); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListServicesRequest { + const message = { ...baseListServicesRequest } as ListServicesRequest; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromJSON(object.resource) + : undefined; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListServicesRequest): unknown { + const obj: any = {}; + message.resource !== undefined && + (obj.resource = message.resource + ? Resource.toJSON(message.resource) + : undefined); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListServicesRequest { + const message = { ...baseListServicesRequest } as ListServicesRequest; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromPartial(object.resource) + : undefined; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListServicesRequest.$type, ListServicesRequest); + +const baseListServicesResponse: object = { + $type: "yandex.cloud.iam.v1.ListServicesResponse", + nextPageToken: "", +}; + +export const ListServicesResponse = { + $type: "yandex.cloud.iam.v1.ListServicesResponse" as const, + + encode( + message: ListServicesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.services) { + Service.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListServicesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListServicesResponse } as ListServicesResponse; + message.services = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.services.push(Service.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListServicesResponse { + const message = { ...baseListServicesResponse } as ListServicesResponse; + message.services = (object.services ?? []).map((e: any) => + Service.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListServicesResponse): unknown { + const obj: any = {}; + if (message.services) { + obj.services = message.services.map((e) => + e ? Service.toJSON(e) : undefined + ); + } else { + obj.services = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListServicesResponse { + const message = { ...baseListServicesResponse } as ListServicesResponse; + message.services = + object.services?.map((e) => Service.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListServicesResponse.$type, ListServicesResponse); + +const baseEnableServiceRequest: object = { + $type: "yandex.cloud.iam.v1.EnableServiceRequest", + serviceId: "", +}; + +export const EnableServiceRequest = { + $type: "yandex.cloud.iam.v1.EnableServiceRequest" as const, + + encode( + message: EnableServiceRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.serviceId !== "") { + writer.uint32(10).string(message.serviceId); + } + if (message.resource !== undefined) { + Resource.encode(message.resource, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): EnableServiceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnableServiceRequest } as EnableServiceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceId = reader.string(); + break; + case 2: + message.resource = Resource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnableServiceRequest { + const message = { ...baseEnableServiceRequest } as EnableServiceRequest; + message.serviceId = + object.serviceId !== undefined && object.serviceId !== null + ? String(object.serviceId) + : ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromJSON(object.resource) + : undefined; + return message; + }, + + toJSON(message: EnableServiceRequest): unknown { + const obj: any = {}; + message.serviceId !== undefined && (obj.serviceId = message.serviceId); + message.resource !== undefined && + (obj.resource = message.resource + ? Resource.toJSON(message.resource) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): EnableServiceRequest { + const message = { ...baseEnableServiceRequest } as EnableServiceRequest; + message.serviceId = object.serviceId ?? ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromPartial(object.resource) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(EnableServiceRequest.$type, EnableServiceRequest); + +const baseEnableServiceMetadata: object = { + $type: "yandex.cloud.iam.v1.EnableServiceMetadata", + serviceId: "", +}; + +export const EnableServiceMetadata = { + $type: "yandex.cloud.iam.v1.EnableServiceMetadata" as const, + + encode( + message: EnableServiceMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.serviceId !== "") { + writer.uint32(10).string(message.serviceId); + } + if (message.resource !== undefined) { + Resource.encode(message.resource, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): EnableServiceMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnableServiceMetadata } as EnableServiceMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceId = reader.string(); + break; + case 2: + message.resource = Resource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnableServiceMetadata { + const message = { ...baseEnableServiceMetadata } as EnableServiceMetadata; + message.serviceId = + object.serviceId !== undefined && object.serviceId !== null + ? String(object.serviceId) + : ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromJSON(object.resource) + : undefined; + return message; + }, + + toJSON(message: EnableServiceMetadata): unknown { + const obj: any = {}; + message.serviceId !== undefined && (obj.serviceId = message.serviceId); + message.resource !== undefined && + (obj.resource = message.resource + ? Resource.toJSON(message.resource) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): EnableServiceMetadata { + const message = { ...baseEnableServiceMetadata } as EnableServiceMetadata; + message.serviceId = object.serviceId ?? ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromPartial(object.resource) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(EnableServiceMetadata.$type, EnableServiceMetadata); + +const baseDisableServiceRequest: object = { + $type: "yandex.cloud.iam.v1.DisableServiceRequest", + serviceId: "", +}; + +export const DisableServiceRequest = { + $type: "yandex.cloud.iam.v1.DisableServiceRequest" as const, + + encode( + message: DisableServiceRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.serviceId !== "") { + writer.uint32(10).string(message.serviceId); + } + if (message.resource !== undefined) { + Resource.encode(message.resource, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DisableServiceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDisableServiceRequest } as DisableServiceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceId = reader.string(); + break; + case 2: + message.resource = Resource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DisableServiceRequest { + const message = { ...baseDisableServiceRequest } as DisableServiceRequest; + message.serviceId = + object.serviceId !== undefined && object.serviceId !== null + ? String(object.serviceId) + : ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromJSON(object.resource) + : undefined; + return message; + }, + + toJSON(message: DisableServiceRequest): unknown { + const obj: any = {}; + message.serviceId !== undefined && (obj.serviceId = message.serviceId); + message.resource !== undefined && + (obj.resource = message.resource + ? Resource.toJSON(message.resource) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): DisableServiceRequest { + const message = { ...baseDisableServiceRequest } as DisableServiceRequest; + message.serviceId = object.serviceId ?? ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromPartial(object.resource) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(DisableServiceRequest.$type, DisableServiceRequest); + +const baseDisableServiceMetadata: object = { + $type: "yandex.cloud.iam.v1.DisableServiceMetadata", + serviceId: "", +}; + +export const DisableServiceMetadata = { + $type: "yandex.cloud.iam.v1.DisableServiceMetadata" as const, + + encode( + message: DisableServiceMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.serviceId !== "") { + writer.uint32(10).string(message.serviceId); + } + if (message.resource !== undefined) { + Resource.encode(message.resource, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DisableServiceMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDisableServiceMetadata } as DisableServiceMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceId = reader.string(); + break; + case 2: + message.resource = Resource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DisableServiceMetadata { + const message = { ...baseDisableServiceMetadata } as DisableServiceMetadata; + message.serviceId = + object.serviceId !== undefined && object.serviceId !== null + ? String(object.serviceId) + : ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromJSON(object.resource) + : undefined; + return message; + }, + + toJSON(message: DisableServiceMetadata): unknown { + const obj: any = {}; + message.serviceId !== undefined && (obj.serviceId = message.serviceId); + message.resource !== undefined && + (obj.resource = message.resource + ? Resource.toJSON(message.resource) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): DisableServiceMetadata { + const message = { ...baseDisableServiceMetadata } as DisableServiceMetadata; + message.serviceId = object.serviceId ?? ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromPartial(object.resource) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(DisableServiceMetadata.$type, DisableServiceMetadata); + +const baseResolveServiceAgentRequest: object = { + $type: "yandex.cloud.iam.v1.ResolveServiceAgentRequest", + serviceId: "", + microserviceId: "", +}; + +export const ResolveServiceAgentRequest = { + $type: "yandex.cloud.iam.v1.ResolveServiceAgentRequest" as const, + + encode( + message: ResolveServiceAgentRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.serviceId !== "") { + writer.uint32(10).string(message.serviceId); + } + if (message.microserviceId !== "") { + writer.uint32(18).string(message.microserviceId); + } + if (message.resource !== undefined) { + Resource.encode(message.resource, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ResolveServiceAgentRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseResolveServiceAgentRequest, + } as ResolveServiceAgentRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceId = reader.string(); + break; + case 2: + message.microserviceId = reader.string(); + break; + case 3: + message.resource = Resource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResolveServiceAgentRequest { + const message = { + ...baseResolveServiceAgentRequest, + } as ResolveServiceAgentRequest; + message.serviceId = + object.serviceId !== undefined && object.serviceId !== null + ? String(object.serviceId) + : ""; + message.microserviceId = + object.microserviceId !== undefined && object.microserviceId !== null + ? String(object.microserviceId) + : ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromJSON(object.resource) + : undefined; + return message; + }, + + toJSON(message: ResolveServiceAgentRequest): unknown { + const obj: any = {}; + message.serviceId !== undefined && (obj.serviceId = message.serviceId); + message.microserviceId !== undefined && + (obj.microserviceId = message.microserviceId); + message.resource !== undefined && + (obj.resource = message.resource + ? Resource.toJSON(message.resource) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ResolveServiceAgentRequest { + const message = { + ...baseResolveServiceAgentRequest, + } as ResolveServiceAgentRequest; + message.serviceId = object.serviceId ?? ""; + message.microserviceId = object.microserviceId ?? ""; + message.resource = + object.resource !== undefined && object.resource !== null + ? Resource.fromPartial(object.resource) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + ResolveServiceAgentRequest.$type, + ResolveServiceAgentRequest +); + +/** A set of methods for managing Service resources. */ +export const ServiceControlServiceService = { + /** + * Returns the Service information in the specified resource container. + * + * To get the list of available Services, make a [List] request. + */ + get: { + path: "/yandex.cloud.iam.v1.ServiceControlService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetServiceRequest) => + Buffer.from(GetServiceRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetServiceRequest.decode(value), + responseSerialize: (value: Service) => + Buffer.from(Service.encode(value).finish()), + responseDeserialize: (value: Buffer) => Service.decode(value), + }, + /** Retrieves the list of Service in the specified resource container. */ + list: { + path: "/yandex.cloud.iam.v1.ServiceControlService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListServicesRequest) => + Buffer.from(ListServicesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListServicesRequest.decode(value), + responseSerialize: (value: ListServicesResponse) => + Buffer.from(ListServicesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListServicesResponse.decode(value), + }, + /** Enable a service in the specified resource container. */ + enable: { + path: "/yandex.cloud.iam.v1.ServiceControlService/Enable", + requestStream: false, + responseStream: false, + requestSerialize: (value: EnableServiceRequest) => + Buffer.from(EnableServiceRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => EnableServiceRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Disable a service in the specified resource container. */ + disable: { + path: "/yandex.cloud.iam.v1.ServiceControlService/Disable", + requestStream: false, + responseStream: false, + requestSerialize: (value: DisableServiceRequest) => + Buffer.from(DisableServiceRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DisableServiceRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Resolve agent service account for the service in the specified resource container. */ + resolveAgent: { + path: "/yandex.cloud.iam.v1.ServiceControlService/ResolveAgent", + requestStream: false, + responseStream: false, + requestSerialize: (value: ResolveServiceAgentRequest) => + Buffer.from(ResolveServiceAgentRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ResolveServiceAgentRequest.decode(value), + responseSerialize: (value: ServiceAgent) => + Buffer.from(ServiceAgent.encode(value).finish()), + responseDeserialize: (value: Buffer) => ServiceAgent.decode(value), + }, +} as const; + +export interface ServiceControlServiceServer + extends UntypedServiceImplementation { + /** + * Returns the Service information in the specified resource container. + * + * To get the list of available Services, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of Service in the specified resource container. */ + list: handleUnaryCall; + /** Enable a service in the specified resource container. */ + enable: handleUnaryCall; + /** Disable a service in the specified resource container. */ + disable: handleUnaryCall; + /** Resolve agent service account for the service in the specified resource container. */ + resolveAgent: handleUnaryCall; +} + +export interface ServiceControlServiceClient extends Client { + /** + * Returns the Service information in the specified resource container. + * + * To get the list of available Services, make a [List] request. + */ + get( + request: GetServiceRequest, + callback: (error: ServiceError | null, response: Service) => void + ): ClientUnaryCall; + get( + request: GetServiceRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Service) => void + ): ClientUnaryCall; + get( + request: GetServiceRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Service) => void + ): ClientUnaryCall; + /** Retrieves the list of Service in the specified resource container. */ + list( + request: ListServicesRequest, + callback: ( + error: ServiceError | null, + response: ListServicesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListServicesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListServicesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListServicesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListServicesResponse + ) => void + ): ClientUnaryCall; + /** Enable a service in the specified resource container. */ + enable( + request: EnableServiceRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + enable( + request: EnableServiceRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + enable( + request: EnableServiceRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Disable a service in the specified resource container. */ + disable( + request: DisableServiceRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + disable( + request: DisableServiceRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + disable( + request: DisableServiceRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Resolve agent service account for the service in the specified resource container. */ + resolveAgent( + request: ResolveServiceAgentRequest, + callback: (error: ServiceError | null, response: ServiceAgent) => void + ): ClientUnaryCall; + resolveAgent( + request: ResolveServiceAgentRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: ServiceAgent) => void + ): ClientUnaryCall; + resolveAgent( + request: ResolveServiceAgentRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: ServiceAgent) => void + ): ClientUnaryCall; +} + +export const ServiceControlServiceClient = makeGenericClientConstructor( + ServiceControlServiceService, + "yandex.cloud.iam.v1.ServiceControlService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ServiceControlServiceClient; + service: typeof ServiceControlServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/iam/v1/workload/federated_credential.ts b/src/generated/yandex/cloud/iam/v1/workload/federated_credential.ts new file mode 100644 index 00000000..21e7cb23 --- /dev/null +++ b/src/generated/yandex/cloud/iam/v1/workload/federated_credential.ts @@ -0,0 +1,197 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.iam.v1.workload"; + +/** A federated credential. */ +export interface FederatedCredential { + $type: "yandex.cloud.iam.v1.workload.FederatedCredential"; + /** Id of the federated credential. */ + id: string; + /** Id of the service account that the federated credential belongs to. */ + serviceAccountId: string; + /** ID of the workload identity federation which is used for authentication. */ + federationId: string; + /** Id of the external subject. */ + externalSubjectId: string; + /** Creation timestamp. */ + createdAt?: Date; +} + +const baseFederatedCredential: object = { + $type: "yandex.cloud.iam.v1.workload.FederatedCredential", + id: "", + serviceAccountId: "", + federationId: "", + externalSubjectId: "", +}; + +export const FederatedCredential = { + $type: "yandex.cloud.iam.v1.workload.FederatedCredential" as const, + + encode( + message: FederatedCredential, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.serviceAccountId !== "") { + writer.uint32(18).string(message.serviceAccountId); + } + if (message.federationId !== "") { + writer.uint32(26).string(message.federationId); + } + if (message.externalSubjectId !== "") { + writer.uint32(34).string(message.externalSubjectId); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(42).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FederatedCredential { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFederatedCredential } as FederatedCredential; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.serviceAccountId = reader.string(); + break; + case 3: + message.federationId = reader.string(); + break; + case 4: + message.externalSubjectId = reader.string(); + break; + case 5: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FederatedCredential { + const message = { ...baseFederatedCredential } as FederatedCredential; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.federationId = + object.federationId !== undefined && object.federationId !== null + ? String(object.federationId) + : ""; + message.externalSubjectId = + object.externalSubjectId !== undefined && + object.externalSubjectId !== null + ? String(object.externalSubjectId) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + return message; + }, + + toJSON(message: FederatedCredential): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.federationId !== undefined && + (obj.federationId = message.federationId); + message.externalSubjectId !== undefined && + (obj.externalSubjectId = message.externalSubjectId); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + return obj; + }, + + fromPartial, I>>( + object: I + ): FederatedCredential { + const message = { ...baseFederatedCredential } as FederatedCredential; + message.id = object.id ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.federationId = object.federationId ?? ""; + message.externalSubjectId = object.externalSubjectId ?? ""; + message.createdAt = object.createdAt ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(FederatedCredential.$type, FederatedCredential); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/iam/v1/workload/federated_credential_service.ts b/src/generated/yandex/cloud/iam/v1/workload/federated_credential_service.ts new file mode 100644 index 00000000..2e263731 --- /dev/null +++ b/src/generated/yandex/cloud/iam/v1/workload/federated_credential_service.ts @@ -0,0 +1,946 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { FederatedCredential } from "../../../../../yandex/cloud/iam/v1/workload/federated_credential"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.iam.v1.workload"; + +export interface GetFederatedCredentialRequest { + $type: "yandex.cloud.iam.v1.workload.GetFederatedCredentialRequest"; + /** + * ID of the federated credential to return. + * To get the federated credential ID, make a [FederatedCredentialService.List] request. + */ + federatedCredentialId: string; +} + +export interface ListFederatedCredentialsRequest { + $type: "yandex.cloud.iam.v1.workload.ListFederatedCredentialsRequest"; + /** + * ID of the service account to list federated credentials for. + * To get the the service account ID make a [yandex.cloud.iam.v1.ServiceAccountService.List] request. + */ + serviceAccountId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], + * the service returns a [ListFederatedCredentialsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] + * to the [ListFederatedCredentialsResponse.next_page_token] + * returned by a previous list request. + */ + pageToken: string; +} + +export interface ListFederatedCredentialsResponse { + $type: "yandex.cloud.iam.v1.workload.ListFederatedCredentialsResponse"; + /** List of federated credentials. */ + federatedCredentials: FederatedCredential[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListFederatedCredentialsRequest.page_size], use + * the [next_page_token] as the value + * for the [ListFederatedCredentialsRequest.page_token] query parameter + * in the next list request. Each subsequent list request will have its own + * [next_page_token] to continue paging through the results. + */ + nextPageToken: string; +} + +export interface CreateFederatedCredentialRequest { + $type: "yandex.cloud.iam.v1.workload.CreateFederatedCredentialRequest"; + /** + * ID of the service account to create a federated credential for. + * To get the service account ID, use a [yandex.cloud.iam.v1.ServiceAccountService.List] request. + */ + serviceAccountId: string; + /** ID of the workload identity federation that is used for authentication. */ + federationId: string; + /** Id of the external subject. */ + externalSubjectId: string; +} + +export interface CreateFederatedCredentialMetadata { + $type: "yandex.cloud.iam.v1.workload.CreateFederatedCredentialMetadata"; + /** ID of the federated credential that is being created. */ + federatedCredentialId: string; +} + +export interface DeleteFederatedCredentialRequest { + $type: "yandex.cloud.iam.v1.workload.DeleteFederatedCredentialRequest"; + /** + * ID of the federated credential key to delete. + * To get the federated credential ID, use a [FederatedCredentialService.List] request. + */ + federatedCredentialId: string; +} + +export interface DeleteFederatedCredentialMetadata { + $type: "yandex.cloud.iam.v1.workload.DeleteFederatedCredentialMetadata"; + /** ID of the federated credential that is being deleted. */ + federatedCredentialId: string; +} + +const baseGetFederatedCredentialRequest: object = { + $type: "yandex.cloud.iam.v1.workload.GetFederatedCredentialRequest", + federatedCredentialId: "", +}; + +export const GetFederatedCredentialRequest = { + $type: "yandex.cloud.iam.v1.workload.GetFederatedCredentialRequest" as const, + + encode( + message: GetFederatedCredentialRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.federatedCredentialId !== "") { + writer.uint32(10).string(message.federatedCredentialId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetFederatedCredentialRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetFederatedCredentialRequest, + } as GetFederatedCredentialRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federatedCredentialId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetFederatedCredentialRequest { + const message = { + ...baseGetFederatedCredentialRequest, + } as GetFederatedCredentialRequest; + message.federatedCredentialId = + object.federatedCredentialId !== undefined && + object.federatedCredentialId !== null + ? String(object.federatedCredentialId) + : ""; + return message; + }, + + toJSON(message: GetFederatedCredentialRequest): unknown { + const obj: any = {}; + message.federatedCredentialId !== undefined && + (obj.federatedCredentialId = message.federatedCredentialId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetFederatedCredentialRequest { + const message = { + ...baseGetFederatedCredentialRequest, + } as GetFederatedCredentialRequest; + message.federatedCredentialId = object.federatedCredentialId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetFederatedCredentialRequest.$type, + GetFederatedCredentialRequest +); + +const baseListFederatedCredentialsRequest: object = { + $type: "yandex.cloud.iam.v1.workload.ListFederatedCredentialsRequest", + serviceAccountId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListFederatedCredentialsRequest = { + $type: + "yandex.cloud.iam.v1.workload.ListFederatedCredentialsRequest" as const, + + encode( + message: ListFederatedCredentialsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.serviceAccountId !== "") { + writer.uint32(10).string(message.serviceAccountId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListFederatedCredentialsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListFederatedCredentialsRequest, + } as ListFederatedCredentialsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceAccountId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListFederatedCredentialsRequest { + const message = { + ...baseListFederatedCredentialsRequest, + } as ListFederatedCredentialsRequest; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListFederatedCredentialsRequest): unknown { + const obj: any = {}; + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListFederatedCredentialsRequest { + const message = { + ...baseListFederatedCredentialsRequest, + } as ListFederatedCredentialsRequest; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListFederatedCredentialsRequest.$type, + ListFederatedCredentialsRequest +); + +const baseListFederatedCredentialsResponse: object = { + $type: "yandex.cloud.iam.v1.workload.ListFederatedCredentialsResponse", + nextPageToken: "", +}; + +export const ListFederatedCredentialsResponse = { + $type: + "yandex.cloud.iam.v1.workload.ListFederatedCredentialsResponse" as const, + + encode( + message: ListFederatedCredentialsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.federatedCredentials) { + FederatedCredential.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListFederatedCredentialsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListFederatedCredentialsResponse, + } as ListFederatedCredentialsResponse; + message.federatedCredentials = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federatedCredentials.push( + FederatedCredential.decode(reader, reader.uint32()) + ); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListFederatedCredentialsResponse { + const message = { + ...baseListFederatedCredentialsResponse, + } as ListFederatedCredentialsResponse; + message.federatedCredentials = (object.federatedCredentials ?? []).map( + (e: any) => FederatedCredential.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListFederatedCredentialsResponse): unknown { + const obj: any = {}; + if (message.federatedCredentials) { + obj.federatedCredentials = message.federatedCredentials.map((e) => + e ? FederatedCredential.toJSON(e) : undefined + ); + } else { + obj.federatedCredentials = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): ListFederatedCredentialsResponse { + const message = { + ...baseListFederatedCredentialsResponse, + } as ListFederatedCredentialsResponse; + message.federatedCredentials = + object.federatedCredentials?.map((e) => + FederatedCredential.fromPartial(e) + ) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListFederatedCredentialsResponse.$type, + ListFederatedCredentialsResponse +); + +const baseCreateFederatedCredentialRequest: object = { + $type: "yandex.cloud.iam.v1.workload.CreateFederatedCredentialRequest", + serviceAccountId: "", + federationId: "", + externalSubjectId: "", +}; + +export const CreateFederatedCredentialRequest = { + $type: + "yandex.cloud.iam.v1.workload.CreateFederatedCredentialRequest" as const, + + encode( + message: CreateFederatedCredentialRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.serviceAccountId !== "") { + writer.uint32(10).string(message.serviceAccountId); + } + if (message.federationId !== "") { + writer.uint32(18).string(message.federationId); + } + if (message.externalSubjectId !== "") { + writer.uint32(26).string(message.externalSubjectId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateFederatedCredentialRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateFederatedCredentialRequest, + } as CreateFederatedCredentialRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serviceAccountId = reader.string(); + break; + case 2: + message.federationId = reader.string(); + break; + case 3: + message.externalSubjectId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateFederatedCredentialRequest { + const message = { + ...baseCreateFederatedCredentialRequest, + } as CreateFederatedCredentialRequest; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.federationId = + object.federationId !== undefined && object.federationId !== null + ? String(object.federationId) + : ""; + message.externalSubjectId = + object.externalSubjectId !== undefined && + object.externalSubjectId !== null + ? String(object.externalSubjectId) + : ""; + return message; + }, + + toJSON(message: CreateFederatedCredentialRequest): unknown { + const obj: any = {}; + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.federationId !== undefined && + (obj.federationId = message.federationId); + message.externalSubjectId !== undefined && + (obj.externalSubjectId = message.externalSubjectId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateFederatedCredentialRequest { + const message = { + ...baseCreateFederatedCredentialRequest, + } as CreateFederatedCredentialRequest; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.federationId = object.federationId ?? ""; + message.externalSubjectId = object.externalSubjectId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateFederatedCredentialRequest.$type, + CreateFederatedCredentialRequest +); + +const baseCreateFederatedCredentialMetadata: object = { + $type: "yandex.cloud.iam.v1.workload.CreateFederatedCredentialMetadata", + federatedCredentialId: "", +}; + +export const CreateFederatedCredentialMetadata = { + $type: + "yandex.cloud.iam.v1.workload.CreateFederatedCredentialMetadata" as const, + + encode( + message: CreateFederatedCredentialMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.federatedCredentialId !== "") { + writer.uint32(10).string(message.federatedCredentialId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateFederatedCredentialMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateFederatedCredentialMetadata, + } as CreateFederatedCredentialMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federatedCredentialId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateFederatedCredentialMetadata { + const message = { + ...baseCreateFederatedCredentialMetadata, + } as CreateFederatedCredentialMetadata; + message.federatedCredentialId = + object.federatedCredentialId !== undefined && + object.federatedCredentialId !== null + ? String(object.federatedCredentialId) + : ""; + return message; + }, + + toJSON(message: CreateFederatedCredentialMetadata): unknown { + const obj: any = {}; + message.federatedCredentialId !== undefined && + (obj.federatedCredentialId = message.federatedCredentialId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateFederatedCredentialMetadata { + const message = { + ...baseCreateFederatedCredentialMetadata, + } as CreateFederatedCredentialMetadata; + message.federatedCredentialId = object.federatedCredentialId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateFederatedCredentialMetadata.$type, + CreateFederatedCredentialMetadata +); + +const baseDeleteFederatedCredentialRequest: object = { + $type: "yandex.cloud.iam.v1.workload.DeleteFederatedCredentialRequest", + federatedCredentialId: "", +}; + +export const DeleteFederatedCredentialRequest = { + $type: + "yandex.cloud.iam.v1.workload.DeleteFederatedCredentialRequest" as const, + + encode( + message: DeleteFederatedCredentialRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.federatedCredentialId !== "") { + writer.uint32(10).string(message.federatedCredentialId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteFederatedCredentialRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteFederatedCredentialRequest, + } as DeleteFederatedCredentialRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federatedCredentialId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteFederatedCredentialRequest { + const message = { + ...baseDeleteFederatedCredentialRequest, + } as DeleteFederatedCredentialRequest; + message.federatedCredentialId = + object.federatedCredentialId !== undefined && + object.federatedCredentialId !== null + ? String(object.federatedCredentialId) + : ""; + return message; + }, + + toJSON(message: DeleteFederatedCredentialRequest): unknown { + const obj: any = {}; + message.federatedCredentialId !== undefined && + (obj.federatedCredentialId = message.federatedCredentialId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): DeleteFederatedCredentialRequest { + const message = { + ...baseDeleteFederatedCredentialRequest, + } as DeleteFederatedCredentialRequest; + message.federatedCredentialId = object.federatedCredentialId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteFederatedCredentialRequest.$type, + DeleteFederatedCredentialRequest +); + +const baseDeleteFederatedCredentialMetadata: object = { + $type: "yandex.cloud.iam.v1.workload.DeleteFederatedCredentialMetadata", + federatedCredentialId: "", +}; + +export const DeleteFederatedCredentialMetadata = { + $type: + "yandex.cloud.iam.v1.workload.DeleteFederatedCredentialMetadata" as const, + + encode( + message: DeleteFederatedCredentialMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.federatedCredentialId !== "") { + writer.uint32(10).string(message.federatedCredentialId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteFederatedCredentialMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteFederatedCredentialMetadata, + } as DeleteFederatedCredentialMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federatedCredentialId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteFederatedCredentialMetadata { + const message = { + ...baseDeleteFederatedCredentialMetadata, + } as DeleteFederatedCredentialMetadata; + message.federatedCredentialId = + object.federatedCredentialId !== undefined && + object.federatedCredentialId !== null + ? String(object.federatedCredentialId) + : ""; + return message; + }, + + toJSON(message: DeleteFederatedCredentialMetadata): unknown { + const obj: any = {}; + message.federatedCredentialId !== undefined && + (obj.federatedCredentialId = message.federatedCredentialId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): DeleteFederatedCredentialMetadata { + const message = { + ...baseDeleteFederatedCredentialMetadata, + } as DeleteFederatedCredentialMetadata; + message.federatedCredentialId = object.federatedCredentialId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteFederatedCredentialMetadata.$type, + DeleteFederatedCredentialMetadata +); + +/** A set of methods for managing federated credentials. */ +export const FederatedCredentialServiceService = { + /** + * Returns the specified federated credential. + * + * To get the list of available federated credentials, make a [List] request. + */ + get: { + path: "/yandex.cloud.iam.v1.workload.FederatedCredentialService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetFederatedCredentialRequest) => + Buffer.from(GetFederatedCredentialRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetFederatedCredentialRequest.decode(value), + responseSerialize: (value: FederatedCredential) => + Buffer.from(FederatedCredential.encode(value).finish()), + responseDeserialize: (value: Buffer) => FederatedCredential.decode(value), + }, + /** Retrieves the list of federated credentials for the specified service account. */ + list: { + path: "/yandex.cloud.iam.v1.workload.FederatedCredentialService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListFederatedCredentialsRequest) => + Buffer.from(ListFederatedCredentialsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListFederatedCredentialsRequest.decode(value), + responseSerialize: (value: ListFederatedCredentialsResponse) => + Buffer.from(ListFederatedCredentialsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListFederatedCredentialsResponse.decode(value), + }, + /** Creates a federated credential for the specified service account. */ + create: { + path: "/yandex.cloud.iam.v1.workload.FederatedCredentialService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateFederatedCredentialRequest) => + Buffer.from(CreateFederatedCredentialRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CreateFederatedCredentialRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes the specified federated credential. */ + delete: { + path: "/yandex.cloud.iam.v1.workload.FederatedCredentialService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteFederatedCredentialRequest) => + Buffer.from(DeleteFederatedCredentialRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteFederatedCredentialRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface FederatedCredentialServiceServer + extends UntypedServiceImplementation { + /** + * Returns the specified federated credential. + * + * To get the list of available federated credentials, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of federated credentials for the specified service account. */ + list: handleUnaryCall< + ListFederatedCredentialsRequest, + ListFederatedCredentialsResponse + >; + /** Creates a federated credential for the specified service account. */ + create: handleUnaryCall; + /** Deletes the specified federated credential. */ + delete: handleUnaryCall; +} + +export interface FederatedCredentialServiceClient extends Client { + /** + * Returns the specified federated credential. + * + * To get the list of available federated credentials, make a [List] request. + */ + get( + request: GetFederatedCredentialRequest, + callback: ( + error: ServiceError | null, + response: FederatedCredential + ) => void + ): ClientUnaryCall; + get( + request: GetFederatedCredentialRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: FederatedCredential + ) => void + ): ClientUnaryCall; + get( + request: GetFederatedCredentialRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: FederatedCredential + ) => void + ): ClientUnaryCall; + /** Retrieves the list of federated credentials for the specified service account. */ + list( + request: ListFederatedCredentialsRequest, + callback: ( + error: ServiceError | null, + response: ListFederatedCredentialsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListFederatedCredentialsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListFederatedCredentialsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListFederatedCredentialsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListFederatedCredentialsResponse + ) => void + ): ClientUnaryCall; + /** Creates a federated credential for the specified service account. */ + create( + request: CreateFederatedCredentialRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateFederatedCredentialRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateFederatedCredentialRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes the specified federated credential. */ + delete( + request: DeleteFederatedCredentialRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteFederatedCredentialRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteFederatedCredentialRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const FederatedCredentialServiceClient = makeGenericClientConstructor( + FederatedCredentialServiceService, + "yandex.cloud.iam.v1.workload.FederatedCredentialService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): FederatedCredentialServiceClient; + service: typeof FederatedCredentialServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/iam/v1/workload/oidc/federation.ts b/src/generated/yandex/cloud/iam/v1/workload/oidc/federation.ts new file mode 100644 index 00000000..1d420f10 --- /dev/null +++ b/src/generated/yandex/cloud/iam/v1/workload/oidc/federation.ts @@ -0,0 +1,383 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.iam.v1.workload.oidc"; + +/** A OIDC workload identity federation. */ +export interface Federation { + $type: "yandex.cloud.iam.v1.workload.oidc.Federation"; + /** Id of the OIDC workload identity federation. */ + id: string; + /** + * Name of the OIDC workload identity federation + * The name is unique within the folder. 3-63 characters long. + */ + name: string; + /** ID of the folder that the OIDC workload identity federation belongs to. */ + folderId: string; + /** Description of the service account. 0-256 characters long. */ + description: string; + /** + * True - the OIDC workload identity federation is enabled and can be used for authentication. + * False - the OIDC workload identity federation is disabled and cannot be used for authentication. + */ + enabled: boolean; + /** List of trusted values for aud claim. */ + audiences: string[]; + /** URL of the external IdP server to be used for authentication. */ + issuer: string; + /** URL reference to trusted keys in format of JSON Web Key Set. */ + jwksUrl: string; + /** Resource labels as `` key:value `` pairs */ + labels: { [key: string]: string }; + /** Creation timestamp. */ + createdAt?: Date; +} + +export interface Federation_LabelsEntry { + $type: "yandex.cloud.iam.v1.workload.oidc.Federation.LabelsEntry"; + key: string; + value: string; +} + +const baseFederation: object = { + $type: "yandex.cloud.iam.v1.workload.oidc.Federation", + id: "", + name: "", + folderId: "", + description: "", + enabled: false, + audiences: "", + issuer: "", + jwksUrl: "", +}; + +export const Federation = { + $type: "yandex.cloud.iam.v1.workload.oidc.Federation" as const, + + encode( + message: Federation, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.folderId !== "") { + writer.uint32(26).string(message.folderId); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.enabled === true) { + writer.uint32(40).bool(message.enabled); + } + for (const v of message.audiences) { + writer.uint32(50).string(v!); + } + if (message.issuer !== "") { + writer.uint32(58).string(message.issuer); + } + if (message.jwksUrl !== "") { + writer.uint32(66).string(message.jwksUrl); + } + Object.entries(message.labels).forEach(([key, value]) => { + Federation_LabelsEntry.encode( + { + $type: "yandex.cloud.iam.v1.workload.oidc.Federation.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(74).fork() + ).ldelim(); + }); + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(82).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Federation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFederation } as Federation; + message.audiences = []; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.folderId = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.enabled = reader.bool(); + break; + case 6: + message.audiences.push(reader.string()); + break; + case 7: + message.issuer = reader.string(); + break; + case 8: + message.jwksUrl = reader.string(); + break; + case 9: + const entry9 = Federation_LabelsEntry.decode(reader, reader.uint32()); + if (entry9.value !== undefined) { + message.labels[entry9.key] = entry9.value; + } + break; + case 10: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Federation { + const message = { ...baseFederation } as Federation; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.enabled = + object.enabled !== undefined && object.enabled !== null + ? Boolean(object.enabled) + : false; + message.audiences = (object.audiences ?? []).map((e: any) => String(e)); + message.issuer = + object.issuer !== undefined && object.issuer !== null + ? String(object.issuer) + : ""; + message.jwksUrl = + object.jwksUrl !== undefined && object.jwksUrl !== null + ? String(object.jwksUrl) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + return message; + }, + + toJSON(message: Federation): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.name !== undefined && (obj.name = message.name); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.description !== undefined && + (obj.description = message.description); + message.enabled !== undefined && (obj.enabled = message.enabled); + if (message.audiences) { + obj.audiences = message.audiences.map((e) => e); + } else { + obj.audiences = []; + } + message.issuer !== undefined && (obj.issuer = message.issuer); + message.jwksUrl !== undefined && (obj.jwksUrl = message.jwksUrl); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + return obj; + }, + + fromPartial, I>>( + object: I + ): Federation { + const message = { ...baseFederation } as Federation; + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.folderId = object.folderId ?? ""; + message.description = object.description ?? ""; + message.enabled = object.enabled ?? false; + message.audiences = object.audiences?.map((e) => e) || []; + message.issuer = object.issuer ?? ""; + message.jwksUrl = object.jwksUrl ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.createdAt = object.createdAt ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Federation.$type, Federation); + +const baseFederation_LabelsEntry: object = { + $type: "yandex.cloud.iam.v1.workload.oidc.Federation.LabelsEntry", + key: "", + value: "", +}; + +export const Federation_LabelsEntry = { + $type: "yandex.cloud.iam.v1.workload.oidc.Federation.LabelsEntry" as const, + + encode( + message: Federation_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Federation_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFederation_LabelsEntry } as Federation_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Federation_LabelsEntry { + const message = { ...baseFederation_LabelsEntry } as Federation_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Federation_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Federation_LabelsEntry { + const message = { ...baseFederation_LabelsEntry } as Federation_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Federation_LabelsEntry.$type, Federation_LabelsEntry); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/iam/v1/workload/oidc/federation_service.ts b/src/generated/yandex/cloud/iam/v1/workload/oidc/federation_service.ts new file mode 100644 index 00000000..efa310f9 --- /dev/null +++ b/src/generated/yandex/cloud/iam/v1/workload/oidc/federation_service.ts @@ -0,0 +1,1524 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../../../../../google/protobuf/field_mask"; +import { Federation } from "../../../../../../yandex/cloud/iam/v1/workload/oidc/federation"; +import { Operation } from "../../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.iam.v1.workload.oidc"; + +export interface GetFederationRequest { + $type: "yandex.cloud.iam.v1.workload.oidc.GetFederationRequest"; + /** + * ID of the OIDC workload identity federation to return. + * To get the OIDC workload identity federation ID, make a [FederationService.List] request. + */ + federationId: string; +} + +export interface ListFederationsRequest { + $type: "yandex.cloud.iam.v1.workload.oidc.ListFederationsRequest"; + /** + * ID of the folder to list OIDC workload identity federations in. + * To get the folder ID, make a [yandex.cloud.resourcemanager.v1.FolderService.List] request. + */ + folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], + * the service returns a [ListFederationsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100 + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] + * to the [ListFederationsResponse.next_page_token] + * returned by a previous list request. + */ + pageToken: string; +} + +export interface ListFederationsResponse { + $type: "yandex.cloud.iam.v1.workload.oidc.ListFederationsResponse"; + /** List of OIDC workload identity federations. */ + federations: Federation[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListFederationsRequest.page_size], use + * the [next_page_token] as the value + * for the [ListFederationsRequest.page_token] query parameter + * in the next list request. Each subsequent list request will have its own + * [next_page_token] to continue paging through the results. + */ + nextPageToken: string; +} + +export interface CreateFederationRequest { + $type: "yandex.cloud.iam.v1.workload.oidc.CreateFederationRequest"; + /** + * ID of the folder to create an OIDC workload identity federation in. + * To get the folder ID, make a [yandex.cloud.resourcemanager.v1.FolderService.List] request. + */ + folderId: string; + /** + * Name of the OIDC workload identity federation. + * The name must be unique within the folder. + */ + name: string; + /** Description of the OIDC workload identity federation. */ + description: string; + /** + * True - the OIDC workload identity federation is disabled and cannot be used for authentication. + * False - the OIDC workload identity federation is enabled and can be used for authentication. + */ + disabled: boolean; + /** List of trusted values for aud claim. */ + audiences: string[]; + /** URL of the external IdP server to be used for authentication. */ + issuer: string; + /** URL reference to trusted keys in format of JSON Web Key Set. */ + jwksUrl: string; + /** Resource labels as `` key:value `` pairs */ + labels: { [key: string]: string }; +} + +export interface CreateFederationRequest_LabelsEntry { + $type: "yandex.cloud.iam.v1.workload.oidc.CreateFederationRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface CreateFederationMetadata { + $type: "yandex.cloud.iam.v1.workload.oidc.CreateFederationMetadata"; + /** ID of the OIDC workload identity federation that is being created. */ + federationId: string; +} + +export interface UpdateFederationRequest { + $type: "yandex.cloud.iam.v1.workload.oidc.UpdateFederationRequest"; + /** + * ID of the OIDC workload identity federation to update. + * To get the OIDC workload identity federation ID, make a [FederationService.List] request. + */ + federationId: string; + /** Field mask that specifies which fields of the OIDC workload identity federation are going to be updated. */ + updateMask?: FieldMask; + /** + * Name of the OIDC workload identity federation. + * The name must be unique within the folder. + */ + name: string; + /** Description of the OIDC workload identity federation. */ + description: string; + /** + * True - the OIDC workload identity federation is disabled and cannot be used for authentication. + * False - the OIDC workload identity federation is enabled and can be used for authentication. + */ + disabled: boolean; + /** List of trusted values for aud claim. */ + audiences: string[]; + /** URL reference to trusted keys in format of JSON Web Key Set. */ + jwksUrl: string; + /** Resource labels as `` key:value `` pairs */ + labels: { [key: string]: string }; +} + +export interface UpdateFederationRequest_LabelsEntry { + $type: "yandex.cloud.iam.v1.workload.oidc.UpdateFederationRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateFederationMetadata { + $type: "yandex.cloud.iam.v1.workload.oidc.UpdateFederationMetadata"; + /** ID of the OIDC workload identity federation that is being updated. */ + federationId: string; +} + +export interface DeleteFederationRequest { + $type: "yandex.cloud.iam.v1.workload.oidc.DeleteFederationRequest"; + /** + * ID of the OIDC workload identity federation to delete. + * To get the OIDC workload identity federation ID, make a [FederationService.List] request. + */ + federationId: string; +} + +export interface DeleteFederationMetadata { + $type: "yandex.cloud.iam.v1.workload.oidc.DeleteFederationMetadata"; + /** ID of the OIDC workload identity federation that is being deleted. */ + federationId: string; +} + +const baseGetFederationRequest: object = { + $type: "yandex.cloud.iam.v1.workload.oidc.GetFederationRequest", + federationId: "", +}; + +export const GetFederationRequest = { + $type: "yandex.cloud.iam.v1.workload.oidc.GetFederationRequest" as const, + + encode( + message: GetFederationRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.federationId !== "") { + writer.uint32(10).string(message.federationId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetFederationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetFederationRequest } as GetFederationRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetFederationRequest { + const message = { ...baseGetFederationRequest } as GetFederationRequest; + message.federationId = + object.federationId !== undefined && object.federationId !== null + ? String(object.federationId) + : ""; + return message; + }, + + toJSON(message: GetFederationRequest): unknown { + const obj: any = {}; + message.federationId !== undefined && + (obj.federationId = message.federationId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetFederationRequest { + const message = { ...baseGetFederationRequest } as GetFederationRequest; + message.federationId = object.federationId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetFederationRequest.$type, GetFederationRequest); + +const baseListFederationsRequest: object = { + $type: "yandex.cloud.iam.v1.workload.oidc.ListFederationsRequest", + folderId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListFederationsRequest = { + $type: "yandex.cloud.iam.v1.workload.oidc.ListFederationsRequest" as const, + + encode( + message: ListFederationsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListFederationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListFederationsRequest } as ListFederationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListFederationsRequest { + const message = { ...baseListFederationsRequest } as ListFederationsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListFederationsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListFederationsRequest { + const message = { ...baseListFederationsRequest } as ListFederationsRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListFederationsRequest.$type, ListFederationsRequest); + +const baseListFederationsResponse: object = { + $type: "yandex.cloud.iam.v1.workload.oidc.ListFederationsResponse", + nextPageToken: "", +}; + +export const ListFederationsResponse = { + $type: "yandex.cloud.iam.v1.workload.oidc.ListFederationsResponse" as const, + + encode( + message: ListFederationsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.federations) { + Federation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListFederationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListFederationsResponse, + } as ListFederationsResponse; + message.federations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federations.push(Federation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListFederationsResponse { + const message = { + ...baseListFederationsResponse, + } as ListFederationsResponse; + message.federations = (object.federations ?? []).map((e: any) => + Federation.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListFederationsResponse): unknown { + const obj: any = {}; + if (message.federations) { + obj.federations = message.federations.map((e) => + e ? Federation.toJSON(e) : undefined + ); + } else { + obj.federations = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListFederationsResponse { + const message = { + ...baseListFederationsResponse, + } as ListFederationsResponse; + message.federations = + object.federations?.map((e) => Federation.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListFederationsResponse.$type, ListFederationsResponse); + +const baseCreateFederationRequest: object = { + $type: "yandex.cloud.iam.v1.workload.oidc.CreateFederationRequest", + folderId: "", + name: "", + description: "", + disabled: false, + audiences: "", + issuer: "", + jwksUrl: "", +}; + +export const CreateFederationRequest = { + $type: "yandex.cloud.iam.v1.workload.oidc.CreateFederationRequest" as const, + + encode( + message: CreateFederationRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.disabled === true) { + writer.uint32(40).bool(message.disabled); + } + for (const v of message.audiences) { + writer.uint32(50).string(v!); + } + if (message.issuer !== "") { + writer.uint32(58).string(message.issuer); + } + if (message.jwksUrl !== "") { + writer.uint32(66).string(message.jwksUrl); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateFederationRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.iam.v1.workload.oidc.CreateFederationRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(74).fork() + ).ldelim(); + }); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateFederationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateFederationRequest, + } as CreateFederationRequest; + message.audiences = []; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.folderId = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.disabled = reader.bool(); + break; + case 6: + message.audiences.push(reader.string()); + break; + case 7: + message.issuer = reader.string(); + break; + case 8: + message.jwksUrl = reader.string(); + break; + case 9: + const entry9 = CreateFederationRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry9.value !== undefined) { + message.labels[entry9.key] = entry9.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateFederationRequest { + const message = { + ...baseCreateFederationRequest, + } as CreateFederationRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.disabled = + object.disabled !== undefined && object.disabled !== null + ? Boolean(object.disabled) + : false; + message.audiences = (object.audiences ?? []).map((e: any) => String(e)); + message.issuer = + object.issuer !== undefined && object.issuer !== null + ? String(object.issuer) + : ""; + message.jwksUrl = + object.jwksUrl !== undefined && object.jwksUrl !== null + ? String(object.jwksUrl) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: CreateFederationRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.disabled !== undefined && (obj.disabled = message.disabled); + if (message.audiences) { + obj.audiences = message.audiences.map((e) => e); + } else { + obj.audiences = []; + } + message.issuer !== undefined && (obj.issuer = message.issuer); + message.jwksUrl !== undefined && (obj.jwksUrl = message.jwksUrl); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateFederationRequest { + const message = { + ...baseCreateFederationRequest, + } as CreateFederationRequest; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.disabled = object.disabled ?? false; + message.audiences = object.audiences?.map((e) => e) || []; + message.issuer = object.issuer ?? ""; + message.jwksUrl = object.jwksUrl ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(CreateFederationRequest.$type, CreateFederationRequest); + +const baseCreateFederationRequest_LabelsEntry: object = { + $type: + "yandex.cloud.iam.v1.workload.oidc.CreateFederationRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateFederationRequest_LabelsEntry = { + $type: + "yandex.cloud.iam.v1.workload.oidc.CreateFederationRequest.LabelsEntry" as const, + + encode( + message: CreateFederationRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateFederationRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateFederationRequest_LabelsEntry, + } as CreateFederationRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateFederationRequest_LabelsEntry { + const message = { + ...baseCreateFederationRequest_LabelsEntry, + } as CreateFederationRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateFederationRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateFederationRequest_LabelsEntry { + const message = { + ...baseCreateFederationRequest_LabelsEntry, + } as CreateFederationRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateFederationRequest_LabelsEntry.$type, + CreateFederationRequest_LabelsEntry +); + +const baseCreateFederationMetadata: object = { + $type: "yandex.cloud.iam.v1.workload.oidc.CreateFederationMetadata", + federationId: "", +}; + +export const CreateFederationMetadata = { + $type: "yandex.cloud.iam.v1.workload.oidc.CreateFederationMetadata" as const, + + encode( + message: CreateFederationMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.federationId !== "") { + writer.uint32(10).string(message.federationId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateFederationMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateFederationMetadata, + } as CreateFederationMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateFederationMetadata { + const message = { + ...baseCreateFederationMetadata, + } as CreateFederationMetadata; + message.federationId = + object.federationId !== undefined && object.federationId !== null + ? String(object.federationId) + : ""; + return message; + }, + + toJSON(message: CreateFederationMetadata): unknown { + const obj: any = {}; + message.federationId !== undefined && + (obj.federationId = message.federationId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateFederationMetadata { + const message = { + ...baseCreateFederationMetadata, + } as CreateFederationMetadata; + message.federationId = object.federationId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateFederationMetadata.$type, + CreateFederationMetadata +); + +const baseUpdateFederationRequest: object = { + $type: "yandex.cloud.iam.v1.workload.oidc.UpdateFederationRequest", + federationId: "", + name: "", + description: "", + disabled: false, + audiences: "", + jwksUrl: "", +}; + +export const UpdateFederationRequest = { + $type: "yandex.cloud.iam.v1.workload.oidc.UpdateFederationRequest" as const, + + encode( + message: UpdateFederationRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.federationId !== "") { + writer.uint32(10).string(message.federationId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.disabled === true) { + writer.uint32(40).bool(message.disabled); + } + for (const v of message.audiences) { + writer.uint32(50).string(v!); + } + if (message.jwksUrl !== "") { + writer.uint32(58).string(message.jwksUrl); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateFederationRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.iam.v1.workload.oidc.UpdateFederationRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(66).fork() + ).ldelim(); + }); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateFederationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateFederationRequest, + } as UpdateFederationRequest; + message.audiences = []; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federationId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.disabled = reader.bool(); + break; + case 6: + message.audiences.push(reader.string()); + break; + case 7: + message.jwksUrl = reader.string(); + break; + case 8: + const entry8 = UpdateFederationRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry8.value !== undefined) { + message.labels[entry8.key] = entry8.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateFederationRequest { + const message = { + ...baseUpdateFederationRequest, + } as UpdateFederationRequest; + message.federationId = + object.federationId !== undefined && object.federationId !== null + ? String(object.federationId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.disabled = + object.disabled !== undefined && object.disabled !== null + ? Boolean(object.disabled) + : false; + message.audiences = (object.audiences ?? []).map((e: any) => String(e)); + message.jwksUrl = + object.jwksUrl !== undefined && object.jwksUrl !== null + ? String(object.jwksUrl) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: UpdateFederationRequest): unknown { + const obj: any = {}; + message.federationId !== undefined && + (obj.federationId = message.federationId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.disabled !== undefined && (obj.disabled = message.disabled); + if (message.audiences) { + obj.audiences = message.audiences.map((e) => e); + } else { + obj.audiences = []; + } + message.jwksUrl !== undefined && (obj.jwksUrl = message.jwksUrl); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateFederationRequest { + const message = { + ...baseUpdateFederationRequest, + } as UpdateFederationRequest; + message.federationId = object.federationId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.disabled = object.disabled ?? false; + message.audiences = object.audiences?.map((e) => e) || []; + message.jwksUrl = object.jwksUrl ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(UpdateFederationRequest.$type, UpdateFederationRequest); + +const baseUpdateFederationRequest_LabelsEntry: object = { + $type: + "yandex.cloud.iam.v1.workload.oidc.UpdateFederationRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateFederationRequest_LabelsEntry = { + $type: + "yandex.cloud.iam.v1.workload.oidc.UpdateFederationRequest.LabelsEntry" as const, + + encode( + message: UpdateFederationRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateFederationRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateFederationRequest_LabelsEntry, + } as UpdateFederationRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateFederationRequest_LabelsEntry { + const message = { + ...baseUpdateFederationRequest_LabelsEntry, + } as UpdateFederationRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateFederationRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateFederationRequest_LabelsEntry { + const message = { + ...baseUpdateFederationRequest_LabelsEntry, + } as UpdateFederationRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateFederationRequest_LabelsEntry.$type, + UpdateFederationRequest_LabelsEntry +); + +const baseUpdateFederationMetadata: object = { + $type: "yandex.cloud.iam.v1.workload.oidc.UpdateFederationMetadata", + federationId: "", +}; + +export const UpdateFederationMetadata = { + $type: "yandex.cloud.iam.v1.workload.oidc.UpdateFederationMetadata" as const, + + encode( + message: UpdateFederationMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.federationId !== "") { + writer.uint32(10).string(message.federationId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateFederationMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateFederationMetadata, + } as UpdateFederationMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateFederationMetadata { + const message = { + ...baseUpdateFederationMetadata, + } as UpdateFederationMetadata; + message.federationId = + object.federationId !== undefined && object.federationId !== null + ? String(object.federationId) + : ""; + return message; + }, + + toJSON(message: UpdateFederationMetadata): unknown { + const obj: any = {}; + message.federationId !== undefined && + (obj.federationId = message.federationId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateFederationMetadata { + const message = { + ...baseUpdateFederationMetadata, + } as UpdateFederationMetadata; + message.federationId = object.federationId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateFederationMetadata.$type, + UpdateFederationMetadata +); + +const baseDeleteFederationRequest: object = { + $type: "yandex.cloud.iam.v1.workload.oidc.DeleteFederationRequest", + federationId: "", +}; + +export const DeleteFederationRequest = { + $type: "yandex.cloud.iam.v1.workload.oidc.DeleteFederationRequest" as const, + + encode( + message: DeleteFederationRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.federationId !== "") { + writer.uint32(10).string(message.federationId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteFederationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteFederationRequest, + } as DeleteFederationRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteFederationRequest { + const message = { + ...baseDeleteFederationRequest, + } as DeleteFederationRequest; + message.federationId = + object.federationId !== undefined && object.federationId !== null + ? String(object.federationId) + : ""; + return message; + }, + + toJSON(message: DeleteFederationRequest): unknown { + const obj: any = {}; + message.federationId !== undefined && + (obj.federationId = message.federationId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteFederationRequest { + const message = { + ...baseDeleteFederationRequest, + } as DeleteFederationRequest; + message.federationId = object.federationId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteFederationRequest.$type, DeleteFederationRequest); + +const baseDeleteFederationMetadata: object = { + $type: "yandex.cloud.iam.v1.workload.oidc.DeleteFederationMetadata", + federationId: "", +}; + +export const DeleteFederationMetadata = { + $type: "yandex.cloud.iam.v1.workload.oidc.DeleteFederationMetadata" as const, + + encode( + message: DeleteFederationMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.federationId !== "") { + writer.uint32(10).string(message.federationId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteFederationMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteFederationMetadata, + } as DeleteFederationMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteFederationMetadata { + const message = { + ...baseDeleteFederationMetadata, + } as DeleteFederationMetadata; + message.federationId = + object.federationId !== undefined && object.federationId !== null + ? String(object.federationId) + : ""; + return message; + }, + + toJSON(message: DeleteFederationMetadata): unknown { + const obj: any = {}; + message.federationId !== undefined && + (obj.federationId = message.federationId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteFederationMetadata { + const message = { + ...baseDeleteFederationMetadata, + } as DeleteFederationMetadata; + message.federationId = object.federationId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteFederationMetadata.$type, + DeleteFederationMetadata +); + +/** A set of methods for managing OIDC workload identity federations. */ +export const FederationServiceService = { + /** + * Returns the specified OIDC workload identity federation. + * + * To get the list of available OIDC workload identity federation, make a [List] request. + */ + get: { + path: "/yandex.cloud.iam.v1.workload.oidc.FederationService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetFederationRequest) => + Buffer.from(GetFederationRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetFederationRequest.decode(value), + responseSerialize: (value: Federation) => + Buffer.from(Federation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Federation.decode(value), + }, + /** Retrieves the list of OIDC workload identity federations in the specified folder. */ + list: { + path: "/yandex.cloud.iam.v1.workload.oidc.FederationService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListFederationsRequest) => + Buffer.from(ListFederationsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListFederationsRequest.decode(value), + responseSerialize: (value: ListFederationsResponse) => + Buffer.from(ListFederationsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListFederationsResponse.decode(value), + }, + /** Creates an OIDC workload identity federation in the specified folder. */ + create: { + path: "/yandex.cloud.iam.v1.workload.oidc.FederationService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateFederationRequest) => + Buffer.from(CreateFederationRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CreateFederationRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates the specified OIDC workload identity federation. */ + update: { + path: "/yandex.cloud.iam.v1.workload.oidc.FederationService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateFederationRequest) => + Buffer.from(UpdateFederationRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateFederationRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes the specified OIDC workload identity federation. */ + delete: { + path: "/yandex.cloud.iam.v1.workload.oidc.FederationService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteFederationRequest) => + Buffer.from(DeleteFederationRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteFederationRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface FederationServiceServer extends UntypedServiceImplementation { + /** + * Returns the specified OIDC workload identity federation. + * + * To get the list of available OIDC workload identity federation, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of OIDC workload identity federations in the specified folder. */ + list: handleUnaryCall; + /** Creates an OIDC workload identity federation in the specified folder. */ + create: handleUnaryCall; + /** Updates the specified OIDC workload identity federation. */ + update: handleUnaryCall; + /** Deletes the specified OIDC workload identity federation. */ + delete: handleUnaryCall; +} + +export interface FederationServiceClient extends Client { + /** + * Returns the specified OIDC workload identity federation. + * + * To get the list of available OIDC workload identity federation, make a [List] request. + */ + get( + request: GetFederationRequest, + callback: (error: ServiceError | null, response: Federation) => void + ): ClientUnaryCall; + get( + request: GetFederationRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Federation) => void + ): ClientUnaryCall; + get( + request: GetFederationRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Federation) => void + ): ClientUnaryCall; + /** Retrieves the list of OIDC workload identity federations in the specified folder. */ + list( + request: ListFederationsRequest, + callback: ( + error: ServiceError | null, + response: ListFederationsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListFederationsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListFederationsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListFederationsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListFederationsResponse + ) => void + ): ClientUnaryCall; + /** Creates an OIDC workload identity federation in the specified folder. */ + create( + request: CreateFederationRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateFederationRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateFederationRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates the specified OIDC workload identity federation. */ + update( + request: UpdateFederationRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateFederationRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateFederationRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes the specified OIDC workload identity federation. */ + delete( + request: DeleteFederationRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteFederationRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteFederationRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const FederationServiceClient = makeGenericClientConstructor( + FederationServiceService, + "yandex.cloud.iam.v1.workload.oidc.FederationService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): FederationServiceClient; + service: typeof FederationServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/index.ts b/src/generated/yandex/cloud/index.ts index 62af102f..c138f57a 100644 --- a/src/generated/yandex/cloud/index.ts +++ b/src/generated/yandex/cloud/index.ts @@ -1,11 +1,16 @@ export * as access from './access/' export * as ai from './ai/' +export * as airflow from './airflow/' export * as api from './api/' export * as apploadbalancer from './apploadbalancer/' +export * as audittrails from './audittrails/' export * as backup from './backup/' export * as billing from './billing/' export * as cdn from './cdn/' export * as certificatemanager from './certificatemanager/' +export * as cic from './cic/' +export * as cloudapps from './cloudapps/' +export * as cloudrouter from './cloudrouter/' export * as compute from './compute/' export * as containerregistry from './containerregistry/' export * as dataproc from './dataproc/' @@ -31,6 +36,10 @@ export * as quota from './quota/' export * as reference from './reference/' export * as resourcemanager from './resourcemanager/' export * as serverless from './serverless/' +export * as smartcaptcha from './smartcaptcha/' +export * as smartwebsecurity from './smartwebsecurity/' +export * as speechsense from './speechsense/' export * as storage from './storage/' +export * as video from './video/' export * as vpc from './vpc/' export * as ydb from './ydb/' \ No newline at end of file diff --git a/src/generated/yandex/cloud/iot/broker/v1/broker.ts b/src/generated/yandex/cloud/iot/broker/v1/broker.ts index eaebee40..281b6db0 100644 --- a/src/generated/yandex/cloud/iot/broker/v1/broker.ts +++ b/src/generated/yandex/cloud/iot/broker/v1/broker.ts @@ -2,6 +2,11 @@ import { messageTypeRegistry } from "../../../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; +import { + LogLevel_Level, + logLevel_LevelFromJSON, + logLevel_LevelToJSON, +} from "../../../../../yandex/cloud/logging/v1/log_entry"; import { Timestamp } from "../../../../../google/protobuf/timestamp"; export const protobufPackage = "yandex.cloud.iot.broker.v1"; @@ -23,6 +28,8 @@ export interface Broker { labels: { [key: string]: string }; /** Status of the broker. */ status: Broker_Status; + /** Options for logging broker events */ + logOptions?: LogOptions; } export enum Broker_Status { @@ -102,6 +109,22 @@ export interface BrokerPassword { createdAt?: Date; } +export interface LogOptions { + $type: "yandex.cloud.iot.broker.v1.LogOptions"; + /** Is logging from broker disabled. */ + disabled: boolean; + /** Entry should be written to log group resolved by ID. */ + logGroupId: string | undefined; + /** Entry should be written to default log group for specified folder. */ + folderId: string | undefined; + /** + * Minimum log entry level. + * + * See [LogLevel.Level] for details. + */ + minLevel: LogLevel_Level; +} + const baseBroker: object = { $type: "yandex.cloud.iot.broker.v1.Broker", id: "", @@ -149,6 +172,9 @@ export const Broker = { if (message.status !== 0) { writer.uint32(56).int32(message.status); } + if (message.logOptions !== undefined) { + LogOptions.encode(message.logOptions, writer.uint32(66).fork()).ldelim(); + } return writer; }, @@ -186,6 +212,9 @@ export const Broker = { case 7: message.status = reader.int32() as any; break; + case 8: + message.logOptions = LogOptions.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -224,6 +253,10 @@ export const Broker = { object.status !== undefined && object.status !== null ? broker_StatusFromJSON(object.status) : 0; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromJSON(object.logOptions) + : undefined; return message; }, @@ -244,6 +277,10 @@ export const Broker = { } message.status !== undefined && (obj.status = broker_StatusToJSON(message.status)); + message.logOptions !== undefined && + (obj.logOptions = message.logOptions + ? LogOptions.toJSON(message.logOptions) + : undefined); return obj; }, @@ -263,6 +300,10 @@ export const Broker = { return acc; }, {}); message.status = object.status ?? 0; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromPartial(object.logOptions) + : undefined; return message; }, }; @@ -541,6 +582,106 @@ export const BrokerPassword = { messageTypeRegistry.set(BrokerPassword.$type, BrokerPassword); +const baseLogOptions: object = { + $type: "yandex.cloud.iot.broker.v1.LogOptions", + disabled: false, + minLevel: 0, +}; + +export const LogOptions = { + $type: "yandex.cloud.iot.broker.v1.LogOptions" as const, + + encode( + message: LogOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.disabled === true) { + writer.uint32(8).bool(message.disabled); + } + if (message.logGroupId !== undefined) { + writer.uint32(18).string(message.logGroupId); + } + if (message.folderId !== undefined) { + writer.uint32(26).string(message.folderId); + } + if (message.minLevel !== 0) { + writer.uint32(32).int32(message.minLevel); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LogOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLogOptions } as LogOptions; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.disabled = reader.bool(); + break; + case 2: + message.logGroupId = reader.string(); + break; + case 3: + message.folderId = reader.string(); + break; + case 4: + message.minLevel = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LogOptions { + const message = { ...baseLogOptions } as LogOptions; + message.disabled = + object.disabled !== undefined && object.disabled !== null + ? Boolean(object.disabled) + : false; + message.logGroupId = + object.logGroupId !== undefined && object.logGroupId !== null + ? String(object.logGroupId) + : undefined; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : undefined; + message.minLevel = + object.minLevel !== undefined && object.minLevel !== null + ? logLevel_LevelFromJSON(object.minLevel) + : 0; + return message; + }, + + toJSON(message: LogOptions): unknown { + const obj: any = {}; + message.disabled !== undefined && (obj.disabled = message.disabled); + message.logGroupId !== undefined && (obj.logGroupId = message.logGroupId); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.minLevel !== undefined && + (obj.minLevel = logLevel_LevelToJSON(message.minLevel)); + return obj; + }, + + fromPartial, I>>( + object: I + ): LogOptions { + const message = { ...baseLogOptions } as LogOptions; + message.disabled = object.disabled ?? false; + message.logGroupId = object.logGroupId ?? undefined; + message.folderId = object.folderId ?? undefined; + message.minLevel = object.minLevel ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(LogOptions.$type, LogOptions); + type Builtin = | Date | Function diff --git a/src/generated/yandex/cloud/iot/broker/v1/broker_service.ts b/src/generated/yandex/cloud/iot/broker/v1/broker_service.ts index 8b855981..fff0f3e7 100644 --- a/src/generated/yandex/cloud/iot/broker/v1/broker_service.ts +++ b/src/generated/yandex/cloud/iot/broker/v1/broker_service.ts @@ -14,12 +14,13 @@ import { ServiceError, } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; -import { FieldMask } from "../../../../../google/protobuf/field_mask"; import { + LogOptions, Broker, BrokerCertificate, BrokerPassword, } from "../../../../../yandex/cloud/iot/broker/v1/broker"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; import { Operation } from "../../../../../yandex/cloud/operation/operation"; export const protobufPackage = "yandex.cloud.iot.broker.v1"; @@ -92,6 +93,8 @@ export interface CreateBrokerRequest { * The password must contain at least three character categories among the following: upper case latin, lower case latin, numbers and special symbols. */ password: string; + /** Options for logging broker events */ + logOptions?: LogOptions; } export interface CreateBrokerRequest_LabelsEntry { @@ -133,6 +136,8 @@ export interface UpdateBrokerRequest { * Existing set of `labels` is completely replaced by the provided set. */ labels: { [key: string]: string }; + /** Options for logging broker events */ + logOptions?: LogOptions; } export interface UpdateBrokerRequest_LabelsEntry { @@ -595,6 +600,9 @@ export const CreateBrokerRequest = { if (message.password !== "") { writer.uint32(50).string(message.password); } + if (message.logOptions !== undefined) { + LogOptions.encode(message.logOptions, writer.uint32(58).fork()).ldelim(); + } return writer; }, @@ -633,6 +641,9 @@ export const CreateBrokerRequest = { case 6: message.password = reader.string(); break; + case 7: + message.logOptions = LogOptions.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -668,6 +679,10 @@ export const CreateBrokerRequest = { object.password !== undefined && object.password !== null ? String(object.password) : ""; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromJSON(object.logOptions) + : undefined; return message; }, @@ -691,6 +706,10 @@ export const CreateBrokerRequest = { obj.certificates = []; } message.password !== undefined && (obj.password = message.password); + message.logOptions !== undefined && + (obj.logOptions = message.logOptions + ? LogOptions.toJSON(message.logOptions) + : undefined); return obj; }, @@ -714,6 +733,10 @@ export const CreateBrokerRequest = { CreateBrokerRequest_Certificate.fromPartial(e) ) || []; message.password = object.password ?? ""; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromPartial(object.logOptions) + : undefined; return message; }, }; @@ -981,6 +1004,9 @@ export const UpdateBrokerRequest = { writer.uint32(42).fork() ).ldelim(); }); + if (message.logOptions !== undefined) { + LogOptions.encode(message.logOptions, writer.uint32(50).fork()).ldelim(); + } return writer; }, @@ -1013,6 +1039,9 @@ export const UpdateBrokerRequest = { message.labels[entry5.key] = entry5.value; } break; + case 6: + message.logOptions = LogOptions.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1045,6 +1074,10 @@ export const UpdateBrokerRequest = { acc[key] = String(value); return acc; }, {}); + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromJSON(object.logOptions) + : undefined; return message; }, @@ -1064,6 +1097,10 @@ export const UpdateBrokerRequest = { obj.labels[k] = v; }); } + message.logOptions !== undefined && + (obj.logOptions = message.logOptions + ? LogOptions.toJSON(message.logOptions) + : undefined); return obj; }, @@ -1086,6 +1123,10 @@ export const UpdateBrokerRequest = { } return acc; }, {}); + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromPartial(object.logOptions) + : undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/iot/devices/v1/registry.ts b/src/generated/yandex/cloud/iot/devices/v1/registry.ts index 9a5d781a..6275e5fb 100644 --- a/src/generated/yandex/cloud/iot/devices/v1/registry.ts +++ b/src/generated/yandex/cloud/iot/devices/v1/registry.ts @@ -2,6 +2,11 @@ import { messageTypeRegistry } from "../../../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; +import { + LogLevel_Level, + logLevel_LevelFromJSON, + logLevel_LevelToJSON, +} from "../../../../../yandex/cloud/logging/v1/log_entry"; import { Timestamp } from "../../../../../google/protobuf/timestamp"; export const protobufPackage = "yandex.cloud.iot.devices.v1"; @@ -25,6 +30,8 @@ export interface Registry { status: Registry_Status; /** ID of the logs group for the specified registry. */ logGroupId: string; + /** Options for logging registry events */ + logOptions?: LogOptions; } export enum Registry_Status { @@ -35,6 +42,8 @@ export enum Registry_Status { ACTIVE = 2, /** DELETING - Registry is being deleted. */ DELETING = 3, + /** DISABLED - Registry is disabled. */ + DISABLED = 4, UNRECOGNIZED = -1, } @@ -52,6 +61,9 @@ export function registry_StatusFromJSON(object: any): Registry_Status { case 3: case "DELETING": return Registry_Status.DELETING; + case 4: + case "DISABLED": + return Registry_Status.DISABLED; case -1: case "UNRECOGNIZED": default: @@ -69,6 +81,8 @@ export function registry_StatusToJSON(object: Registry_Status): string { return "ACTIVE"; case Registry_Status.DELETING: return "DELETING"; + case Registry_Status.DISABLED: + return "DISABLED"; default: return "UNKNOWN"; } @@ -140,6 +154,22 @@ export interface DataStreamExport { createdAt?: Date; } +export interface LogOptions { + $type: "yandex.cloud.iot.devices.v1.LogOptions"; + /** Is logging from registry disabled. */ + disabled: boolean; + /** Entry should be written to log group resolved by ID. */ + logGroupId: string | undefined; + /** Entry should be written to default log group for specified folder. */ + folderId: string | undefined; + /** + * Minimum log entry level. + * + * See [LogLevel.Level] for details. + */ + minLevel: LogLevel_Level; +} + const baseRegistry: object = { $type: "yandex.cloud.iot.devices.v1.Registry", id: "", @@ -191,6 +221,9 @@ export const Registry = { if (message.logGroupId !== "") { writer.uint32(66).string(message.logGroupId); } + if (message.logOptions !== undefined) { + LogOptions.encode(message.logOptions, writer.uint32(74).fork()).ldelim(); + } return writer; }, @@ -231,6 +264,9 @@ export const Registry = { case 8: message.logGroupId = reader.string(); break; + case 9: + message.logOptions = LogOptions.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -273,6 +309,10 @@ export const Registry = { object.logGroupId !== undefined && object.logGroupId !== null ? String(object.logGroupId) : ""; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromJSON(object.logOptions) + : undefined; return message; }, @@ -294,6 +334,10 @@ export const Registry = { message.status !== undefined && (obj.status = registry_StatusToJSON(message.status)); message.logGroupId !== undefined && (obj.logGroupId = message.logGroupId); + message.logOptions !== undefined && + (obj.logOptions = message.logOptions + ? LogOptions.toJSON(message.logOptions) + : undefined); return obj; }, @@ -314,6 +358,10 @@ export const Registry = { }, {}); message.status = object.status ?? 0; message.logGroupId = object.logGroupId ?? ""; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromPartial(object.logOptions) + : undefined; return message; }, }; @@ -842,6 +890,106 @@ export const DataStreamExport = { messageTypeRegistry.set(DataStreamExport.$type, DataStreamExport); +const baseLogOptions: object = { + $type: "yandex.cloud.iot.devices.v1.LogOptions", + disabled: false, + minLevel: 0, +}; + +export const LogOptions = { + $type: "yandex.cloud.iot.devices.v1.LogOptions" as const, + + encode( + message: LogOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.disabled === true) { + writer.uint32(8).bool(message.disabled); + } + if (message.logGroupId !== undefined) { + writer.uint32(18).string(message.logGroupId); + } + if (message.folderId !== undefined) { + writer.uint32(26).string(message.folderId); + } + if (message.minLevel !== 0) { + writer.uint32(32).int32(message.minLevel); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LogOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLogOptions } as LogOptions; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.disabled = reader.bool(); + break; + case 2: + message.logGroupId = reader.string(); + break; + case 3: + message.folderId = reader.string(); + break; + case 4: + message.minLevel = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LogOptions { + const message = { ...baseLogOptions } as LogOptions; + message.disabled = + object.disabled !== undefined && object.disabled !== null + ? Boolean(object.disabled) + : false; + message.logGroupId = + object.logGroupId !== undefined && object.logGroupId !== null + ? String(object.logGroupId) + : undefined; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : undefined; + message.minLevel = + object.minLevel !== undefined && object.minLevel !== null + ? logLevel_LevelFromJSON(object.minLevel) + : 0; + return message; + }, + + toJSON(message: LogOptions): unknown { + const obj: any = {}; + message.disabled !== undefined && (obj.disabled = message.disabled); + message.logGroupId !== undefined && (obj.logGroupId = message.logGroupId); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.minLevel !== undefined && + (obj.minLevel = logLevel_LevelToJSON(message.minLevel)); + return obj; + }, + + fromPartial, I>>( + object: I + ): LogOptions { + const message = { ...baseLogOptions } as LogOptions; + message.disabled = object.disabled ?? false; + message.logGroupId = object.logGroupId ?? undefined; + message.folderId = object.folderId ?? undefined; + message.minLevel = object.minLevel ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(LogOptions.$type, LogOptions); + type Builtin = | Date | Function diff --git a/src/generated/yandex/cloud/iot/devices/v1/registry_service.ts b/src/generated/yandex/cloud/iot/devices/v1/registry_service.ts index 1022db04..ac763c42 100644 --- a/src/generated/yandex/cloud/iot/devices/v1/registry_service.ts +++ b/src/generated/yandex/cloud/iot/devices/v1/registry_service.ts @@ -14,14 +14,15 @@ import { ServiceError, } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; -import { FieldMask } from "../../../../../google/protobuf/field_mask"; import { + LogOptions, Registry, RegistryCertificate, RegistryPassword, DeviceAlias, DataStreamExport, } from "../../../../../yandex/cloud/iot/devices/v1/registry"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; import { Operation } from "../../../../../yandex/cloud/operation/operation"; export const protobufPackage = "yandex.cloud.iot.devices.v1"; @@ -110,6 +111,8 @@ export interface CreateRegistryRequest { * The password must contain at least three character categories among the following: upper case latin, lower case latin, numbers and special symbols. */ password: string; + /** Options for logging registry events */ + logOptions?: LogOptions; } export interface CreateRegistryRequest_LabelsEntry { @@ -151,6 +154,8 @@ export interface UpdateRegistryRequest { * Existing set of `labels` is completely replaced by the provided set. */ labels: { [key: string]: string }; + /** Options for logging registry events */ + logOptions?: LogOptions; } export interface UpdateRegistryRequest_LabelsEntry { @@ -434,6 +439,30 @@ export interface ListDataStreamExportsResponse { dataStreamExports: DataStreamExport[]; } +export interface DisableRegistryRequest { + $type: "yandex.cloud.iot.devices.v1.DisableRegistryRequest"; + /** ID of the registry to disable. */ + registryId: string; +} + +export interface DisableRegistryMetadata { + $type: "yandex.cloud.iot.devices.v1.DisableRegistryMetadata"; + /** ID of the registry that was disabled. */ + registryId: string; +} + +export interface EnableRegistryRequest { + $type: "yandex.cloud.iot.devices.v1.EnableRegistryRequest"; + /** ID of the registry to enable. */ + registryId: string; +} + +export interface EnableRegistryMetadata { + $type: "yandex.cloud.iot.devices.v1.EnableRegistryMetadata"; + /** ID of the registry that was enabled. */ + registryId: string; +} + const baseGetRegistryRequest: object = { $type: "yandex.cloud.iot.devices.v1.GetRegistryRequest", registryId: "", @@ -805,6 +834,9 @@ export const CreateRegistryRequest = { if (message.password !== "") { writer.uint32(50).string(message.password); } + if (message.logOptions !== undefined) { + LogOptions.encode(message.logOptions, writer.uint32(58).fork()).ldelim(); + } return writer; }, @@ -846,6 +878,9 @@ export const CreateRegistryRequest = { case 6: message.password = reader.string(); break; + case 7: + message.logOptions = LogOptions.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -881,6 +916,10 @@ export const CreateRegistryRequest = { object.password !== undefined && object.password !== null ? String(object.password) : ""; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromJSON(object.logOptions) + : undefined; return message; }, @@ -904,6 +943,10 @@ export const CreateRegistryRequest = { obj.certificates = []; } message.password !== undefined && (obj.password = message.password); + message.logOptions !== undefined && + (obj.logOptions = message.logOptions + ? LogOptions.toJSON(message.logOptions) + : undefined); return obj; }, @@ -927,6 +970,10 @@ export const CreateRegistryRequest = { CreateRegistryRequest_Certificate.fromPartial(e) ) || []; message.password = object.password ?? ""; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromPartial(object.logOptions) + : undefined; return message; }, }; @@ -1197,6 +1244,9 @@ export const UpdateRegistryRequest = { writer.uint32(42).fork() ).ldelim(); }); + if (message.logOptions !== undefined) { + LogOptions.encode(message.logOptions, writer.uint32(50).fork()).ldelim(); + } return writer; }, @@ -1232,6 +1282,9 @@ export const UpdateRegistryRequest = { message.labels[entry5.key] = entry5.value; } break; + case 6: + message.logOptions = LogOptions.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1264,6 +1317,10 @@ export const UpdateRegistryRequest = { acc[key] = String(value); return acc; }, {}); + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromJSON(object.logOptions) + : undefined; return message; }, @@ -1283,6 +1340,10 @@ export const UpdateRegistryRequest = { obj.labels[k] = v; }); } + message.logOptions !== undefined && + (obj.logOptions = message.logOptions + ? LogOptions.toJSON(message.logOptions) + : undefined); return obj; }, @@ -1305,6 +1366,10 @@ export const UpdateRegistryRequest = { } return acc; }, {}); + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromPartial(object.logOptions) + : undefined; return message; }, }; @@ -3575,6 +3640,272 @@ messageTypeRegistry.set( ListDataStreamExportsResponse ); +const baseDisableRegistryRequest: object = { + $type: "yandex.cloud.iot.devices.v1.DisableRegistryRequest", + registryId: "", +}; + +export const DisableRegistryRequest = { + $type: "yandex.cloud.iot.devices.v1.DisableRegistryRequest" as const, + + encode( + message: DisableRegistryRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.registryId !== "") { + writer.uint32(10).string(message.registryId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DisableRegistryRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDisableRegistryRequest } as DisableRegistryRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.registryId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DisableRegistryRequest { + const message = { ...baseDisableRegistryRequest } as DisableRegistryRequest; + message.registryId = + object.registryId !== undefined && object.registryId !== null + ? String(object.registryId) + : ""; + return message; + }, + + toJSON(message: DisableRegistryRequest): unknown { + const obj: any = {}; + message.registryId !== undefined && (obj.registryId = message.registryId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DisableRegistryRequest { + const message = { ...baseDisableRegistryRequest } as DisableRegistryRequest; + message.registryId = object.registryId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DisableRegistryRequest.$type, DisableRegistryRequest); + +const baseDisableRegistryMetadata: object = { + $type: "yandex.cloud.iot.devices.v1.DisableRegistryMetadata", + registryId: "", +}; + +export const DisableRegistryMetadata = { + $type: "yandex.cloud.iot.devices.v1.DisableRegistryMetadata" as const, + + encode( + message: DisableRegistryMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.registryId !== "") { + writer.uint32(10).string(message.registryId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DisableRegistryMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDisableRegistryMetadata, + } as DisableRegistryMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.registryId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DisableRegistryMetadata { + const message = { + ...baseDisableRegistryMetadata, + } as DisableRegistryMetadata; + message.registryId = + object.registryId !== undefined && object.registryId !== null + ? String(object.registryId) + : ""; + return message; + }, + + toJSON(message: DisableRegistryMetadata): unknown { + const obj: any = {}; + message.registryId !== undefined && (obj.registryId = message.registryId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DisableRegistryMetadata { + const message = { + ...baseDisableRegistryMetadata, + } as DisableRegistryMetadata; + message.registryId = object.registryId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DisableRegistryMetadata.$type, DisableRegistryMetadata); + +const baseEnableRegistryRequest: object = { + $type: "yandex.cloud.iot.devices.v1.EnableRegistryRequest", + registryId: "", +}; + +export const EnableRegistryRequest = { + $type: "yandex.cloud.iot.devices.v1.EnableRegistryRequest" as const, + + encode( + message: EnableRegistryRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.registryId !== "") { + writer.uint32(10).string(message.registryId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): EnableRegistryRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnableRegistryRequest } as EnableRegistryRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.registryId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnableRegistryRequest { + const message = { ...baseEnableRegistryRequest } as EnableRegistryRequest; + message.registryId = + object.registryId !== undefined && object.registryId !== null + ? String(object.registryId) + : ""; + return message; + }, + + toJSON(message: EnableRegistryRequest): unknown { + const obj: any = {}; + message.registryId !== undefined && (obj.registryId = message.registryId); + return obj; + }, + + fromPartial, I>>( + object: I + ): EnableRegistryRequest { + const message = { ...baseEnableRegistryRequest } as EnableRegistryRequest; + message.registryId = object.registryId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(EnableRegistryRequest.$type, EnableRegistryRequest); + +const baseEnableRegistryMetadata: object = { + $type: "yandex.cloud.iot.devices.v1.EnableRegistryMetadata", + registryId: "", +}; + +export const EnableRegistryMetadata = { + $type: "yandex.cloud.iot.devices.v1.EnableRegistryMetadata" as const, + + encode( + message: EnableRegistryMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.registryId !== "") { + writer.uint32(10).string(message.registryId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): EnableRegistryMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnableRegistryMetadata } as EnableRegistryMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.registryId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnableRegistryMetadata { + const message = { ...baseEnableRegistryMetadata } as EnableRegistryMetadata; + message.registryId = + object.registryId !== undefined && object.registryId !== null + ? String(object.registryId) + : ""; + return message; + }, + + toJSON(message: EnableRegistryMetadata): unknown { + const obj: any = {}; + message.registryId !== undefined && (obj.registryId = message.registryId); + return obj; + }, + + fromPartial, I>>( + object: I + ): EnableRegistryMetadata { + const message = { ...baseEnableRegistryMetadata } as EnableRegistryMetadata; + message.registryId = object.registryId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(EnableRegistryMetadata.$type, EnableRegistryMetadata); + /** A set of methods for managing registry. */ export const RegistryServiceService = { /** @@ -3802,6 +4133,30 @@ export const RegistryServiceService = { responseDeserialize: (value: Buffer) => ListRegistryOperationsResponse.decode(value), }, + /** Disables the specified registry. */ + disable: { + path: "/yandex.cloud.iot.devices.v1.RegistryService/Disable", + requestStream: false, + responseStream: false, + requestSerialize: (value: DisableRegistryRequest) => + Buffer.from(DisableRegistryRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DisableRegistryRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Enables the specified registry. */ + enable: { + path: "/yandex.cloud.iot.devices.v1.RegistryService/Enable", + requestStream: false, + responseStream: false, + requestSerialize: (value: EnableRegistryRequest) => + Buffer.from(EnableRegistryRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => EnableRegistryRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface RegistryServiceServer extends UntypedServiceImplementation { @@ -3863,6 +4218,10 @@ export interface RegistryServiceServer extends UntypedServiceImplementation { ListRegistryOperationsRequest, ListRegistryOperationsResponse >; + /** Disables the specified registry. */ + disable: handleUnaryCall; + /** Enables the specified registry. */ + enable: handleUnaryCall; } export interface RegistryServiceClient extends Client { @@ -4195,6 +4554,38 @@ export interface RegistryServiceClient extends Client { response: ListRegistryOperationsResponse ) => void ): ClientUnaryCall; + /** Disables the specified registry. */ + disable( + request: DisableRegistryRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + disable( + request: DisableRegistryRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + disable( + request: DisableRegistryRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Enables the specified registry. */ + enable( + request: EnableRegistryRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + enable( + request: EnableRegistryRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + enable( + request: EnableRegistryRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const RegistryServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/iot/index.ts b/src/generated/yandex/cloud/iot/index.ts index ae539991..933e25e3 100644 --- a/src/generated/yandex/cloud/iot/index.ts +++ b/src/generated/yandex/cloud/iot/index.ts @@ -1,9 +1,9 @@ -export * as broker from './broker/v1/broker' -export * as broker_broker_data_service from './broker/v1/broker_data_service' -export * as broker_service from './broker/v1/broker_service' -export * as devices_device from './devices/v1/device' -export * as devices_device_data_service from './devices/v1/device_data_service' -export * as devices_device_service from './devices/v1/device_service' -export * as devices_registry from './devices/v1/registry' -export * as devices_registry_data_service from './devices/v1/registry_data_service' -export * as devices_registry_service from './devices/v1/registry_service' \ No newline at end of file +export * as broker_v1_broker from './broker/v1/broker' +export * as broker_v1_broker_data_service from './broker/v1/broker_data_service' +export * as broker_v1_broker_service from './broker/v1/broker_service' +export * as devices_v1_device from './devices/v1/device' +export * as devices_v1_device_data_service from './devices/v1/device_data_service' +export * as devices_v1_device_service from './devices/v1/device_service' +export * as devices_v1_registry from './devices/v1/registry' +export * as devices_v1_registry_data_service from './devices/v1/registry_data_service' +export * as devices_v1_registry_service from './devices/v1/registry_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/k8s/index.ts b/src/generated/yandex/cloud/k8s/index.ts index 1b420fa7..371cf37a 100644 --- a/src/generated/yandex/cloud/k8s/index.ts +++ b/src/generated/yandex/cloud/k8s/index.ts @@ -1,8 +1,10 @@ -export * as cluster from './v1/cluster' -export * as cluster_service from './v1/cluster_service' -export * as maintenance from './v1/maintenance' -export * as node from './v1/node' -export * as node_group from './v1/node_group' -export * as node_group_service from './v1/node_group_service' -export * as version from './v1/version' -export * as version_service from './v1/version_service' \ No newline at end of file +export * as v1_cluster from './v1/cluster' +export * as v1_cluster_service from './v1/cluster_service' +export * as v1_maintenance from './v1/maintenance' +export * as v1_node from './v1/node' +export * as v1_node_group from './v1/node_group' +export * as v1_node_group_service from './v1/node_group_service' +export * as v1_version from './v1/version' +export * as v1_version_service from './v1/version_service' +export * as marketplace_v1_helm_release from './marketplace/v1/helm_release' +export * as marketplace_v1_helm_release_service from './marketplace/v1/helm_release_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/k8s/marketplace/v1/helm_release.ts b/src/generated/yandex/cloud/k8s/marketplace/v1/helm_release.ts new file mode 100644 index 00000000..c962b539 --- /dev/null +++ b/src/generated/yandex/cloud/k8s/marketplace/v1/helm_release.ts @@ -0,0 +1,346 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.k8s.marketplace.v1"; + +/** A Helm Release. */ +export interface HelmRelease { + $type: "yandex.cloud.k8s.marketplace.v1.HelmRelease"; + /** ID of a helm release. */ + id: string; + /** ID of the Kubernetes cluster. */ + clusterId: string; + /** Name of the application. */ + appName: string; + /** Namespace of the application. */ + appNamespace: string; + /** Kubernetes marketplace product id. */ + productId: string; + /** Kubernetes marketplace product name. */ + productName: string; + /** Kubernetes marketplace product version. */ + productVersion: string; + /** Status of a helm release. */ + status: HelmRelease_Status; + /** Creation timestamp. */ + createdAt?: Date; +} + +export enum HelmRelease_Status { + STATUS_UNSPECIFIED = 0, + /** UNKNOWN - Helm release status is unknown */ + UNKNOWN = 1, + /** DEPLOYED - Helm release deployed. */ + DEPLOYED = 2, + /** UNINSTALLED - Helm release uninstalled. */ + UNINSTALLED = 3, + /** SUPERSEDED - Helm release superseded. */ + SUPERSEDED = 4, + /** FAILED - Helm release installation failed. */ + FAILED = 5, + /** UNINSTALLING - Helm release is being uninstalled. */ + UNINSTALLING = 6, + /** PENDING_INSTALL - Helm release is to be installed. */ + PENDING_INSTALL = 7, + /** PENDING_UPGRADE - Helm release is to be updated. */ + PENDING_UPGRADE = 8, + /** PENDING_ROLLBACK - Helm release is to be rolled back. */ + PENDING_ROLLBACK = 9, + UNRECOGNIZED = -1, +} + +export function helmRelease_StatusFromJSON(object: any): HelmRelease_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return HelmRelease_Status.STATUS_UNSPECIFIED; + case 1: + case "UNKNOWN": + return HelmRelease_Status.UNKNOWN; + case 2: + case "DEPLOYED": + return HelmRelease_Status.DEPLOYED; + case 3: + case "UNINSTALLED": + return HelmRelease_Status.UNINSTALLED; + case 4: + case "SUPERSEDED": + return HelmRelease_Status.SUPERSEDED; + case 5: + case "FAILED": + return HelmRelease_Status.FAILED; + case 6: + case "UNINSTALLING": + return HelmRelease_Status.UNINSTALLING; + case 7: + case "PENDING_INSTALL": + return HelmRelease_Status.PENDING_INSTALL; + case 8: + case "PENDING_UPGRADE": + return HelmRelease_Status.PENDING_UPGRADE; + case 9: + case "PENDING_ROLLBACK": + return HelmRelease_Status.PENDING_ROLLBACK; + case -1: + case "UNRECOGNIZED": + default: + return HelmRelease_Status.UNRECOGNIZED; + } +} + +export function helmRelease_StatusToJSON(object: HelmRelease_Status): string { + switch (object) { + case HelmRelease_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case HelmRelease_Status.UNKNOWN: + return "UNKNOWN"; + case HelmRelease_Status.DEPLOYED: + return "DEPLOYED"; + case HelmRelease_Status.UNINSTALLED: + return "UNINSTALLED"; + case HelmRelease_Status.SUPERSEDED: + return "SUPERSEDED"; + case HelmRelease_Status.FAILED: + return "FAILED"; + case HelmRelease_Status.UNINSTALLING: + return "UNINSTALLING"; + case HelmRelease_Status.PENDING_INSTALL: + return "PENDING_INSTALL"; + case HelmRelease_Status.PENDING_UPGRADE: + return "PENDING_UPGRADE"; + case HelmRelease_Status.PENDING_ROLLBACK: + return "PENDING_ROLLBACK"; + default: + return "UNKNOWN"; + } +} + +const baseHelmRelease: object = { + $type: "yandex.cloud.k8s.marketplace.v1.HelmRelease", + id: "", + clusterId: "", + appName: "", + appNamespace: "", + productId: "", + productName: "", + productVersion: "", + status: 0, +}; + +export const HelmRelease = { + $type: "yandex.cloud.k8s.marketplace.v1.HelmRelease" as const, + + encode( + message: HelmRelease, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.clusterId !== "") { + writer.uint32(18).string(message.clusterId); + } + if (message.appName !== "") { + writer.uint32(26).string(message.appName); + } + if (message.appNamespace !== "") { + writer.uint32(34).string(message.appNamespace); + } + if (message.productId !== "") { + writer.uint32(42).string(message.productId); + } + if (message.productName !== "") { + writer.uint32(50).string(message.productName); + } + if (message.productVersion !== "") { + writer.uint32(82).string(message.productVersion); + } + if (message.status !== 0) { + writer.uint32(56).int32(message.status); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(66).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HelmRelease { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHelmRelease } as HelmRelease; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.clusterId = reader.string(); + break; + case 3: + message.appName = reader.string(); + break; + case 4: + message.appNamespace = reader.string(); + break; + case 5: + message.productId = reader.string(); + break; + case 6: + message.productName = reader.string(); + break; + case 10: + message.productVersion = reader.string(); + break; + case 7: + message.status = reader.int32() as any; + break; + case 8: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HelmRelease { + const message = { ...baseHelmRelease } as HelmRelease; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.appName = + object.appName !== undefined && object.appName !== null + ? String(object.appName) + : ""; + message.appNamespace = + object.appNamespace !== undefined && object.appNamespace !== null + ? String(object.appNamespace) + : ""; + message.productId = + object.productId !== undefined && object.productId !== null + ? String(object.productId) + : ""; + message.productName = + object.productName !== undefined && object.productName !== null + ? String(object.productName) + : ""; + message.productVersion = + object.productVersion !== undefined && object.productVersion !== null + ? String(object.productVersion) + : ""; + message.status = + object.status !== undefined && object.status !== null + ? helmRelease_StatusFromJSON(object.status) + : 0; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + return message; + }, + + toJSON(message: HelmRelease): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.appName !== undefined && (obj.appName = message.appName); + message.appNamespace !== undefined && + (obj.appNamespace = message.appNamespace); + message.productId !== undefined && (obj.productId = message.productId); + message.productName !== undefined && + (obj.productName = message.productName); + message.productVersion !== undefined && + (obj.productVersion = message.productVersion); + message.status !== undefined && + (obj.status = helmRelease_StatusToJSON(message.status)); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + return obj; + }, + + fromPartial, I>>( + object: I + ): HelmRelease { + const message = { ...baseHelmRelease } as HelmRelease; + message.id = object.id ?? ""; + message.clusterId = object.clusterId ?? ""; + message.appName = object.appName ?? ""; + message.appNamespace = object.appNamespace ?? ""; + message.productId = object.productId ?? ""; + message.productName = object.productName ?? ""; + message.productVersion = object.productVersion ?? ""; + message.status = object.status ?? 0; + message.createdAt = object.createdAt ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(HelmRelease.$type, HelmRelease); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/k8s/marketplace/v1/helm_release_service.ts b/src/generated/yandex/cloud/k8s/marketplace/v1/helm_release_service.ts new file mode 100644 index 00000000..a446ee52 --- /dev/null +++ b/src/generated/yandex/cloud/k8s/marketplace/v1/helm_release_service.ts @@ -0,0 +1,1312 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { HelmRelease } from "../../../../../yandex/cloud/k8s/marketplace/v1/helm_release"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.k8s.marketplace.v1"; + +export interface ListHelmReleasesRequest { + $type: "yandex.cloud.k8s.marketplace.v1.ListHelmReleasesRequest"; + /** The ID of the Kubernetes cluster to list Helm releases from. */ + clusterId: string; + /** The maximum number of results per page that should be returned. */ + pageSize: number; + /** Token for pagination to retrieve the next page of results. */ + pageToken: string; +} + +export interface ListHelmReleasesResponse { + $type: "yandex.cloud.k8s.marketplace.v1.ListHelmReleasesResponse"; + /** List of Helm releases in the Kubernetes cluster. */ + helmReleases: HelmRelease[]; + /** Token for retrieving the next page of Helm releases. */ + nextPageToken: string; +} + +export interface GetHelmReleaseRequest { + $type: "yandex.cloud.k8s.marketplace.v1.GetHelmReleaseRequest"; + /** The ID of the Helm release to retrieve. */ + id: string; +} + +export interface InstallHelmReleaseRequest { + $type: "yandex.cloud.k8s.marketplace.v1.InstallHelmReleaseRequest"; + /** The ID of the Kubernetes cluster where the Helm release is to be installed. */ + clusterId: string; + /** The product version ID to install. */ + productVersionId: string; + /** User-defined values for the Helm chart during installation. */ + userValues: ValueWithKey[]; +} + +export interface InstallHelmReleaseMetadata { + $type: "yandex.cloud.k8s.marketplace.v1.InstallHelmReleaseMetadata"; + /** The ID of the Kubernetes cluster where the Helm release is being installed. */ + clusterId: string; + /** The ID of the Helm release being installed. */ + helmReleaseId: string; + /** The ID of the product version being deployed. */ + productVersionId: string; +} + +export interface UpdateHelmReleaseRequest { + $type: "yandex.cloud.k8s.marketplace.v1.UpdateHelmReleaseRequest"; + /** The ID of the Helm release to update. */ + id: string; + /** The ID of the new product version for the release. */ + productVersionId: string; + /** Custom user values to apply during the update. */ + userValues: ValueWithKey[]; +} + +export interface UpdateHelmReleaseMetadata { + $type: "yandex.cloud.k8s.marketplace.v1.UpdateHelmReleaseMetadata"; + /** The ID of the Kubernetes cluster where the Helm release is being updated. */ + clusterId: string; + /** The ID of the Helm release being updated. */ + helmReleaseId: string; + /** The ID of the new product version to update the Helm release to. */ + productVersionId: string; +} + +export interface UninstallHelmReleaseRequest { + $type: "yandex.cloud.k8s.marketplace.v1.UninstallHelmReleaseRequest"; + /** The ID of the Helm release to retrieve. */ + id: string; +} + +export interface UninstallHelmReleaseMetadata { + $type: "yandex.cloud.k8s.marketplace.v1.UninstallHelmReleaseMetadata"; + /** The ID of the Kubernetes cluster where the release is being uninstalled. */ + clusterId: string; + /** The ID of the Helm release being uninstalled. */ + helmReleaseId: string; +} + +export interface ValueWithKey { + $type: "yandex.cloud.k8s.marketplace.v1.ValueWithKey"; + /** The key associated with the value. */ + key: string; + /** The value associated with the key. */ + value?: Value; +} + +export interface Value { + $type: "yandex.cloud.k8s.marketplace.v1.Value"; + /** The typed string value. */ + typedValue: string | undefined; +} + +const baseListHelmReleasesRequest: object = { + $type: "yandex.cloud.k8s.marketplace.v1.ListHelmReleasesRequest", + clusterId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListHelmReleasesRequest = { + $type: "yandex.cloud.k8s.marketplace.v1.ListHelmReleasesRequest" as const, + + encode( + message: ListHelmReleasesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListHelmReleasesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListHelmReleasesRequest, + } as ListHelmReleasesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListHelmReleasesRequest { + const message = { + ...baseListHelmReleasesRequest, + } as ListHelmReleasesRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListHelmReleasesRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListHelmReleasesRequest { + const message = { + ...baseListHelmReleasesRequest, + } as ListHelmReleasesRequest; + message.clusterId = object.clusterId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListHelmReleasesRequest.$type, ListHelmReleasesRequest); + +const baseListHelmReleasesResponse: object = { + $type: "yandex.cloud.k8s.marketplace.v1.ListHelmReleasesResponse", + nextPageToken: "", +}; + +export const ListHelmReleasesResponse = { + $type: "yandex.cloud.k8s.marketplace.v1.ListHelmReleasesResponse" as const, + + encode( + message: ListHelmReleasesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.helmReleases) { + HelmRelease.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListHelmReleasesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListHelmReleasesResponse, + } as ListHelmReleasesResponse; + message.helmReleases = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.helmReleases.push( + HelmRelease.decode(reader, reader.uint32()) + ); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListHelmReleasesResponse { + const message = { + ...baseListHelmReleasesResponse, + } as ListHelmReleasesResponse; + message.helmReleases = (object.helmReleases ?? []).map((e: any) => + HelmRelease.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListHelmReleasesResponse): unknown { + const obj: any = {}; + if (message.helmReleases) { + obj.helmReleases = message.helmReleases.map((e) => + e ? HelmRelease.toJSON(e) : undefined + ); + } else { + obj.helmReleases = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListHelmReleasesResponse { + const message = { + ...baseListHelmReleasesResponse, + } as ListHelmReleasesResponse; + message.helmReleases = + object.helmReleases?.map((e) => HelmRelease.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListHelmReleasesResponse.$type, + ListHelmReleasesResponse +); + +const baseGetHelmReleaseRequest: object = { + $type: "yandex.cloud.k8s.marketplace.v1.GetHelmReleaseRequest", + id: "", +}; + +export const GetHelmReleaseRequest = { + $type: "yandex.cloud.k8s.marketplace.v1.GetHelmReleaseRequest" as const, + + encode( + message: GetHelmReleaseRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetHelmReleaseRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetHelmReleaseRequest } as GetHelmReleaseRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetHelmReleaseRequest { + const message = { ...baseGetHelmReleaseRequest } as GetHelmReleaseRequest; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + return message; + }, + + toJSON(message: GetHelmReleaseRequest): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetHelmReleaseRequest { + const message = { ...baseGetHelmReleaseRequest } as GetHelmReleaseRequest; + message.id = object.id ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetHelmReleaseRequest.$type, GetHelmReleaseRequest); + +const baseInstallHelmReleaseRequest: object = { + $type: "yandex.cloud.k8s.marketplace.v1.InstallHelmReleaseRequest", + clusterId: "", + productVersionId: "", +}; + +export const InstallHelmReleaseRequest = { + $type: "yandex.cloud.k8s.marketplace.v1.InstallHelmReleaseRequest" as const, + + encode( + message: InstallHelmReleaseRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.productVersionId !== "") { + writer.uint32(18).string(message.productVersionId); + } + for (const v of message.userValues) { + ValueWithKey.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): InstallHelmReleaseRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseInstallHelmReleaseRequest, + } as InstallHelmReleaseRequest; + message.userValues = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.productVersionId = reader.string(); + break; + case 3: + message.userValues.push(ValueWithKey.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InstallHelmReleaseRequest { + const message = { + ...baseInstallHelmReleaseRequest, + } as InstallHelmReleaseRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.productVersionId = + object.productVersionId !== undefined && object.productVersionId !== null + ? String(object.productVersionId) + : ""; + message.userValues = (object.userValues ?? []).map((e: any) => + ValueWithKey.fromJSON(e) + ); + return message; + }, + + toJSON(message: InstallHelmReleaseRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.productVersionId !== undefined && + (obj.productVersionId = message.productVersionId); + if (message.userValues) { + obj.userValues = message.userValues.map((e) => + e ? ValueWithKey.toJSON(e) : undefined + ); + } else { + obj.userValues = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): InstallHelmReleaseRequest { + const message = { + ...baseInstallHelmReleaseRequest, + } as InstallHelmReleaseRequest; + message.clusterId = object.clusterId ?? ""; + message.productVersionId = object.productVersionId ?? ""; + message.userValues = + object.userValues?.map((e) => ValueWithKey.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + InstallHelmReleaseRequest.$type, + InstallHelmReleaseRequest +); + +const baseInstallHelmReleaseMetadata: object = { + $type: "yandex.cloud.k8s.marketplace.v1.InstallHelmReleaseMetadata", + clusterId: "", + helmReleaseId: "", + productVersionId: "", +}; + +export const InstallHelmReleaseMetadata = { + $type: "yandex.cloud.k8s.marketplace.v1.InstallHelmReleaseMetadata" as const, + + encode( + message: InstallHelmReleaseMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.helmReleaseId !== "") { + writer.uint32(18).string(message.helmReleaseId); + } + if (message.productVersionId !== "") { + writer.uint32(26).string(message.productVersionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): InstallHelmReleaseMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseInstallHelmReleaseMetadata, + } as InstallHelmReleaseMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.helmReleaseId = reader.string(); + break; + case 3: + message.productVersionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InstallHelmReleaseMetadata { + const message = { + ...baseInstallHelmReleaseMetadata, + } as InstallHelmReleaseMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.helmReleaseId = + object.helmReleaseId !== undefined && object.helmReleaseId !== null + ? String(object.helmReleaseId) + : ""; + message.productVersionId = + object.productVersionId !== undefined && object.productVersionId !== null + ? String(object.productVersionId) + : ""; + return message; + }, + + toJSON(message: InstallHelmReleaseMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.helmReleaseId !== undefined && + (obj.helmReleaseId = message.helmReleaseId); + message.productVersionId !== undefined && + (obj.productVersionId = message.productVersionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): InstallHelmReleaseMetadata { + const message = { + ...baseInstallHelmReleaseMetadata, + } as InstallHelmReleaseMetadata; + message.clusterId = object.clusterId ?? ""; + message.helmReleaseId = object.helmReleaseId ?? ""; + message.productVersionId = object.productVersionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + InstallHelmReleaseMetadata.$type, + InstallHelmReleaseMetadata +); + +const baseUpdateHelmReleaseRequest: object = { + $type: "yandex.cloud.k8s.marketplace.v1.UpdateHelmReleaseRequest", + id: "", + productVersionId: "", +}; + +export const UpdateHelmReleaseRequest = { + $type: "yandex.cloud.k8s.marketplace.v1.UpdateHelmReleaseRequest" as const, + + encode( + message: UpdateHelmReleaseRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.productVersionId !== "") { + writer.uint32(18).string(message.productVersionId); + } + for (const v of message.userValues) { + ValueWithKey.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateHelmReleaseRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateHelmReleaseRequest, + } as UpdateHelmReleaseRequest; + message.userValues = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.productVersionId = reader.string(); + break; + case 3: + message.userValues.push(ValueWithKey.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateHelmReleaseRequest { + const message = { + ...baseUpdateHelmReleaseRequest, + } as UpdateHelmReleaseRequest; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.productVersionId = + object.productVersionId !== undefined && object.productVersionId !== null + ? String(object.productVersionId) + : ""; + message.userValues = (object.userValues ?? []).map((e: any) => + ValueWithKey.fromJSON(e) + ); + return message; + }, + + toJSON(message: UpdateHelmReleaseRequest): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.productVersionId !== undefined && + (obj.productVersionId = message.productVersionId); + if (message.userValues) { + obj.userValues = message.userValues.map((e) => + e ? ValueWithKey.toJSON(e) : undefined + ); + } else { + obj.userValues = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateHelmReleaseRequest { + const message = { + ...baseUpdateHelmReleaseRequest, + } as UpdateHelmReleaseRequest; + message.id = object.id ?? ""; + message.productVersionId = object.productVersionId ?? ""; + message.userValues = + object.userValues?.map((e) => ValueWithKey.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateHelmReleaseRequest.$type, + UpdateHelmReleaseRequest +); + +const baseUpdateHelmReleaseMetadata: object = { + $type: "yandex.cloud.k8s.marketplace.v1.UpdateHelmReleaseMetadata", + clusterId: "", + helmReleaseId: "", + productVersionId: "", +}; + +export const UpdateHelmReleaseMetadata = { + $type: "yandex.cloud.k8s.marketplace.v1.UpdateHelmReleaseMetadata" as const, + + encode( + message: UpdateHelmReleaseMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.helmReleaseId !== "") { + writer.uint32(18).string(message.helmReleaseId); + } + if (message.productVersionId !== "") { + writer.uint32(26).string(message.productVersionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateHelmReleaseMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateHelmReleaseMetadata, + } as UpdateHelmReleaseMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.helmReleaseId = reader.string(); + break; + case 3: + message.productVersionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateHelmReleaseMetadata { + const message = { + ...baseUpdateHelmReleaseMetadata, + } as UpdateHelmReleaseMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.helmReleaseId = + object.helmReleaseId !== undefined && object.helmReleaseId !== null + ? String(object.helmReleaseId) + : ""; + message.productVersionId = + object.productVersionId !== undefined && object.productVersionId !== null + ? String(object.productVersionId) + : ""; + return message; + }, + + toJSON(message: UpdateHelmReleaseMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.helmReleaseId !== undefined && + (obj.helmReleaseId = message.helmReleaseId); + message.productVersionId !== undefined && + (obj.productVersionId = message.productVersionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateHelmReleaseMetadata { + const message = { + ...baseUpdateHelmReleaseMetadata, + } as UpdateHelmReleaseMetadata; + message.clusterId = object.clusterId ?? ""; + message.helmReleaseId = object.helmReleaseId ?? ""; + message.productVersionId = object.productVersionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateHelmReleaseMetadata.$type, + UpdateHelmReleaseMetadata +); + +const baseUninstallHelmReleaseRequest: object = { + $type: "yandex.cloud.k8s.marketplace.v1.UninstallHelmReleaseRequest", + id: "", +}; + +export const UninstallHelmReleaseRequest = { + $type: "yandex.cloud.k8s.marketplace.v1.UninstallHelmReleaseRequest" as const, + + encode( + message: UninstallHelmReleaseRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UninstallHelmReleaseRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUninstallHelmReleaseRequest, + } as UninstallHelmReleaseRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninstallHelmReleaseRequest { + const message = { + ...baseUninstallHelmReleaseRequest, + } as UninstallHelmReleaseRequest; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + return message; + }, + + toJSON(message: UninstallHelmReleaseRequest): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + return obj; + }, + + fromPartial, I>>( + object: I + ): UninstallHelmReleaseRequest { + const message = { + ...baseUninstallHelmReleaseRequest, + } as UninstallHelmReleaseRequest; + message.id = object.id ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UninstallHelmReleaseRequest.$type, + UninstallHelmReleaseRequest +); + +const baseUninstallHelmReleaseMetadata: object = { + $type: "yandex.cloud.k8s.marketplace.v1.UninstallHelmReleaseMetadata", + clusterId: "", + helmReleaseId: "", +}; + +export const UninstallHelmReleaseMetadata = { + $type: + "yandex.cloud.k8s.marketplace.v1.UninstallHelmReleaseMetadata" as const, + + encode( + message: UninstallHelmReleaseMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.helmReleaseId !== "") { + writer.uint32(18).string(message.helmReleaseId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UninstallHelmReleaseMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUninstallHelmReleaseMetadata, + } as UninstallHelmReleaseMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.helmReleaseId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninstallHelmReleaseMetadata { + const message = { + ...baseUninstallHelmReleaseMetadata, + } as UninstallHelmReleaseMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.helmReleaseId = + object.helmReleaseId !== undefined && object.helmReleaseId !== null + ? String(object.helmReleaseId) + : ""; + return message; + }, + + toJSON(message: UninstallHelmReleaseMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.helmReleaseId !== undefined && + (obj.helmReleaseId = message.helmReleaseId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UninstallHelmReleaseMetadata { + const message = { + ...baseUninstallHelmReleaseMetadata, + } as UninstallHelmReleaseMetadata; + message.clusterId = object.clusterId ?? ""; + message.helmReleaseId = object.helmReleaseId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UninstallHelmReleaseMetadata.$type, + UninstallHelmReleaseMetadata +); + +const baseValueWithKey: object = { + $type: "yandex.cloud.k8s.marketplace.v1.ValueWithKey", + key: "", +}; + +export const ValueWithKey = { + $type: "yandex.cloud.k8s.marketplace.v1.ValueWithKey" as const, + + encode( + message: ValueWithKey, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Value.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValueWithKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValueWithKey } as ValueWithKey; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValueWithKey { + const message = { ...baseValueWithKey } as ValueWithKey; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? Value.fromJSON(object.value) + : undefined; + return message; + }, + + toJSON(message: ValueWithKey): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && + (obj.value = message.value ? Value.toJSON(message.value) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ValueWithKey { + const message = { ...baseValueWithKey } as ValueWithKey; + message.key = object.key ?? ""; + message.value = + object.value !== undefined && object.value !== null + ? Value.fromPartial(object.value) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ValueWithKey.$type, ValueWithKey); + +const baseValue: object = { $type: "yandex.cloud.k8s.marketplace.v1.Value" }; + +export const Value = { + $type: "yandex.cloud.k8s.marketplace.v1.Value" as const, + + encode(message: Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typedValue !== undefined) { + writer.uint32(10).string(message.typedValue); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Value { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValue } as Value; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typedValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Value { + const message = { ...baseValue } as Value; + message.typedValue = + object.typedValue !== undefined && object.typedValue !== null + ? String(object.typedValue) + : undefined; + return message; + }, + + toJSON(message: Value): unknown { + const obj: any = {}; + message.typedValue !== undefined && (obj.typedValue = message.typedValue); + return obj; + }, + + fromPartial, I>>(object: I): Value { + const message = { ...baseValue } as Value; + message.typedValue = object.typedValue ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Value.$type, Value); + +/** A set of methods for managing Helm release. */ +export const HelmReleaseServiceService = { + /** Retrieves the list of Helm releases in the specified Kubernetes Cluster. */ + list: { + path: "/yandex.cloud.k8s.marketplace.v1.HelmReleaseService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListHelmReleasesRequest) => + Buffer.from(ListHelmReleasesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListHelmReleasesRequest.decode(value), + responseSerialize: (value: ListHelmReleasesResponse) => + Buffer.from(ListHelmReleasesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListHelmReleasesResponse.decode(value), + }, + /** Returns the specified Helm release. */ + get: { + path: "/yandex.cloud.k8s.marketplace.v1.HelmReleaseService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetHelmReleaseRequest) => + Buffer.from(GetHelmReleaseRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetHelmReleaseRequest.decode(value), + responseSerialize: (value: HelmRelease) => + Buffer.from(HelmRelease.encode(value).finish()), + responseDeserialize: (value: Buffer) => HelmRelease.decode(value), + }, + /** Installs helm release into specified Kubernetes Cluster. */ + install: { + path: "/yandex.cloud.k8s.marketplace.v1.HelmReleaseService/Install", + requestStream: false, + responseStream: false, + requestSerialize: (value: InstallHelmReleaseRequest) => + Buffer.from(InstallHelmReleaseRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + InstallHelmReleaseRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates helm release. */ + update: { + path: "/yandex.cloud.k8s.marketplace.v1.HelmReleaseService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateHelmReleaseRequest) => + Buffer.from(UpdateHelmReleaseRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateHelmReleaseRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Uninstalls helm release. */ + uninstall: { + path: "/yandex.cloud.k8s.marketplace.v1.HelmReleaseService/Uninstall", + requestStream: false, + responseStream: false, + requestSerialize: (value: UninstallHelmReleaseRequest) => + Buffer.from(UninstallHelmReleaseRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UninstallHelmReleaseRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface HelmReleaseServiceServer extends UntypedServiceImplementation { + /** Retrieves the list of Helm releases in the specified Kubernetes Cluster. */ + list: handleUnaryCall; + /** Returns the specified Helm release. */ + get: handleUnaryCall; + /** Installs helm release into specified Kubernetes Cluster. */ + install: handleUnaryCall; + /** Updates helm release. */ + update: handleUnaryCall; + /** Uninstalls helm release. */ + uninstall: handleUnaryCall; +} + +export interface HelmReleaseServiceClient extends Client { + /** Retrieves the list of Helm releases in the specified Kubernetes Cluster. */ + list( + request: ListHelmReleasesRequest, + callback: ( + error: ServiceError | null, + response: ListHelmReleasesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListHelmReleasesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListHelmReleasesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListHelmReleasesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListHelmReleasesResponse + ) => void + ): ClientUnaryCall; + /** Returns the specified Helm release. */ + get( + request: GetHelmReleaseRequest, + callback: (error: ServiceError | null, response: HelmRelease) => void + ): ClientUnaryCall; + get( + request: GetHelmReleaseRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: HelmRelease) => void + ): ClientUnaryCall; + get( + request: GetHelmReleaseRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: HelmRelease) => void + ): ClientUnaryCall; + /** Installs helm release into specified Kubernetes Cluster. */ + install( + request: InstallHelmReleaseRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + install( + request: InstallHelmReleaseRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + install( + request: InstallHelmReleaseRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates helm release. */ + update( + request: UpdateHelmReleaseRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateHelmReleaseRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateHelmReleaseRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Uninstalls helm release. */ + uninstall( + request: UninstallHelmReleaseRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + uninstall( + request: UninstallHelmReleaseRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + uninstall( + request: UninstallHelmReleaseRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const HelmReleaseServiceClient = makeGenericClientConstructor( + HelmReleaseServiceService, + "yandex.cloud.k8s.marketplace.v1.HelmReleaseService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): HelmReleaseServiceClient; + service: typeof HelmReleaseServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/k8s/v1/cluster.ts b/src/generated/yandex/cloud/k8s/v1/cluster.ts index d90e67cc..ed50d91d 100644 --- a/src/generated/yandex/cloud/k8s/v1/cluster.ts +++ b/src/generated/yandex/cloud/k8s/v1/cluster.ts @@ -93,7 +93,7 @@ export interface Cluster { * When creating a Kubernetes cluster, you should specify one of three release channels. The release channel contains several Kubernetes versions. * Channels differ in the set of available versions, the management of auto-updates, and the updates received. * You can't change the channel once the Kubernetes cluster is created, you can only recreate the Kubernetes cluster and specify a new release channel. - * For more details see [documentation](https://cloud.yandex.com/docs/managed-kubernetes/concepts/release-channels-and-updates). + * For more details see [documentation](/docs/managed-kubernetes/concepts/release-channels-and-updates). */ releaseChannel: ReleaseChannel; networkPolicy?: NetworkPolicy; diff --git a/src/generated/yandex/cloud/k8s/v1/version_service.ts b/src/generated/yandex/cloud/k8s/v1/version_service.ts index 0212e0fe..9a439fcd 100644 --- a/src/generated/yandex/cloud/k8s/v1/version_service.ts +++ b/src/generated/yandex/cloud/k8s/v1/version_service.ts @@ -34,7 +34,7 @@ export interface ListVersionsResponse { export interface AvailableVersions { $type: "yandex.cloud.k8s.v1.AvailableVersions"; - /** Release channel: `RAPID`, `REGULAR` or `STABLE`. For more details see [documentation](https://cloud.yandex.ru/docs/managed-kubernetes/concepts/release-channels-and-updates). */ + /** Release channel: `RAPID`, `REGULAR` or `STABLE`. For more details see [documentation](/docs/managed-kubernetes/concepts/release-channels-and-updates). */ releaseChannel: ReleaseChannel; /** Version of Kubernetes components. */ versions: string[]; diff --git a/src/generated/yandex/cloud/kms/index.ts b/src/generated/yandex/cloud/kms/index.ts index 89e4a981..718425f4 100644 --- a/src/generated/yandex/cloud/kms/index.ts +++ b/src/generated/yandex/cloud/kms/index.ts @@ -1,9 +1,9 @@ -export * as symmetric_crypto_service from './v1/symmetric_crypto_service' -export * as symmetric_key from './v1/symmetric_key' -export * as symmetric_key_service from './v1/symmetric_key_service' -export * as asymmetric_encryption_crypto_service from './v1/asymmetricencryption/asymmetric_encryption_crypto_service' -export * as asymmetric_encryption_key from './v1/asymmetricencryption/asymmetric_encryption_key' -export * as asymmetric_encryption_key_service from './v1/asymmetricencryption/asymmetric_encryption_key_service' -export * as asymmetric_signature_crypto_service from './v1/asymmetricsignature/asymmetric_signature_crypto_service' -export * as asymmetric_signature_key from './v1/asymmetricsignature/asymmetric_signature_key' -export * as asymmetric_signature_key_service from './v1/asymmetricsignature/asymmetric_signature_key_service' \ No newline at end of file +export * as v1_symmetric_crypto_service from './v1/symmetric_crypto_service' +export * as v1_symmetric_key from './v1/symmetric_key' +export * as v1_symmetric_key_service from './v1/symmetric_key_service' +export * as v1_asymmetricencryption_asymmetric_encryption_crypto_service from './v1/asymmetricencryption/asymmetric_encryption_crypto_service' +export * as v1_asymmetricencryption_asymmetric_encryption_key from './v1/asymmetricencryption/asymmetric_encryption_key' +export * as v1_asymmetricencryption_asymmetric_encryption_key_service from './v1/asymmetricencryption/asymmetric_encryption_key_service' +export * as v1_asymmetricsignature_asymmetric_signature_crypto_service from './v1/asymmetricsignature/asymmetric_signature_crypto_service' +export * as v1_asymmetricsignature_asymmetric_signature_key from './v1/asymmetricsignature/asymmetric_signature_key' +export * as v1_asymmetricsignature_asymmetric_signature_key_service from './v1/asymmetricsignature/asymmetric_signature_key_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/loadbalancer/index.ts b/src/generated/yandex/cloud/loadbalancer/index.ts index 917233d4..368dbfd3 100644 --- a/src/generated/yandex/cloud/loadbalancer/index.ts +++ b/src/generated/yandex/cloud/loadbalancer/index.ts @@ -1,5 +1,5 @@ -export * as health_check from './v1/health_check' -export * as network_load_balancer from './v1/network_load_balancer' -export * as network_load_balancer_service from './v1/network_load_balancer_service' -export * as target_group from './v1/target_group' -export * as target_group_service from './v1/target_group_service' \ No newline at end of file +export * as v1_health_check from './v1/health_check' +export * as v1_network_load_balancer from './v1/network_load_balancer' +export * as v1_network_load_balancer_service from './v1/network_load_balancer_service' +export * as v1_target_group from './v1/target_group' +export * as v1_target_group_service from './v1/target_group_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/loadtesting/agent/v1/agent_registration_service.ts b/src/generated/yandex/cloud/loadtesting/agent/v1/agent_registration_service.ts index ad292646..af706e89 100644 --- a/src/generated/yandex/cloud/loadtesting/agent/v1/agent_registration_service.ts +++ b/src/generated/yandex/cloud/loadtesting/agent/v1/agent_registration_service.ts @@ -21,6 +21,7 @@ export const protobufPackage = "yandex.cloud.loadtesting.agent.v1"; export interface RegisterRequest { $type: "yandex.cloud.loadtesting.agent.v1.RegisterRequest"; computeInstanceId: string; + agentVersion: string; } export interface RegisterResponse { @@ -34,6 +35,13 @@ export interface ExternalAgentRegisterRequest { computeInstanceId: string; name: string; agentVersion: string; + labels: { [key: string]: string }; +} + +export interface ExternalAgentRegisterRequest_LabelsEntry { + $type: "yandex.cloud.loadtesting.agent.v1.ExternalAgentRegisterRequest.LabelsEntry"; + key: string; + value: string; } export interface ExternalAgentRegisterMetadata { @@ -44,6 +52,7 @@ export interface ExternalAgentRegisterMetadata { const baseRegisterRequest: object = { $type: "yandex.cloud.loadtesting.agent.v1.RegisterRequest", computeInstanceId: "", + agentVersion: "", }; export const RegisterRequest = { @@ -56,6 +65,9 @@ export const RegisterRequest = { if (message.computeInstanceId !== "") { writer.uint32(10).string(message.computeInstanceId); } + if (message.agentVersion !== "") { + writer.uint32(18).string(message.agentVersion); + } return writer; }, @@ -69,6 +81,9 @@ export const RegisterRequest = { case 1: message.computeInstanceId = reader.string(); break; + case 2: + message.agentVersion = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -84,6 +99,10 @@ export const RegisterRequest = { object.computeInstanceId !== null ? String(object.computeInstanceId) : ""; + message.agentVersion = + object.agentVersion !== undefined && object.agentVersion !== null + ? String(object.agentVersion) + : ""; return message; }, @@ -91,6 +110,8 @@ export const RegisterRequest = { const obj: any = {}; message.computeInstanceId !== undefined && (obj.computeInstanceId = message.computeInstanceId); + message.agentVersion !== undefined && + (obj.agentVersion = message.agentVersion); return obj; }, @@ -99,6 +120,7 @@ export const RegisterRequest = { ): RegisterRequest { const message = { ...baseRegisterRequest } as RegisterRequest; message.computeInstanceId = object.computeInstanceId ?? ""; + message.agentVersion = object.agentVersion ?? ""; return message; }, }; @@ -196,6 +218,17 @@ export const ExternalAgentRegisterRequest = { if (message.agentVersion !== "") { writer.uint32(34).string(message.agentVersion); } + Object.entries(message.labels).forEach(([key, value]) => { + ExternalAgentRegisterRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.loadtesting.agent.v1.ExternalAgentRegisterRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(42).fork() + ).ldelim(); + }); return writer; }, @@ -208,6 +241,7 @@ export const ExternalAgentRegisterRequest = { const message = { ...baseExternalAgentRegisterRequest, } as ExternalAgentRegisterRequest; + message.labels = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -223,6 +257,15 @@ export const ExternalAgentRegisterRequest = { case 4: message.agentVersion = reader.string(); break; + case 5: + const entry5 = ExternalAgentRegisterRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry5.value !== undefined) { + message.labels[entry5.key] = entry5.value; + } + break; default: reader.skipType(tag & 7); break; @@ -252,6 +295,12 @@ export const ExternalAgentRegisterRequest = { object.agentVersion !== undefined && object.agentVersion !== null ? String(object.agentVersion) : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); return message; }, @@ -263,6 +312,12 @@ export const ExternalAgentRegisterRequest = { message.name !== undefined && (obj.name = message.name); message.agentVersion !== undefined && (obj.agentVersion = message.agentVersion); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } return obj; }, @@ -276,6 +331,14 @@ export const ExternalAgentRegisterRequest = { message.computeInstanceId = object.computeInstanceId ?? ""; message.name = object.name ?? ""; message.agentVersion = object.agentVersion ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); return message; }, }; @@ -285,6 +348,93 @@ messageTypeRegistry.set( ExternalAgentRegisterRequest ); +const baseExternalAgentRegisterRequest_LabelsEntry: object = { + $type: + "yandex.cloud.loadtesting.agent.v1.ExternalAgentRegisterRequest.LabelsEntry", + key: "", + value: "", +}; + +export const ExternalAgentRegisterRequest_LabelsEntry = { + $type: + "yandex.cloud.loadtesting.agent.v1.ExternalAgentRegisterRequest.LabelsEntry" as const, + + encode( + message: ExternalAgentRegisterRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ExternalAgentRegisterRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseExternalAgentRegisterRequest_LabelsEntry, + } as ExternalAgentRegisterRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExternalAgentRegisterRequest_LabelsEntry { + const message = { + ...baseExternalAgentRegisterRequest_LabelsEntry, + } as ExternalAgentRegisterRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: ExternalAgentRegisterRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): ExternalAgentRegisterRequest_LabelsEntry { + const message = { + ...baseExternalAgentRegisterRequest_LabelsEntry, + } as ExternalAgentRegisterRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ExternalAgentRegisterRequest_LabelsEntry.$type, + ExternalAgentRegisterRequest_LabelsEntry +); + const baseExternalAgentRegisterMetadata: object = { $type: "yandex.cloud.loadtesting.agent.v1.ExternalAgentRegisterMetadata", agentInstanceId: "", diff --git a/src/generated/yandex/cloud/loadtesting/agent/v1/agent_service.ts b/src/generated/yandex/cloud/loadtesting/agent/v1/agent_service.ts index ed7e2e83..8011525d 100644 --- a/src/generated/yandex/cloud/loadtesting/agent/v1/agent_service.ts +++ b/src/generated/yandex/cloud/loadtesting/agent/v1/agent_service.ts @@ -14,6 +14,7 @@ import { ServiceError, } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; export const protobufPackage = "yandex.cloud.loadtesting.agent.v1"; @@ -21,6 +22,7 @@ export interface ClaimAgentStatusRequest { $type: "yandex.cloud.loadtesting.agent.v1.ClaimAgentStatusRequest"; agentInstanceId: string; status: ClaimAgentStatusRequest_Status; + statusMessage: string; } export enum ClaimAgentStatusRequest_Status { @@ -31,6 +33,7 @@ export enum ClaimAgentStatusRequest_Status { TANK_FAILED = 4, STOPPED = 5, UPLOADING_ARTIFACTS = 6, + ERROR = 7, UNRECOGNIZED = -1, } @@ -59,6 +62,9 @@ export function claimAgentStatusRequest_StatusFromJSON( case 6: case "UPLOADING_ARTIFACTS": return ClaimAgentStatusRequest_Status.UPLOADING_ARTIFACTS; + case 7: + case "ERROR": + return ClaimAgentStatusRequest_Status.ERROR; case -1: case "UNRECOGNIZED": default: @@ -84,6 +90,8 @@ export function claimAgentStatusRequest_StatusToJSON( return "STOPPED"; case ClaimAgentStatusRequest_Status.UPLOADING_ARTIFACTS: return "UPLOADING_ARTIFACTS"; + case ClaimAgentStatusRequest_Status.ERROR: + return "ERROR"; default: return "UNKNOWN"; } @@ -94,10 +102,92 @@ export interface ClaimAgentStatusResponse { code: number; } +export interface ReportEventLogsRequest { + $type: "yandex.cloud.loadtesting.agent.v1.ReportEventLogsRequest"; + agentInstanceId: string; + idempotencyKey: string; + events: EventLog[]; +} + +export interface ReportEventLogsResponse { + $type: "yandex.cloud.loadtesting.agent.v1.ReportEventLogsResponse"; +} + +export interface EventLog { + $type: "yandex.cloud.loadtesting.agent.v1.EventLog"; + message: string; + severity: EventLog_Severity; + timestamp?: Date; + metadata: { [key: string]: string }; +} + +export enum EventLog_Severity { + SEVERITY_UNSPECIFIED = 0, + DEBUG = 1, + INFO = 2, + WARNING = 3, + ERROR = 4, + FATAL = 5, + UNRECOGNIZED = -1, +} + +export function eventLog_SeverityFromJSON(object: any): EventLog_Severity { + switch (object) { + case 0: + case "SEVERITY_UNSPECIFIED": + return EventLog_Severity.SEVERITY_UNSPECIFIED; + case 1: + case "DEBUG": + return EventLog_Severity.DEBUG; + case 2: + case "INFO": + return EventLog_Severity.INFO; + case 3: + case "WARNING": + return EventLog_Severity.WARNING; + case 4: + case "ERROR": + return EventLog_Severity.ERROR; + case 5: + case "FATAL": + return EventLog_Severity.FATAL; + case -1: + case "UNRECOGNIZED": + default: + return EventLog_Severity.UNRECOGNIZED; + } +} + +export function eventLog_SeverityToJSON(object: EventLog_Severity): string { + switch (object) { + case EventLog_Severity.SEVERITY_UNSPECIFIED: + return "SEVERITY_UNSPECIFIED"; + case EventLog_Severity.DEBUG: + return "DEBUG"; + case EventLog_Severity.INFO: + return "INFO"; + case EventLog_Severity.WARNING: + return "WARNING"; + case EventLog_Severity.ERROR: + return "ERROR"; + case EventLog_Severity.FATAL: + return "FATAL"; + default: + return "UNKNOWN"; + } +} + +export interface EventLog_MetadataEntry { + $type: "yandex.cloud.loadtesting.agent.v1.EventLog.MetadataEntry"; + key: string; + value: string; +} + const baseClaimAgentStatusRequest: object = { $type: "yandex.cloud.loadtesting.agent.v1.ClaimAgentStatusRequest", agentInstanceId: "", status: 0, + statusMessage: "", }; export const ClaimAgentStatusRequest = { @@ -113,6 +203,9 @@ export const ClaimAgentStatusRequest = { if (message.status !== 0) { writer.uint32(16).int32(message.status); } + if (message.statusMessage !== "") { + writer.uint32(26).string(message.statusMessage); + } return writer; }, @@ -134,6 +227,9 @@ export const ClaimAgentStatusRequest = { case 2: message.status = reader.int32() as any; break; + case 3: + message.statusMessage = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -154,6 +250,10 @@ export const ClaimAgentStatusRequest = { object.status !== undefined && object.status !== null ? claimAgentStatusRequest_StatusFromJSON(object.status) : 0; + message.statusMessage = + object.statusMessage !== undefined && object.statusMessage !== null + ? String(object.statusMessage) + : ""; return message; }, @@ -163,6 +263,8 @@ export const ClaimAgentStatusRequest = { (obj.agentInstanceId = message.agentInstanceId); message.status !== undefined && (obj.status = claimAgentStatusRequest_StatusToJSON(message.status)); + message.statusMessage !== undefined && + (obj.statusMessage = message.statusMessage); return obj; }, @@ -174,6 +276,7 @@ export const ClaimAgentStatusRequest = { } as ClaimAgentStatusRequest; message.agentInstanceId = object.agentInstanceId ?? ""; message.status = object.status ?? 0; + message.statusMessage = object.statusMessage ?? ""; return message; }, }; @@ -254,6 +357,367 @@ messageTypeRegistry.set( ClaimAgentStatusResponse ); +const baseReportEventLogsRequest: object = { + $type: "yandex.cloud.loadtesting.agent.v1.ReportEventLogsRequest", + agentInstanceId: "", + idempotencyKey: "", +}; + +export const ReportEventLogsRequest = { + $type: "yandex.cloud.loadtesting.agent.v1.ReportEventLogsRequest" as const, + + encode( + message: ReportEventLogsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.agentInstanceId !== "") { + writer.uint32(10).string(message.agentInstanceId); + } + if (message.idempotencyKey !== "") { + writer.uint32(18).string(message.idempotencyKey); + } + for (const v of message.events) { + EventLog.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ReportEventLogsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseReportEventLogsRequest } as ReportEventLogsRequest; + message.events = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.agentInstanceId = reader.string(); + break; + case 2: + message.idempotencyKey = reader.string(); + break; + case 3: + message.events.push(EventLog.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ReportEventLogsRequest { + const message = { ...baseReportEventLogsRequest } as ReportEventLogsRequest; + message.agentInstanceId = + object.agentInstanceId !== undefined && object.agentInstanceId !== null + ? String(object.agentInstanceId) + : ""; + message.idempotencyKey = + object.idempotencyKey !== undefined && object.idempotencyKey !== null + ? String(object.idempotencyKey) + : ""; + message.events = (object.events ?? []).map((e: any) => + EventLog.fromJSON(e) + ); + return message; + }, + + toJSON(message: ReportEventLogsRequest): unknown { + const obj: any = {}; + message.agentInstanceId !== undefined && + (obj.agentInstanceId = message.agentInstanceId); + message.idempotencyKey !== undefined && + (obj.idempotencyKey = message.idempotencyKey); + if (message.events) { + obj.events = message.events.map((e) => + e ? EventLog.toJSON(e) : undefined + ); + } else { + obj.events = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ReportEventLogsRequest { + const message = { ...baseReportEventLogsRequest } as ReportEventLogsRequest; + message.agentInstanceId = object.agentInstanceId ?? ""; + message.idempotencyKey = object.idempotencyKey ?? ""; + message.events = object.events?.map((e) => EventLog.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ReportEventLogsRequest.$type, ReportEventLogsRequest); + +const baseReportEventLogsResponse: object = { + $type: "yandex.cloud.loadtesting.agent.v1.ReportEventLogsResponse", +}; + +export const ReportEventLogsResponse = { + $type: "yandex.cloud.loadtesting.agent.v1.ReportEventLogsResponse" as const, + + encode( + _: ReportEventLogsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ReportEventLogsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseReportEventLogsResponse, + } as ReportEventLogsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): ReportEventLogsResponse { + const message = { + ...baseReportEventLogsResponse, + } as ReportEventLogsResponse; + return message; + }, + + toJSON(_: ReportEventLogsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): ReportEventLogsResponse { + const message = { + ...baseReportEventLogsResponse, + } as ReportEventLogsResponse; + return message; + }, +}; + +messageTypeRegistry.set(ReportEventLogsResponse.$type, ReportEventLogsResponse); + +const baseEventLog: object = { + $type: "yandex.cloud.loadtesting.agent.v1.EventLog", + message: "", + severity: 0, +}; + +export const EventLog = { + $type: "yandex.cloud.loadtesting.agent.v1.EventLog" as const, + + encode( + message: EventLog, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + if (message.severity !== 0) { + writer.uint32(16).int32(message.severity); + } + if (message.timestamp !== undefined) { + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(26).fork() + ).ldelim(); + } + Object.entries(message.metadata).forEach(([key, value]) => { + EventLog_MetadataEntry.encode( + { + $type: "yandex.cloud.loadtesting.agent.v1.EventLog.MetadataEntry", + key: key as any, + value, + }, + writer.uint32(34).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EventLog { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEventLog } as EventLog; + message.metadata = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + case 2: + message.severity = reader.int32() as any; + break; + case 3: + message.timestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 4: + const entry4 = EventLog_MetadataEntry.decode(reader, reader.uint32()); + if (entry4.value !== undefined) { + message.metadata[entry4.key] = entry4.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EventLog { + const message = { ...baseEventLog } as EventLog; + message.message = + object.message !== undefined && object.message !== null + ? String(object.message) + : ""; + message.severity = + object.severity !== undefined && object.severity !== null + ? eventLog_SeverityFromJSON(object.severity) + : 0; + message.timestamp = + object.timestamp !== undefined && object.timestamp !== null + ? fromJsonTimestamp(object.timestamp) + : undefined; + message.metadata = Object.entries(object.metadata ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: EventLog): unknown { + const obj: any = {}; + message.message !== undefined && (obj.message = message.message); + message.severity !== undefined && + (obj.severity = eventLog_SeverityToJSON(message.severity)); + message.timestamp !== undefined && + (obj.timestamp = message.timestamp.toISOString()); + obj.metadata = {}; + if (message.metadata) { + Object.entries(message.metadata).forEach(([k, v]) => { + obj.metadata[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>(object: I): EventLog { + const message = { ...baseEventLog } as EventLog; + message.message = object.message ?? ""; + message.severity = object.severity ?? 0; + message.timestamp = object.timestamp ?? undefined; + message.metadata = Object.entries(object.metadata ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(EventLog.$type, EventLog); + +const baseEventLog_MetadataEntry: object = { + $type: "yandex.cloud.loadtesting.agent.v1.EventLog.MetadataEntry", + key: "", + value: "", +}; + +export const EventLog_MetadataEntry = { + $type: "yandex.cloud.loadtesting.agent.v1.EventLog.MetadataEntry" as const, + + encode( + message: EventLog_MetadataEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): EventLog_MetadataEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEventLog_MetadataEntry } as EventLog_MetadataEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EventLog_MetadataEntry { + const message = { ...baseEventLog_MetadataEntry } as EventLog_MetadataEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: EventLog_MetadataEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): EventLog_MetadataEntry { + const message = { ...baseEventLog_MetadataEntry } as EventLog_MetadataEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(EventLog_MetadataEntry.$type, EventLog_MetadataEntry); + export const AgentServiceService = { /** Claims status for the specified agent. */ claimStatus: { @@ -269,6 +733,18 @@ export const AgentServiceService = { responseDeserialize: (value: Buffer) => ClaimAgentStatusResponse.decode(value), }, + reportEventLogs: { + path: "/yandex.cloud.loadtesting.agent.v1.AgentService/ReportEventLogs", + requestStream: false, + responseStream: false, + requestSerialize: (value: ReportEventLogsRequest) => + Buffer.from(ReportEventLogsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ReportEventLogsRequest.decode(value), + responseSerialize: (value: ReportEventLogsResponse) => + Buffer.from(ReportEventLogsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ReportEventLogsResponse.decode(value), + }, } as const; export interface AgentServiceServer extends UntypedServiceImplementation { @@ -277,6 +753,10 @@ export interface AgentServiceServer extends UntypedServiceImplementation { ClaimAgentStatusRequest, ClaimAgentStatusResponse >; + reportEventLogs: handleUnaryCall< + ReportEventLogsRequest, + ReportEventLogsResponse + >; } export interface AgentServiceClient extends Client { @@ -305,6 +785,30 @@ export interface AgentServiceClient extends Client { response: ClaimAgentStatusResponse ) => void ): ClientUnaryCall; + reportEventLogs( + request: ReportEventLogsRequest, + callback: ( + error: ServiceError | null, + response: ReportEventLogsResponse + ) => void + ): ClientUnaryCall; + reportEventLogs( + request: ReportEventLogsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ReportEventLogsResponse + ) => void + ): ClientUnaryCall; + reportEventLogs( + request: ReportEventLogsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ReportEventLogsResponse + ) => void + ): ClientUnaryCall; } export const AgentServiceClient = makeGenericClientConstructor( @@ -357,6 +861,28 @@ export type Exact = P extends Builtin never >; +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + function longToNumber(long: Long): number { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); diff --git a/src/generated/yandex/cloud/loadtesting/agent/v1/job_service.ts b/src/generated/yandex/cloud/loadtesting/agent/v1/job_service.ts index 2e6a0d95..a3822d13 100644 --- a/src/generated/yandex/cloud/loadtesting/agent/v1/job_service.ts +++ b/src/generated/yandex/cloud/loadtesting/agent/v1/job_service.ts @@ -81,6 +81,7 @@ export enum ClaimJobStatusRequest_JobStatus { POST_PROCESS = 1, INITIATED = 2, PREPARING = 3, + /** @deprecated */ NOT_FOUND = 4, RUNNING = 5, FINISHING = 6, diff --git a/src/generated/yandex/cloud/loadtesting/agent/v1/test.ts b/src/generated/yandex/cloud/loadtesting/agent/v1/test.ts index 3fb2d0a7..23e2be18 100644 --- a/src/generated/yandex/cloud/loadtesting/agent/v1/test.ts +++ b/src/generated/yandex/cloud/loadtesting/agent/v1/test.ts @@ -6,171 +6,6 @@ import { Timestamp } from "../../../../../google/protobuf/timestamp"; export const protobufPackage = "yandex.cloud.loadtesting.agent.v1"; -/** - * Ammo type for generators: phantom.ammo_type, - * ammo.type in pandora.config_content.pool - */ -export enum AmmoType { - AMMO_TYPE_UNSPECIFIED = 0, - HTTP_JSON = 1, - RAW = 2, - URI = 3, - URIPOST = 4, - PHANTOM = 5, - ACCESS = 6, - UNRECOGNIZED = -1, -} - -export function ammoTypeFromJSON(object: any): AmmoType { - switch (object) { - case 0: - case "AMMO_TYPE_UNSPECIFIED": - return AmmoType.AMMO_TYPE_UNSPECIFIED; - case 1: - case "HTTP_JSON": - return AmmoType.HTTP_JSON; - case 2: - case "RAW": - return AmmoType.RAW; - case 3: - case "URI": - return AmmoType.URI; - case 4: - case "URIPOST": - return AmmoType.URIPOST; - case 5: - case "PHANTOM": - return AmmoType.PHANTOM; - case 6: - case "ACCESS": - return AmmoType.ACCESS; - case -1: - case "UNRECOGNIZED": - default: - return AmmoType.UNRECOGNIZED; - } -} - -export function ammoTypeToJSON(object: AmmoType): string { - switch (object) { - case AmmoType.AMMO_TYPE_UNSPECIFIED: - return "AMMO_TYPE_UNSPECIFIED"; - case AmmoType.HTTP_JSON: - return "HTTP_JSON"; - case AmmoType.RAW: - return "RAW"; - case AmmoType.URI: - return "URI"; - case AmmoType.URIPOST: - return "URIPOST"; - case AmmoType.PHANTOM: - return "PHANTOM"; - case AmmoType.ACCESS: - return "ACCESS"; - default: - return "UNKNOWN"; - } -} - -/** Load type: phantom.load_profile.load_type, */ -export enum LoadType { - LOAD_TYPE_UNSPECIFIED = 0, - RPS = 1, - INSTANCES = 2, - STPD_FILE = 3, - UNRECOGNIZED = -1, -} - -export function loadTypeFromJSON(object: any): LoadType { - switch (object) { - case 0: - case "LOAD_TYPE_UNSPECIFIED": - return LoadType.LOAD_TYPE_UNSPECIFIED; - case 1: - case "RPS": - return LoadType.RPS; - case 2: - case "INSTANCES": - return LoadType.INSTANCES; - case 3: - case "STPD_FILE": - return LoadType.STPD_FILE; - case -1: - case "UNRECOGNIZED": - default: - return LoadType.UNRECOGNIZED; - } -} - -export function loadTypeToJSON(object: LoadType): string { - switch (object) { - case LoadType.LOAD_TYPE_UNSPECIFIED: - return "LOAD_TYPE_UNSPECIFIED"; - case LoadType.RPS: - return "RPS"; - case LoadType.INSTANCES: - return "INSTANCES"; - case LoadType.STPD_FILE: - return "STPD_FILE"; - default: - return "UNKNOWN"; - } -} - -/** - * Schedule type: phantom.load_profile.schedule, - * rps.schedule.type in pandora.config_content.pool - */ -export enum ScheduleType { - SCHEDULE_TYPE_UNSPECIFIED = 0, - ONCE = 1, - CONST = 2, - LINE = 3, - STEP = 4, - UNRECOGNIZED = -1, -} - -export function scheduleTypeFromJSON(object: any): ScheduleType { - switch (object) { - case 0: - case "SCHEDULE_TYPE_UNSPECIFIED": - return ScheduleType.SCHEDULE_TYPE_UNSPECIFIED; - case 1: - case "ONCE": - return ScheduleType.ONCE; - case 2: - case "CONST": - return ScheduleType.CONST; - case 3: - case "LINE": - return ScheduleType.LINE; - case 4: - case "STEP": - return ScheduleType.STEP; - case -1: - case "UNRECOGNIZED": - default: - return ScheduleType.UNRECOGNIZED; - } -} - -export function scheduleTypeToJSON(object: ScheduleType): string { - switch (object) { - case ScheduleType.SCHEDULE_TYPE_UNSPECIFIED: - return "SCHEDULE_TYPE_UNSPECIFIED"; - case ScheduleType.ONCE: - return "ONCE"; - case ScheduleType.CONST: - return "CONST"; - case ScheduleType.LINE: - return "LINE"; - case ScheduleType.STEP: - return "STEP"; - default: - return "UNKNOWN"; - } -} - export interface Test { $type: "yandex.cloud.loadtesting.agent.v1.Test"; id: string; @@ -215,6 +50,7 @@ export enum Test_Status { AUTOSTOPPED = 11, WAITING = 12, DELETING = 13, + LOST = 14, UNRECOGNIZED = -1, } @@ -262,6 +98,9 @@ export function test_StatusFromJSON(object: any): Test_Status { case 13: case "DELETING": return Test_Status.DELETING; + case 14: + case "LOST": + return Test_Status.LOST; case -1: case "UNRECOGNIZED": default: @@ -299,6 +138,8 @@ export function test_StatusToJSON(object: Test_Status): string { return "WAITING"; case Test_Status.DELETING: return "DELETING"; + case Test_Status.LOST: + return "LOST"; default: return "UNKNOWN"; } @@ -354,32 +195,6 @@ export interface Test_LabelsEntry { value: string; } -/** - * Load schedule string: - * {duration: 180s, type: line, from: 1, to: 10000} for pandora, - * step(25, 5, 5, 60) for phantom. - */ -export interface LoadSchedule { - $type: "yandex.cloud.loadtesting.agent.v1.LoadSchedule"; - type: ScheduleType; - /** times for pandora */ - instances: number; - duration: string; - rpsFrom: number; - rpsTo: number; - step: number; - ops: number; - stpdPath: string; -} - -/** Load profile in general: phantom.load_profile, pool schedule for pandora */ -export interface Schedule { - $type: "yandex.cloud.loadtesting.agent.v1.Schedule"; - loadType: LoadType; - loadSchedule: LoadSchedule[]; - loadProfile: string[]; -} - const baseTest: object = { $type: "yandex.cloud.loadtesting.agent.v1.Test", id: "", @@ -821,256 +636,6 @@ export const Test_LabelsEntry = { messageTypeRegistry.set(Test_LabelsEntry.$type, Test_LabelsEntry); -const baseLoadSchedule: object = { - $type: "yandex.cloud.loadtesting.agent.v1.LoadSchedule", - type: 0, - instances: 0, - duration: "", - rpsFrom: 0, - rpsTo: 0, - step: 0, - ops: 0, - stpdPath: "", -}; - -export const LoadSchedule = { - $type: "yandex.cloud.loadtesting.agent.v1.LoadSchedule" as const, - - encode( - message: LoadSchedule, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.type !== 0) { - writer.uint32(8).int32(message.type); - } - if (message.instances !== 0) { - writer.uint32(16).int64(message.instances); - } - if (message.duration !== "") { - writer.uint32(26).string(message.duration); - } - if (message.rpsFrom !== 0) { - writer.uint32(32).int64(message.rpsFrom); - } - if (message.rpsTo !== 0) { - writer.uint32(40).int64(message.rpsTo); - } - if (message.step !== 0) { - writer.uint32(48).int64(message.step); - } - if (message.ops !== 0) { - writer.uint32(56).int64(message.ops); - } - if (message.stpdPath !== "") { - writer.uint32(66).string(message.stpdPath); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): LoadSchedule { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseLoadSchedule } as LoadSchedule; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32() as any; - break; - case 2: - message.instances = longToNumber(reader.int64() as Long); - break; - case 3: - message.duration = reader.string(); - break; - case 4: - message.rpsFrom = longToNumber(reader.int64() as Long); - break; - case 5: - message.rpsTo = longToNumber(reader.int64() as Long); - break; - case 6: - message.step = longToNumber(reader.int64() as Long); - break; - case 7: - message.ops = longToNumber(reader.int64() as Long); - break; - case 8: - message.stpdPath = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LoadSchedule { - const message = { ...baseLoadSchedule } as LoadSchedule; - message.type = - object.type !== undefined && object.type !== null - ? scheduleTypeFromJSON(object.type) - : 0; - message.instances = - object.instances !== undefined && object.instances !== null - ? Number(object.instances) - : 0; - message.duration = - object.duration !== undefined && object.duration !== null - ? String(object.duration) - : ""; - message.rpsFrom = - object.rpsFrom !== undefined && object.rpsFrom !== null - ? Number(object.rpsFrom) - : 0; - message.rpsTo = - object.rpsTo !== undefined && object.rpsTo !== null - ? Number(object.rpsTo) - : 0; - message.step = - object.step !== undefined && object.step !== null - ? Number(object.step) - : 0; - message.ops = - object.ops !== undefined && object.ops !== null ? Number(object.ops) : 0; - message.stpdPath = - object.stpdPath !== undefined && object.stpdPath !== null - ? String(object.stpdPath) - : ""; - return message; - }, - - toJSON(message: LoadSchedule): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = scheduleTypeToJSON(message.type)); - message.instances !== undefined && - (obj.instances = Math.round(message.instances)); - message.duration !== undefined && (obj.duration = message.duration); - message.rpsFrom !== undefined && - (obj.rpsFrom = Math.round(message.rpsFrom)); - message.rpsTo !== undefined && (obj.rpsTo = Math.round(message.rpsTo)); - message.step !== undefined && (obj.step = Math.round(message.step)); - message.ops !== undefined && (obj.ops = Math.round(message.ops)); - message.stpdPath !== undefined && (obj.stpdPath = message.stpdPath); - return obj; - }, - - fromPartial, I>>( - object: I - ): LoadSchedule { - const message = { ...baseLoadSchedule } as LoadSchedule; - message.type = object.type ?? 0; - message.instances = object.instances ?? 0; - message.duration = object.duration ?? ""; - message.rpsFrom = object.rpsFrom ?? 0; - message.rpsTo = object.rpsTo ?? 0; - message.step = object.step ?? 0; - message.ops = object.ops ?? 0; - message.stpdPath = object.stpdPath ?? ""; - return message; - }, -}; - -messageTypeRegistry.set(LoadSchedule.$type, LoadSchedule); - -const baseSchedule: object = { - $type: "yandex.cloud.loadtesting.agent.v1.Schedule", - loadType: 0, - loadProfile: "", -}; - -export const Schedule = { - $type: "yandex.cloud.loadtesting.agent.v1.Schedule" as const, - - encode( - message: Schedule, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.loadType !== 0) { - writer.uint32(8).int32(message.loadType); - } - for (const v of message.loadSchedule) { - LoadSchedule.encode(v!, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.loadProfile) { - writer.uint32(26).string(v!); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Schedule { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseSchedule } as Schedule; - message.loadSchedule = []; - message.loadProfile = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.loadType = reader.int32() as any; - break; - case 2: - message.loadSchedule.push( - LoadSchedule.decode(reader, reader.uint32()) - ); - break; - case 3: - message.loadProfile.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Schedule { - const message = { ...baseSchedule } as Schedule; - message.loadType = - object.loadType !== undefined && object.loadType !== null - ? loadTypeFromJSON(object.loadType) - : 0; - message.loadSchedule = (object.loadSchedule ?? []).map((e: any) => - LoadSchedule.fromJSON(e) - ); - message.loadProfile = (object.loadProfile ?? []).map((e: any) => String(e)); - return message; - }, - - toJSON(message: Schedule): unknown { - const obj: any = {}; - message.loadType !== undefined && - (obj.loadType = loadTypeToJSON(message.loadType)); - if (message.loadSchedule) { - obj.loadSchedule = message.loadSchedule.map((e) => - e ? LoadSchedule.toJSON(e) : undefined - ); - } else { - obj.loadSchedule = []; - } - if (message.loadProfile) { - obj.loadProfile = message.loadProfile.map((e) => e); - } else { - obj.loadProfile = []; - } - return obj; - }, - - fromPartial, I>>(object: I): Schedule { - const message = { ...baseSchedule } as Schedule; - message.loadType = object.loadType ?? 0; - message.loadSchedule = - object.loadSchedule?.map((e) => LoadSchedule.fromPartial(e)) || []; - message.loadProfile = object.loadProfile?.map((e) => e) || []; - return message; - }, -}; - -messageTypeRegistry.set(Schedule.$type, Schedule); - declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/generated/yandex/cloud/loadtesting/agent/v1/test_service.ts b/src/generated/yandex/cloud/loadtesting/agent/v1/test_service.ts index 61d8b234..829a6303 100644 --- a/src/generated/yandex/cloud/loadtesting/agent/v1/test_service.ts +++ b/src/generated/yandex/cloud/loadtesting/agent/v1/test_service.ts @@ -14,17 +14,8 @@ import { ServiceError, } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; -import { - Test_Generator, - Schedule, - AmmoType, - Test, - test_GeneratorFromJSON, - ammoTypeFromJSON, - test_GeneratorToJSON, - ammoTypeToJSON, -} from "../../../../../yandex/cloud/loadtesting/agent/v1/test"; import { FieldMask } from "../../../../../google/protobuf/field_mask"; +import { Test } from "../../../../../yandex/cloud/loadtesting/agent/v1/test"; import { Operation } from "../../../../../yandex/cloud/operation/operation"; export const protobufPackage = "yandex.cloud.loadtesting.agent.v1"; @@ -34,53 +25,19 @@ export interface GetTestRequest { testId: string; } -export interface CreateTestRequest { - $type: "yandex.cloud.loadtesting.agent.v1.CreateTestRequest"; - folderId: string; - name: string; - description: string; - labels: { [key: string]: string }; - generator: Test_Generator; - agentInstanceId: string; - /** - * Fields for TestConfig creation. These fields have the higher priority than yaml config. - * These fields are taken from Form - */ - targetAddress: string; - targetPort: number; - targetVersion: string; - instances: number; - loadSchedule?: Schedule; - config: string; - ammoId: string; - ammoUrls: string[]; - ammoHeaders: string[]; - ammoType: AmmoType; - ssl: boolean; - imbalancePoint: number; - imbalanceTs: number; - loggingLogGroupId: string; -} - -export interface CreateTestRequest_LabelsEntry { - $type: "yandex.cloud.loadtesting.agent.v1.CreateTestRequest.LabelsEntry"; - key: string; - value: string; -} - -export interface CreateTestMetadata { - $type: "yandex.cloud.loadtesting.agent.v1.CreateTestMetadata"; - testId: string; -} - export interface UpdateTestRequest { $type: "yandex.cloud.loadtesting.agent.v1.UpdateTestRequest"; testId: string; updateMask?: FieldMask; + /** @deprecated */ name: string; + /** @deprecated */ description: string; + /** @deprecated */ labels: { [key: string]: string }; + /** @deprecated */ favorite: boolean; + /** @deprecated */ targetVersion: string; imbalancePoint: number; imbalanceTs: number; @@ -160,512 +117,6 @@ export const GetTestRequest = { messageTypeRegistry.set(GetTestRequest.$type, GetTestRequest); -const baseCreateTestRequest: object = { - $type: "yandex.cloud.loadtesting.agent.v1.CreateTestRequest", - folderId: "", - name: "", - description: "", - generator: 0, - agentInstanceId: "", - targetAddress: "", - targetPort: 0, - targetVersion: "", - instances: 0, - config: "", - ammoId: "", - ammoUrls: "", - ammoHeaders: "", - ammoType: 0, - ssl: false, - imbalancePoint: 0, - imbalanceTs: 0, - loggingLogGroupId: "", -}; - -export const CreateTestRequest = { - $type: "yandex.cloud.loadtesting.agent.v1.CreateTestRequest" as const, - - encode( - message: CreateTestRequest, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.folderId !== "") { - writer.uint32(10).string(message.folderId); - } - if (message.name !== "") { - writer.uint32(18).string(message.name); - } - if (message.description !== "") { - writer.uint32(26).string(message.description); - } - Object.entries(message.labels).forEach(([key, value]) => { - CreateTestRequest_LabelsEntry.encode( - { - $type: - "yandex.cloud.loadtesting.agent.v1.CreateTestRequest.LabelsEntry", - key: key as any, - value, - }, - writer.uint32(34).fork() - ).ldelim(); - }); - if (message.generator !== 0) { - writer.uint32(40).int32(message.generator); - } - if (message.agentInstanceId !== "") { - writer.uint32(50).string(message.agentInstanceId); - } - if (message.targetAddress !== "") { - writer.uint32(58).string(message.targetAddress); - } - if (message.targetPort !== 0) { - writer.uint32(64).int64(message.targetPort); - } - if (message.targetVersion !== "") { - writer.uint32(74).string(message.targetVersion); - } - if (message.instances !== 0) { - writer.uint32(80).int64(message.instances); - } - if (message.loadSchedule !== undefined) { - Schedule.encode(message.loadSchedule, writer.uint32(90).fork()).ldelim(); - } - if (message.config !== "") { - writer.uint32(98).string(message.config); - } - if (message.ammoId !== "") { - writer.uint32(106).string(message.ammoId); - } - for (const v of message.ammoUrls) { - writer.uint32(114).string(v!); - } - for (const v of message.ammoHeaders) { - writer.uint32(122).string(v!); - } - if (message.ammoType !== 0) { - writer.uint32(128).int32(message.ammoType); - } - if (message.ssl === true) { - writer.uint32(136).bool(message.ssl); - } - if (message.imbalancePoint !== 0) { - writer.uint32(144).int64(message.imbalancePoint); - } - if (message.imbalanceTs !== 0) { - writer.uint32(152).int64(message.imbalanceTs); - } - if (message.loggingLogGroupId !== "") { - writer.uint32(162).string(message.loggingLogGroupId); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CreateTestRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCreateTestRequest } as CreateTestRequest; - message.labels = {}; - message.ammoUrls = []; - message.ammoHeaders = []; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.folderId = reader.string(); - break; - case 2: - message.name = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - const entry4 = CreateTestRequest_LabelsEntry.decode( - reader, - reader.uint32() - ); - if (entry4.value !== undefined) { - message.labels[entry4.key] = entry4.value; - } - break; - case 5: - message.generator = reader.int32() as any; - break; - case 6: - message.agentInstanceId = reader.string(); - break; - case 7: - message.targetAddress = reader.string(); - break; - case 8: - message.targetPort = longToNumber(reader.int64() as Long); - break; - case 9: - message.targetVersion = reader.string(); - break; - case 10: - message.instances = longToNumber(reader.int64() as Long); - break; - case 11: - message.loadSchedule = Schedule.decode(reader, reader.uint32()); - break; - case 12: - message.config = reader.string(); - break; - case 13: - message.ammoId = reader.string(); - break; - case 14: - message.ammoUrls.push(reader.string()); - break; - case 15: - message.ammoHeaders.push(reader.string()); - break; - case 16: - message.ammoType = reader.int32() as any; - break; - case 17: - message.ssl = reader.bool(); - break; - case 18: - message.imbalancePoint = longToNumber(reader.int64() as Long); - break; - case 19: - message.imbalanceTs = longToNumber(reader.int64() as Long); - break; - case 20: - message.loggingLogGroupId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CreateTestRequest { - const message = { ...baseCreateTestRequest } as CreateTestRequest; - message.folderId = - object.folderId !== undefined && object.folderId !== null - ? String(object.folderId) - : ""; - message.name = - object.name !== undefined && object.name !== null - ? String(object.name) - : ""; - message.description = - object.description !== undefined && object.description !== null - ? String(object.description) - : ""; - message.labels = Object.entries(object.labels ?? {}).reduce<{ - [key: string]: string; - }>((acc, [key, value]) => { - acc[key] = String(value); - return acc; - }, {}); - message.generator = - object.generator !== undefined && object.generator !== null - ? test_GeneratorFromJSON(object.generator) - : 0; - message.agentInstanceId = - object.agentInstanceId !== undefined && object.agentInstanceId !== null - ? String(object.agentInstanceId) - : ""; - message.targetAddress = - object.targetAddress !== undefined && object.targetAddress !== null - ? String(object.targetAddress) - : ""; - message.targetPort = - object.targetPort !== undefined && object.targetPort !== null - ? Number(object.targetPort) - : 0; - message.targetVersion = - object.targetVersion !== undefined && object.targetVersion !== null - ? String(object.targetVersion) - : ""; - message.instances = - object.instances !== undefined && object.instances !== null - ? Number(object.instances) - : 0; - message.loadSchedule = - object.loadSchedule !== undefined && object.loadSchedule !== null - ? Schedule.fromJSON(object.loadSchedule) - : undefined; - message.config = - object.config !== undefined && object.config !== null - ? String(object.config) - : ""; - message.ammoId = - object.ammoId !== undefined && object.ammoId !== null - ? String(object.ammoId) - : ""; - message.ammoUrls = (object.ammoUrls ?? []).map((e: any) => String(e)); - message.ammoHeaders = (object.ammoHeaders ?? []).map((e: any) => String(e)); - message.ammoType = - object.ammoType !== undefined && object.ammoType !== null - ? ammoTypeFromJSON(object.ammoType) - : 0; - message.ssl = - object.ssl !== undefined && object.ssl !== null - ? Boolean(object.ssl) - : false; - message.imbalancePoint = - object.imbalancePoint !== undefined && object.imbalancePoint !== null - ? Number(object.imbalancePoint) - : 0; - message.imbalanceTs = - object.imbalanceTs !== undefined && object.imbalanceTs !== null - ? Number(object.imbalanceTs) - : 0; - message.loggingLogGroupId = - object.loggingLogGroupId !== undefined && - object.loggingLogGroupId !== null - ? String(object.loggingLogGroupId) - : ""; - return message; - }, - - toJSON(message: CreateTestRequest): unknown { - const obj: any = {}; - message.folderId !== undefined && (obj.folderId = message.folderId); - message.name !== undefined && (obj.name = message.name); - message.description !== undefined && - (obj.description = message.description); - obj.labels = {}; - if (message.labels) { - Object.entries(message.labels).forEach(([k, v]) => { - obj.labels[k] = v; - }); - } - message.generator !== undefined && - (obj.generator = test_GeneratorToJSON(message.generator)); - message.agentInstanceId !== undefined && - (obj.agentInstanceId = message.agentInstanceId); - message.targetAddress !== undefined && - (obj.targetAddress = message.targetAddress); - message.targetPort !== undefined && - (obj.targetPort = Math.round(message.targetPort)); - message.targetVersion !== undefined && - (obj.targetVersion = message.targetVersion); - message.instances !== undefined && - (obj.instances = Math.round(message.instances)); - message.loadSchedule !== undefined && - (obj.loadSchedule = message.loadSchedule - ? Schedule.toJSON(message.loadSchedule) - : undefined); - message.config !== undefined && (obj.config = message.config); - message.ammoId !== undefined && (obj.ammoId = message.ammoId); - if (message.ammoUrls) { - obj.ammoUrls = message.ammoUrls.map((e) => e); - } else { - obj.ammoUrls = []; - } - if (message.ammoHeaders) { - obj.ammoHeaders = message.ammoHeaders.map((e) => e); - } else { - obj.ammoHeaders = []; - } - message.ammoType !== undefined && - (obj.ammoType = ammoTypeToJSON(message.ammoType)); - message.ssl !== undefined && (obj.ssl = message.ssl); - message.imbalancePoint !== undefined && - (obj.imbalancePoint = Math.round(message.imbalancePoint)); - message.imbalanceTs !== undefined && - (obj.imbalanceTs = Math.round(message.imbalanceTs)); - message.loggingLogGroupId !== undefined && - (obj.loggingLogGroupId = message.loggingLogGroupId); - return obj; - }, - - fromPartial, I>>( - object: I - ): CreateTestRequest { - const message = { ...baseCreateTestRequest } as CreateTestRequest; - message.folderId = object.folderId ?? ""; - message.name = object.name ?? ""; - message.description = object.description ?? ""; - message.labels = Object.entries(object.labels ?? {}).reduce<{ - [key: string]: string; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = String(value); - } - return acc; - }, {}); - message.generator = object.generator ?? 0; - message.agentInstanceId = object.agentInstanceId ?? ""; - message.targetAddress = object.targetAddress ?? ""; - message.targetPort = object.targetPort ?? 0; - message.targetVersion = object.targetVersion ?? ""; - message.instances = object.instances ?? 0; - message.loadSchedule = - object.loadSchedule !== undefined && object.loadSchedule !== null - ? Schedule.fromPartial(object.loadSchedule) - : undefined; - message.config = object.config ?? ""; - message.ammoId = object.ammoId ?? ""; - message.ammoUrls = object.ammoUrls?.map((e) => e) || []; - message.ammoHeaders = object.ammoHeaders?.map((e) => e) || []; - message.ammoType = object.ammoType ?? 0; - message.ssl = object.ssl ?? false; - message.imbalancePoint = object.imbalancePoint ?? 0; - message.imbalanceTs = object.imbalanceTs ?? 0; - message.loggingLogGroupId = object.loggingLogGroupId ?? ""; - return message; - }, -}; - -messageTypeRegistry.set(CreateTestRequest.$type, CreateTestRequest); - -const baseCreateTestRequest_LabelsEntry: object = { - $type: "yandex.cloud.loadtesting.agent.v1.CreateTestRequest.LabelsEntry", - key: "", - value: "", -}; - -export const CreateTestRequest_LabelsEntry = { - $type: - "yandex.cloud.loadtesting.agent.v1.CreateTestRequest.LabelsEntry" as const, - - encode( - message: CreateTestRequest_LabelsEntry, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== "") { - writer.uint32(18).string(message.value); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): CreateTestRequest_LabelsEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseCreateTestRequest_LabelsEntry, - } as CreateTestRequest_LabelsEntry; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CreateTestRequest_LabelsEntry { - const message = { - ...baseCreateTestRequest_LabelsEntry, - } as CreateTestRequest_LabelsEntry; - message.key = - object.key !== undefined && object.key !== null ? String(object.key) : ""; - message.value = - object.value !== undefined && object.value !== null - ? String(object.value) - : ""; - return message; - }, - - toJSON(message: CreateTestRequest_LabelsEntry): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); - return obj; - }, - - fromPartial, I>>( - object: I - ): CreateTestRequest_LabelsEntry { - const message = { - ...baseCreateTestRequest_LabelsEntry, - } as CreateTestRequest_LabelsEntry; - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; - }, -}; - -messageTypeRegistry.set( - CreateTestRequest_LabelsEntry.$type, - CreateTestRequest_LabelsEntry -); - -const baseCreateTestMetadata: object = { - $type: "yandex.cloud.loadtesting.agent.v1.CreateTestMetadata", - testId: "", -}; - -export const CreateTestMetadata = { - $type: "yandex.cloud.loadtesting.agent.v1.CreateTestMetadata" as const, - - encode( - message: CreateTestMetadata, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.testId !== "") { - writer.uint32(10).string(message.testId); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CreateTestMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseCreateTestMetadata } as CreateTestMetadata; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.testId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CreateTestMetadata { - const message = { ...baseCreateTestMetadata } as CreateTestMetadata; - message.testId = - object.testId !== undefined && object.testId !== null - ? String(object.testId) - : ""; - return message; - }, - - toJSON(message: CreateTestMetadata): unknown { - const obj: any = {}; - message.testId !== undefined && (obj.testId = message.testId); - return obj; - }, - - fromPartial, I>>( - object: I - ): CreateTestMetadata { - const message = { ...baseCreateTestMetadata } as CreateTestMetadata; - message.testId = object.testId ?? ""; - return message; - }, -}; - -messageTypeRegistry.set(CreateTestMetadata.$type, CreateTestMetadata); - const baseUpdateTestRequest: object = { $type: "yandex.cloud.loadtesting.agent.v1.UpdateTestRequest", testId: "", @@ -1044,18 +495,6 @@ export const TestServiceService = { Buffer.from(Test.encode(value).finish()), responseDeserialize: (value: Buffer) => Test.decode(value), }, - /** Creates test for the specified folder. */ - create: { - path: "/yandex.cloud.loadtesting.agent.v1.TestService/Create", - requestStream: false, - responseStream: false, - requestSerialize: (value: CreateTestRequest) => - Buffer.from(CreateTestRequest.encode(value).finish()), - requestDeserialize: (value: Buffer) => CreateTestRequest.decode(value), - responseSerialize: (value: Operation) => - Buffer.from(Operation.encode(value).finish()), - responseDeserialize: (value: Buffer) => Operation.decode(value), - }, /** Updates the specified test. */ update: { path: "/yandex.cloud.loadtesting.agent.v1.TestService/Update", @@ -1073,8 +512,6 @@ export const TestServiceService = { export interface TestServiceServer extends UntypedServiceImplementation { /** Returns test by test id. */ get: handleUnaryCall; - /** Creates test for the specified folder. */ - create: handleUnaryCall; /** Updates the specified test. */ update: handleUnaryCall; } @@ -1096,22 +533,6 @@ export interface TestServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Test) => void ): ClientUnaryCall; - /** Creates test for the specified folder. */ - create( - request: CreateTestRequest, - callback: (error: ServiceError | null, response: Operation) => void - ): ClientUnaryCall; - create( - request: CreateTestRequest, - metadata: Metadata, - callback: (error: ServiceError | null, response: Operation) => void - ): ClientUnaryCall; - create( - request: CreateTestRequest, - metadata: Metadata, - options: Partial, - callback: (error: ServiceError | null, response: Operation) => void - ): ClientUnaryCall; /** Updates the specified test. */ update( request: UpdateTestRequest, diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/agent/agent.ts b/src/generated/yandex/cloud/loadtesting/api/v1/agent/agent.ts index c219a8e4..8dde82da 100644 --- a/src/generated/yandex/cloud/loadtesting/api/v1/agent/agent.ts +++ b/src/generated/yandex/cloud/loadtesting/api/v1/agent/agent.ts @@ -7,19 +7,45 @@ import { statusFromJSON, statusToJSON, } from "../../../../../../yandex/cloud/loadtesting/api/v1/agent/status"; +import { LogSettings } from "../../../../../../yandex/cloud/loadtesting/api/v1/agent/log_settings"; export const protobufPackage = "yandex.cloud.loadtesting.api.v1.agent"; +/** Load testing agent on which tests are executed. */ export interface Agent { $type: "yandex.cloud.loadtesting.api.v1.agent.Agent"; + /** ID of the agent. Generated at creation time. */ id: string; + /** ID of the folder that the agent belongs to. */ folderId: string; + /** Name of the agent. */ name: string; + /** Description of the agent. */ description: string; + /** + * ID of the compute instance managed by the agent. + * + * Empty if there is no such instance (i.e. the case of external agent). + */ computeInstanceId: string; + /** Status of the agent. */ status: Status; + /** List of errors reported by the agent. */ errors: string[]; + /** ID of the test that is currently being executed by the agent. */ currentJobId: string; + /** Version of the agent. */ + agentVersionId: string; + /** Agent labels as `key:value` pairs. */ + labels: { [key: string]: string }; + /** Agent log settings */ + logSettings?: LogSettings; +} + +export interface Agent_LabelsEntry { + $type: "yandex.cloud.loadtesting.api.v1.agent.Agent.LabelsEntry"; + key: string; + value: string; } const baseAgent: object = { @@ -32,6 +58,7 @@ const baseAgent: object = { status: 0, errors: "", currentJobId: "", + agentVersionId: "", }; export const Agent = { @@ -62,6 +89,25 @@ export const Agent = { if (message.currentJobId !== "") { writer.uint32(74).string(message.currentJobId); } + if (message.agentVersionId !== "") { + writer.uint32(82).string(message.agentVersionId); + } + Object.entries(message.labels).forEach(([key, value]) => { + Agent_LabelsEntry.encode( + { + $type: "yandex.cloud.loadtesting.api.v1.agent.Agent.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(98).fork() + ).ldelim(); + }); + if (message.logSettings !== undefined) { + LogSettings.encode( + message.logSettings, + writer.uint32(106).fork() + ).ldelim(); + } return writer; }, @@ -70,6 +116,7 @@ export const Agent = { let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseAgent } as Agent; message.errors = []; + message.labels = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -97,6 +144,18 @@ export const Agent = { case 9: message.currentJobId = reader.string(); break; + case 10: + message.agentVersionId = reader.string(); + break; + case 12: + const entry12 = Agent_LabelsEntry.decode(reader, reader.uint32()); + if (entry12.value !== undefined) { + message.labels[entry12.key] = entry12.value; + } + break; + case 13: + message.logSettings = LogSettings.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -135,6 +194,20 @@ export const Agent = { object.currentJobId !== undefined && object.currentJobId !== null ? String(object.currentJobId) : ""; + message.agentVersionId = + object.agentVersionId !== undefined && object.agentVersionId !== null + ? String(object.agentVersionId) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.logSettings = + object.logSettings !== undefined && object.logSettings !== null + ? LogSettings.fromJSON(object.logSettings) + : undefined; return message; }, @@ -155,6 +228,18 @@ export const Agent = { } message.currentJobId !== undefined && (obj.currentJobId = message.currentJobId); + message.agentVersionId !== undefined && + (obj.agentVersionId = message.agentVersionId); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.logSettings !== undefined && + (obj.logSettings = message.logSettings + ? LogSettings.toJSON(message.logSettings) + : undefined); return obj; }, @@ -168,12 +253,98 @@ export const Agent = { message.status = object.status ?? 0; message.errors = object.errors?.map((e) => e) || []; message.currentJobId = object.currentJobId ?? ""; + message.agentVersionId = object.agentVersionId ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.logSettings = + object.logSettings !== undefined && object.logSettings !== null + ? LogSettings.fromPartial(object.logSettings) + : undefined; return message; }, }; messageTypeRegistry.set(Agent.$type, Agent); +const baseAgent_LabelsEntry: object = { + $type: "yandex.cloud.loadtesting.api.v1.agent.Agent.LabelsEntry", + key: "", + value: "", +}; + +export const Agent_LabelsEntry = { + $type: "yandex.cloud.loadtesting.api.v1.agent.Agent.LabelsEntry" as const, + + encode( + message: Agent_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Agent_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAgent_LabelsEntry } as Agent_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Agent_LabelsEntry { + const message = { ...baseAgent_LabelsEntry } as Agent_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Agent_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Agent_LabelsEntry { + const message = { ...baseAgent_LabelsEntry } as Agent_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Agent_LabelsEntry.$type, Agent_LabelsEntry); + type Builtin = | Date | Function diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/agent/create_compute_instance.ts b/src/generated/yandex/cloud/loadtesting/api/v1/agent/create_compute_instance.ts index 49fb8910..6892b078 100644 --- a/src/generated/yandex/cloud/loadtesting/api/v1/agent/create_compute_instance.ts +++ b/src/generated/yandex/cloud/loadtesting/api/v1/agent/create_compute_instance.ts @@ -48,6 +48,11 @@ export interface CreateComputeInstance { * To get the service account ID, use a [yandex.cloud.iam.v1.ServiceAccountService.List] request. */ serviceAccountId: string; + /** + * ID of the [Compute VM platform](docs/compute/concepts/vm-platforms) on which the agent will be created. + * Default value: "standard-v2" + */ + platformId: string; } export interface CreateComputeInstance_LabelsEntry { @@ -66,6 +71,7 @@ const baseCreateComputeInstance: object = { $type: "yandex.cloud.loadtesting.api.v1.agent.CreateComputeInstance", zoneId: "", serviceAccountId: "", + platformId: "", }; export const CreateComputeInstance = { @@ -118,6 +124,9 @@ export const CreateComputeInstance = { if (message.serviceAccountId !== "") { writer.uint32(114).string(message.serviceAccountId); } + if (message.platformId !== "") { + writer.uint32(122).string(message.platformId); + } return writer; }, @@ -172,6 +181,9 @@ export const CreateComputeInstance = { case 14: message.serviceAccountId = reader.string(); break; + case 15: + message.platformId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -213,6 +225,10 @@ export const CreateComputeInstance = { object.serviceAccountId !== undefined && object.serviceAccountId !== null ? String(object.serviceAccountId) : ""; + message.platformId = + object.platformId !== undefined && object.platformId !== null + ? String(object.platformId) + : ""; return message; }, @@ -248,6 +264,7 @@ export const CreateComputeInstance = { } message.serviceAccountId !== undefined && (obj.serviceAccountId = message.serviceAccountId); + message.platformId !== undefined && (obj.platformId = message.platformId); return obj; }, @@ -285,6 +302,7 @@ export const CreateComputeInstance = { NetworkInterfaceSpec.fromPartial(e) ) || []; message.serviceAccountId = object.serviceAccountId ?? ""; + message.platformId = object.platformId ?? ""; return message; }, }; diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/agent/log_settings.ts b/src/generated/yandex/cloud/loadtesting/api/v1/agent/log_settings.ts new file mode 100644 index 00000000..be70da1a --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/agent/log_settings.ts @@ -0,0 +1,107 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.agent"; + +export interface LogSettings { + $type: "yandex.cloud.loadtesting.api.v1.agent.LogSettings"; + /** Id of Yandex Cloud log group to upload agent logs to */ + cloudLogGroupId: string; +} + +const baseLogSettings: object = { + $type: "yandex.cloud.loadtesting.api.v1.agent.LogSettings", + cloudLogGroupId: "", +}; + +export const LogSettings = { + $type: "yandex.cloud.loadtesting.api.v1.agent.LogSettings" as const, + + encode( + message: LogSettings, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.cloudLogGroupId !== "") { + writer.uint32(10).string(message.cloudLogGroupId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LogSettings { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLogSettings } as LogSettings; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cloudLogGroupId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LogSettings { + const message = { ...baseLogSettings } as LogSettings; + message.cloudLogGroupId = + object.cloudLogGroupId !== undefined && object.cloudLogGroupId !== null + ? String(object.cloudLogGroupId) + : ""; + return message; + }, + + toJSON(message: LogSettings): unknown { + const obj: any = {}; + message.cloudLogGroupId !== undefined && + (obj.cloudLogGroupId = message.cloudLogGroupId); + return obj; + }, + + fromPartial, I>>( + object: I + ): LogSettings { + const message = { ...baseLogSettings } as LogSettings; + message.cloudLogGroupId = object.cloudLogGroupId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(LogSettings.$type, LogSettings); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/agent/status.ts b/src/generated/yandex/cloud/loadtesting/api/v1/agent/status.ts index de42d092..25867b98 100644 --- a/src/generated/yandex/cloud/loadtesting/api/v1/agent/status.ts +++ b/src/generated/yandex/cloud/loadtesting/api/v1/agent/status.ts @@ -4,23 +4,41 @@ import _m0 from "protobufjs/minimal"; export const protobufPackage = "yandex.cloud.loadtesting.api.v1.agent"; +/** Agent status. */ export enum Status { + /** STATUS_UNSPECIFIED - Status is not specified. */ STATUS_UNSPECIFIED = 0, + /** PREPARING_TEST - Agent is preparing a test to be executed. */ PREPARING_TEST = 1, + /** READY_FOR_TEST - Agent is ready to take a test. */ READY_FOR_TEST = 2, + /** TESTING - Agent is executing a test. */ TESTING = 3, + /** TANK_FAILED - Agent application encountered an error and cannot operate normally. */ TANK_FAILED = 4, + /** PROVISIONING - Agent is waiting for resources to be allocated. */ PROVISIONING = 5, + /** STOPPING - Agent is being stopped. */ STOPPING = 6, + /** STOPPED - Agent is stopped. */ STOPPED = 7, + /** STARTING - Agent is being started. */ STARTING = 8, + /** RESTARTING - Agent is being restarted. */ RESTARTING = 9, + /** UPDATING - Agent is being updated. */ UPDATING = 10, + /** ERROR - Agent encountered an error and cannot operate. */ ERROR = 11, + /** CRASHED - Agent is crashed and will be restarted automatically. */ CRASHED = 12, + /** DELETING - Agent is being deleted. */ DELETING = 13, + /** INITIALIZING_CONNECTION - Service is waiting for connection with agent to be established. */ INITIALIZING_CONNECTION = 15, + /** LOST_CONNECTION_WITH_AGENT - Service has lost connection with agent. */ LOST_CONNECTION_WITH_AGENT = 16, + /** UPLOADING_ARTIFACTS - Agent is uploading test artifacts. */ UPLOADING_ARTIFACTS = 17, UNRECOGNIZED = -1, } diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/agent_service.ts b/src/generated/yandex/cloud/loadtesting/api/v1/agent_service.ts index 256c9886..094adcc7 100644 --- a/src/generated/yandex/cloud/loadtesting/api/v1/agent_service.ts +++ b/src/generated/yandex/cloud/loadtesting/api/v1/agent_service.ts @@ -15,6 +15,8 @@ import { } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; import { CreateComputeInstance } from "../../../../../yandex/cloud/loadtesting/api/v1/agent/create_compute_instance"; +import { LogSettings } from "../../../../../yandex/cloud/loadtesting/api/v1/agent/log_settings"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; import { Agent } from "../../../../../yandex/cloud/loadtesting/api/v1/agent/agent"; import { Operation } from "../../../../../yandex/cloud/operation/operation"; @@ -22,47 +24,146 @@ export const protobufPackage = "yandex.cloud.loadtesting.api.v1"; export interface CreateAgentRequest { $type: "yandex.cloud.loadtesting.api.v1.CreateAgentRequest"; + /** ID of the folder to create an agent in. */ folderId: string; + /** + * Name of the agent. + * + * A created compute instance will have the same name. + */ name: string; + /** + * Description of the agent. + * + * A created compute instance will have the same description. + */ description: string; + /** Parameters for compute instance to be created. */ computeInstanceParams?: CreateComputeInstance; + /** + * Version of the agent. + * + * If not provided, the most recent agent version will be used. + */ agentVersion: string; + /** Agent labels as `key:value` pairs. */ + labels: { [key: string]: string }; + /** Agent log settings */ + logSettings?: LogSettings; +} + +export interface CreateAgentRequest_LabelsEntry { + $type: "yandex.cloud.loadtesting.api.v1.CreateAgentRequest.LabelsEntry"; + key: string; + value: string; } export interface CreateAgentMetadata { $type: "yandex.cloud.loadtesting.api.v1.CreateAgentMetadata"; + /** ID of the agent that is being created. */ agentId: string; } export interface GetAgentRequest { $type: "yandex.cloud.loadtesting.api.v1.GetAgentRequest"; + /** ID of the agent to return. */ agentId: string; } export interface DeleteAgentRequest { $type: "yandex.cloud.loadtesting.api.v1.DeleteAgentRequest"; + /** ID of the agent to delete. */ agentId: string; } export interface DeleteAgentMetadata { $type: "yandex.cloud.loadtesting.api.v1.DeleteAgentMetadata"; + /** ID of the agent that is being deleted. */ agentId: string; } export interface ListAgentsRequest { $type: "yandex.cloud.loadtesting.api.v1.ListAgentsRequest"; + /** ID of the folder to list agents in. */ folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than `page_size`, the service returns a [ListAgentsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100. + */ pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * [ListAgentsResponse.next_page_token] returned by a previous list request. + */ pageToken: string; + /** + * A filter expression that filters agents listed in the response. + * + * The filter expression may contain multiple field expressions joined by `AND`. + * The field expression must specify: + * 1. The field name. + * 2. An operator: + * - `=`, `!=`, `CONTAINS`, for single values. + * - `IN` or `NOT IN` for lists of values. + * 3. The value. String values must be encosed in `"`, boolean values are {`true`, `false`}, timestamp values in ISO-8601. + * + * Currently supported fields: + * - `id` [yandex.cloud.loadtesting.api.v1.agent.Agent.id] + * - operators: `=`, `!=`, `IN`, `NOT IN` + * - `name` [yandex.cloud.loadtesting.api.v1.agent.Agent.name] + * - operators: `=`, `!=`, `IN`, `NOT IN`, `CONTAINS` + * + * Examples: + * - `id IN ("1", "2", "3")` + * - `name CONTAINS "compute-agent-large" AND id NOT IN ("4", "5")` + */ filter: string; } export interface ListAgentsResponse { $type: "yandex.cloud.loadtesting.api.v1.ListAgentsResponse"; + /** List of agents in the specified folder. */ agents: Agent[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListAgentsRequest.page_size], use `next_page_token` as the value + * for the [ListAgentsRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `next_page_token` to continue paging through the results. + */ nextPageToken: string; } +export interface UpdateAgentRequest { + $type: "yandex.cloud.loadtesting.api.v1.UpdateAgentRequest"; + /** ID of the agent to update. */ + agentId: string; + /** Field mask that specifies which attributes of the agent are going to be updated. */ + updateMask?: FieldMask; + /** New name of the agent. */ + name: string; + /** New description of the agent. */ + description: string; + /** New parameters of compute instance managed by the agent. */ + computeInstanceParams?: CreateComputeInstance; + /** New labels of the agent. */ + labels: { [key: string]: string }; +} + +export interface UpdateAgentRequest_LabelsEntry { + $type: "yandex.cloud.loadtesting.api.v1.UpdateAgentRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateAgentMetadata { + $type: "yandex.cloud.loadtesting.api.v1.UpdateAgentMetadata"; + /** ID of the agent that is being updated. */ + agentId: string; +} + const baseCreateAgentRequest: object = { $type: "yandex.cloud.loadtesting.api.v1.CreateAgentRequest", folderId: "", @@ -96,6 +197,23 @@ export const CreateAgentRequest = { if (message.agentVersion !== "") { writer.uint32(42).string(message.agentVersion); } + Object.entries(message.labels).forEach(([key, value]) => { + CreateAgentRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.loadtesting.api.v1.CreateAgentRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + if (message.logSettings !== undefined) { + LogSettings.encode( + message.logSettings, + writer.uint32(58).fork() + ).ldelim(); + } return writer; }, @@ -103,6 +221,7 @@ export const CreateAgentRequest = { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCreateAgentRequest } as CreateAgentRequest; + message.labels = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -124,6 +243,18 @@ export const CreateAgentRequest = { case 5: message.agentVersion = reader.string(); break; + case 6: + const entry6 = CreateAgentRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + case 7: + message.logSettings = LogSettings.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -155,6 +286,16 @@ export const CreateAgentRequest = { object.agentVersion !== undefined && object.agentVersion !== null ? String(object.agentVersion) : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.logSettings = + object.logSettings !== undefined && object.logSettings !== null + ? LogSettings.fromJSON(object.logSettings) + : undefined; return message; }, @@ -170,6 +311,16 @@ export const CreateAgentRequest = { : undefined); message.agentVersion !== undefined && (obj.agentVersion = message.agentVersion); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.logSettings !== undefined && + (obj.logSettings = message.logSettings + ? LogSettings.toJSON(message.logSettings) + : undefined); return obj; }, @@ -186,12 +337,110 @@ export const CreateAgentRequest = { ? CreateComputeInstance.fromPartial(object.computeInstanceParams) : undefined; message.agentVersion = object.agentVersion ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.logSettings = + object.logSettings !== undefined && object.logSettings !== null + ? LogSettings.fromPartial(object.logSettings) + : undefined; return message; }, }; messageTypeRegistry.set(CreateAgentRequest.$type, CreateAgentRequest); +const baseCreateAgentRequest_LabelsEntry: object = { + $type: "yandex.cloud.loadtesting.api.v1.CreateAgentRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateAgentRequest_LabelsEntry = { + $type: + "yandex.cloud.loadtesting.api.v1.CreateAgentRequest.LabelsEntry" as const, + + encode( + message: CreateAgentRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateAgentRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateAgentRequest_LabelsEntry, + } as CreateAgentRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateAgentRequest_LabelsEntry { + const message = { + ...baseCreateAgentRequest_LabelsEntry, + } as CreateAgentRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateAgentRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateAgentRequest_LabelsEntry { + const message = { + ...baseCreateAgentRequest_LabelsEntry, + } as CreateAgentRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateAgentRequest_LabelsEntry.$type, + CreateAgentRequest_LabelsEntry +); + const baseCreateAgentMetadata: object = { $type: "yandex.cloud.loadtesting.api.v1.CreateAgentMetadata", agentId: "", @@ -619,7 +868,335 @@ export const ListAgentsResponse = { messageTypeRegistry.set(ListAgentsResponse.$type, ListAgentsResponse); +const baseUpdateAgentRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.UpdateAgentRequest", + agentId: "", + name: "", + description: "", +}; + +export const UpdateAgentRequest = { + $type: "yandex.cloud.loadtesting.api.v1.UpdateAgentRequest" as const, + + encode( + message: UpdateAgentRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.agentId !== "") { + writer.uint32(10).string(message.agentId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.computeInstanceParams !== undefined) { + CreateComputeInstance.encode( + message.computeInstanceParams, + writer.uint32(42).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateAgentRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.loadtesting.api.v1.UpdateAgentRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateAgentRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateAgentRequest } as UpdateAgentRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.agentId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.computeInstanceParams = CreateComputeInstance.decode( + reader, + reader.uint32() + ); + break; + case 6: + const entry6 = UpdateAgentRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateAgentRequest { + const message = { ...baseUpdateAgentRequest } as UpdateAgentRequest; + message.agentId = + object.agentId !== undefined && object.agentId !== null + ? String(object.agentId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.computeInstanceParams = + object.computeInstanceParams !== undefined && + object.computeInstanceParams !== null + ? CreateComputeInstance.fromJSON(object.computeInstanceParams) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: UpdateAgentRequest): unknown { + const obj: any = {}; + message.agentId !== undefined && (obj.agentId = message.agentId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.computeInstanceParams !== undefined && + (obj.computeInstanceParams = message.computeInstanceParams + ? CreateComputeInstance.toJSON(message.computeInstanceParams) + : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateAgentRequest { + const message = { ...baseUpdateAgentRequest } as UpdateAgentRequest; + message.agentId = object.agentId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.computeInstanceParams = + object.computeInstanceParams !== undefined && + object.computeInstanceParams !== null + ? CreateComputeInstance.fromPartial(object.computeInstanceParams) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(UpdateAgentRequest.$type, UpdateAgentRequest); + +const baseUpdateAgentRequest_LabelsEntry: object = { + $type: "yandex.cloud.loadtesting.api.v1.UpdateAgentRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateAgentRequest_LabelsEntry = { + $type: + "yandex.cloud.loadtesting.api.v1.UpdateAgentRequest.LabelsEntry" as const, + + encode( + message: UpdateAgentRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateAgentRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateAgentRequest_LabelsEntry, + } as UpdateAgentRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateAgentRequest_LabelsEntry { + const message = { + ...baseUpdateAgentRequest_LabelsEntry, + } as UpdateAgentRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateAgentRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateAgentRequest_LabelsEntry { + const message = { + ...baseUpdateAgentRequest_LabelsEntry, + } as UpdateAgentRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateAgentRequest_LabelsEntry.$type, + UpdateAgentRequest_LabelsEntry +); + +const baseUpdateAgentMetadata: object = { + $type: "yandex.cloud.loadtesting.api.v1.UpdateAgentMetadata", + agentId: "", +}; + +export const UpdateAgentMetadata = { + $type: "yandex.cloud.loadtesting.api.v1.UpdateAgentMetadata" as const, + + encode( + message: UpdateAgentMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.agentId !== "") { + writer.uint32(10).string(message.agentId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateAgentMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateAgentMetadata } as UpdateAgentMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.agentId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateAgentMetadata { + const message = { ...baseUpdateAgentMetadata } as UpdateAgentMetadata; + message.agentId = + object.agentId !== undefined && object.agentId !== null + ? String(object.agentId) + : ""; + return message; + }, + + toJSON(message: UpdateAgentMetadata): unknown { + const obj: any = {}; + message.agentId !== undefined && (obj.agentId = message.agentId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateAgentMetadata { + const message = { ...baseUpdateAgentMetadata } as UpdateAgentMetadata; + message.agentId = object.agentId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateAgentMetadata.$type, UpdateAgentMetadata); + +/** A set of methods for managing Load Testing agents. */ export const AgentServiceService = { + /** + * Creates an agent in the specified folder. + * + * Also creates a corresponding compute instance. + */ create: { path: "/yandex.cloud.loadtesting.api.v1.AgentService/Create", requestStream: false, @@ -631,6 +1208,11 @@ export const AgentServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** + * Returns the specified agent. + * + * To get the list of all available agents, make a [List] request. + */ get: { path: "/yandex.cloud.loadtesting.api.v1.AgentService/Get", requestStream: false, @@ -642,6 +1224,7 @@ export const AgentServiceService = { Buffer.from(Agent.encode(value).finish()), responseDeserialize: (value: Buffer) => Agent.decode(value), }, + /** Retrieves the list of agents in the specified folder. */ list: { path: "/yandex.cloud.loadtesting.api.v1.AgentService/List", requestStream: false, @@ -653,6 +1236,11 @@ export const AgentServiceService = { Buffer.from(ListAgentsResponse.encode(value).finish()), responseDeserialize: (value: Buffer) => ListAgentsResponse.decode(value), }, + /** + * Deletes the specified agent. + * + * Also deletes a corresponding compute instance. + */ delete: { path: "/yandex.cloud.loadtesting.api.v1.AgentService/Delete", requestStream: false, @@ -664,16 +1252,51 @@ export const AgentServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Updates the specified agent. */ + update: { + path: "/yandex.cloud.loadtesting.api.v1.AgentService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAgentRequest) => + Buffer.from(UpdateAgentRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateAgentRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface AgentServiceServer extends UntypedServiceImplementation { + /** + * Creates an agent in the specified folder. + * + * Also creates a corresponding compute instance. + */ create: handleUnaryCall; + /** + * Returns the specified agent. + * + * To get the list of all available agents, make a [List] request. + */ get: handleUnaryCall; + /** Retrieves the list of agents in the specified folder. */ list: handleUnaryCall; + /** + * Deletes the specified agent. + * + * Also deletes a corresponding compute instance. + */ delete: handleUnaryCall; + /** Updates the specified agent. */ + update: handleUnaryCall; } export interface AgentServiceClient extends Client { + /** + * Creates an agent in the specified folder. + * + * Also creates a corresponding compute instance. + */ create( request: CreateAgentRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -689,6 +1312,11 @@ export interface AgentServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** + * Returns the specified agent. + * + * To get the list of all available agents, make a [List] request. + */ get( request: GetAgentRequest, callback: (error: ServiceError | null, response: Agent) => void @@ -704,6 +1332,7 @@ export interface AgentServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Agent) => void ): ClientUnaryCall; + /** Retrieves the list of agents in the specified folder. */ list( request: ListAgentsRequest, callback: (error: ServiceError | null, response: ListAgentsResponse) => void @@ -719,6 +1348,11 @@ export interface AgentServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: ListAgentsResponse) => void ): ClientUnaryCall; + /** + * Deletes the specified agent. + * + * Also deletes a corresponding compute instance. + */ delete( request: DeleteAgentRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -734,6 +1368,22 @@ export interface AgentServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Updates the specified agent. */ + update( + request: UpdateAgentRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateAgentRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateAgentRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const AgentServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/common/quantiles.ts b/src/generated/yandex/cloud/loadtesting/api/v1/common/quantiles.ts new file mode 100644 index 00000000..decf8b37 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/common/quantiles.ts @@ -0,0 +1,302 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.common"; + +/** Quantiles (percentiles). */ +export enum QuantileType { + /** QUANTILE_TYPE_UNSPECIFIED - Unspecified percentile. */ + QUANTILE_TYPE_UNSPECIFIED = 0, + /** QUANTILE_TYPE_50 - 50 percentile (median). */ + QUANTILE_TYPE_50 = 1, + /** QUANTILE_TYPE_75 - 75 percentile. */ + QUANTILE_TYPE_75 = 2, + /** QUANTILE_TYPE_80 - 80 percentile. */ + QUANTILE_TYPE_80 = 3, + /** QUANTILE_TYPE_85 - 85 percentile. */ + QUANTILE_TYPE_85 = 4, + /** QUANTILE_TYPE_90 - 90 percentile. */ + QUANTILE_TYPE_90 = 5, + /** QUANTILE_TYPE_95 - 95 percentile. */ + QUANTILE_TYPE_95 = 6, + /** QUANTILE_TYPE_98 - 98 percentile. */ + QUANTILE_TYPE_98 = 7, + /** QUANTILE_TYPE_99 - 99 percentile. */ + QUANTILE_TYPE_99 = 8, + /** QUANTILE_TYPE_100 - 100 percentile (maximum or minimum). */ + QUANTILE_TYPE_100 = 9, + UNRECOGNIZED = -1, +} + +export function quantileTypeFromJSON(object: any): QuantileType { + switch (object) { + case 0: + case "QUANTILE_TYPE_UNSPECIFIED": + return QuantileType.QUANTILE_TYPE_UNSPECIFIED; + case 1: + case "QUANTILE_TYPE_50": + return QuantileType.QUANTILE_TYPE_50; + case 2: + case "QUANTILE_TYPE_75": + return QuantileType.QUANTILE_TYPE_75; + case 3: + case "QUANTILE_TYPE_80": + return QuantileType.QUANTILE_TYPE_80; + case 4: + case "QUANTILE_TYPE_85": + return QuantileType.QUANTILE_TYPE_85; + case 5: + case "QUANTILE_TYPE_90": + return QuantileType.QUANTILE_TYPE_90; + case 6: + case "QUANTILE_TYPE_95": + return QuantileType.QUANTILE_TYPE_95; + case 7: + case "QUANTILE_TYPE_98": + return QuantileType.QUANTILE_TYPE_98; + case 8: + case "QUANTILE_TYPE_99": + return QuantileType.QUANTILE_TYPE_99; + case 9: + case "QUANTILE_TYPE_100": + return QuantileType.QUANTILE_TYPE_100; + case -1: + case "UNRECOGNIZED": + default: + return QuantileType.UNRECOGNIZED; + } +} + +export function quantileTypeToJSON(object: QuantileType): string { + switch (object) { + case QuantileType.QUANTILE_TYPE_UNSPECIFIED: + return "QUANTILE_TYPE_UNSPECIFIED"; + case QuantileType.QUANTILE_TYPE_50: + return "QUANTILE_TYPE_50"; + case QuantileType.QUANTILE_TYPE_75: + return "QUANTILE_TYPE_75"; + case QuantileType.QUANTILE_TYPE_80: + return "QUANTILE_TYPE_80"; + case QuantileType.QUANTILE_TYPE_85: + return "QUANTILE_TYPE_85"; + case QuantileType.QUANTILE_TYPE_90: + return "QUANTILE_TYPE_90"; + case QuantileType.QUANTILE_TYPE_95: + return "QUANTILE_TYPE_95"; + case QuantileType.QUANTILE_TYPE_98: + return "QUANTILE_TYPE_98"; + case QuantileType.QUANTILE_TYPE_99: + return "QUANTILE_TYPE_99"; + case QuantileType.QUANTILE_TYPE_100: + return "QUANTILE_TYPE_100"; + default: + return "UNKNOWN"; + } +} + +/** Statistical data aggregated by predefined set of quantiles. */ +export interface Quantiles { + $type: "yandex.cloud.loadtesting.api.v1.common.Quantiles"; + /** 50 percentile (median). */ + q50: number; + /** 75 percentile. */ + q75: number; + /** 80 percentile. */ + q80: number; + /** 85 percentile. */ + q85: number; + /** 90 percentile. */ + q90: number; + /** 95 percentile. */ + q95: number; + /** 98 percentile. */ + q98: number; + /** 99 percentile. */ + q99: number; + /** 100 percentile (maximum or minimum). */ + q100: number; +} + +const baseQuantiles: object = { + $type: "yandex.cloud.loadtesting.api.v1.common.Quantiles", + q50: 0, + q75: 0, + q80: 0, + q85: 0, + q90: 0, + q95: 0, + q98: 0, + q99: 0, + q100: 0, +}; + +export const Quantiles = { + $type: "yandex.cloud.loadtesting.api.v1.common.Quantiles" as const, + + encode( + message: Quantiles, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.q50 !== 0) { + writer.uint32(9).double(message.q50); + } + if (message.q75 !== 0) { + writer.uint32(17).double(message.q75); + } + if (message.q80 !== 0) { + writer.uint32(25).double(message.q80); + } + if (message.q85 !== 0) { + writer.uint32(33).double(message.q85); + } + if (message.q90 !== 0) { + writer.uint32(41).double(message.q90); + } + if (message.q95 !== 0) { + writer.uint32(49).double(message.q95); + } + if (message.q98 !== 0) { + writer.uint32(57).double(message.q98); + } + if (message.q99 !== 0) { + writer.uint32(65).double(message.q99); + } + if (message.q100 !== 0) { + writer.uint32(73).double(message.q100); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Quantiles { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQuantiles } as Quantiles; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.q50 = reader.double(); + break; + case 2: + message.q75 = reader.double(); + break; + case 3: + message.q80 = reader.double(); + break; + case 4: + message.q85 = reader.double(); + break; + case 5: + message.q90 = reader.double(); + break; + case 6: + message.q95 = reader.double(); + break; + case 7: + message.q98 = reader.double(); + break; + case 8: + message.q99 = reader.double(); + break; + case 9: + message.q100 = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Quantiles { + const message = { ...baseQuantiles } as Quantiles; + message.q50 = + object.q50 !== undefined && object.q50 !== null ? Number(object.q50) : 0; + message.q75 = + object.q75 !== undefined && object.q75 !== null ? Number(object.q75) : 0; + message.q80 = + object.q80 !== undefined && object.q80 !== null ? Number(object.q80) : 0; + message.q85 = + object.q85 !== undefined && object.q85 !== null ? Number(object.q85) : 0; + message.q90 = + object.q90 !== undefined && object.q90 !== null ? Number(object.q90) : 0; + message.q95 = + object.q95 !== undefined && object.q95 !== null ? Number(object.q95) : 0; + message.q98 = + object.q98 !== undefined && object.q98 !== null ? Number(object.q98) : 0; + message.q99 = + object.q99 !== undefined && object.q99 !== null ? Number(object.q99) : 0; + message.q100 = + object.q100 !== undefined && object.q100 !== null + ? Number(object.q100) + : 0; + return message; + }, + + toJSON(message: Quantiles): unknown { + const obj: any = {}; + message.q50 !== undefined && (obj.q50 = message.q50); + message.q75 !== undefined && (obj.q75 = message.q75); + message.q80 !== undefined && (obj.q80 = message.q80); + message.q85 !== undefined && (obj.q85 = message.q85); + message.q90 !== undefined && (obj.q90 = message.q90); + message.q95 !== undefined && (obj.q95 = message.q95); + message.q98 !== undefined && (obj.q98 = message.q98); + message.q99 !== undefined && (obj.q99 = message.q99); + message.q100 !== undefined && (obj.q100 = message.q100); + return obj; + }, + + fromPartial, I>>( + object: I + ): Quantiles { + const message = { ...baseQuantiles } as Quantiles; + message.q50 = object.q50 ?? 0; + message.q75 = object.q75 ?? 0; + message.q80 = object.q80 ?? 0; + message.q85 = object.q85 ?? 0; + message.q90 = object.q90 ?? 0; + message.q95 = object.q95 ?? 0; + message.q98 = object.q98 ?? 0; + message.q99 = object.q99 ?? 0; + message.q100 = object.q100 ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Quantiles.$type, Quantiles); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/common/tag.ts b/src/generated/yandex/cloud/loadtesting/api/v1/common/tag.ts new file mode 100644 index 00000000..2384133c --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/common/tag.ts @@ -0,0 +1,115 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.common"; + +/** Tag attached to some entity. */ +export interface Tag { + $type: "yandex.cloud.loadtesting.api.v1.common.Tag"; + /** Key of the tag. */ + key: string; + /** Value of the tag. */ + value: string; +} + +const baseTag: object = { + $type: "yandex.cloud.loadtesting.api.v1.common.Tag", + key: "", + value: "", +}; + +export const Tag = { + $type: "yandex.cloud.loadtesting.api.v1.common.Tag" as const, + + encode(message: Tag, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Tag { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTag } as Tag; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Tag { + const message = { ...baseTag } as Tag; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Tag): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>(object: I): Tag { + const message = { ...baseTag } as Tag; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Tag.$type, Tag); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/config/config.ts b/src/generated/yandex/cloud/loadtesting/api/v1/config/config.ts new file mode 100644 index 00000000..55ffd1d5 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/config/config.ts @@ -0,0 +1,206 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.config"; + +/** Test config. */ +export interface Config { + $type: "yandex.cloud.loadtesting.api.v1.config.Config"; + /** ID of the test config. Generated at creation time. */ + id: string; + /** ID of the folder that the config belongs to. */ + folderId: string; + /** Config content in YAML format. */ + yamlString: string; + /** Name of the config. */ + name: string; + /** Creation timestamp. */ + createdAt?: Date; + /** UA or SA that created the config. */ + createdBy: string; +} + +const baseConfig: object = { + $type: "yandex.cloud.loadtesting.api.v1.config.Config", + id: "", + folderId: "", + yamlString: "", + name: "", + createdBy: "", +}; + +export const Config = { + $type: "yandex.cloud.loadtesting.api.v1.config.Config" as const, + + encode( + message: Config, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.yamlString !== "") { + writer.uint32(26).string(message.yamlString); + } + if (message.name !== "") { + writer.uint32(82).string(message.name); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(90).fork() + ).ldelim(); + } + if (message.createdBy !== "") { + writer.uint32(98).string(message.createdBy); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Config { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConfig } as Config; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.yamlString = reader.string(); + break; + case 10: + message.name = reader.string(); + break; + case 11: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 12: + message.createdBy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Config { + const message = { ...baseConfig } as Config; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.yamlString = + object.yamlString !== undefined && object.yamlString !== null + ? String(object.yamlString) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + return message; + }, + + toJSON(message: Config): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.yamlString !== undefined && (obj.yamlString = message.yamlString); + message.name !== undefined && (obj.name = message.name); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + return obj; + }, + + fromPartial, I>>(object: I): Config { + const message = { ...baseConfig } as Config; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.yamlString = object.yamlString ?? ""; + message.name = object.name ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.createdBy = object.createdBy ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Config.$type, Config); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/config_service.ts b/src/generated/yandex/cloud/loadtesting/api/v1/config_service.ts new file mode 100644 index 00000000..83346848 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/config_service.ts @@ -0,0 +1,825 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { Config } from "../../../../../yandex/cloud/loadtesting/api/v1/config/config"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1"; + +export interface CreateConfigRequest { + $type: "yandex.cloud.loadtesting.api.v1.CreateConfigRequest"; + /** ID of the folder to create a config in. */ + folderId: string; + /** Config content provided as a string in YAML format. */ + yamlString: string | undefined; + /** Name of the config. */ + name: string; +} + +export interface CreateConfigMetadata { + $type: "yandex.cloud.loadtesting.api.v1.CreateConfigMetadata"; + /** ID of the config that is being created. */ + configId: string; +} + +export interface GetConfigRequest { + $type: "yandex.cloud.loadtesting.api.v1.GetConfigRequest"; + /** ID of the config to return. */ + configId: string; +} + +export interface ListConfigsRequest { + $type: "yandex.cloud.loadtesting.api.v1.ListConfigsRequest"; + /** ID of the folder to list configs in. */ + folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than `page_size`, the service returns a [ListConfigsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * [ListConfigsResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** A filter expression that filters tests listed in the response. */ + filter: string; +} + +export interface ListConfigsResponse { + $type: "yandex.cloud.loadtesting.api.v1.ListConfigsResponse"; + /** List of configs in the specified folder. */ + configs: Config[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListConfigsRequest.page_size], use `next_page_token` as the value + * for the [ListConfigsRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `next_page_token` to continue paging through the results. + */ + nextPageToken: string; +} + +export interface DeleteConfigRequest { + $type: "yandex.cloud.loadtesting.api.v1.DeleteConfigRequest"; + /** ID of the config to deleted. */ + configId: string; +} + +export interface DeleteConfigMetadata { + $type: "yandex.cloud.loadtesting.api.v1.DeleteConfigMetadata"; + /** ID of the config that is being deleted. */ + configId: string; +} + +const baseCreateConfigRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.CreateConfigRequest", + folderId: "", + name: "", +}; + +export const CreateConfigRequest = { + $type: "yandex.cloud.loadtesting.api.v1.CreateConfigRequest" as const, + + encode( + message: CreateConfigRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.yamlString !== undefined) { + writer.uint32(18).string(message.yamlString); + } + if (message.name !== "") { + writer.uint32(82).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateConfigRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateConfigRequest } as CreateConfigRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.yamlString = reader.string(); + break; + case 10: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateConfigRequest { + const message = { ...baseCreateConfigRequest } as CreateConfigRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.yamlString = + object.yamlString !== undefined && object.yamlString !== null + ? String(object.yamlString) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + return message; + }, + + toJSON(message: CreateConfigRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.yamlString !== undefined && (obj.yamlString = message.yamlString); + message.name !== undefined && (obj.name = message.name); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateConfigRequest { + const message = { ...baseCreateConfigRequest } as CreateConfigRequest; + message.folderId = object.folderId ?? ""; + message.yamlString = object.yamlString ?? undefined; + message.name = object.name ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateConfigRequest.$type, CreateConfigRequest); + +const baseCreateConfigMetadata: object = { + $type: "yandex.cloud.loadtesting.api.v1.CreateConfigMetadata", + configId: "", +}; + +export const CreateConfigMetadata = { + $type: "yandex.cloud.loadtesting.api.v1.CreateConfigMetadata" as const, + + encode( + message: CreateConfigMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.configId !== "") { + writer.uint32(10).string(message.configId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateConfigMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateConfigMetadata } as CreateConfigMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateConfigMetadata { + const message = { ...baseCreateConfigMetadata } as CreateConfigMetadata; + message.configId = + object.configId !== undefined && object.configId !== null + ? String(object.configId) + : ""; + return message; + }, + + toJSON(message: CreateConfigMetadata): unknown { + const obj: any = {}; + message.configId !== undefined && (obj.configId = message.configId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateConfigMetadata { + const message = { ...baseCreateConfigMetadata } as CreateConfigMetadata; + message.configId = object.configId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateConfigMetadata.$type, CreateConfigMetadata); + +const baseGetConfigRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.GetConfigRequest", + configId: "", +}; + +export const GetConfigRequest = { + $type: "yandex.cloud.loadtesting.api.v1.GetConfigRequest" as const, + + encode( + message: GetConfigRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.configId !== "") { + writer.uint32(10).string(message.configId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetConfigRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetConfigRequest } as GetConfigRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetConfigRequest { + const message = { ...baseGetConfigRequest } as GetConfigRequest; + message.configId = + object.configId !== undefined && object.configId !== null + ? String(object.configId) + : ""; + return message; + }, + + toJSON(message: GetConfigRequest): unknown { + const obj: any = {}; + message.configId !== undefined && (obj.configId = message.configId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetConfigRequest { + const message = { ...baseGetConfigRequest } as GetConfigRequest; + message.configId = object.configId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetConfigRequest.$type, GetConfigRequest); + +const baseListConfigsRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.ListConfigsRequest", + folderId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListConfigsRequest = { + $type: "yandex.cloud.loadtesting.api.v1.ListConfigsRequest" as const, + + encode( + message: ListConfigsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListConfigsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListConfigsRequest } as ListConfigsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListConfigsRequest { + const message = { ...baseListConfigsRequest } as ListConfigsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListConfigsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListConfigsRequest { + const message = { ...baseListConfigsRequest } as ListConfigsRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListConfigsRequest.$type, ListConfigsRequest); + +const baseListConfigsResponse: object = { + $type: "yandex.cloud.loadtesting.api.v1.ListConfigsResponse", + nextPageToken: "", +}; + +export const ListConfigsResponse = { + $type: "yandex.cloud.loadtesting.api.v1.ListConfigsResponse" as const, + + encode( + message: ListConfigsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.configs) { + Config.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListConfigsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListConfigsResponse } as ListConfigsResponse; + message.configs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configs.push(Config.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListConfigsResponse { + const message = { ...baseListConfigsResponse } as ListConfigsResponse; + message.configs = (object.configs ?? []).map((e: any) => + Config.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListConfigsResponse): unknown { + const obj: any = {}; + if (message.configs) { + obj.configs = message.configs.map((e) => + e ? Config.toJSON(e) : undefined + ); + } else { + obj.configs = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListConfigsResponse { + const message = { ...baseListConfigsResponse } as ListConfigsResponse; + message.configs = object.configs?.map((e) => Config.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListConfigsResponse.$type, ListConfigsResponse); + +const baseDeleteConfigRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.DeleteConfigRequest", + configId: "", +}; + +export const DeleteConfigRequest = { + $type: "yandex.cloud.loadtesting.api.v1.DeleteConfigRequest" as const, + + encode( + message: DeleteConfigRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.configId !== "") { + writer.uint32(10).string(message.configId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteConfigRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteConfigRequest } as DeleteConfigRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteConfigRequest { + const message = { ...baseDeleteConfigRequest } as DeleteConfigRequest; + message.configId = + object.configId !== undefined && object.configId !== null + ? String(object.configId) + : ""; + return message; + }, + + toJSON(message: DeleteConfigRequest): unknown { + const obj: any = {}; + message.configId !== undefined && (obj.configId = message.configId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteConfigRequest { + const message = { ...baseDeleteConfigRequest } as DeleteConfigRequest; + message.configId = object.configId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteConfigRequest.$type, DeleteConfigRequest); + +const baseDeleteConfigMetadata: object = { + $type: "yandex.cloud.loadtesting.api.v1.DeleteConfigMetadata", + configId: "", +}; + +export const DeleteConfigMetadata = { + $type: "yandex.cloud.loadtesting.api.v1.DeleteConfigMetadata" as const, + + encode( + message: DeleteConfigMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.configId !== "") { + writer.uint32(10).string(message.configId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteConfigMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteConfigMetadata } as DeleteConfigMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteConfigMetadata { + const message = { ...baseDeleteConfigMetadata } as DeleteConfigMetadata; + message.configId = + object.configId !== undefined && object.configId !== null + ? String(object.configId) + : ""; + return message; + }, + + toJSON(message: DeleteConfigMetadata): unknown { + const obj: any = {}; + message.configId !== undefined && (obj.configId = message.configId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteConfigMetadata { + const message = { ...baseDeleteConfigMetadata } as DeleteConfigMetadata; + message.configId = object.configId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteConfigMetadata.$type, DeleteConfigMetadata); + +/** A set of methods for managing test configurations. */ +export const ConfigServiceService = { + /** Creates a test config in the specified folder. */ + create: { + path: "/yandex.cloud.loadtesting.api.v1.ConfigService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateConfigRequest) => + Buffer.from(CreateConfigRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateConfigRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** + * Returns the specified config. + * + * To get the list of all available configs, make a [List] request. + */ + get: { + path: "/yandex.cloud.loadtesting.api.v1.ConfigService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetConfigRequest) => + Buffer.from(GetConfigRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetConfigRequest.decode(value), + responseSerialize: (value: Config) => + Buffer.from(Config.encode(value).finish()), + responseDeserialize: (value: Buffer) => Config.decode(value), + }, + /** Retrieves the list of configs in the specified folder. */ + list: { + path: "/yandex.cloud.loadtesting.api.v1.ConfigService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListConfigsRequest) => + Buffer.from(ListConfigsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListConfigsRequest.decode(value), + responseSerialize: (value: ListConfigsResponse) => + Buffer.from(ListConfigsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListConfigsResponse.decode(value), + }, + /** Deletes the specified config. */ + delete: { + path: "/yandex.cloud.loadtesting.api.v1.ConfigService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteConfigRequest) => + Buffer.from(DeleteConfigRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteConfigRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface ConfigServiceServer extends UntypedServiceImplementation { + /** Creates a test config in the specified folder. */ + create: handleUnaryCall; + /** + * Returns the specified config. + * + * To get the list of all available configs, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of configs in the specified folder. */ + list: handleUnaryCall; + /** Deletes the specified config. */ + delete: handleUnaryCall; +} + +export interface ConfigServiceClient extends Client { + /** Creates a test config in the specified folder. */ + create( + request: CreateConfigRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateConfigRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateConfigRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** + * Returns the specified config. + * + * To get the list of all available configs, make a [List] request. + */ + get( + request: GetConfigRequest, + callback: (error: ServiceError | null, response: Config) => void + ): ClientUnaryCall; + get( + request: GetConfigRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Config) => void + ): ClientUnaryCall; + get( + request: GetConfigRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Config) => void + ): ClientUnaryCall; + /** Retrieves the list of configs in the specified folder. */ + list( + request: ListConfigsRequest, + callback: ( + error: ServiceError | null, + response: ListConfigsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListConfigsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListConfigsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListConfigsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListConfigsResponse + ) => void + ): ClientUnaryCall; + /** Deletes the specified config. */ + delete( + request: DeleteConfigRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteConfigRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteConfigRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const ConfigServiceClient = makeGenericClientConstructor( + ConfigServiceService, + "yandex.cloud.loadtesting.api.v1.ConfigService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ConfigServiceClient; + service: typeof ConfigServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/regression/dashboard.ts b/src/generated/yandex/cloud/loadtesting/api/v1/regression/dashboard.ts new file mode 100644 index 00000000..9c3f1f81 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/regression/dashboard.ts @@ -0,0 +1,343 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../../../google/protobuf/timestamp"; +import { Widget } from "../../../../../../yandex/cloud/loadtesting/api/v1/regression/widget"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.regression"; + +/** Regression dashboard. */ +export interface Dashboard { + $type: "yandex.cloud.loadtesting.api.v1.regression.Dashboard"; + /** ID of the dashboard. */ + id: string; + /** Name of the dashboard. */ + name: string; + /** Description of the dashboard. */ + description: string; + /** Creation timestamp. */ + createdAt?: Date; + /** Last update timestamp. */ + updatedAt?: Date; + /** UA or SA that created the dashboard. */ + createdBy: string; + /** UA or SA that updated the dashboard last time. */ + updatedBy: string; + /** Etag of the dashboard. */ + etag: string; + /** Dashboard content. */ + content?: Dashboard_Content; +} + +/** Content of regression dashboard. */ +export interface Dashboard_Content { + $type: "yandex.cloud.loadtesting.api.v1.regression.Dashboard.Content"; + /** Widgets. */ + widgets: Widget[]; +} + +const baseDashboard: object = { + $type: "yandex.cloud.loadtesting.api.v1.regression.Dashboard", + id: "", + name: "", + description: "", + createdBy: "", + updatedBy: "", + etag: "", +}; + +export const Dashboard = { + $type: "yandex.cloud.loadtesting.api.v1.regression.Dashboard" as const, + + encode( + message: Dashboard, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(34).fork() + ).ldelim(); + } + if (message.updatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.updatedAt), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.createdBy !== "") { + writer.uint32(50).string(message.createdBy); + } + if (message.updatedBy !== "") { + writer.uint32(58).string(message.updatedBy); + } + if (message.etag !== "") { + writer.uint32(66).string(message.etag); + } + if (message.content !== undefined) { + Dashboard_Content.encode( + message.content, + writer.uint32(74).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Dashboard { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDashboard } as Dashboard; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 5: + message.updatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + message.createdBy = reader.string(); + break; + case 7: + message.updatedBy = reader.string(); + break; + case 8: + message.etag = reader.string(); + break; + case 9: + message.content = Dashboard_Content.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Dashboard { + const message = { ...baseDashboard } as Dashboard; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.updatedAt = + object.updatedAt !== undefined && object.updatedAt !== null + ? fromJsonTimestamp(object.updatedAt) + : undefined; + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + message.updatedBy = + object.updatedBy !== undefined && object.updatedBy !== null + ? String(object.updatedBy) + : ""; + message.etag = + object.etag !== undefined && object.etag !== null + ? String(object.etag) + : ""; + message.content = + object.content !== undefined && object.content !== null + ? Dashboard_Content.fromJSON(object.content) + : undefined; + return message; + }, + + toJSON(message: Dashboard): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.updatedAt !== undefined && + (obj.updatedAt = message.updatedAt.toISOString()); + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + message.updatedBy !== undefined && (obj.updatedBy = message.updatedBy); + message.etag !== undefined && (obj.etag = message.etag); + message.content !== undefined && + (obj.content = message.content + ? Dashboard_Content.toJSON(message.content) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Dashboard { + const message = { ...baseDashboard } as Dashboard; + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.updatedAt = object.updatedAt ?? undefined; + message.createdBy = object.createdBy ?? ""; + message.updatedBy = object.updatedBy ?? ""; + message.etag = object.etag ?? ""; + message.content = + object.content !== undefined && object.content !== null + ? Dashboard_Content.fromPartial(object.content) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Dashboard.$type, Dashboard); + +const baseDashboard_Content: object = { + $type: "yandex.cloud.loadtesting.api.v1.regression.Dashboard.Content", +}; + +export const Dashboard_Content = { + $type: + "yandex.cloud.loadtesting.api.v1.regression.Dashboard.Content" as const, + + encode( + message: Dashboard_Content, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.widgets) { + Widget.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Dashboard_Content { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDashboard_Content } as Dashboard_Content; + message.widgets = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.widgets.push(Widget.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Dashboard_Content { + const message = { ...baseDashboard_Content } as Dashboard_Content; + message.widgets = (object.widgets ?? []).map((e: any) => + Widget.fromJSON(e) + ); + return message; + }, + + toJSON(message: Dashboard_Content): unknown { + const obj: any = {}; + if (message.widgets) { + obj.widgets = message.widgets.map((e) => + e ? Widget.toJSON(e) : undefined + ); + } else { + obj.widgets = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Dashboard_Content { + const message = { ...baseDashboard_Content } as Dashboard_Content; + message.widgets = object.widgets?.map((e) => Widget.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Dashboard_Content.$type, Dashboard_Content); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/regression/widget.ts b/src/generated/yandex/cloud/loadtesting/api/v1/regression/widget.ts new file mode 100644 index 00000000..16ac488d --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/regression/widget.ts @@ -0,0 +1,665 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Kpi } from "../../../../../../yandex/cloud/loadtesting/api/v1/report/kpi"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.regression"; + +/** Regression dashboard widget. */ +export interface Widget { + $type: "yandex.cloud.loadtesting.api.v1.regression.Widget"; + /** Widget position. */ + position?: Widget_LayoutPosition; + /** Chart widget. */ + chart?: ChartWidget | undefined; + /** Text widget. */ + text?: TextWidget | undefined; + /** Title widget. */ + title?: TitleWidget | undefined; +} + +/** Widget position. */ +export interface Widget_LayoutPosition { + $type: "yandex.cloud.loadtesting.api.v1.regression.Widget.LayoutPosition"; + /** X. */ + x: number; + /** Y. */ + y: number; + /** Width. */ + width: number; + /** Height. */ + height: number; +} + +/** Regression chart. */ +export interface ChartWidget { + $type: "yandex.cloud.loadtesting.api.v1.regression.ChartWidget"; + /** ID of the chart. */ + id: string; + /** Name of the chart. */ + name: string; + /** Description of the chart. */ + description: string; + /** Test filter selector to show KPI values for. */ + filterStr: string; + /** Test case to show KPI values for. */ + testCase: string; + /** KPIs to show. */ + kpis: Kpi[]; +} + +/** Text widget. */ +export interface TextWidget { + $type: "yandex.cloud.loadtesting.api.v1.regression.TextWidget"; + /** Text string. */ + text: string; +} + +/** Title widget. */ +export interface TitleWidget { + $type: "yandex.cloud.loadtesting.api.v1.regression.TitleWidget"; + /** Title string. */ + text: string; + /** Title size. */ + size: TitleWidget_TitleSize; +} + +/** Title size. */ +export enum TitleWidget_TitleSize { + /** TITLE_SIZE_UNSPECIFIED - Unspecified. */ + TITLE_SIZE_UNSPECIFIED = 0, + /** TITLE_SIZE_XS - Extra small. */ + TITLE_SIZE_XS = 1, + /** TITLE_SIZE_S - Small. */ + TITLE_SIZE_S = 2, + /** TITLE_SIZE_M - Medium. */ + TITLE_SIZE_M = 3, + /** TITLE_SIZE_L - Large. */ + TITLE_SIZE_L = 4, + UNRECOGNIZED = -1, +} + +export function titleWidget_TitleSizeFromJSON( + object: any +): TitleWidget_TitleSize { + switch (object) { + case 0: + case "TITLE_SIZE_UNSPECIFIED": + return TitleWidget_TitleSize.TITLE_SIZE_UNSPECIFIED; + case 1: + case "TITLE_SIZE_XS": + return TitleWidget_TitleSize.TITLE_SIZE_XS; + case 2: + case "TITLE_SIZE_S": + return TitleWidget_TitleSize.TITLE_SIZE_S; + case 3: + case "TITLE_SIZE_M": + return TitleWidget_TitleSize.TITLE_SIZE_M; + case 4: + case "TITLE_SIZE_L": + return TitleWidget_TitleSize.TITLE_SIZE_L; + case -1: + case "UNRECOGNIZED": + default: + return TitleWidget_TitleSize.UNRECOGNIZED; + } +} + +export function titleWidget_TitleSizeToJSON( + object: TitleWidget_TitleSize +): string { + switch (object) { + case TitleWidget_TitleSize.TITLE_SIZE_UNSPECIFIED: + return "TITLE_SIZE_UNSPECIFIED"; + case TitleWidget_TitleSize.TITLE_SIZE_XS: + return "TITLE_SIZE_XS"; + case TitleWidget_TitleSize.TITLE_SIZE_S: + return "TITLE_SIZE_S"; + case TitleWidget_TitleSize.TITLE_SIZE_M: + return "TITLE_SIZE_M"; + case TitleWidget_TitleSize.TITLE_SIZE_L: + return "TITLE_SIZE_L"; + default: + return "UNKNOWN"; + } +} + +const baseWidget: object = { + $type: "yandex.cloud.loadtesting.api.v1.regression.Widget", +}; + +export const Widget = { + $type: "yandex.cloud.loadtesting.api.v1.regression.Widget" as const, + + encode( + message: Widget, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.position !== undefined) { + Widget_LayoutPosition.encode( + message.position, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.chart !== undefined) { + ChartWidget.encode(message.chart, writer.uint32(18).fork()).ldelim(); + } + if (message.text !== undefined) { + TextWidget.encode(message.text, writer.uint32(26).fork()).ldelim(); + } + if (message.title !== undefined) { + TitleWidget.encode(message.title, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Widget { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWidget } as Widget; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.position = Widget_LayoutPosition.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.chart = ChartWidget.decode(reader, reader.uint32()); + break; + case 3: + message.text = TextWidget.decode(reader, reader.uint32()); + break; + case 4: + message.title = TitleWidget.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Widget { + const message = { ...baseWidget } as Widget; + message.position = + object.position !== undefined && object.position !== null + ? Widget_LayoutPosition.fromJSON(object.position) + : undefined; + message.chart = + object.chart !== undefined && object.chart !== null + ? ChartWidget.fromJSON(object.chart) + : undefined; + message.text = + object.text !== undefined && object.text !== null + ? TextWidget.fromJSON(object.text) + : undefined; + message.title = + object.title !== undefined && object.title !== null + ? TitleWidget.fromJSON(object.title) + : undefined; + return message; + }, + + toJSON(message: Widget): unknown { + const obj: any = {}; + message.position !== undefined && + (obj.position = message.position + ? Widget_LayoutPosition.toJSON(message.position) + : undefined); + message.chart !== undefined && + (obj.chart = message.chart + ? ChartWidget.toJSON(message.chart) + : undefined); + message.text !== undefined && + (obj.text = message.text ? TextWidget.toJSON(message.text) : undefined); + message.title !== undefined && + (obj.title = message.title + ? TitleWidget.toJSON(message.title) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Widget { + const message = { ...baseWidget } as Widget; + message.position = + object.position !== undefined && object.position !== null + ? Widget_LayoutPosition.fromPartial(object.position) + : undefined; + message.chart = + object.chart !== undefined && object.chart !== null + ? ChartWidget.fromPartial(object.chart) + : undefined; + message.text = + object.text !== undefined && object.text !== null + ? TextWidget.fromPartial(object.text) + : undefined; + message.title = + object.title !== undefined && object.title !== null + ? TitleWidget.fromPartial(object.title) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Widget.$type, Widget); + +const baseWidget_LayoutPosition: object = { + $type: "yandex.cloud.loadtesting.api.v1.regression.Widget.LayoutPosition", + x: 0, + y: 0, + width: 0, + height: 0, +}; + +export const Widget_LayoutPosition = { + $type: + "yandex.cloud.loadtesting.api.v1.regression.Widget.LayoutPosition" as const, + + encode( + message: Widget_LayoutPosition, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.x !== 0) { + writer.uint32(8).int64(message.x); + } + if (message.y !== 0) { + writer.uint32(16).int64(message.y); + } + if (message.width !== 0) { + writer.uint32(24).int64(message.width); + } + if (message.height !== 0) { + writer.uint32(32).int64(message.height); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Widget_LayoutPosition { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWidget_LayoutPosition } as Widget_LayoutPosition; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.x = longToNumber(reader.int64() as Long); + break; + case 2: + message.y = longToNumber(reader.int64() as Long); + break; + case 3: + message.width = longToNumber(reader.int64() as Long); + break; + case 4: + message.height = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Widget_LayoutPosition { + const message = { ...baseWidget_LayoutPosition } as Widget_LayoutPosition; + message.x = + object.x !== undefined && object.x !== null ? Number(object.x) : 0; + message.y = + object.y !== undefined && object.y !== null ? Number(object.y) : 0; + message.width = + object.width !== undefined && object.width !== null + ? Number(object.width) + : 0; + message.height = + object.height !== undefined && object.height !== null + ? Number(object.height) + : 0; + return message; + }, + + toJSON(message: Widget_LayoutPosition): unknown { + const obj: any = {}; + message.x !== undefined && (obj.x = Math.round(message.x)); + message.y !== undefined && (obj.y = Math.round(message.y)); + message.width !== undefined && (obj.width = Math.round(message.width)); + message.height !== undefined && (obj.height = Math.round(message.height)); + return obj; + }, + + fromPartial, I>>( + object: I + ): Widget_LayoutPosition { + const message = { ...baseWidget_LayoutPosition } as Widget_LayoutPosition; + message.x = object.x ?? 0; + message.y = object.y ?? 0; + message.width = object.width ?? 0; + message.height = object.height ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Widget_LayoutPosition.$type, Widget_LayoutPosition); + +const baseChartWidget: object = { + $type: "yandex.cloud.loadtesting.api.v1.regression.ChartWidget", + id: "", + name: "", + description: "", + filterStr: "", + testCase: "", +}; + +export const ChartWidget = { + $type: "yandex.cloud.loadtesting.api.v1.regression.ChartWidget" as const, + + encode( + message: ChartWidget, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.filterStr !== "") { + writer.uint32(34).string(message.filterStr); + } + if (message.testCase !== "") { + writer.uint32(42).string(message.testCase); + } + for (const v of message.kpis) { + Kpi.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ChartWidget { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseChartWidget } as ChartWidget; + message.kpis = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.filterStr = reader.string(); + break; + case 5: + message.testCase = reader.string(); + break; + case 6: + message.kpis.push(Kpi.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ChartWidget { + const message = { ...baseChartWidget } as ChartWidget; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.filterStr = + object.filterStr !== undefined && object.filterStr !== null + ? String(object.filterStr) + : ""; + message.testCase = + object.testCase !== undefined && object.testCase !== null + ? String(object.testCase) + : ""; + message.kpis = (object.kpis ?? []).map((e: any) => Kpi.fromJSON(e)); + return message; + }, + + toJSON(message: ChartWidget): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.filterStr !== undefined && (obj.filterStr = message.filterStr); + message.testCase !== undefined && (obj.testCase = message.testCase); + if (message.kpis) { + obj.kpis = message.kpis.map((e) => (e ? Kpi.toJSON(e) : undefined)); + } else { + obj.kpis = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ChartWidget { + const message = { ...baseChartWidget } as ChartWidget; + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.filterStr = object.filterStr ?? ""; + message.testCase = object.testCase ?? ""; + message.kpis = object.kpis?.map((e) => Kpi.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ChartWidget.$type, ChartWidget); + +const baseTextWidget: object = { + $type: "yandex.cloud.loadtesting.api.v1.regression.TextWidget", + text: "", +}; + +export const TextWidget = { + $type: "yandex.cloud.loadtesting.api.v1.regression.TextWidget" as const, + + encode( + message: TextWidget, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.text !== "") { + writer.uint32(10).string(message.text); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TextWidget { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTextWidget } as TextWidget; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TextWidget { + const message = { ...baseTextWidget } as TextWidget; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + return message; + }, + + toJSON(message: TextWidget): unknown { + const obj: any = {}; + message.text !== undefined && (obj.text = message.text); + return obj; + }, + + fromPartial, I>>( + object: I + ): TextWidget { + const message = { ...baseTextWidget } as TextWidget; + message.text = object.text ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(TextWidget.$type, TextWidget); + +const baseTitleWidget: object = { + $type: "yandex.cloud.loadtesting.api.v1.regression.TitleWidget", + text: "", + size: 0, +}; + +export const TitleWidget = { + $type: "yandex.cloud.loadtesting.api.v1.regression.TitleWidget" as const, + + encode( + message: TitleWidget, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.text !== "") { + writer.uint32(10).string(message.text); + } + if (message.size !== 0) { + writer.uint32(16).int32(message.size); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TitleWidget { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTitleWidget } as TitleWidget; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.size = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TitleWidget { + const message = { ...baseTitleWidget } as TitleWidget; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + message.size = + object.size !== undefined && object.size !== null + ? titleWidget_TitleSizeFromJSON(object.size) + : 0; + return message; + }, + + toJSON(message: TitleWidget): unknown { + const obj: any = {}; + message.text !== undefined && (obj.text = message.text); + message.size !== undefined && + (obj.size = titleWidget_TitleSizeToJSON(message.size)); + return obj; + }, + + fromPartial, I>>( + object: I + ): TitleWidget { + const message = { ...baseTitleWidget } as TitleWidget; + message.text = object.text ?? ""; + message.size = object.size ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(TitleWidget.$type, TitleWidget); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/regression_dashboard_service.ts b/src/generated/yandex/cloud/loadtesting/api/v1/regression_dashboard_service.ts new file mode 100644 index 00000000..55aad16a --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/regression_dashboard_service.ts @@ -0,0 +1,1272 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + Dashboard_Content, + Dashboard, +} from "../../../../../yandex/cloud/loadtesting/api/v1/regression/dashboard"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1"; + +export interface CreateRegressionDashboardRequest { + $type: "yandex.cloud.loadtesting.api.v1.CreateRegressionDashboardRequest"; + /** ID of the folder to create a regression dashboard in. */ + folderId: string; + /** Name of the dashboard. */ + name: string; + /** Description of the dashboard. */ + description: string; + /** Content of the dashboard. */ + content?: Dashboard_Content; +} + +export interface CreateRegressionDashboardMetadata { + $type: "yandex.cloud.loadtesting.api.v1.CreateRegressionDashboardMetadata"; + /** ID of the dashboard that is being created. */ + dashboardId: string; +} + +export interface GetRegressionDashboardRequest { + $type: "yandex.cloud.loadtesting.api.v1.GetRegressionDashboardRequest"; + /** ID of the dashboard to return. */ + dashboardId: string; +} + +export interface DeleteRegressionDashboardRequest { + $type: "yandex.cloud.loadtesting.api.v1.DeleteRegressionDashboardRequest"; + /** ID of the dashboard to delete. */ + dashboardId: string; + /** The current etag of the dashboard. */ + etag: string; +} + +export interface DeleteRegressionDashboardMetadata { + $type: "yandex.cloud.loadtesting.api.v1.DeleteRegressionDashboardMetadata"; + /** ID of the dashboard that is being deleted. */ + dashboardId: string; +} + +export interface ListRegressionDashboardsRequest { + $type: "yandex.cloud.loadtesting.api.v1.ListRegressionDashboardsRequest"; + /** ID of the folder to list dashboards in. */ + folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than `page_size`, the service returns a [ListRegressionDashboardsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * [ListRegressionDashboardsResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters dashboards listed in the response. + * + * The filter expression may contain multiple field expressions joined by `AND`. + * The field expression must specify: + * 1. The field name. + * 2. An operator: + * - `=`, `!=`, `CONTAINS`, for single values. + * - `IN` or `NOT IN` for lists of values. + * 3. The value. String values must be encosed in `"`, boolean values are {`true`, `false`}, timestamp values in ISO-8601. + * + * Currently supported fields: + * - `id` [yandex.cloud.loadtesting.api.v1.regression.Dashboard.id] + * - operators: `=`, `!=`, `IN`, `NOT IN` + * - `name` [yandex.cloud.loadtesting.api.v1.regression.Dashboard.name] + * - operators: `=`, `!=`, `IN`, `NOT IN`, `CONTAINS` + * + * Examples: + * - `id IN ("1", "2", "3")` + * - `name CONTAINS "my-dashboard" AND id NOT IN ("4", "5")` + */ + filter: string; +} + +export interface ListRegressionDashboardsResponse { + $type: "yandex.cloud.loadtesting.api.v1.ListRegressionDashboardsResponse"; + /** List of dashboards in the specified folder. */ + dashboards: Dashboard[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListRegressionDashboardsRequest.page_size], use `next_page_token` as the value + * for the [ListRegressionDashboardsRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `next_page_token` to continue paging through the results. + */ + nextPageToken: string; +} + +export interface UpdateRegressionDashboardRequest { + $type: "yandex.cloud.loadtesting.api.v1.UpdateRegressionDashboardRequest"; + /** ID of the dashboards to update. */ + dashboardId: string; + /** The current etag of the dashboard. */ + etag: string; + /** Field mask that specifies which attributes of the dashboard are going to be updated. */ + updateMask?: FieldMask; + /** New name of the dashboard. */ + name: string; + /** New description of the dashboard. */ + description: string; + /** New content of the dashboard. */ + content?: Dashboard_Content; +} + +export interface UpdateRegressionDashboardMetadata { + $type: "yandex.cloud.loadtesting.api.v1.UpdateRegressionDashboardMetadata"; + /** ID of the dashboard that is being updated. */ + dashboardId: string; +} + +const baseCreateRegressionDashboardRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.CreateRegressionDashboardRequest", + folderId: "", + name: "", + description: "", +}; + +export const CreateRegressionDashboardRequest = { + $type: + "yandex.cloud.loadtesting.api.v1.CreateRegressionDashboardRequest" as const, + + encode( + message: CreateRegressionDashboardRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.content !== undefined) { + Dashboard_Content.encode( + message.content, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateRegressionDashboardRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateRegressionDashboardRequest, + } as CreateRegressionDashboardRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.content = Dashboard_Content.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateRegressionDashboardRequest { + const message = { + ...baseCreateRegressionDashboardRequest, + } as CreateRegressionDashboardRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.content = + object.content !== undefined && object.content !== null + ? Dashboard_Content.fromJSON(object.content) + : undefined; + return message; + }, + + toJSON(message: CreateRegressionDashboardRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.content !== undefined && + (obj.content = message.content + ? Dashboard_Content.toJSON(message.content) + : undefined); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateRegressionDashboardRequest { + const message = { + ...baseCreateRegressionDashboardRequest, + } as CreateRegressionDashboardRequest; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.content = + object.content !== undefined && object.content !== null + ? Dashboard_Content.fromPartial(object.content) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + CreateRegressionDashboardRequest.$type, + CreateRegressionDashboardRequest +); + +const baseCreateRegressionDashboardMetadata: object = { + $type: "yandex.cloud.loadtesting.api.v1.CreateRegressionDashboardMetadata", + dashboardId: "", +}; + +export const CreateRegressionDashboardMetadata = { + $type: + "yandex.cloud.loadtesting.api.v1.CreateRegressionDashboardMetadata" as const, + + encode( + message: CreateRegressionDashboardMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.dashboardId !== "") { + writer.uint32(10).string(message.dashboardId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateRegressionDashboardMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateRegressionDashboardMetadata, + } as CreateRegressionDashboardMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dashboardId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateRegressionDashboardMetadata { + const message = { + ...baseCreateRegressionDashboardMetadata, + } as CreateRegressionDashboardMetadata; + message.dashboardId = + object.dashboardId !== undefined && object.dashboardId !== null + ? String(object.dashboardId) + : ""; + return message; + }, + + toJSON(message: CreateRegressionDashboardMetadata): unknown { + const obj: any = {}; + message.dashboardId !== undefined && + (obj.dashboardId = message.dashboardId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateRegressionDashboardMetadata { + const message = { + ...baseCreateRegressionDashboardMetadata, + } as CreateRegressionDashboardMetadata; + message.dashboardId = object.dashboardId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateRegressionDashboardMetadata.$type, + CreateRegressionDashboardMetadata +); + +const baseGetRegressionDashboardRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.GetRegressionDashboardRequest", + dashboardId: "", +}; + +export const GetRegressionDashboardRequest = { + $type: + "yandex.cloud.loadtesting.api.v1.GetRegressionDashboardRequest" as const, + + encode( + message: GetRegressionDashboardRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.dashboardId !== "") { + writer.uint32(10).string(message.dashboardId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetRegressionDashboardRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetRegressionDashboardRequest, + } as GetRegressionDashboardRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dashboardId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetRegressionDashboardRequest { + const message = { + ...baseGetRegressionDashboardRequest, + } as GetRegressionDashboardRequest; + message.dashboardId = + object.dashboardId !== undefined && object.dashboardId !== null + ? String(object.dashboardId) + : ""; + return message; + }, + + toJSON(message: GetRegressionDashboardRequest): unknown { + const obj: any = {}; + message.dashboardId !== undefined && + (obj.dashboardId = message.dashboardId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetRegressionDashboardRequest { + const message = { + ...baseGetRegressionDashboardRequest, + } as GetRegressionDashboardRequest; + message.dashboardId = object.dashboardId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetRegressionDashboardRequest.$type, + GetRegressionDashboardRequest +); + +const baseDeleteRegressionDashboardRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.DeleteRegressionDashboardRequest", + dashboardId: "", + etag: "", +}; + +export const DeleteRegressionDashboardRequest = { + $type: + "yandex.cloud.loadtesting.api.v1.DeleteRegressionDashboardRequest" as const, + + encode( + message: DeleteRegressionDashboardRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.dashboardId !== "") { + writer.uint32(10).string(message.dashboardId); + } + if (message.etag !== "") { + writer.uint32(18).string(message.etag); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteRegressionDashboardRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteRegressionDashboardRequest, + } as DeleteRegressionDashboardRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dashboardId = reader.string(); + break; + case 2: + message.etag = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteRegressionDashboardRequest { + const message = { + ...baseDeleteRegressionDashboardRequest, + } as DeleteRegressionDashboardRequest; + message.dashboardId = + object.dashboardId !== undefined && object.dashboardId !== null + ? String(object.dashboardId) + : ""; + message.etag = + object.etag !== undefined && object.etag !== null + ? String(object.etag) + : ""; + return message; + }, + + toJSON(message: DeleteRegressionDashboardRequest): unknown { + const obj: any = {}; + message.dashboardId !== undefined && + (obj.dashboardId = message.dashboardId); + message.etag !== undefined && (obj.etag = message.etag); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): DeleteRegressionDashboardRequest { + const message = { + ...baseDeleteRegressionDashboardRequest, + } as DeleteRegressionDashboardRequest; + message.dashboardId = object.dashboardId ?? ""; + message.etag = object.etag ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteRegressionDashboardRequest.$type, + DeleteRegressionDashboardRequest +); + +const baseDeleteRegressionDashboardMetadata: object = { + $type: "yandex.cloud.loadtesting.api.v1.DeleteRegressionDashboardMetadata", + dashboardId: "", +}; + +export const DeleteRegressionDashboardMetadata = { + $type: + "yandex.cloud.loadtesting.api.v1.DeleteRegressionDashboardMetadata" as const, + + encode( + message: DeleteRegressionDashboardMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.dashboardId !== "") { + writer.uint32(10).string(message.dashboardId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteRegressionDashboardMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteRegressionDashboardMetadata, + } as DeleteRegressionDashboardMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dashboardId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteRegressionDashboardMetadata { + const message = { + ...baseDeleteRegressionDashboardMetadata, + } as DeleteRegressionDashboardMetadata; + message.dashboardId = + object.dashboardId !== undefined && object.dashboardId !== null + ? String(object.dashboardId) + : ""; + return message; + }, + + toJSON(message: DeleteRegressionDashboardMetadata): unknown { + const obj: any = {}; + message.dashboardId !== undefined && + (obj.dashboardId = message.dashboardId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): DeleteRegressionDashboardMetadata { + const message = { + ...baseDeleteRegressionDashboardMetadata, + } as DeleteRegressionDashboardMetadata; + message.dashboardId = object.dashboardId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteRegressionDashboardMetadata.$type, + DeleteRegressionDashboardMetadata +); + +const baseListRegressionDashboardsRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.ListRegressionDashboardsRequest", + folderId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListRegressionDashboardsRequest = { + $type: + "yandex.cloud.loadtesting.api.v1.ListRegressionDashboardsRequest" as const, + + encode( + message: ListRegressionDashboardsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(24).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(34).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(42).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListRegressionDashboardsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListRegressionDashboardsRequest, + } as ListRegressionDashboardsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 3: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 4: + message.pageToken = reader.string(); + break; + case 5: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListRegressionDashboardsRequest { + const message = { + ...baseListRegressionDashboardsRequest, + } as ListRegressionDashboardsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListRegressionDashboardsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListRegressionDashboardsRequest { + const message = { + ...baseListRegressionDashboardsRequest, + } as ListRegressionDashboardsRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListRegressionDashboardsRequest.$type, + ListRegressionDashboardsRequest +); + +const baseListRegressionDashboardsResponse: object = { + $type: "yandex.cloud.loadtesting.api.v1.ListRegressionDashboardsResponse", + nextPageToken: "", +}; + +export const ListRegressionDashboardsResponse = { + $type: + "yandex.cloud.loadtesting.api.v1.ListRegressionDashboardsResponse" as const, + + encode( + message: ListRegressionDashboardsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.dashboards) { + Dashboard.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListRegressionDashboardsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListRegressionDashboardsResponse, + } as ListRegressionDashboardsResponse; + message.dashboards = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dashboards.push(Dashboard.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListRegressionDashboardsResponse { + const message = { + ...baseListRegressionDashboardsResponse, + } as ListRegressionDashboardsResponse; + message.dashboards = (object.dashboards ?? []).map((e: any) => + Dashboard.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListRegressionDashboardsResponse): unknown { + const obj: any = {}; + if (message.dashboards) { + obj.dashboards = message.dashboards.map((e) => + e ? Dashboard.toJSON(e) : undefined + ); + } else { + obj.dashboards = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): ListRegressionDashboardsResponse { + const message = { + ...baseListRegressionDashboardsResponse, + } as ListRegressionDashboardsResponse; + message.dashboards = + object.dashboards?.map((e) => Dashboard.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListRegressionDashboardsResponse.$type, + ListRegressionDashboardsResponse +); + +const baseUpdateRegressionDashboardRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.UpdateRegressionDashboardRequest", + dashboardId: "", + etag: "", + name: "", + description: "", +}; + +export const UpdateRegressionDashboardRequest = { + $type: + "yandex.cloud.loadtesting.api.v1.UpdateRegressionDashboardRequest" as const, + + encode( + message: UpdateRegressionDashboardRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.dashboardId !== "") { + writer.uint32(10).string(message.dashboardId); + } + if (message.etag !== "") { + writer.uint32(18).string(message.etag); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(26).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + if (message.content !== undefined) { + Dashboard_Content.encode( + message.content, + writer.uint32(50).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateRegressionDashboardRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateRegressionDashboardRequest, + } as UpdateRegressionDashboardRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dashboardId = reader.string(); + break; + case 2: + message.etag = reader.string(); + break; + case 3: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 4: + message.name = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.content = Dashboard_Content.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateRegressionDashboardRequest { + const message = { + ...baseUpdateRegressionDashboardRequest, + } as UpdateRegressionDashboardRequest; + message.dashboardId = + object.dashboardId !== undefined && object.dashboardId !== null + ? String(object.dashboardId) + : ""; + message.etag = + object.etag !== undefined && object.etag !== null + ? String(object.etag) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.content = + object.content !== undefined && object.content !== null + ? Dashboard_Content.fromJSON(object.content) + : undefined; + return message; + }, + + toJSON(message: UpdateRegressionDashboardRequest): unknown { + const obj: any = {}; + message.dashboardId !== undefined && + (obj.dashboardId = message.dashboardId); + message.etag !== undefined && (obj.etag = message.etag); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.content !== undefined && + (obj.content = message.content + ? Dashboard_Content.toJSON(message.content) + : undefined); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateRegressionDashboardRequest { + const message = { + ...baseUpdateRegressionDashboardRequest, + } as UpdateRegressionDashboardRequest; + message.dashboardId = object.dashboardId ?? ""; + message.etag = object.etag ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.content = + object.content !== undefined && object.content !== null + ? Dashboard_Content.fromPartial(object.content) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateRegressionDashboardRequest.$type, + UpdateRegressionDashboardRequest +); + +const baseUpdateRegressionDashboardMetadata: object = { + $type: "yandex.cloud.loadtesting.api.v1.UpdateRegressionDashboardMetadata", + dashboardId: "", +}; + +export const UpdateRegressionDashboardMetadata = { + $type: + "yandex.cloud.loadtesting.api.v1.UpdateRegressionDashboardMetadata" as const, + + encode( + message: UpdateRegressionDashboardMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.dashboardId !== "") { + writer.uint32(10).string(message.dashboardId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateRegressionDashboardMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateRegressionDashboardMetadata, + } as UpdateRegressionDashboardMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dashboardId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateRegressionDashboardMetadata { + const message = { + ...baseUpdateRegressionDashboardMetadata, + } as UpdateRegressionDashboardMetadata; + message.dashboardId = + object.dashboardId !== undefined && object.dashboardId !== null + ? String(object.dashboardId) + : ""; + return message; + }, + + toJSON(message: UpdateRegressionDashboardMetadata): unknown { + const obj: any = {}; + message.dashboardId !== undefined && + (obj.dashboardId = message.dashboardId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateRegressionDashboardMetadata { + const message = { + ...baseUpdateRegressionDashboardMetadata, + } as UpdateRegressionDashboardMetadata; + message.dashboardId = object.dashboardId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateRegressionDashboardMetadata.$type, + UpdateRegressionDashboardMetadata +); + +/** A set of methods for managing Load Testing Regression Dashboards. */ +export const RegressionDashboardServiceService = { + /** Creates a regression dashboard in the specified folder. */ + create: { + path: "/yandex.cloud.loadtesting.api.v1.RegressionDashboardService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateRegressionDashboardRequest) => + Buffer.from(CreateRegressionDashboardRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CreateRegressionDashboardRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** + * Returns the specified regression dashboard. + * + * To get the list of all available regression dashboards, make a [List] request. + */ + get: { + path: "/yandex.cloud.loadtesting.api.v1.RegressionDashboardService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetRegressionDashboardRequest) => + Buffer.from(GetRegressionDashboardRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetRegressionDashboardRequest.decode(value), + responseSerialize: (value: Dashboard) => + Buffer.from(Dashboard.encode(value).finish()), + responseDeserialize: (value: Buffer) => Dashboard.decode(value), + }, + /** Retrieves the list of regression dashboards in the specified folder. */ + list: { + path: "/yandex.cloud.loadtesting.api.v1.RegressionDashboardService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListRegressionDashboardsRequest) => + Buffer.from(ListRegressionDashboardsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListRegressionDashboardsRequest.decode(value), + responseSerialize: (value: ListRegressionDashboardsResponse) => + Buffer.from(ListRegressionDashboardsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListRegressionDashboardsResponse.decode(value), + }, + /** Deletes the specified regression dashboard. */ + delete: { + path: "/yandex.cloud.loadtesting.api.v1.RegressionDashboardService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteRegressionDashboardRequest) => + Buffer.from(DeleteRegressionDashboardRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteRegressionDashboardRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates the specified regression dashboard. */ + update: { + path: "/yandex.cloud.loadtesting.api.v1.RegressionDashboardService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateRegressionDashboardRequest) => + Buffer.from(UpdateRegressionDashboardRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateRegressionDashboardRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface RegressionDashboardServiceServer + extends UntypedServiceImplementation { + /** Creates a regression dashboard in the specified folder. */ + create: handleUnaryCall; + /** + * Returns the specified regression dashboard. + * + * To get the list of all available regression dashboards, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of regression dashboards in the specified folder. */ + list: handleUnaryCall< + ListRegressionDashboardsRequest, + ListRegressionDashboardsResponse + >; + /** Deletes the specified regression dashboard. */ + delete: handleUnaryCall; + /** Updates the specified regression dashboard. */ + update: handleUnaryCall; +} + +export interface RegressionDashboardServiceClient extends Client { + /** Creates a regression dashboard in the specified folder. */ + create( + request: CreateRegressionDashboardRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateRegressionDashboardRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateRegressionDashboardRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** + * Returns the specified regression dashboard. + * + * To get the list of all available regression dashboards, make a [List] request. + */ + get( + request: GetRegressionDashboardRequest, + callback: (error: ServiceError | null, response: Dashboard) => void + ): ClientUnaryCall; + get( + request: GetRegressionDashboardRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Dashboard) => void + ): ClientUnaryCall; + get( + request: GetRegressionDashboardRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Dashboard) => void + ): ClientUnaryCall; + /** Retrieves the list of regression dashboards in the specified folder. */ + list( + request: ListRegressionDashboardsRequest, + callback: ( + error: ServiceError | null, + response: ListRegressionDashboardsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListRegressionDashboardsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListRegressionDashboardsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListRegressionDashboardsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListRegressionDashboardsResponse + ) => void + ): ClientUnaryCall; + /** Deletes the specified regression dashboard. */ + delete( + request: DeleteRegressionDashboardRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteRegressionDashboardRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteRegressionDashboardRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates the specified regression dashboard. */ + update( + request: UpdateRegressionDashboardRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateRegressionDashboardRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateRegressionDashboardRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const RegressionDashboardServiceClient = makeGenericClientConstructor( + RegressionDashboardServiceService, + "yandex.cloud.loadtesting.api.v1.RegressionDashboardService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): RegressionDashboardServiceClient; + service: typeof RegressionDashboardServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/report/kpi.ts b/src/generated/yandex/cloud/loadtesting/api/v1/report/kpi.ts new file mode 100644 index 00000000..497d30f5 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/report/kpi.ts @@ -0,0 +1,1177 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + QuantileType, + quantileTypeFromJSON, + quantileTypeToJSON, +} from "../../../../../../yandex/cloud/loadtesting/api/v1/common/quantiles"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.report"; + +/** Aggregation function. */ +export enum Aggregation { + /** AGGREGATION_UNSPECIFIED - Unspecified. */ + AGGREGATION_UNSPECIFIED = 0, + /** AGGREGATION_MIN - Minimum. */ + AGGREGATION_MIN = 1, + /** AGGREGATION_MAX - Maximum. */ + AGGREGATION_MAX = 2, + /** AGGREGATION_AVG - Average. */ + AGGREGATION_AVG = 4, + /** AGGREGATION_MEDIAN - Median. */ + AGGREGATION_MEDIAN = 5, + /** AGGREGATION_STD_DEV - Standard deviation. */ + AGGREGATION_STD_DEV = 6, + UNRECOGNIZED = -1, +} + +export function aggregationFromJSON(object: any): Aggregation { + switch (object) { + case 0: + case "AGGREGATION_UNSPECIFIED": + return Aggregation.AGGREGATION_UNSPECIFIED; + case 1: + case "AGGREGATION_MIN": + return Aggregation.AGGREGATION_MIN; + case 2: + case "AGGREGATION_MAX": + return Aggregation.AGGREGATION_MAX; + case 4: + case "AGGREGATION_AVG": + return Aggregation.AGGREGATION_AVG; + case 5: + case "AGGREGATION_MEDIAN": + return Aggregation.AGGREGATION_MEDIAN; + case 6: + case "AGGREGATION_STD_DEV": + return Aggregation.AGGREGATION_STD_DEV; + case -1: + case "UNRECOGNIZED": + default: + return Aggregation.UNRECOGNIZED; + } +} + +export function aggregationToJSON(object: Aggregation): string { + switch (object) { + case Aggregation.AGGREGATION_UNSPECIFIED: + return "AGGREGATION_UNSPECIFIED"; + case Aggregation.AGGREGATION_MIN: + return "AGGREGATION_MIN"; + case Aggregation.AGGREGATION_MAX: + return "AGGREGATION_MAX"; + case Aggregation.AGGREGATION_AVG: + return "AGGREGATION_AVG"; + case Aggregation.AGGREGATION_MEDIAN: + return "AGGREGATION_MEDIAN"; + case Aggregation.AGGREGATION_STD_DEV: + return "AGGREGATION_STD_DEV"; + default: + return "UNKNOWN"; + } +} + +/** Comparison operator. */ +export enum Comparison { + /** COMPARISON_UNSPECIFIED - Unspecified. */ + COMPARISON_UNSPECIFIED = 0, + /** COMPARISON_LT - Less than the specified value. */ + COMPARISON_LT = 1, + /** COMPARISON_LTE - Less than or equal to the specified value. */ + COMPARISON_LTE = 2, + /** COMPARISON_GT - Greater than the specified value. */ + COMPARISON_GT = 3, + /** COMPARISON_GTE - Greater than or equal to the specified value. */ + COMPARISON_GTE = 4, + UNRECOGNIZED = -1, +} + +export function comparisonFromJSON(object: any): Comparison { + switch (object) { + case 0: + case "COMPARISON_UNSPECIFIED": + return Comparison.COMPARISON_UNSPECIFIED; + case 1: + case "COMPARISON_LT": + return Comparison.COMPARISON_LT; + case 2: + case "COMPARISON_LTE": + return Comparison.COMPARISON_LTE; + case 3: + case "COMPARISON_GT": + return Comparison.COMPARISON_GT; + case 4: + case "COMPARISON_GTE": + return Comparison.COMPARISON_GTE; + case -1: + case "UNRECOGNIZED": + default: + return Comparison.UNRECOGNIZED; + } +} + +export function comparisonToJSON(object: Comparison): string { + switch (object) { + case Comparison.COMPARISON_UNSPECIFIED: + return "COMPARISON_UNSPECIFIED"; + case Comparison.COMPARISON_LT: + return "COMPARISON_LT"; + case Comparison.COMPARISON_LTE: + return "COMPARISON_LTE"; + case Comparison.COMPARISON_GT: + return "COMPARISON_GT"; + case Comparison.COMPARISON_GTE: + return "COMPARISON_GTE"; + default: + return "UNKNOWN"; + } +} + +/** KPI (Key Performance Indicator) represents some integral indicator measured during test. */ +export interface Kpi { + $type: "yandex.cloud.loadtesting.api.v1.report.Kpi"; + /** Kind of KPI. */ + selector?: KpiSelector; + /** A condition that should be specified. */ + threshold?: KpiThreshold; +} + +/** KPI threshold represents a condition that an actual value of test's KPI should satisfy. */ +export interface KpiThreshold { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiThreshold"; + /** Value for comparison with an actual KPI value. */ + value: number; + /** + * Comparison operator for comparing actual with the threshold value. + * + * Rule: actual (/>=) reference + */ + comparison: Comparison; +} + +/** KPI selector. */ +export interface KpiSelector { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiSelector"; + /** Response time cummulative quantile (percentile). */ + responseTime?: KpiSelector_ResponseTime | undefined; + /** A number of instances throughout the test. */ + instances?: KpiSelector_Instances | undefined; + /** An RPS at the moment the test has been auto-stopped. */ + imbalanceRps?: KpiSelector_ImbalanceRps | undefined; + /** A total number of requests completed with certain protocol (HTTP, GRPC, etc.) codes. */ + protocolCodesAbsolute?: KpiSelector_ProtocolCodesAbsolute | undefined; + /** A percentage of requests completed with certain protocol (HTTP, GRPC, etc.) codes. */ + protocolCodesRelative?: KpiSelector_ProtocolCodesRelative | undefined; + /** A total number of requests completed with certain network codes. */ + networkCodesAbsolute?: KpiSelector_NetworkCodesAbsolute | undefined; + /** A percentage of requests completed with certain network codes. */ + networkCodesRelative?: KpiSelector_NetworkCodesRelative | undefined; +} + +/** Response time. */ +export interface KpiSelector_ResponseTime { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiSelector.ResponseTime"; + /** Cummulative quantile (percentile). */ + quantile: QuantileType; +} + +/** Aggregated number of instances. */ +export interface KpiSelector_Instances { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiSelector.Instances"; + /** Aggregation function. */ + agg: Aggregation; +} + +/** Imbalance RPS. */ +export interface KpiSelector_ImbalanceRps { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiSelector.ImbalanceRps"; +} + +export interface KpiSelector_ProtocolCodesAbsolute { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiSelector.ProtocolCodesAbsolute"; + /** + * Protocol (HTTP, GRPC) code patterns to match. + * + * All successful HTTP responses: ['2xx', '3xx']. + * All failed HTTP responses: ['0', '4xx', '5xx']. + */ + codesPatterns: string[]; +} + +export interface KpiSelector_ProtocolCodesRelative { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiSelector.ProtocolCodesRelative"; + /** + * Protocol (HTTP, GRPC) code patterns to match. + * + * All successful HTTP responses: ['2xx', '3xx']. + * All failed HTTP responses: ['0', '4xx', '5xx']. + */ + codesPatterns: string[]; +} + +export interface KpiSelector_NetworkCodesAbsolute { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiSelector.NetworkCodesAbsolute"; + /** + * Network code patterns to match. + * + * All successful network responses: ['0']. + * All failed network responses: ['xx', 'xxx']. + */ + codesPatterns: string[]; +} + +export interface KpiSelector_NetworkCodesRelative { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiSelector.NetworkCodesRelative"; + /** + * Network code patterns to match. + * + * All successful network responses: ['0']. + * All failed network responses: ['xx', 'xxx']. + */ + codesPatterns: string[]; +} + +const baseKpi: object = { $type: "yandex.cloud.loadtesting.api.v1.report.Kpi" }; + +export const Kpi = { + $type: "yandex.cloud.loadtesting.api.v1.report.Kpi" as const, + + encode(message: Kpi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.selector !== undefined) { + KpiSelector.encode(message.selector, writer.uint32(10).fork()).ldelim(); + } + if (message.threshold !== undefined) { + KpiThreshold.encode(message.threshold, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Kpi { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseKpi } as Kpi; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = KpiSelector.decode(reader, reader.uint32()); + break; + case 2: + message.threshold = KpiThreshold.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Kpi { + const message = { ...baseKpi } as Kpi; + message.selector = + object.selector !== undefined && object.selector !== null + ? KpiSelector.fromJSON(object.selector) + : undefined; + message.threshold = + object.threshold !== undefined && object.threshold !== null + ? KpiThreshold.fromJSON(object.threshold) + : undefined; + return message; + }, + + toJSON(message: Kpi): unknown { + const obj: any = {}; + message.selector !== undefined && + (obj.selector = message.selector + ? KpiSelector.toJSON(message.selector) + : undefined); + message.threshold !== undefined && + (obj.threshold = message.threshold + ? KpiThreshold.toJSON(message.threshold) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Kpi { + const message = { ...baseKpi } as Kpi; + message.selector = + object.selector !== undefined && object.selector !== null + ? KpiSelector.fromPartial(object.selector) + : undefined; + message.threshold = + object.threshold !== undefined && object.threshold !== null + ? KpiThreshold.fromPartial(object.threshold) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Kpi.$type, Kpi); + +const baseKpiThreshold: object = { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiThreshold", + value: 0, + comparison: 0, +}; + +export const KpiThreshold = { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiThreshold" as const, + + encode( + message: KpiThreshold, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.value !== 0) { + writer.uint32(9).double(message.value); + } + if (message.comparison !== 0) { + writer.uint32(16).int32(message.comparison); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): KpiThreshold { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseKpiThreshold } as KpiThreshold; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.double(); + break; + case 2: + message.comparison = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): KpiThreshold { + const message = { ...baseKpiThreshold } as KpiThreshold; + message.value = + object.value !== undefined && object.value !== null + ? Number(object.value) + : 0; + message.comparison = + object.comparison !== undefined && object.comparison !== null + ? comparisonFromJSON(object.comparison) + : 0; + return message; + }, + + toJSON(message: KpiThreshold): unknown { + const obj: any = {}; + message.value !== undefined && (obj.value = message.value); + message.comparison !== undefined && + (obj.comparison = comparisonToJSON(message.comparison)); + return obj; + }, + + fromPartial, I>>( + object: I + ): KpiThreshold { + const message = { ...baseKpiThreshold } as KpiThreshold; + message.value = object.value ?? 0; + message.comparison = object.comparison ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(KpiThreshold.$type, KpiThreshold); + +const baseKpiSelector: object = { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiSelector", +}; + +export const KpiSelector = { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiSelector" as const, + + encode( + message: KpiSelector, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.responseTime !== undefined) { + KpiSelector_ResponseTime.encode( + message.responseTime, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.instances !== undefined) { + KpiSelector_Instances.encode( + message.instances, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.imbalanceRps !== undefined) { + KpiSelector_ImbalanceRps.encode( + message.imbalanceRps, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.protocolCodesAbsolute !== undefined) { + KpiSelector_ProtocolCodesAbsolute.encode( + message.protocolCodesAbsolute, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.protocolCodesRelative !== undefined) { + KpiSelector_ProtocolCodesRelative.encode( + message.protocolCodesRelative, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.networkCodesAbsolute !== undefined) { + KpiSelector_NetworkCodesAbsolute.encode( + message.networkCodesAbsolute, + writer.uint32(50).fork() + ).ldelim(); + } + if (message.networkCodesRelative !== undefined) { + KpiSelector_NetworkCodesRelative.encode( + message.networkCodesRelative, + writer.uint32(58).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): KpiSelector { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseKpiSelector } as KpiSelector; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.responseTime = KpiSelector_ResponseTime.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.instances = KpiSelector_Instances.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.imbalanceRps = KpiSelector_ImbalanceRps.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.protocolCodesAbsolute = + KpiSelector_ProtocolCodesAbsolute.decode(reader, reader.uint32()); + break; + case 5: + message.protocolCodesRelative = + KpiSelector_ProtocolCodesRelative.decode(reader, reader.uint32()); + break; + case 6: + message.networkCodesAbsolute = + KpiSelector_NetworkCodesAbsolute.decode(reader, reader.uint32()); + break; + case 7: + message.networkCodesRelative = + KpiSelector_NetworkCodesRelative.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): KpiSelector { + const message = { ...baseKpiSelector } as KpiSelector; + message.responseTime = + object.responseTime !== undefined && object.responseTime !== null + ? KpiSelector_ResponseTime.fromJSON(object.responseTime) + : undefined; + message.instances = + object.instances !== undefined && object.instances !== null + ? KpiSelector_Instances.fromJSON(object.instances) + : undefined; + message.imbalanceRps = + object.imbalanceRps !== undefined && object.imbalanceRps !== null + ? KpiSelector_ImbalanceRps.fromJSON(object.imbalanceRps) + : undefined; + message.protocolCodesAbsolute = + object.protocolCodesAbsolute !== undefined && + object.protocolCodesAbsolute !== null + ? KpiSelector_ProtocolCodesAbsolute.fromJSON( + object.protocolCodesAbsolute + ) + : undefined; + message.protocolCodesRelative = + object.protocolCodesRelative !== undefined && + object.protocolCodesRelative !== null + ? KpiSelector_ProtocolCodesRelative.fromJSON( + object.protocolCodesRelative + ) + : undefined; + message.networkCodesAbsolute = + object.networkCodesAbsolute !== undefined && + object.networkCodesAbsolute !== null + ? KpiSelector_NetworkCodesAbsolute.fromJSON(object.networkCodesAbsolute) + : undefined; + message.networkCodesRelative = + object.networkCodesRelative !== undefined && + object.networkCodesRelative !== null + ? KpiSelector_NetworkCodesRelative.fromJSON(object.networkCodesRelative) + : undefined; + return message; + }, + + toJSON(message: KpiSelector): unknown { + const obj: any = {}; + message.responseTime !== undefined && + (obj.responseTime = message.responseTime + ? KpiSelector_ResponseTime.toJSON(message.responseTime) + : undefined); + message.instances !== undefined && + (obj.instances = message.instances + ? KpiSelector_Instances.toJSON(message.instances) + : undefined); + message.imbalanceRps !== undefined && + (obj.imbalanceRps = message.imbalanceRps + ? KpiSelector_ImbalanceRps.toJSON(message.imbalanceRps) + : undefined); + message.protocolCodesAbsolute !== undefined && + (obj.protocolCodesAbsolute = message.protocolCodesAbsolute + ? KpiSelector_ProtocolCodesAbsolute.toJSON( + message.protocolCodesAbsolute + ) + : undefined); + message.protocolCodesRelative !== undefined && + (obj.protocolCodesRelative = message.protocolCodesRelative + ? KpiSelector_ProtocolCodesRelative.toJSON( + message.protocolCodesRelative + ) + : undefined); + message.networkCodesAbsolute !== undefined && + (obj.networkCodesAbsolute = message.networkCodesAbsolute + ? KpiSelector_NetworkCodesAbsolute.toJSON(message.networkCodesAbsolute) + : undefined); + message.networkCodesRelative !== undefined && + (obj.networkCodesRelative = message.networkCodesRelative + ? KpiSelector_NetworkCodesRelative.toJSON(message.networkCodesRelative) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): KpiSelector { + const message = { ...baseKpiSelector } as KpiSelector; + message.responseTime = + object.responseTime !== undefined && object.responseTime !== null + ? KpiSelector_ResponseTime.fromPartial(object.responseTime) + : undefined; + message.instances = + object.instances !== undefined && object.instances !== null + ? KpiSelector_Instances.fromPartial(object.instances) + : undefined; + message.imbalanceRps = + object.imbalanceRps !== undefined && object.imbalanceRps !== null + ? KpiSelector_ImbalanceRps.fromPartial(object.imbalanceRps) + : undefined; + message.protocolCodesAbsolute = + object.protocolCodesAbsolute !== undefined && + object.protocolCodesAbsolute !== null + ? KpiSelector_ProtocolCodesAbsolute.fromPartial( + object.protocolCodesAbsolute + ) + : undefined; + message.protocolCodesRelative = + object.protocolCodesRelative !== undefined && + object.protocolCodesRelative !== null + ? KpiSelector_ProtocolCodesRelative.fromPartial( + object.protocolCodesRelative + ) + : undefined; + message.networkCodesAbsolute = + object.networkCodesAbsolute !== undefined && + object.networkCodesAbsolute !== null + ? KpiSelector_NetworkCodesAbsolute.fromPartial( + object.networkCodesAbsolute + ) + : undefined; + message.networkCodesRelative = + object.networkCodesRelative !== undefined && + object.networkCodesRelative !== null + ? KpiSelector_NetworkCodesRelative.fromPartial( + object.networkCodesRelative + ) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(KpiSelector.$type, KpiSelector); + +const baseKpiSelector_ResponseTime: object = { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiSelector.ResponseTime", + quantile: 0, +}; + +export const KpiSelector_ResponseTime = { + $type: + "yandex.cloud.loadtesting.api.v1.report.KpiSelector.ResponseTime" as const, + + encode( + message: KpiSelector_ResponseTime, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.quantile !== 0) { + writer.uint32(8).int32(message.quantile); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): KpiSelector_ResponseTime { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseKpiSelector_ResponseTime, + } as KpiSelector_ResponseTime; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quantile = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): KpiSelector_ResponseTime { + const message = { + ...baseKpiSelector_ResponseTime, + } as KpiSelector_ResponseTime; + message.quantile = + object.quantile !== undefined && object.quantile !== null + ? quantileTypeFromJSON(object.quantile) + : 0; + return message; + }, + + toJSON(message: KpiSelector_ResponseTime): unknown { + const obj: any = {}; + message.quantile !== undefined && + (obj.quantile = quantileTypeToJSON(message.quantile)); + return obj; + }, + + fromPartial, I>>( + object: I + ): KpiSelector_ResponseTime { + const message = { + ...baseKpiSelector_ResponseTime, + } as KpiSelector_ResponseTime; + message.quantile = object.quantile ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + KpiSelector_ResponseTime.$type, + KpiSelector_ResponseTime +); + +const baseKpiSelector_Instances: object = { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiSelector.Instances", + agg: 0, +}; + +export const KpiSelector_Instances = { + $type: + "yandex.cloud.loadtesting.api.v1.report.KpiSelector.Instances" as const, + + encode( + message: KpiSelector_Instances, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.agg !== 0) { + writer.uint32(8).int32(message.agg); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): KpiSelector_Instances { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseKpiSelector_Instances } as KpiSelector_Instances; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.agg = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): KpiSelector_Instances { + const message = { ...baseKpiSelector_Instances } as KpiSelector_Instances; + message.agg = + object.agg !== undefined && object.agg !== null + ? aggregationFromJSON(object.agg) + : 0; + return message; + }, + + toJSON(message: KpiSelector_Instances): unknown { + const obj: any = {}; + message.agg !== undefined && (obj.agg = aggregationToJSON(message.agg)); + return obj; + }, + + fromPartial, I>>( + object: I + ): KpiSelector_Instances { + const message = { ...baseKpiSelector_Instances } as KpiSelector_Instances; + message.agg = object.agg ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(KpiSelector_Instances.$type, KpiSelector_Instances); + +const baseKpiSelector_ImbalanceRps: object = { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiSelector.ImbalanceRps", +}; + +export const KpiSelector_ImbalanceRps = { + $type: + "yandex.cloud.loadtesting.api.v1.report.KpiSelector.ImbalanceRps" as const, + + encode( + _: KpiSelector_ImbalanceRps, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): KpiSelector_ImbalanceRps { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseKpiSelector_ImbalanceRps, + } as KpiSelector_ImbalanceRps; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): KpiSelector_ImbalanceRps { + const message = { + ...baseKpiSelector_ImbalanceRps, + } as KpiSelector_ImbalanceRps; + return message; + }, + + toJSON(_: KpiSelector_ImbalanceRps): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): KpiSelector_ImbalanceRps { + const message = { + ...baseKpiSelector_ImbalanceRps, + } as KpiSelector_ImbalanceRps; + return message; + }, +}; + +messageTypeRegistry.set( + KpiSelector_ImbalanceRps.$type, + KpiSelector_ImbalanceRps +); + +const baseKpiSelector_ProtocolCodesAbsolute: object = { + $type: + "yandex.cloud.loadtesting.api.v1.report.KpiSelector.ProtocolCodesAbsolute", + codesPatterns: "", +}; + +export const KpiSelector_ProtocolCodesAbsolute = { + $type: + "yandex.cloud.loadtesting.api.v1.report.KpiSelector.ProtocolCodesAbsolute" as const, + + encode( + message: KpiSelector_ProtocolCodesAbsolute, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.codesPatterns) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): KpiSelector_ProtocolCodesAbsolute { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseKpiSelector_ProtocolCodesAbsolute, + } as KpiSelector_ProtocolCodesAbsolute; + message.codesPatterns = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codesPatterns.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): KpiSelector_ProtocolCodesAbsolute { + const message = { + ...baseKpiSelector_ProtocolCodesAbsolute, + } as KpiSelector_ProtocolCodesAbsolute; + message.codesPatterns = (object.codesPatterns ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: KpiSelector_ProtocolCodesAbsolute): unknown { + const obj: any = {}; + if (message.codesPatterns) { + obj.codesPatterns = message.codesPatterns.map((e) => e); + } else { + obj.codesPatterns = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): KpiSelector_ProtocolCodesAbsolute { + const message = { + ...baseKpiSelector_ProtocolCodesAbsolute, + } as KpiSelector_ProtocolCodesAbsolute; + message.codesPatterns = object.codesPatterns?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + KpiSelector_ProtocolCodesAbsolute.$type, + KpiSelector_ProtocolCodesAbsolute +); + +const baseKpiSelector_ProtocolCodesRelative: object = { + $type: + "yandex.cloud.loadtesting.api.v1.report.KpiSelector.ProtocolCodesRelative", + codesPatterns: "", +}; + +export const KpiSelector_ProtocolCodesRelative = { + $type: + "yandex.cloud.loadtesting.api.v1.report.KpiSelector.ProtocolCodesRelative" as const, + + encode( + message: KpiSelector_ProtocolCodesRelative, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.codesPatterns) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): KpiSelector_ProtocolCodesRelative { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseKpiSelector_ProtocolCodesRelative, + } as KpiSelector_ProtocolCodesRelative; + message.codesPatterns = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codesPatterns.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): KpiSelector_ProtocolCodesRelative { + const message = { + ...baseKpiSelector_ProtocolCodesRelative, + } as KpiSelector_ProtocolCodesRelative; + message.codesPatterns = (object.codesPatterns ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: KpiSelector_ProtocolCodesRelative): unknown { + const obj: any = {}; + if (message.codesPatterns) { + obj.codesPatterns = message.codesPatterns.map((e) => e); + } else { + obj.codesPatterns = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): KpiSelector_ProtocolCodesRelative { + const message = { + ...baseKpiSelector_ProtocolCodesRelative, + } as KpiSelector_ProtocolCodesRelative; + message.codesPatterns = object.codesPatterns?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + KpiSelector_ProtocolCodesRelative.$type, + KpiSelector_ProtocolCodesRelative +); + +const baseKpiSelector_NetworkCodesAbsolute: object = { + $type: + "yandex.cloud.loadtesting.api.v1.report.KpiSelector.NetworkCodesAbsolute", + codesPatterns: "", +}; + +export const KpiSelector_NetworkCodesAbsolute = { + $type: + "yandex.cloud.loadtesting.api.v1.report.KpiSelector.NetworkCodesAbsolute" as const, + + encode( + message: KpiSelector_NetworkCodesAbsolute, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.codesPatterns) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): KpiSelector_NetworkCodesAbsolute { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseKpiSelector_NetworkCodesAbsolute, + } as KpiSelector_NetworkCodesAbsolute; + message.codesPatterns = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codesPatterns.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): KpiSelector_NetworkCodesAbsolute { + const message = { + ...baseKpiSelector_NetworkCodesAbsolute, + } as KpiSelector_NetworkCodesAbsolute; + message.codesPatterns = (object.codesPatterns ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: KpiSelector_NetworkCodesAbsolute): unknown { + const obj: any = {}; + if (message.codesPatterns) { + obj.codesPatterns = message.codesPatterns.map((e) => e); + } else { + obj.codesPatterns = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): KpiSelector_NetworkCodesAbsolute { + const message = { + ...baseKpiSelector_NetworkCodesAbsolute, + } as KpiSelector_NetworkCodesAbsolute; + message.codesPatterns = object.codesPatterns?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + KpiSelector_NetworkCodesAbsolute.$type, + KpiSelector_NetworkCodesAbsolute +); + +const baseKpiSelector_NetworkCodesRelative: object = { + $type: + "yandex.cloud.loadtesting.api.v1.report.KpiSelector.NetworkCodesRelative", + codesPatterns: "", +}; + +export const KpiSelector_NetworkCodesRelative = { + $type: + "yandex.cloud.loadtesting.api.v1.report.KpiSelector.NetworkCodesRelative" as const, + + encode( + message: KpiSelector_NetworkCodesRelative, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.codesPatterns) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): KpiSelector_NetworkCodesRelative { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseKpiSelector_NetworkCodesRelative, + } as KpiSelector_NetworkCodesRelative; + message.codesPatterns = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codesPatterns.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): KpiSelector_NetworkCodesRelative { + const message = { + ...baseKpiSelector_NetworkCodesRelative, + } as KpiSelector_NetworkCodesRelative; + message.codesPatterns = (object.codesPatterns ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: KpiSelector_NetworkCodesRelative): unknown { + const obj: any = {}; + if (message.codesPatterns) { + obj.codesPatterns = message.codesPatterns.map((e) => e); + } else { + obj.codesPatterns = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): KpiSelector_NetworkCodesRelative { + const message = { + ...baseKpiSelector_NetworkCodesRelative, + } as KpiSelector_NetworkCodesRelative; + message.codesPatterns = object.codesPatterns?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + KpiSelector_NetworkCodesRelative.$type, + KpiSelector_NetworkCodesRelative +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/report/kpi_value.ts b/src/generated/yandex/cloud/loadtesting/api/v1/report/kpi_value.ts new file mode 100644 index 00000000..7fde2c2d --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/report/kpi_value.ts @@ -0,0 +1,135 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.report"; + +/** An actual value of test's KPI. */ +export interface KpiValue { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiValue"; + /** ID of a test. */ + testId: string; + /** Value of KPI. */ + value: number; + /** A flag indicating whether the value satisfies KPI threshold condition. */ + isOk: boolean; +} + +const baseKpiValue: object = { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiValue", + testId: "", + value: 0, + isOk: false, +}; + +export const KpiValue = { + $type: "yandex.cloud.loadtesting.api.v1.report.KpiValue" as const, + + encode( + message: KpiValue, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.testId !== "") { + writer.uint32(10).string(message.testId); + } + if (message.value !== 0) { + writer.uint32(17).double(message.value); + } + if (message.isOk === true) { + writer.uint32(24).bool(message.isOk); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): KpiValue { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseKpiValue } as KpiValue; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.testId = reader.string(); + break; + case 2: + message.value = reader.double(); + break; + case 3: + message.isOk = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): KpiValue { + const message = { ...baseKpiValue } as KpiValue; + message.testId = + object.testId !== undefined && object.testId !== null + ? String(object.testId) + : ""; + message.value = + object.value !== undefined && object.value !== null + ? Number(object.value) + : 0; + message.isOk = + object.isOk !== undefined && object.isOk !== null + ? Boolean(object.isOk) + : false; + return message; + }, + + toJSON(message: KpiValue): unknown { + const obj: any = {}; + message.testId !== undefined && (obj.testId = message.testId); + message.value !== undefined && (obj.value = message.value); + message.isOk !== undefined && (obj.isOk = message.isOk); + return obj; + }, + + fromPartial, I>>(object: I): KpiValue { + const message = { ...baseKpiValue } as KpiValue; + message.testId = object.testId ?? ""; + message.value = object.value ?? 0; + message.isOk = object.isOk ?? false; + return message; + }, +}; + +messageTypeRegistry.set(KpiValue.$type, KpiValue); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/report/status.ts b/src/generated/yandex/cloud/loadtesting/api/v1/report/status.ts new file mode 100644 index 00000000..19700d40 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/report/status.ts @@ -0,0 +1,59 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.report"; + +/** Report status. */ +export enum Status { + /** STATUS_UNSPECIFIED - Status is not specified. */ + STATUS_UNSPECIFIED = 0, + /** COLLECTING - Report is being collected. */ + COLLECTING = 1, + /** CALCULATING - Report is being calculated. */ + CALCULATING = 2, + /** READY - Report is ready. */ + READY = 3, + UNRECOGNIZED = -1, +} + +export function statusFromJSON(object: any): Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return Status.STATUS_UNSPECIFIED; + case 1: + case "COLLECTING": + return Status.COLLECTING; + case 2: + case "CALCULATING": + return Status.CALCULATING; + case 3: + case "READY": + return Status.READY; + case -1: + case "UNRECOGNIZED": + default: + return Status.UNRECOGNIZED; + } +} + +export function statusToJSON(object: Status): string { + switch (object) { + case Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case Status.COLLECTING: + return "COLLECTING"; + case Status.CALCULATING: + return "CALCULATING"; + case Status.READY: + return "READY"; + default: + return "UNKNOWN"; + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/report/table/report.ts b/src/generated/yandex/cloud/loadtesting/api/v1/report/table/report.ts new file mode 100644 index 00000000..dc1ee7bd --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/report/table/report.ts @@ -0,0 +1,375 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Quantiles } from "../../../../../../../yandex/cloud/loadtesting/api/v1/common/quantiles"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.report.table"; + +/** Aggregated test results. */ +export interface Report { + $type: "yandex.cloud.loadtesting.api.v1.report.table.Report"; + /** Total count of HTTP responses, grouped by HTTP response code. */ + httpCodes: { [key: number]: number }; + /** Total count of network responses, grouped by response code. */ + netCodes: { [key: number]: number }; + /** Response time statistics, aggregated by quantiles. */ + quantiles?: Quantiles; +} + +export interface Report_HttpCodesEntry { + $type: "yandex.cloud.loadtesting.api.v1.report.table.Report.HttpCodesEntry"; + key: number; + value: number; +} + +export interface Report_NetCodesEntry { + $type: "yandex.cloud.loadtesting.api.v1.report.table.Report.NetCodesEntry"; + key: number; + value: number; +} + +const baseReport: object = { + $type: "yandex.cloud.loadtesting.api.v1.report.table.Report", +}; + +export const Report = { + $type: "yandex.cloud.loadtesting.api.v1.report.table.Report" as const, + + encode( + message: Report, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + Object.entries(message.httpCodes).forEach(([key, value]) => { + Report_HttpCodesEntry.encode( + { + $type: + "yandex.cloud.loadtesting.api.v1.report.table.Report.HttpCodesEntry", + key: key as any, + value, + }, + writer.uint32(10).fork() + ).ldelim(); + }); + Object.entries(message.netCodes).forEach(([key, value]) => { + Report_NetCodesEntry.encode( + { + $type: + "yandex.cloud.loadtesting.api.v1.report.table.Report.NetCodesEntry", + key: key as any, + value, + }, + writer.uint32(18).fork() + ).ldelim(); + }); + if (message.quantiles !== undefined) { + Quantiles.encode(message.quantiles, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Report { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseReport } as Report; + message.httpCodes = {}; + message.netCodes = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + const entry1 = Report_HttpCodesEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.httpCodes[entry1.key] = entry1.value; + } + break; + case 2: + const entry2 = Report_NetCodesEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.netCodes[entry2.key] = entry2.value; + } + break; + case 3: + message.quantiles = Quantiles.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Report { + const message = { ...baseReport } as Report; + message.httpCodes = Object.entries(object.httpCodes ?? {}).reduce<{ + [key: number]: number; + }>((acc, [key, value]) => { + acc[Number(key)] = Number(value); + return acc; + }, {}); + message.netCodes = Object.entries(object.netCodes ?? {}).reduce<{ + [key: number]: number; + }>((acc, [key, value]) => { + acc[Number(key)] = Number(value); + return acc; + }, {}); + message.quantiles = + object.quantiles !== undefined && object.quantiles !== null + ? Quantiles.fromJSON(object.quantiles) + : undefined; + return message; + }, + + toJSON(message: Report): unknown { + const obj: any = {}; + obj.httpCodes = {}; + if (message.httpCodes) { + Object.entries(message.httpCodes).forEach(([k, v]) => { + obj.httpCodes[k] = Math.round(v); + }); + } + obj.netCodes = {}; + if (message.netCodes) { + Object.entries(message.netCodes).forEach(([k, v]) => { + obj.netCodes[k] = Math.round(v); + }); + } + message.quantiles !== undefined && + (obj.quantiles = message.quantiles + ? Quantiles.toJSON(message.quantiles) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Report { + const message = { ...baseReport } as Report; + message.httpCodes = Object.entries(object.httpCodes ?? {}).reduce<{ + [key: number]: number; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[Number(key)] = Number(value); + } + return acc; + }, {}); + message.netCodes = Object.entries(object.netCodes ?? {}).reduce<{ + [key: number]: number; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[Number(key)] = Number(value); + } + return acc; + }, {}); + message.quantiles = + object.quantiles !== undefined && object.quantiles !== null + ? Quantiles.fromPartial(object.quantiles) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Report.$type, Report); + +const baseReport_HttpCodesEntry: object = { + $type: "yandex.cloud.loadtesting.api.v1.report.table.Report.HttpCodesEntry", + key: 0, + value: 0, +}; + +export const Report_HttpCodesEntry = { + $type: + "yandex.cloud.loadtesting.api.v1.report.table.Report.HttpCodesEntry" as const, + + encode( + message: Report_HttpCodesEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== 0) { + writer.uint32(8).int64(message.key); + } + if (message.value !== 0) { + writer.uint32(16).int64(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Report_HttpCodesEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseReport_HttpCodesEntry } as Report_HttpCodesEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = longToNumber(reader.int64() as Long); + break; + case 2: + message.value = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Report_HttpCodesEntry { + const message = { ...baseReport_HttpCodesEntry } as Report_HttpCodesEntry; + message.key = + object.key !== undefined && object.key !== null ? Number(object.key) : 0; + message.value = + object.value !== undefined && object.value !== null + ? Number(object.value) + : 0; + return message; + }, + + toJSON(message: Report_HttpCodesEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = Math.round(message.key)); + message.value !== undefined && (obj.value = Math.round(message.value)); + return obj; + }, + + fromPartial, I>>( + object: I + ): Report_HttpCodesEntry { + const message = { ...baseReport_HttpCodesEntry } as Report_HttpCodesEntry; + message.key = object.key ?? 0; + message.value = object.value ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Report_HttpCodesEntry.$type, Report_HttpCodesEntry); + +const baseReport_NetCodesEntry: object = { + $type: "yandex.cloud.loadtesting.api.v1.report.table.Report.NetCodesEntry", + key: 0, + value: 0, +}; + +export const Report_NetCodesEntry = { + $type: + "yandex.cloud.loadtesting.api.v1.report.table.Report.NetCodesEntry" as const, + + encode( + message: Report_NetCodesEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== 0) { + writer.uint32(8).int64(message.key); + } + if (message.value !== 0) { + writer.uint32(16).int64(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Report_NetCodesEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseReport_NetCodesEntry } as Report_NetCodesEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = longToNumber(reader.int64() as Long); + break; + case 2: + message.value = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Report_NetCodesEntry { + const message = { ...baseReport_NetCodesEntry } as Report_NetCodesEntry; + message.key = + object.key !== undefined && object.key !== null ? Number(object.key) : 0; + message.value = + object.value !== undefined && object.value !== null + ? Number(object.value) + : 0; + return message; + }, + + toJSON(message: Report_NetCodesEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = Math.round(message.key)); + message.value !== undefined && (obj.value = Math.round(message.value)); + return obj; + }, + + fromPartial, I>>( + object: I + ): Report_NetCodesEntry { + const message = { ...baseReport_NetCodesEntry } as Report_NetCodesEntry; + message.key = object.key ?? 0; + message.value = object.value ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Report_NetCodesEntry.$type, Report_NetCodesEntry); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/report_service.ts b/src/generated/yandex/cloud/loadtesting/api/v1/report_service.ts new file mode 100644 index 00000000..60abddc2 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/report_service.ts @@ -0,0 +1,698 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + Status, + statusFromJSON, + statusToJSON, +} from "../../../../../yandex/cloud/loadtesting/api/v1/report/status"; +import { Report } from "../../../../../yandex/cloud/loadtesting/api/v1/report/table/report"; +import { Kpi } from "../../../../../yandex/cloud/loadtesting/api/v1/report/kpi"; +import { KpiValue } from "../../../../../yandex/cloud/loadtesting/api/v1/report/kpi_value"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1"; + +export interface GetTableReportRequest { + $type: "yandex.cloud.loadtesting.api.v1.GetTableReportRequest"; + /** ID of the test for which report table will be returned. */ + testId: string; +} + +export interface GetTableReportResponse { + $type: "yandex.cloud.loadtesting.api.v1.GetTableReportResponse"; + /** Status of report table. */ + status: Status; + /** Result for all test cases combined ("overall" test case). */ + overall?: Report; + /** Results for individual test cases, mapped as `case_name:report`. */ + cases: { [key: string]: Report }; +} + +export interface GetTableReportResponse_CasesEntry { + $type: "yandex.cloud.loadtesting.api.v1.GetTableReportResponse.CasesEntry"; + key: string; + value?: Report; +} + +export interface CalculateReportKpiValuesRequest { + $type: "yandex.cloud.loadtesting.api.v1.CalculateReportKpiValuesRequest"; + /** ID of the folder containing tests. */ + folderId: string; + /** Test filter selector to calculate KPI values for. */ + testFilter: string; + /** + * Test case to calculate KPI values for. + * + * If not specified, KPI values will be calculated for 'overall' case. + */ + testCase: string; + /** KPI to be calculated. */ + kpi?: Kpi; +} + +export interface CalculateReportKpiValuesResponse { + $type: "yandex.cloud.loadtesting.api.v1.CalculateReportKpiValuesResponse"; + /** ID of the folder. */ + folderId: string; + /** Actual KPI values. */ + values: KpiValue[]; +} + +const baseGetTableReportRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.GetTableReportRequest", + testId: "", +}; + +export const GetTableReportRequest = { + $type: "yandex.cloud.loadtesting.api.v1.GetTableReportRequest" as const, + + encode( + message: GetTableReportRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.testId !== "") { + writer.uint32(10).string(message.testId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetTableReportRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetTableReportRequest } as GetTableReportRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.testId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetTableReportRequest { + const message = { ...baseGetTableReportRequest } as GetTableReportRequest; + message.testId = + object.testId !== undefined && object.testId !== null + ? String(object.testId) + : ""; + return message; + }, + + toJSON(message: GetTableReportRequest): unknown { + const obj: any = {}; + message.testId !== undefined && (obj.testId = message.testId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetTableReportRequest { + const message = { ...baseGetTableReportRequest } as GetTableReportRequest; + message.testId = object.testId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetTableReportRequest.$type, GetTableReportRequest); + +const baseGetTableReportResponse: object = { + $type: "yandex.cloud.loadtesting.api.v1.GetTableReportResponse", + status: 0, +}; + +export const GetTableReportResponse = { + $type: "yandex.cloud.loadtesting.api.v1.GetTableReportResponse" as const, + + encode( + message: GetTableReportResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + if (message.overall !== undefined) { + Report.encode(message.overall, writer.uint32(18).fork()).ldelim(); + } + Object.entries(message.cases).forEach(([key, value]) => { + GetTableReportResponse_CasesEntry.encode( + { + $type: + "yandex.cloud.loadtesting.api.v1.GetTableReportResponse.CasesEntry", + key: key as any, + value, + }, + writer.uint32(26).fork() + ).ldelim(); + }); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetTableReportResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetTableReportResponse } as GetTableReportResponse; + message.cases = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.int32() as any; + break; + case 2: + message.overall = Report.decode(reader, reader.uint32()); + break; + case 3: + const entry3 = GetTableReportResponse_CasesEntry.decode( + reader, + reader.uint32() + ); + if (entry3.value !== undefined) { + message.cases[entry3.key] = entry3.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetTableReportResponse { + const message = { ...baseGetTableReportResponse } as GetTableReportResponse; + message.status = + object.status !== undefined && object.status !== null + ? statusFromJSON(object.status) + : 0; + message.overall = + object.overall !== undefined && object.overall !== null + ? Report.fromJSON(object.overall) + : undefined; + message.cases = Object.entries(object.cases ?? {}).reduce<{ + [key: string]: Report; + }>((acc, [key, value]) => { + acc[key] = Report.fromJSON(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: GetTableReportResponse): unknown { + const obj: any = {}; + message.status !== undefined && (obj.status = statusToJSON(message.status)); + message.overall !== undefined && + (obj.overall = message.overall + ? Report.toJSON(message.overall) + : undefined); + obj.cases = {}; + if (message.cases) { + Object.entries(message.cases).forEach(([k, v]) => { + obj.cases[k] = Report.toJSON(v); + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): GetTableReportResponse { + const message = { ...baseGetTableReportResponse } as GetTableReportResponse; + message.status = object.status ?? 0; + message.overall = + object.overall !== undefined && object.overall !== null + ? Report.fromPartial(object.overall) + : undefined; + message.cases = Object.entries(object.cases ?? {}).reduce<{ + [key: string]: Report; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Report.fromPartial(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(GetTableReportResponse.$type, GetTableReportResponse); + +const baseGetTableReportResponse_CasesEntry: object = { + $type: "yandex.cloud.loadtesting.api.v1.GetTableReportResponse.CasesEntry", + key: "", +}; + +export const GetTableReportResponse_CasesEntry = { + $type: + "yandex.cloud.loadtesting.api.v1.GetTableReportResponse.CasesEntry" as const, + + encode( + message: GetTableReportResponse_CasesEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Report.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetTableReportResponse_CasesEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetTableReportResponse_CasesEntry, + } as GetTableReportResponse_CasesEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = Report.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetTableReportResponse_CasesEntry { + const message = { + ...baseGetTableReportResponse_CasesEntry, + } as GetTableReportResponse_CasesEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? Report.fromJSON(object.value) + : undefined; + return message; + }, + + toJSON(message: GetTableReportResponse_CasesEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && + (obj.value = message.value ? Report.toJSON(message.value) : undefined); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): GetTableReportResponse_CasesEntry { + const message = { + ...baseGetTableReportResponse_CasesEntry, + } as GetTableReportResponse_CasesEntry; + message.key = object.key ?? ""; + message.value = + object.value !== undefined && object.value !== null + ? Report.fromPartial(object.value) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + GetTableReportResponse_CasesEntry.$type, + GetTableReportResponse_CasesEntry +); + +const baseCalculateReportKpiValuesRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.CalculateReportKpiValuesRequest", + folderId: "", + testFilter: "", + testCase: "", +}; + +export const CalculateReportKpiValuesRequest = { + $type: + "yandex.cloud.loadtesting.api.v1.CalculateReportKpiValuesRequest" as const, + + encode( + message: CalculateReportKpiValuesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.testFilter !== "") { + writer.uint32(18).string(message.testFilter); + } + if (message.testCase !== "") { + writer.uint32(26).string(message.testCase); + } + if (message.kpi !== undefined) { + Kpi.encode(message.kpi, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CalculateReportKpiValuesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCalculateReportKpiValuesRequest, + } as CalculateReportKpiValuesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.testFilter = reader.string(); + break; + case 3: + message.testCase = reader.string(); + break; + case 4: + message.kpi = Kpi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CalculateReportKpiValuesRequest { + const message = { + ...baseCalculateReportKpiValuesRequest, + } as CalculateReportKpiValuesRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.testFilter = + object.testFilter !== undefined && object.testFilter !== null + ? String(object.testFilter) + : ""; + message.testCase = + object.testCase !== undefined && object.testCase !== null + ? String(object.testCase) + : ""; + message.kpi = + object.kpi !== undefined && object.kpi !== null + ? Kpi.fromJSON(object.kpi) + : undefined; + return message; + }, + + toJSON(message: CalculateReportKpiValuesRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.testFilter !== undefined && (obj.testFilter = message.testFilter); + message.testCase !== undefined && (obj.testCase = message.testCase); + message.kpi !== undefined && + (obj.kpi = message.kpi ? Kpi.toJSON(message.kpi) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CalculateReportKpiValuesRequest { + const message = { + ...baseCalculateReportKpiValuesRequest, + } as CalculateReportKpiValuesRequest; + message.folderId = object.folderId ?? ""; + message.testFilter = object.testFilter ?? ""; + message.testCase = object.testCase ?? ""; + message.kpi = + object.kpi !== undefined && object.kpi !== null + ? Kpi.fromPartial(object.kpi) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + CalculateReportKpiValuesRequest.$type, + CalculateReportKpiValuesRequest +); + +const baseCalculateReportKpiValuesResponse: object = { + $type: "yandex.cloud.loadtesting.api.v1.CalculateReportKpiValuesResponse", + folderId: "", +}; + +export const CalculateReportKpiValuesResponse = { + $type: + "yandex.cloud.loadtesting.api.v1.CalculateReportKpiValuesResponse" as const, + + encode( + message: CalculateReportKpiValuesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + for (const v of message.values) { + KpiValue.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CalculateReportKpiValuesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCalculateReportKpiValuesResponse, + } as CalculateReportKpiValuesResponse; + message.values = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.values.push(KpiValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CalculateReportKpiValuesResponse { + const message = { + ...baseCalculateReportKpiValuesResponse, + } as CalculateReportKpiValuesResponse; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.values = (object.values ?? []).map((e: any) => + KpiValue.fromJSON(e) + ); + return message; + }, + + toJSON(message: CalculateReportKpiValuesResponse): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + if (message.values) { + obj.values = message.values.map((e) => + e ? KpiValue.toJSON(e) : undefined + ); + } else { + obj.values = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CalculateReportKpiValuesResponse { + const message = { + ...baseCalculateReportKpiValuesResponse, + } as CalculateReportKpiValuesResponse; + message.folderId = object.folderId ?? ""; + message.values = object.values?.map((e) => KpiValue.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + CalculateReportKpiValuesResponse.$type, + CalculateReportKpiValuesResponse +); + +/** A set of methods for managing test reports. */ +export const ReportServiceService = { + /** Returns a report table for the specified test. */ + getTable: { + path: "/yandex.cloud.loadtesting.api.v1.ReportService/GetTable", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetTableReportRequest) => + Buffer.from(GetTableReportRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetTableReportRequest.decode(value), + responseSerialize: (value: GetTableReportResponse) => + Buffer.from(GetTableReportResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + GetTableReportResponse.decode(value), + }, + /** Returns a list of KPI values for tests matching the specified filter. */ + calculateKpiValues: { + path: "/yandex.cloud.loadtesting.api.v1.ReportService/CalculateKpiValues", + requestStream: false, + responseStream: false, + requestSerialize: (value: CalculateReportKpiValuesRequest) => + Buffer.from(CalculateReportKpiValuesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CalculateReportKpiValuesRequest.decode(value), + responseSerialize: (value: CalculateReportKpiValuesResponse) => + Buffer.from(CalculateReportKpiValuesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + CalculateReportKpiValuesResponse.decode(value), + }, +} as const; + +export interface ReportServiceServer extends UntypedServiceImplementation { + /** Returns a report table for the specified test. */ + getTable: handleUnaryCall; + /** Returns a list of KPI values for tests matching the specified filter. */ + calculateKpiValues: handleUnaryCall< + CalculateReportKpiValuesRequest, + CalculateReportKpiValuesResponse + >; +} + +export interface ReportServiceClient extends Client { + /** Returns a report table for the specified test. */ + getTable( + request: GetTableReportRequest, + callback: ( + error: ServiceError | null, + response: GetTableReportResponse + ) => void + ): ClientUnaryCall; + getTable( + request: GetTableReportRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: GetTableReportResponse + ) => void + ): ClientUnaryCall; + getTable( + request: GetTableReportRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: GetTableReportResponse + ) => void + ): ClientUnaryCall; + /** Returns a list of KPI values for tests matching the specified filter. */ + calculateKpiValues( + request: CalculateReportKpiValuesRequest, + callback: ( + error: ServiceError | null, + response: CalculateReportKpiValuesResponse + ) => void + ): ClientUnaryCall; + calculateKpiValues( + request: CalculateReportKpiValuesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: CalculateReportKpiValuesResponse + ) => void + ): ClientUnaryCall; + calculateKpiValues( + request: CalculateReportKpiValuesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: CalculateReportKpiValuesResponse + ) => void + ): ClientUnaryCall; +} + +export const ReportServiceClient = makeGenericClientConstructor( + ReportServiceService, + "yandex.cloud.loadtesting.api.v1.ReportService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ReportServiceClient; + service: typeof ReportServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/test/agent_selector.ts b/src/generated/yandex/cloud/loadtesting/api/v1/test/agent_selector.ts new file mode 100644 index 00000000..fe1faa5b --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/test/agent_selector.ts @@ -0,0 +1,140 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.test"; + +/** + * Agent selection criterion. + * + * The structure is used by service to determine on which agents a specific test should be executed. + */ +export interface AgentSelector { + $type: "yandex.cloud.loadtesting.api.v1.test.AgentSelector"; + /** Selection by agent ID. */ + agentId: string | undefined; + /** Selection by filter string. */ + matchByFilter: string | undefined; + /** Select anonymoud (i.e. not registered) agents. */ + anonymousAgent: boolean | undefined; +} + +const baseAgentSelector: object = { + $type: "yandex.cloud.loadtesting.api.v1.test.AgentSelector", +}; + +export const AgentSelector = { + $type: "yandex.cloud.loadtesting.api.v1.test.AgentSelector" as const, + + encode( + message: AgentSelector, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.agentId !== undefined) { + writer.uint32(10).string(message.agentId); + } + if (message.matchByFilter !== undefined) { + writer.uint32(18).string(message.matchByFilter); + } + if (message.anonymousAgent !== undefined) { + writer.uint32(24).bool(message.anonymousAgent); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AgentSelector { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAgentSelector } as AgentSelector; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.agentId = reader.string(); + break; + case 2: + message.matchByFilter = reader.string(); + break; + case 3: + message.anonymousAgent = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AgentSelector { + const message = { ...baseAgentSelector } as AgentSelector; + message.agentId = + object.agentId !== undefined && object.agentId !== null + ? String(object.agentId) + : undefined; + message.matchByFilter = + object.matchByFilter !== undefined && object.matchByFilter !== null + ? String(object.matchByFilter) + : undefined; + message.anonymousAgent = + object.anonymousAgent !== undefined && object.anonymousAgent !== null + ? Boolean(object.anonymousAgent) + : undefined; + return message; + }, + + toJSON(message: AgentSelector): unknown { + const obj: any = {}; + message.agentId !== undefined && (obj.agentId = message.agentId); + message.matchByFilter !== undefined && + (obj.matchByFilter = message.matchByFilter); + message.anonymousAgent !== undefined && + (obj.anonymousAgent = message.anonymousAgent); + return obj; + }, + + fromPartial, I>>( + object: I + ): AgentSelector { + const message = { ...baseAgentSelector } as AgentSelector; + message.agentId = object.agentId ?? undefined; + message.matchByFilter = object.matchByFilter ?? undefined; + message.anonymousAgent = object.anonymousAgent ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(AgentSelector.$type, AgentSelector); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/test/artifact_settings.ts b/src/generated/yandex/cloud/loadtesting/api/v1/test/artifact_settings.ts new file mode 100644 index 00000000..1c791670 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/test/artifact_settings.ts @@ -0,0 +1,176 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.test"; + +/** + * Artifact upload settings. + * + * Defines where to upload test artifacts and which files should be included. + */ +export interface ArtifactSettings { + $type: "yandex.cloud.loadtesting.api.v1.test.ArtifactSettings"; + /** Name of output object storage bucket in test's folder. */ + objectStorageBucket: string | undefined; + /** Setting which defines whether artifact files should be archived prior to uploading. */ + isArchive: boolean; + /** + * Filter strings defining which files should be included to artifacts. GLOB format. + * + * Example: + * - ['*'] - all files will be uploaded. + * - ['*.log', '*.yaml] - all `.log` and `.yaml` files will be uploaded. + */ + filterInclude: string[]; + /** + * Filter strings defining which files should be excluded from artifacts. GLOB format. + * + * Example: + * - filter_include=['*'], filter_exclude=['phout.log'] - upload all `.log` files excluding `phout.log`. + */ + filterExclude: string[]; +} + +const baseArtifactSettings: object = { + $type: "yandex.cloud.loadtesting.api.v1.test.ArtifactSettings", + isArchive: false, + filterInclude: "", + filterExclude: "", +}; + +export const ArtifactSettings = { + $type: "yandex.cloud.loadtesting.api.v1.test.ArtifactSettings" as const, + + encode( + message: ArtifactSettings, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.objectStorageBucket !== undefined) { + writer.uint32(10).string(message.objectStorageBucket); + } + if (message.isArchive === true) { + writer.uint32(48).bool(message.isArchive); + } + for (const v of message.filterInclude) { + writer.uint32(58).string(v!); + } + for (const v of message.filterExclude) { + writer.uint32(66).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ArtifactSettings { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseArtifactSettings } as ArtifactSettings; + message.filterInclude = []; + message.filterExclude = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.objectStorageBucket = reader.string(); + break; + case 6: + message.isArchive = reader.bool(); + break; + case 7: + message.filterInclude.push(reader.string()); + break; + case 8: + message.filterExclude.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ArtifactSettings { + const message = { ...baseArtifactSettings } as ArtifactSettings; + message.objectStorageBucket = + object.objectStorageBucket !== undefined && + object.objectStorageBucket !== null + ? String(object.objectStorageBucket) + : undefined; + message.isArchive = + object.isArchive !== undefined && object.isArchive !== null + ? Boolean(object.isArchive) + : false; + message.filterInclude = (object.filterInclude ?? []).map((e: any) => + String(e) + ); + message.filterExclude = (object.filterExclude ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: ArtifactSettings): unknown { + const obj: any = {}; + message.objectStorageBucket !== undefined && + (obj.objectStorageBucket = message.objectStorageBucket); + message.isArchive !== undefined && (obj.isArchive = message.isArchive); + if (message.filterInclude) { + obj.filterInclude = message.filterInclude.map((e) => e); + } else { + obj.filterInclude = []; + } + if (message.filterExclude) { + obj.filterExclude = message.filterExclude.map((e) => e); + } else { + obj.filterExclude = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ArtifactSettings { + const message = { ...baseArtifactSettings } as ArtifactSettings; + message.objectStorageBucket = object.objectStorageBucket ?? undefined; + message.isArchive = object.isArchive ?? false; + message.filterInclude = object.filterInclude?.map((e) => e) || []; + message.filterExclude = object.filterExclude?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(ArtifactSettings.$type, ArtifactSettings); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/test/details.ts b/src/generated/yandex/cloud/loadtesting/api/v1/test/details.ts new file mode 100644 index 00000000..4d268c5c --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/test/details.ts @@ -0,0 +1,182 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ArtifactSettings } from "../../../../../../yandex/cloud/loadtesting/api/v1/test/artifact_settings"; +import { Tag } from "../../../../../../yandex/cloud/loadtesting/api/v1/common/tag"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.test"; + +/** Test meta information. */ +export interface Details { + $type: "yandex.cloud.loadtesting.api.v1.test.Details"; + /** Name of the test. */ + name: string; + /** Description of the test. */ + description: string; + /** Tags assigned to the test. */ + tags: Tag[]; + /** ID of the logging group to which test artifacts are uploaded. */ + loggingLogGroupId: string; + /** Settings which define where to upload test artifacts and which files should be included. */ + artifactSettings?: ArtifactSettings; +} + +const baseDetails: object = { + $type: "yandex.cloud.loadtesting.api.v1.test.Details", + name: "", + description: "", + loggingLogGroupId: "", +}; + +export const Details = { + $type: "yandex.cloud.loadtesting.api.v1.test.Details" as const, + + encode( + message: Details, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.tags) { + Tag.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.loggingLogGroupId !== "") { + writer.uint32(34).string(message.loggingLogGroupId); + } + if (message.artifactSettings !== undefined) { + ArtifactSettings.encode( + message.artifactSettings, + writer.uint32(42).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Details { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDetails } as Details; + message.tags = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.tags.push(Tag.decode(reader, reader.uint32())); + break; + case 4: + message.loggingLogGroupId = reader.string(); + break; + case 5: + message.artifactSettings = ArtifactSettings.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Details { + const message = { ...baseDetails } as Details; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.tags = (object.tags ?? []).map((e: any) => Tag.fromJSON(e)); + message.loggingLogGroupId = + object.loggingLogGroupId !== undefined && + object.loggingLogGroupId !== null + ? String(object.loggingLogGroupId) + : ""; + message.artifactSettings = + object.artifactSettings !== undefined && object.artifactSettings !== null + ? ArtifactSettings.fromJSON(object.artifactSettings) + : undefined; + return message; + }, + + toJSON(message: Details): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + if (message.tags) { + obj.tags = message.tags.map((e) => (e ? Tag.toJSON(e) : undefined)); + } else { + obj.tags = []; + } + message.loggingLogGroupId !== undefined && + (obj.loggingLogGroupId = message.loggingLogGroupId); + message.artifactSettings !== undefined && + (obj.artifactSettings = message.artifactSettings + ? ArtifactSettings.toJSON(message.artifactSettings) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Details { + const message = { ...baseDetails } as Details; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.tags = object.tags?.map((e) => Tag.fromPartial(e)) || []; + message.loggingLogGroupId = object.loggingLogGroupId ?? ""; + message.artifactSettings = + object.artifactSettings !== undefined && object.artifactSettings !== null + ? ArtifactSettings.fromPartial(object.artifactSettings) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Details.$type, Details); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/test/file_pointer.ts b/src/generated/yandex/cloud/loadtesting/api/v1/test/file_pointer.ts new file mode 100644 index 00000000..c352fc9f --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/test/file_pointer.ts @@ -0,0 +1,116 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ObjectStorage } from "../../../../../../yandex/cloud/loadtesting/api/v1/test/object_storage"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.test"; + +/** Variant-like structure for referencing files in different sources. */ +export interface FilePointer { + $type: "yandex.cloud.loadtesting.api.v1.test.FilePointer"; + /** Reference to a file in Object Storage. */ + objectStorage?: ObjectStorage | undefined; +} + +const baseFilePointer: object = { + $type: "yandex.cloud.loadtesting.api.v1.test.FilePointer", +}; + +export const FilePointer = { + $type: "yandex.cloud.loadtesting.api.v1.test.FilePointer" as const, + + encode( + message: FilePointer, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.objectStorage !== undefined) { + ObjectStorage.encode( + message.objectStorage, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FilePointer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFilePointer } as FilePointer; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.objectStorage = ObjectStorage.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FilePointer { + const message = { ...baseFilePointer } as FilePointer; + message.objectStorage = + object.objectStorage !== undefined && object.objectStorage !== null + ? ObjectStorage.fromJSON(object.objectStorage) + : undefined; + return message; + }, + + toJSON(message: FilePointer): unknown { + const obj: any = {}; + message.objectStorage !== undefined && + (obj.objectStorage = message.objectStorage + ? ObjectStorage.toJSON(message.objectStorage) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): FilePointer { + const message = { ...baseFilePointer } as FilePointer; + message.objectStorage = + object.objectStorage !== undefined && object.objectStorage !== null + ? ObjectStorage.fromPartial(object.objectStorage) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(FilePointer.$type, FilePointer); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/test/imbalance_point.ts b/src/generated/yandex/cloud/loadtesting/api/v1/test/imbalance_point.ts new file mode 100644 index 00000000..74298326 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/test/imbalance_point.ts @@ -0,0 +1,178 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.test"; + +/** Test imbalance point. */ +export interface ImbalancePoint { + $type: "yandex.cloud.loadtesting.api.v1.test.ImbalancePoint"; + /** Imbalance moment timestamp. */ + at?: Date; + /** Imbalance moment RPS. */ + rps: number; + /** Imbalance reason comment. */ + comment: string; +} + +const baseImbalancePoint: object = { + $type: "yandex.cloud.loadtesting.api.v1.test.ImbalancePoint", + rps: 0, + comment: "", +}; + +export const ImbalancePoint = { + $type: "yandex.cloud.loadtesting.api.v1.test.ImbalancePoint" as const, + + encode( + message: ImbalancePoint, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.at !== undefined) { + Timestamp.encode( + toTimestamp(message.at), + writer.uint32(10).fork() + ).ldelim(); + } + if (message.rps !== 0) { + writer.uint32(16).int64(message.rps); + } + if (message.comment !== "") { + writer.uint32(26).string(message.comment); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ImbalancePoint { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseImbalancePoint } as ImbalancePoint; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.at = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 2: + message.rps = longToNumber(reader.int64() as Long); + break; + case 3: + message.comment = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ImbalancePoint { + const message = { ...baseImbalancePoint } as ImbalancePoint; + message.at = + object.at !== undefined && object.at !== null + ? fromJsonTimestamp(object.at) + : undefined; + message.rps = + object.rps !== undefined && object.rps !== null ? Number(object.rps) : 0; + message.comment = + object.comment !== undefined && object.comment !== null + ? String(object.comment) + : ""; + return message; + }, + + toJSON(message: ImbalancePoint): unknown { + const obj: any = {}; + message.at !== undefined && (obj.at = message.at.toISOString()); + message.rps !== undefined && (obj.rps = Math.round(message.rps)); + message.comment !== undefined && (obj.comment = message.comment); + return obj; + }, + + fromPartial, I>>( + object: I + ): ImbalancePoint { + const message = { ...baseImbalancePoint } as ImbalancePoint; + message.at = object.at ?? undefined; + message.rps = object.rps ?? 0; + message.comment = object.comment ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ImbalancePoint.$type, ImbalancePoint); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/test/object_storage.ts b/src/generated/yandex/cloud/loadtesting/api/v1/test/object_storage.ts new file mode 100644 index 00000000..3fed2fe5 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/test/object_storage.ts @@ -0,0 +1,122 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.test"; + +/** Reference to a file stored in Object Storage. */ +export interface ObjectStorage { + $type: "yandex.cloud.loadtesting.api.v1.test.ObjectStorage"; + /** Bucket name. */ + bucket: string; + /** File name. */ + name: string; +} + +const baseObjectStorage: object = { + $type: "yandex.cloud.loadtesting.api.v1.test.ObjectStorage", + bucket: "", + name: "", +}; + +export const ObjectStorage = { + $type: "yandex.cloud.loadtesting.api.v1.test.ObjectStorage" as const, + + encode( + message: ObjectStorage, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.bucket !== "") { + writer.uint32(10).string(message.bucket); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ObjectStorage { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseObjectStorage } as ObjectStorage; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bucket = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ObjectStorage { + const message = { ...baseObjectStorage } as ObjectStorage; + message.bucket = + object.bucket !== undefined && object.bucket !== null + ? String(object.bucket) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + return message; + }, + + toJSON(message: ObjectStorage): unknown { + const obj: any = {}; + message.bucket !== undefined && (obj.bucket = message.bucket); + message.name !== undefined && (obj.name = message.name); + return obj; + }, + + fromPartial, I>>( + object: I + ): ObjectStorage { + const message = { ...baseObjectStorage } as ObjectStorage; + message.bucket = object.bucket ?? ""; + message.name = object.name ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ObjectStorage.$type, ObjectStorage); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/test/single_agent_configuration.ts b/src/generated/yandex/cloud/loadtesting/api/v1/test/single_agent_configuration.ts new file mode 100644 index 00000000..61abd4b9 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/test/single_agent_configuration.ts @@ -0,0 +1,297 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { AgentSelector } from "../../../../../../yandex/cloud/loadtesting/api/v1/test/agent_selector"; +import { FilePointer } from "../../../../../../yandex/cloud/loadtesting/api/v1/test/file_pointer"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.test"; + +/** Configuration of a test. */ +export interface SingleAgentConfiguration { + $type: "yandex.cloud.loadtesting.api.v1.test.SingleAgentConfiguration"; + /** ID of the config. */ + configId: string; + /** Agent selection criterion. */ + agentSelector?: AgentSelector; + /** + * Additional files to be used during test execution, represented as `rel_path:file` pairs. + * + * `rel_path` can be either a simple file name, a relative path, or absolute path. Files are + * downloaded by the agent to appropriate location. + * + * Use cases include: + * - [Test Data files](/docs/load-testing/concepts/payload). + * - Custom Pandora executable. + * - JMeter executable or ".jmx" scenario. + * - etc. + */ + files: { [key: string]: FilePointer }; +} + +export interface SingleAgentConfiguration_FilesEntry { + $type: "yandex.cloud.loadtesting.api.v1.test.SingleAgentConfiguration.FilesEntry"; + key: string; + value?: FilePointer; +} + +const baseSingleAgentConfiguration: object = { + $type: "yandex.cloud.loadtesting.api.v1.test.SingleAgentConfiguration", + configId: "", +}; + +export const SingleAgentConfiguration = { + $type: + "yandex.cloud.loadtesting.api.v1.test.SingleAgentConfiguration" as const, + + encode( + message: SingleAgentConfiguration, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.configId !== "") { + writer.uint32(10).string(message.configId); + } + if (message.agentSelector !== undefined) { + AgentSelector.encode( + message.agentSelector, + writer.uint32(18).fork() + ).ldelim(); + } + Object.entries(message.files).forEach(([key, value]) => { + SingleAgentConfiguration_FilesEntry.encode( + { + $type: + "yandex.cloud.loadtesting.api.v1.test.SingleAgentConfiguration.FilesEntry", + key: key as any, + value, + }, + writer.uint32(26).fork() + ).ldelim(); + }); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SingleAgentConfiguration { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSingleAgentConfiguration, + } as SingleAgentConfiguration; + message.files = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configId = reader.string(); + break; + case 2: + message.agentSelector = AgentSelector.decode(reader, reader.uint32()); + break; + case 3: + const entry3 = SingleAgentConfiguration_FilesEntry.decode( + reader, + reader.uint32() + ); + if (entry3.value !== undefined) { + message.files[entry3.key] = entry3.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SingleAgentConfiguration { + const message = { + ...baseSingleAgentConfiguration, + } as SingleAgentConfiguration; + message.configId = + object.configId !== undefined && object.configId !== null + ? String(object.configId) + : ""; + message.agentSelector = + object.agentSelector !== undefined && object.agentSelector !== null + ? AgentSelector.fromJSON(object.agentSelector) + : undefined; + message.files = Object.entries(object.files ?? {}).reduce<{ + [key: string]: FilePointer; + }>((acc, [key, value]) => { + acc[key] = FilePointer.fromJSON(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: SingleAgentConfiguration): unknown { + const obj: any = {}; + message.configId !== undefined && (obj.configId = message.configId); + message.agentSelector !== undefined && + (obj.agentSelector = message.agentSelector + ? AgentSelector.toJSON(message.agentSelector) + : undefined); + obj.files = {}; + if (message.files) { + Object.entries(message.files).forEach(([k, v]) => { + obj.files[k] = FilePointer.toJSON(v); + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): SingleAgentConfiguration { + const message = { + ...baseSingleAgentConfiguration, + } as SingleAgentConfiguration; + message.configId = object.configId ?? ""; + message.agentSelector = + object.agentSelector !== undefined && object.agentSelector !== null + ? AgentSelector.fromPartial(object.agentSelector) + : undefined; + message.files = Object.entries(object.files ?? {}).reduce<{ + [key: string]: FilePointer; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = FilePointer.fromPartial(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set( + SingleAgentConfiguration.$type, + SingleAgentConfiguration +); + +const baseSingleAgentConfiguration_FilesEntry: object = { + $type: + "yandex.cloud.loadtesting.api.v1.test.SingleAgentConfiguration.FilesEntry", + key: "", +}; + +export const SingleAgentConfiguration_FilesEntry = { + $type: + "yandex.cloud.loadtesting.api.v1.test.SingleAgentConfiguration.FilesEntry" as const, + + encode( + message: SingleAgentConfiguration_FilesEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + FilePointer.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SingleAgentConfiguration_FilesEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSingleAgentConfiguration_FilesEntry, + } as SingleAgentConfiguration_FilesEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = FilePointer.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SingleAgentConfiguration_FilesEntry { + const message = { + ...baseSingleAgentConfiguration_FilesEntry, + } as SingleAgentConfiguration_FilesEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? FilePointer.fromJSON(object.value) + : undefined; + return message; + }, + + toJSON(message: SingleAgentConfiguration_FilesEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && + (obj.value = message.value + ? FilePointer.toJSON(message.value) + : undefined); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): SingleAgentConfiguration_FilesEntry { + const message = { + ...baseSingleAgentConfiguration_FilesEntry, + } as SingleAgentConfiguration_FilesEntry; + message.key = object.key ?? ""; + message.value = + object.value !== undefined && object.value !== null + ? FilePointer.fromPartial(object.value) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + SingleAgentConfiguration_FilesEntry.$type, + SingleAgentConfiguration_FilesEntry +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/test/status.ts b/src/generated/yandex/cloud/loadtesting/api/v1/test/status.ts new file mode 100644 index 00000000..52ffdf61 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/test/status.ts @@ -0,0 +1,140 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.test"; + +export enum Status { + /** STATUS_UNSPECIFIED - Status is unspecified. */ + STATUS_UNSPECIFIED = 0, + /** CREATED - Test has been created, but not started by any agent. */ + CREATED = 1, + /** INITIATED - Execution stage: initialization. */ + INITIATED = 2, + /** PREPARING - Execution stage: data preparation and warm-up. */ + PREPARING = 3, + /** RUNNING - Execution stage: load generation. */ + RUNNING = 4, + /** FINISHING - Execution stage: termination. */ + FINISHING = 5, + /** DONE - Test is done. */ + DONE = 6, + /** POST_PROCESSING - Execution stage: results post-processing. */ + POST_PROCESSING = 7, + /** FAILED - Test has failed due to some error. */ + FAILED = 8, + /** STOPPING - Test is being stopped. */ + STOPPING = 9, + /** STOPPED - Test has been stopped. */ + STOPPED = 10, + /** AUTOSTOPPED - Test has been stopped automatically by satisfying autostop condition. */ + AUTOSTOPPED = 11, + /** WAITING - Execution stage: waiting for a trigger to start. */ + WAITING = 12, + /** DELETING - Test is being deleted. */ + DELETING = 13, + /** + * LOST - Test status has not been reported in a while during execution stage. + * + * Means that either an agent is too busy to send it, got offline, or failed without + * reporting a final status. + */ + LOST = 14, + UNRECOGNIZED = -1, +} + +export function statusFromJSON(object: any): Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return Status.STATUS_UNSPECIFIED; + case 1: + case "CREATED": + return Status.CREATED; + case 2: + case "INITIATED": + return Status.INITIATED; + case 3: + case "PREPARING": + return Status.PREPARING; + case 4: + case "RUNNING": + return Status.RUNNING; + case 5: + case "FINISHING": + return Status.FINISHING; + case 6: + case "DONE": + return Status.DONE; + case 7: + case "POST_PROCESSING": + return Status.POST_PROCESSING; + case 8: + case "FAILED": + return Status.FAILED; + case 9: + case "STOPPING": + return Status.STOPPING; + case 10: + case "STOPPED": + return Status.STOPPED; + case 11: + case "AUTOSTOPPED": + return Status.AUTOSTOPPED; + case 12: + case "WAITING": + return Status.WAITING; + case 13: + case "DELETING": + return Status.DELETING; + case 14: + case "LOST": + return Status.LOST; + case -1: + case "UNRECOGNIZED": + default: + return Status.UNRECOGNIZED; + } +} + +export function statusToJSON(object: Status): string { + switch (object) { + case Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case Status.CREATED: + return "CREATED"; + case Status.INITIATED: + return "INITIATED"; + case Status.PREPARING: + return "PREPARING"; + case Status.RUNNING: + return "RUNNING"; + case Status.FINISHING: + return "FINISHING"; + case Status.DONE: + return "DONE"; + case Status.POST_PROCESSING: + return "POST_PROCESSING"; + case Status.FAILED: + return "FAILED"; + case Status.STOPPING: + return "STOPPING"; + case Status.STOPPED: + return "STOPPED"; + case Status.AUTOSTOPPED: + return "AUTOSTOPPED"; + case Status.WAITING: + return "WAITING"; + case Status.DELETING: + return "DELETING"; + case Status.LOST: + return "LOST"; + default: + return "UNKNOWN"; + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/test/summary.ts b/src/generated/yandex/cloud/loadtesting/api/v1/test/summary.ts new file mode 100644 index 00000000..fe1ef333 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/test/summary.ts @@ -0,0 +1,322 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + Status, + statusFromJSON, + statusToJSON, +} from "../../../../../../yandex/cloud/loadtesting/api/v1/test/status"; +import { ImbalancePoint } from "../../../../../../yandex/cloud/loadtesting/api/v1/test/imbalance_point"; +import { FilePointer } from "../../../../../../yandex/cloud/loadtesting/api/v1/test/file_pointer"; +import { Timestamp } from "../../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.test"; + +/** Process of test and some results */ +export interface Summary { + $type: "yandex.cloud.loadtesting.api.v1.test.Summary"; + /** Status of the test. */ + status: Status; + /** Creation timestamp. */ + createdAt?: Date; + /** UA or SA that created the test. */ + createdBy: string; + /** + * Test start timestamp. + * + * Empty if the test has not been started yet. + */ + startedAt?: Date; + /** + * Test finish timestamp. + * + * Empty if the test has not been finished yet. + */ + finishedAt?: Date; + /** Indicates whether the test is finished. */ + isFinished: boolean; + /** Error message. */ + error: string; + /** + * Detected imbalance point. + * + * Contains information about a state at the moment it has been + * [auto-stopped](/docs/load-testing/concepts/auto-stop). + * + * Empty if no auto-stop occured. + */ + imbalancePoint?: ImbalancePoint; + /** ID of the agent that executed the test. */ + assignedAgentId: string; + /** + * Test output artifacts. + * + * Link to the artifacts output target containing `.log` and other files collected + * during test execution. + */ + artifacts?: FilePointer; +} + +const baseSummary: object = { + $type: "yandex.cloud.loadtesting.api.v1.test.Summary", + status: 0, + createdBy: "", + isFinished: false, + error: "", + assignedAgentId: "", +}; + +export const Summary = { + $type: "yandex.cloud.loadtesting.api.v1.test.Summary" as const, + + encode( + message: Summary, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(18).fork() + ).ldelim(); + } + if (message.createdBy !== "") { + writer.uint32(26).string(message.createdBy); + } + if (message.startedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.startedAt), + writer.uint32(34).fork() + ).ldelim(); + } + if (message.finishedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.finishedAt), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.isFinished === true) { + writer.uint32(48).bool(message.isFinished); + } + if (message.error !== "") { + writer.uint32(58).string(message.error); + } + if (message.imbalancePoint !== undefined) { + ImbalancePoint.encode( + message.imbalancePoint, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.assignedAgentId !== "") { + writer.uint32(74).string(message.assignedAgentId); + } + if (message.artifacts !== undefined) { + FilePointer.encode(message.artifacts, writer.uint32(82).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Summary { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSummary } as Summary; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.int32() as any; + break; + case 2: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 3: + message.createdBy = reader.string(); + break; + case 4: + message.startedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 5: + message.finishedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + message.isFinished = reader.bool(); + break; + case 7: + message.error = reader.string(); + break; + case 8: + message.imbalancePoint = ImbalancePoint.decode( + reader, + reader.uint32() + ); + break; + case 9: + message.assignedAgentId = reader.string(); + break; + case 10: + message.artifacts = FilePointer.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Summary { + const message = { ...baseSummary } as Summary; + message.status = + object.status !== undefined && object.status !== null + ? statusFromJSON(object.status) + : 0; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + message.startedAt = + object.startedAt !== undefined && object.startedAt !== null + ? fromJsonTimestamp(object.startedAt) + : undefined; + message.finishedAt = + object.finishedAt !== undefined && object.finishedAt !== null + ? fromJsonTimestamp(object.finishedAt) + : undefined; + message.isFinished = + object.isFinished !== undefined && object.isFinished !== null + ? Boolean(object.isFinished) + : false; + message.error = + object.error !== undefined && object.error !== null + ? String(object.error) + : ""; + message.imbalancePoint = + object.imbalancePoint !== undefined && object.imbalancePoint !== null + ? ImbalancePoint.fromJSON(object.imbalancePoint) + : undefined; + message.assignedAgentId = + object.assignedAgentId !== undefined && object.assignedAgentId !== null + ? String(object.assignedAgentId) + : ""; + message.artifacts = + object.artifacts !== undefined && object.artifacts !== null + ? FilePointer.fromJSON(object.artifacts) + : undefined; + return message; + }, + + toJSON(message: Summary): unknown { + const obj: any = {}; + message.status !== undefined && (obj.status = statusToJSON(message.status)); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + message.startedAt !== undefined && + (obj.startedAt = message.startedAt.toISOString()); + message.finishedAt !== undefined && + (obj.finishedAt = message.finishedAt.toISOString()); + message.isFinished !== undefined && (obj.isFinished = message.isFinished); + message.error !== undefined && (obj.error = message.error); + message.imbalancePoint !== undefined && + (obj.imbalancePoint = message.imbalancePoint + ? ImbalancePoint.toJSON(message.imbalancePoint) + : undefined); + message.assignedAgentId !== undefined && + (obj.assignedAgentId = message.assignedAgentId); + message.artifacts !== undefined && + (obj.artifacts = message.artifacts + ? FilePointer.toJSON(message.artifacts) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Summary { + const message = { ...baseSummary } as Summary; + message.status = object.status ?? 0; + message.createdAt = object.createdAt ?? undefined; + message.createdBy = object.createdBy ?? ""; + message.startedAt = object.startedAt ?? undefined; + message.finishedAt = object.finishedAt ?? undefined; + message.isFinished = object.isFinished ?? false; + message.error = object.error ?? ""; + message.imbalancePoint = + object.imbalancePoint !== undefined && object.imbalancePoint !== null + ? ImbalancePoint.fromPartial(object.imbalancePoint) + : undefined; + message.assignedAgentId = object.assignedAgentId ?? ""; + message.artifacts = + object.artifacts !== undefined && object.artifacts !== null + ? FilePointer.fromPartial(object.artifacts) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Summary.$type, Summary); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/test/test.ts b/src/generated/yandex/cloud/loadtesting/api/v1/test/test.ts new file mode 100644 index 00000000..b234210c --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/test/test.ts @@ -0,0 +1,193 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Details } from "../../../../../../yandex/cloud/loadtesting/api/v1/test/details"; +import { Summary } from "../../../../../../yandex/cloud/loadtesting/api/v1/test/summary"; +import { SingleAgentConfiguration } from "../../../../../../yandex/cloud/loadtesting/api/v1/test/single_agent_configuration"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1.test"; + +/** + * Load Test. + * + * In context of the service, Test represents a single testing task/job. + */ +export interface Test { + $type: "yandex.cloud.loadtesting.api.v1.test.Test"; + /** ID of the test. Generated at creation time. */ + id: string; + /** + * Configuration of the test. + * + * A test can have multiple configurations if it can be + * executed on multiple agents simultaneously. For more information, see + * [Load testing using multiple agents](docs/load-testing/tutorials/loadtesting-multiply). + */ + configurations: SingleAgentConfiguration[]; + /** Test meta information. Name, description, etc. */ + details?: Details; + /** Test execution information. */ + summary?: Summary; + /** ID of the folder that the test belongs to. */ + folderId: string; +} + +const baseTest: object = { + $type: "yandex.cloud.loadtesting.api.v1.test.Test", + id: "", + folderId: "", +}; + +export const Test = { + $type: "yandex.cloud.loadtesting.api.v1.test.Test" as const, + + encode(message: Test, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + for (const v of message.configurations) { + SingleAgentConfiguration.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.details !== undefined) { + Details.encode(message.details, writer.uint32(26).fork()).ldelim(); + } + if (message.summary !== undefined) { + Summary.encode(message.summary, writer.uint32(34).fork()).ldelim(); + } + if (message.folderId !== "") { + writer.uint32(42).string(message.folderId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Test { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTest } as Test; + message.configurations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.configurations.push( + SingleAgentConfiguration.decode(reader, reader.uint32()) + ); + break; + case 3: + message.details = Details.decode(reader, reader.uint32()); + break; + case 4: + message.summary = Summary.decode(reader, reader.uint32()); + break; + case 5: + message.folderId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Test { + const message = { ...baseTest } as Test; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.configurations = (object.configurations ?? []).map((e: any) => + SingleAgentConfiguration.fromJSON(e) + ); + message.details = + object.details !== undefined && object.details !== null + ? Details.fromJSON(object.details) + : undefined; + message.summary = + object.summary !== undefined && object.summary !== null + ? Summary.fromJSON(object.summary) + : undefined; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + return message; + }, + + toJSON(message: Test): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + if (message.configurations) { + obj.configurations = message.configurations.map((e) => + e ? SingleAgentConfiguration.toJSON(e) : undefined + ); + } else { + obj.configurations = []; + } + message.details !== undefined && + (obj.details = message.details + ? Details.toJSON(message.details) + : undefined); + message.summary !== undefined && + (obj.summary = message.summary + ? Summary.toJSON(message.summary) + : undefined); + message.folderId !== undefined && (obj.folderId = message.folderId); + return obj; + }, + + fromPartial, I>>(object: I): Test { + const message = { ...baseTest } as Test; + message.id = object.id ?? ""; + message.configurations = + object.configurations?.map((e) => + SingleAgentConfiguration.fromPartial(e) + ) || []; + message.details = + object.details !== undefined && object.details !== null + ? Details.fromPartial(object.details) + : undefined; + message.summary = + object.summary !== undefined && object.summary !== null + ? Summary.fromPartial(object.summary) + : undefined; + message.folderId = object.folderId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Test.$type, Test); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/api/v1/test_service.ts b/src/generated/yandex/cloud/loadtesting/api/v1/test_service.ts new file mode 100644 index 00000000..1a954093 --- /dev/null +++ b/src/generated/yandex/cloud/loadtesting/api/v1/test_service.ts @@ -0,0 +1,1023 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { Details } from "../../../../../yandex/cloud/loadtesting/api/v1/test/details"; +import { SingleAgentConfiguration } from "../../../../../yandex/cloud/loadtesting/api/v1/test/single_agent_configuration"; +import { Test } from "../../../../../yandex/cloud/loadtesting/api/v1/test/test"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.loadtesting.api.v1"; + +export interface CreateTestRequest { + $type: "yandex.cloud.loadtesting.api.v1.CreateTestRequest"; + /** ID of the folder to create a test in. */ + folderId: string; + /** + * Test configuration associated with agents on which they will be executed. + * In case of multiple configurations, a multitest will be created. + */ + configurations: SingleAgentConfiguration[]; + /** Test details. Name, tags etc. */ + testDetails?: Details; +} + +export interface CreateTestMetadata { + $type: "yandex.cloud.loadtesting.api.v1.CreateTestMetadata"; + /** ID of the test that is being created. */ + testId: string; +} + +export interface GetTestRequest { + $type: "yandex.cloud.loadtesting.api.v1.GetTestRequest"; + /** ID of the test to return. */ + testId: string; +} + +export interface StopTestRequest { + $type: "yandex.cloud.loadtesting.api.v1.StopTestRequest"; + /** ID of the test to stop. */ + testId: string; +} + +export interface StopTestMetadata { + $type: "yandex.cloud.loadtesting.api.v1.StopTestMetadata"; + /** ID of the test that is being stopped. */ + testId: string; +} + +export interface DeleteTestRequest { + $type: "yandex.cloud.loadtesting.api.v1.DeleteTestRequest"; + /** ID of the test to delete. */ + testId: string; +} + +export interface DeleteTestMetadata { + $type: "yandex.cloud.loadtesting.api.v1.DeleteTestMetadata"; + /** ID of the test that is being deleted. */ + testId: string; +} + +export interface ListTestsRequest { + $type: "yandex.cloud.loadtesting.api.v1.ListTestsRequest"; + /** ID of the folder to list tests in. */ + folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than `page_size`, the service returns a [ListTestsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * [ListTestsResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters tests listed in the response. + * + * The filter expression may contain multiple field expressions joined by `AND`. + * The field expression must specify: + * 1. The field name. + * 2. An operator: + * - `=`, `!=`, `<`, `<=`, `>`, `>=`, `CONTAINS`, `:` for single values. + * - `IN` or `NOT IN` for lists of values. + * 3. The value. String values must be encosed in `"`, boolean values are {`true`, `false`}, timestamp values in ISO-8601. + * + * Currently supported fields: + * - `id` [yandex.cloud.loadtesting.api.v1.test.Test.id] + * - operators: `=`, `!=`, `IN`, `NOT IN` + * - `details.name` [yandex.cloud.loadtesting.api.v1.test.Details.name] + * - operators: `=`, `!=`, `IN`, `NOT IN`, `CONTAINS` + * - `details.tags.` [yandex.cloud.loadtesting.api.v1.test.Details.tags] + * - operators: `:` + * - `summary.status` [yandex.cloud.loadtesting.api.v1.test.Summary.status] + * - operators: `=`, `!=`, `IN`, `NOT IN` + * - `summary.is_finished` [yandex.cloud.loadtesting.api.v1.test.Summary.is_finished] + * - operators: `=` + * - `summary.created_at` [yandex.cloud.loadtesting.api.v1.test.Summary.created_at] + * - operators: `<`, `<=`, `>`, `>=` + * - `summary.created_by` [yandex.cloud.loadtesting.api.v1.test.Summary.created_by] + * - operators: `=`, `!=`, `IN`, `NOT IN` + * + * Examples: + * - `summary.status IN ("DONE", "ERROR") AND details.tags.author:"yandex"` + * - `summary.is_finished = true AND details.name CONTAINS "nightly-test"` + */ + filter: string; +} + +export interface ListTestsResponse { + $type: "yandex.cloud.loadtesting.api.v1.ListTestsResponse"; + /** List of tests in the specified folder. */ + tests: Test[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListTestsRequest.page_size], use `next_page_token` as the value + * for the [ListTestsRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `next_page_token` to continue paging through the results. + */ + nextPageToken: string; +} + +const baseCreateTestRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.CreateTestRequest", + folderId: "", +}; + +export const CreateTestRequest = { + $type: "yandex.cloud.loadtesting.api.v1.CreateTestRequest" as const, + + encode( + message: CreateTestRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + for (const v of message.configurations) { + SingleAgentConfiguration.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.testDetails !== undefined) { + Details.encode(message.testDetails, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateTestRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateTestRequest } as CreateTestRequest; + message.configurations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.configurations.push( + SingleAgentConfiguration.decode(reader, reader.uint32()) + ); + break; + case 3: + message.testDetails = Details.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateTestRequest { + const message = { ...baseCreateTestRequest } as CreateTestRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.configurations = (object.configurations ?? []).map((e: any) => + SingleAgentConfiguration.fromJSON(e) + ); + message.testDetails = + object.testDetails !== undefined && object.testDetails !== null + ? Details.fromJSON(object.testDetails) + : undefined; + return message; + }, + + toJSON(message: CreateTestRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + if (message.configurations) { + obj.configurations = message.configurations.map((e) => + e ? SingleAgentConfiguration.toJSON(e) : undefined + ); + } else { + obj.configurations = []; + } + message.testDetails !== undefined && + (obj.testDetails = message.testDetails + ? Details.toJSON(message.testDetails) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateTestRequest { + const message = { ...baseCreateTestRequest } as CreateTestRequest; + message.folderId = object.folderId ?? ""; + message.configurations = + object.configurations?.map((e) => + SingleAgentConfiguration.fromPartial(e) + ) || []; + message.testDetails = + object.testDetails !== undefined && object.testDetails !== null + ? Details.fromPartial(object.testDetails) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CreateTestRequest.$type, CreateTestRequest); + +const baseCreateTestMetadata: object = { + $type: "yandex.cloud.loadtesting.api.v1.CreateTestMetadata", + testId: "", +}; + +export const CreateTestMetadata = { + $type: "yandex.cloud.loadtesting.api.v1.CreateTestMetadata" as const, + + encode( + message: CreateTestMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.testId !== "") { + writer.uint32(10).string(message.testId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateTestMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateTestMetadata } as CreateTestMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.testId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateTestMetadata { + const message = { ...baseCreateTestMetadata } as CreateTestMetadata; + message.testId = + object.testId !== undefined && object.testId !== null + ? String(object.testId) + : ""; + return message; + }, + + toJSON(message: CreateTestMetadata): unknown { + const obj: any = {}; + message.testId !== undefined && (obj.testId = message.testId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateTestMetadata { + const message = { ...baseCreateTestMetadata } as CreateTestMetadata; + message.testId = object.testId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateTestMetadata.$type, CreateTestMetadata); + +const baseGetTestRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.GetTestRequest", + testId: "", +}; + +export const GetTestRequest = { + $type: "yandex.cloud.loadtesting.api.v1.GetTestRequest" as const, + + encode( + message: GetTestRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.testId !== "") { + writer.uint32(10).string(message.testId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetTestRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetTestRequest } as GetTestRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.testId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetTestRequest { + const message = { ...baseGetTestRequest } as GetTestRequest; + message.testId = + object.testId !== undefined && object.testId !== null + ? String(object.testId) + : ""; + return message; + }, + + toJSON(message: GetTestRequest): unknown { + const obj: any = {}; + message.testId !== undefined && (obj.testId = message.testId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetTestRequest { + const message = { ...baseGetTestRequest } as GetTestRequest; + message.testId = object.testId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetTestRequest.$type, GetTestRequest); + +const baseStopTestRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.StopTestRequest", + testId: "", +}; + +export const StopTestRequest = { + $type: "yandex.cloud.loadtesting.api.v1.StopTestRequest" as const, + + encode( + message: StopTestRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.testId !== "") { + writer.uint32(10).string(message.testId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StopTestRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStopTestRequest } as StopTestRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.testId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StopTestRequest { + const message = { ...baseStopTestRequest } as StopTestRequest; + message.testId = + object.testId !== undefined && object.testId !== null + ? String(object.testId) + : ""; + return message; + }, + + toJSON(message: StopTestRequest): unknown { + const obj: any = {}; + message.testId !== undefined && (obj.testId = message.testId); + return obj; + }, + + fromPartial, I>>( + object: I + ): StopTestRequest { + const message = { ...baseStopTestRequest } as StopTestRequest; + message.testId = object.testId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StopTestRequest.$type, StopTestRequest); + +const baseStopTestMetadata: object = { + $type: "yandex.cloud.loadtesting.api.v1.StopTestMetadata", + testId: "", +}; + +export const StopTestMetadata = { + $type: "yandex.cloud.loadtesting.api.v1.StopTestMetadata" as const, + + encode( + message: StopTestMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.testId !== "") { + writer.uint32(10).string(message.testId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StopTestMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStopTestMetadata } as StopTestMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.testId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StopTestMetadata { + const message = { ...baseStopTestMetadata } as StopTestMetadata; + message.testId = + object.testId !== undefined && object.testId !== null + ? String(object.testId) + : ""; + return message; + }, + + toJSON(message: StopTestMetadata): unknown { + const obj: any = {}; + message.testId !== undefined && (obj.testId = message.testId); + return obj; + }, + + fromPartial, I>>( + object: I + ): StopTestMetadata { + const message = { ...baseStopTestMetadata } as StopTestMetadata; + message.testId = object.testId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StopTestMetadata.$type, StopTestMetadata); + +const baseDeleteTestRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.DeleteTestRequest", + testId: "", +}; + +export const DeleteTestRequest = { + $type: "yandex.cloud.loadtesting.api.v1.DeleteTestRequest" as const, + + encode( + message: DeleteTestRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.testId !== "") { + writer.uint32(10).string(message.testId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteTestRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteTestRequest } as DeleteTestRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.testId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteTestRequest { + const message = { ...baseDeleteTestRequest } as DeleteTestRequest; + message.testId = + object.testId !== undefined && object.testId !== null + ? String(object.testId) + : ""; + return message; + }, + + toJSON(message: DeleteTestRequest): unknown { + const obj: any = {}; + message.testId !== undefined && (obj.testId = message.testId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteTestRequest { + const message = { ...baseDeleteTestRequest } as DeleteTestRequest; + message.testId = object.testId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteTestRequest.$type, DeleteTestRequest); + +const baseDeleteTestMetadata: object = { + $type: "yandex.cloud.loadtesting.api.v1.DeleteTestMetadata", + testId: "", +}; + +export const DeleteTestMetadata = { + $type: "yandex.cloud.loadtesting.api.v1.DeleteTestMetadata" as const, + + encode( + message: DeleteTestMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.testId !== "") { + writer.uint32(10).string(message.testId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteTestMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteTestMetadata } as DeleteTestMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.testId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteTestMetadata { + const message = { ...baseDeleteTestMetadata } as DeleteTestMetadata; + message.testId = + object.testId !== undefined && object.testId !== null + ? String(object.testId) + : ""; + return message; + }, + + toJSON(message: DeleteTestMetadata): unknown { + const obj: any = {}; + message.testId !== undefined && (obj.testId = message.testId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteTestMetadata { + const message = { ...baseDeleteTestMetadata } as DeleteTestMetadata; + message.testId = object.testId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteTestMetadata.$type, DeleteTestMetadata); + +const baseListTestsRequest: object = { + $type: "yandex.cloud.loadtesting.api.v1.ListTestsRequest", + folderId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListTestsRequest = { + $type: "yandex.cloud.loadtesting.api.v1.ListTestsRequest" as const, + + encode( + message: ListTestsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListTestsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListTestsRequest } as ListTestsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListTestsRequest { + const message = { ...baseListTestsRequest } as ListTestsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListTestsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListTestsRequest { + const message = { ...baseListTestsRequest } as ListTestsRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListTestsRequest.$type, ListTestsRequest); + +const baseListTestsResponse: object = { + $type: "yandex.cloud.loadtesting.api.v1.ListTestsResponse", + nextPageToken: "", +}; + +export const ListTestsResponse = { + $type: "yandex.cloud.loadtesting.api.v1.ListTestsResponse" as const, + + encode( + message: ListTestsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.tests) { + Test.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListTestsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListTestsResponse } as ListTestsResponse; + message.tests = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tests.push(Test.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListTestsResponse { + const message = { ...baseListTestsResponse } as ListTestsResponse; + message.tests = (object.tests ?? []).map((e: any) => Test.fromJSON(e)); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListTestsResponse): unknown { + const obj: any = {}; + if (message.tests) { + obj.tests = message.tests.map((e) => (e ? Test.toJSON(e) : undefined)); + } else { + obj.tests = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListTestsResponse { + const message = { ...baseListTestsResponse } as ListTestsResponse; + message.tests = object.tests?.map((e) => Test.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListTestsResponse.$type, ListTestsResponse); + +/** A set of methods for managing tests. */ +export const TestServiceService = { + /** Creates (runs) a test in the specified folder. */ + create: { + path: "/yandex.cloud.loadtesting.api.v1.TestService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateTestRequest) => + Buffer.from(CreateTestRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateTestRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** + * Returns the specified test. + * + * To get the list of all available tests, make a [List] request. + */ + get: { + path: "/yandex.cloud.loadtesting.api.v1.TestService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetTestRequest) => + Buffer.from(GetTestRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetTestRequest.decode(value), + responseSerialize: (value: Test) => + Buffer.from(Test.encode(value).finish()), + responseDeserialize: (value: Buffer) => Test.decode(value), + }, + /** Stops the specified test. */ + stop: { + path: "/yandex.cloud.loadtesting.api.v1.TestService/Stop", + requestStream: false, + responseStream: false, + requestSerialize: (value: StopTestRequest) => + Buffer.from(StopTestRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => StopTestRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes specified tests. */ + delete: { + path: "/yandex.cloud.loadtesting.api.v1.TestService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteTestRequest) => + Buffer.from(DeleteTestRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteTestRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Retrieves the list of test in the specified folder. */ + list: { + path: "/yandex.cloud.loadtesting.api.v1.TestService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListTestsRequest) => + Buffer.from(ListTestsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListTestsRequest.decode(value), + responseSerialize: (value: ListTestsResponse) => + Buffer.from(ListTestsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListTestsResponse.decode(value), + }, +} as const; + +export interface TestServiceServer extends UntypedServiceImplementation { + /** Creates (runs) a test in the specified folder. */ + create: handleUnaryCall; + /** + * Returns the specified test. + * + * To get the list of all available tests, make a [List] request. + */ + get: handleUnaryCall; + /** Stops the specified test. */ + stop: handleUnaryCall; + /** Deletes specified tests. */ + delete: handleUnaryCall; + /** Retrieves the list of test in the specified folder. */ + list: handleUnaryCall; +} + +export interface TestServiceClient extends Client { + /** Creates (runs) a test in the specified folder. */ + create( + request: CreateTestRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateTestRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateTestRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** + * Returns the specified test. + * + * To get the list of all available tests, make a [List] request. + */ + get( + request: GetTestRequest, + callback: (error: ServiceError | null, response: Test) => void + ): ClientUnaryCall; + get( + request: GetTestRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Test) => void + ): ClientUnaryCall; + get( + request: GetTestRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Test) => void + ): ClientUnaryCall; + /** Stops the specified test. */ + stop( + request: StopTestRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + stop( + request: StopTestRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + stop( + request: StopTestRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes specified tests. */ + delete( + request: DeleteTestRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteTestRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteTestRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Retrieves the list of test in the specified folder. */ + list( + request: ListTestsRequest, + callback: (error: ServiceError | null, response: ListTestsResponse) => void + ): ClientUnaryCall; + list( + request: ListTestsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: ListTestsResponse) => void + ): ClientUnaryCall; + list( + request: ListTestsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: ListTestsResponse) => void + ): ClientUnaryCall; +} + +export const TestServiceClient = makeGenericClientConstructor( + TestServiceService, + "yandex.cloud.loadtesting.api.v1.TestService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): TestServiceClient; + service: typeof TestServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/loadtesting/index.ts b/src/generated/yandex/cloud/loadtesting/index.ts index 6478188a..7d3fe9c2 100644 --- a/src/generated/yandex/cloud/loadtesting/index.ts +++ b/src/generated/yandex/cloud/loadtesting/index.ts @@ -1,12 +1,36 @@ -export * as agent from './agent/v1/agent' -export * as agent_agent_registration_service from './agent/v1/agent_registration_service' -export * as agent_service from './agent/v1/agent_service' -export * as agent_job_service from './agent/v1/job_service' -export * as agent_monitoring_service from './agent/v1/monitoring_service' -export * as agent_test from './agent/v1/test' -export * as agent_test_service from './agent/v1/test_service' -export * as agent_trail_service from './agent/v1/trail_service' -export * as api_agent_service from './api/v1/agent_service' -export * as api_agent from './api/v1/agent/agent' -export * as api_create_compute_instance from './api/v1/agent/create_compute_instance' -export * as api_status from './api/v1/agent/status' \ No newline at end of file +export * as agent_v1_agent from './agent/v1/agent' +export * as agent_v1_agent_registration_service from './agent/v1/agent_registration_service' +export * as agent_v1_agent_service from './agent/v1/agent_service' +export * as agent_v1_job_service from './agent/v1/job_service' +export * as agent_v1_monitoring_service from './agent/v1/monitoring_service' +export * as agent_v1_test from './agent/v1/test' +export * as agent_v1_test_service from './agent/v1/test_service' +export * as agent_v1_trail_service from './agent/v1/trail_service' +export * as api_v1_agent_service from './api/v1/agent_service' +export * as api_v1_config_service from './api/v1/config_service' +export * as api_v1_regression_dashboard_service from './api/v1/regression_dashboard_service' +export * as api_v1_report_service from './api/v1/report_service' +export * as api_v1_test_service from './api/v1/test_service' +export * as api_v1_agent_agent from './api/v1/agent/agent' +export * as api_v1_agent_create_compute_instance from './api/v1/agent/create_compute_instance' +export * as api_v1_agent_log_settings from './api/v1/agent/log_settings' +export * as api_v1_agent_status from './api/v1/agent/status' +export * as api_v1_common_quantiles from './api/v1/common/quantiles' +export * as api_v1_common_tag from './api/v1/common/tag' +export * as api_v1_config_config from './api/v1/config/config' +export * as api_v1_regression_dashboard from './api/v1/regression/dashboard' +export * as api_v1_regression_widget from './api/v1/regression/widget' +export * as api_v1_report_kpi from './api/v1/report/kpi' +export * as api_v1_report_kpi_value from './api/v1/report/kpi_value' +export * as api_v1_report_status from './api/v1/report/status' +export * as api_v1_test_agent_selector from './api/v1/test/agent_selector' +export * as api_v1_test_artifact_settings from './api/v1/test/artifact_settings' +export * as api_v1_test_details from './api/v1/test/details' +export * as api_v1_test_file_pointer from './api/v1/test/file_pointer' +export * as api_v1_test_imbalance_point from './api/v1/test/imbalance_point' +export * as api_v1_test_object_storage from './api/v1/test/object_storage' +export * as api_v1_test_single_agent_configuration from './api/v1/test/single_agent_configuration' +export * as api_v1_test_status from './api/v1/test/status' +export * as api_v1_test_summary from './api/v1/test/summary' +export * as api_v1_test_test from './api/v1/test/test' +export * as api_v1_report_table_report from './api/v1/report/table/report' \ No newline at end of file diff --git a/src/generated/yandex/cloud/lockbox/index.ts b/src/generated/yandex/cloud/lockbox/index.ts index f80cf698..cd297404 100644 --- a/src/generated/yandex/cloud/lockbox/index.ts +++ b/src/generated/yandex/cloud/lockbox/index.ts @@ -1,4 +1,4 @@ -export * as payload from './v1/payload' -export * as payload_service from './v1/payload_service' -export * as secret from './v1/secret' -export * as secret_service from './v1/secret_service' \ No newline at end of file +export * as v1_payload from './v1/payload' +export * as v1_payload_service from './v1/payload_service' +export * as v1_secret from './v1/secret' +export * as v1_secret_service from './v1/secret_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/lockbox/v1/secret.ts b/src/generated/yandex/cloud/lockbox/v1/secret.ts index 9433a72c..54721d49 100644 --- a/src/generated/yandex/cloud/lockbox/v1/secret.ts +++ b/src/generated/yandex/cloud/lockbox/v1/secret.ts @@ -3,6 +3,7 @@ import { messageTypeRegistry } from "../../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { BoolValue } from "../../../../google/protobuf/wrappers"; export const protobufPackage = "yandex.cloud.lockbox.v1"; @@ -29,6 +30,7 @@ export interface Secret { currentVersion?: Version; /** Flag that inhibits deletion of the secret. */ deletionProtection: boolean; + passwordPayloadSpecification?: PasswordPayloadSpecification | undefined; } export enum Secret_Status { @@ -111,6 +113,7 @@ export interface Version { status: Version_Status; /** Keys of the entries contained in the version payload. */ payloadEntryKeys: string[]; + passwordPayloadSpecification?: PasswordPayloadSpecification | undefined; } export enum Version_Status { @@ -163,6 +166,33 @@ export function version_StatusToJSON(object: Version_Status): string { } } +export interface PasswordPayloadSpecification { + $type: "yandex.cloud.lockbox.v1.PasswordPayloadSpecification"; + /** key of the entry to store generated password value */ + passwordKey: string; + /** password length; by default, a reasonable length will be decided */ + length: number; + /** whether at least one A..Z character is included in the password, true by default */ + includeUppercase?: boolean; + /** whether at least one a..z character is included in the password, true by default */ + includeLowercase?: boolean; + /** whether at least one 0..9 character is included in the password, true by default */ + includeDigits?: boolean; + /** + * whether at least one punctuation character is included in the password, true by default + * punctuation characters by default (there are 32): !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ + * to customize the punctuation characters, see included_punctuation and excluded_punctuation below + */ + includePunctuation?: boolean; + /** + * If include_punctuation is true, one of these two fields (not both) may be used optionally to customize the punctuation: + * a string of specific punctuation characters to use (at most, all the 32) + */ + includedPunctuation: string; + /** a string of punctuation characters to exclude from the default (at most 31, it's not allowed to exclude all the 32) */ + excludedPunctuation: string; +} + const baseSecret: object = { $type: "yandex.cloud.lockbox.v1.Secret", id: "", @@ -221,6 +251,12 @@ export const Secret = { if (message.deletionProtection === true) { writer.uint32(80).bool(message.deletionProtection); } + if (message.passwordPayloadSpecification !== undefined) { + PasswordPayloadSpecification.encode( + message.passwordPayloadSpecification, + writer.uint32(90).fork() + ).ldelim(); + } return writer; }, @@ -267,6 +303,10 @@ export const Secret = { case 10: message.deletionProtection = reader.bool(); break; + case 11: + message.passwordPayloadSpecification = + PasswordPayloadSpecification.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -318,6 +358,13 @@ export const Secret = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : false; + message.passwordPayloadSpecification = + object.passwordPayloadSpecification !== undefined && + object.passwordPayloadSpecification !== null + ? PasswordPayloadSpecification.fromJSON( + object.passwordPayloadSpecification + ) + : undefined; return message; }, @@ -345,6 +392,12 @@ export const Secret = { : undefined); message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + message.passwordPayloadSpecification !== undefined && + (obj.passwordPayloadSpecification = message.passwordPayloadSpecification + ? PasswordPayloadSpecification.toJSON( + message.passwordPayloadSpecification + ) + : undefined); return obj; }, @@ -370,6 +423,13 @@ export const Secret = { ? Version.fromPartial(object.currentVersion) : undefined; message.deletionProtection = object.deletionProtection ?? false; + message.passwordPayloadSpecification = + object.passwordPayloadSpecification !== undefined && + object.passwordPayloadSpecification !== null + ? PasswordPayloadSpecification.fromPartial( + object.passwordPayloadSpecification + ) + : undefined; return message; }, }; @@ -492,6 +552,12 @@ export const Version = { for (const v of message.payloadEntryKeys) { writer.uint32(58).string(v!); } + if (message.passwordPayloadSpecification !== undefined) { + PasswordPayloadSpecification.encode( + message.passwordPayloadSpecification, + writer.uint32(66).fork() + ).ldelim(); + } return writer; }, @@ -528,6 +594,10 @@ export const Version = { case 7: message.payloadEntryKeys.push(reader.string()); break; + case 8: + message.passwordPayloadSpecification = + PasswordPayloadSpecification.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -563,6 +633,13 @@ export const Version = { message.payloadEntryKeys = (object.payloadEntryKeys ?? []).map((e: any) => String(e) ); + message.passwordPayloadSpecification = + object.passwordPayloadSpecification !== undefined && + object.passwordPayloadSpecification !== null + ? PasswordPayloadSpecification.fromJSON( + object.passwordPayloadSpecification + ) + : undefined; return message; }, @@ -583,6 +660,12 @@ export const Version = { } else { obj.payloadEntryKeys = []; } + message.passwordPayloadSpecification !== undefined && + (obj.passwordPayloadSpecification = message.passwordPayloadSpecification + ? PasswordPayloadSpecification.toJSON( + message.passwordPayloadSpecification + ) + : undefined); return obj; }, @@ -595,12 +678,234 @@ export const Version = { message.description = object.description ?? ""; message.status = object.status ?? 0; message.payloadEntryKeys = object.payloadEntryKeys?.map((e) => e) || []; + message.passwordPayloadSpecification = + object.passwordPayloadSpecification !== undefined && + object.passwordPayloadSpecification !== null + ? PasswordPayloadSpecification.fromPartial( + object.passwordPayloadSpecification + ) + : undefined; return message; }, }; messageTypeRegistry.set(Version.$type, Version); +const basePasswordPayloadSpecification: object = { + $type: "yandex.cloud.lockbox.v1.PasswordPayloadSpecification", + passwordKey: "", + length: 0, + includedPunctuation: "", + excludedPunctuation: "", +}; + +export const PasswordPayloadSpecification = { + $type: "yandex.cloud.lockbox.v1.PasswordPayloadSpecification" as const, + + encode( + message: PasswordPayloadSpecification, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.passwordKey !== "") { + writer.uint32(10).string(message.passwordKey); + } + if (message.length !== 0) { + writer.uint32(16).int64(message.length); + } + if (message.includeUppercase !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.includeUppercase!, + }, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.includeLowercase !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.includeLowercase!, + }, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.includeDigits !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.includeDigits! }, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.includePunctuation !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.includePunctuation!, + }, + writer.uint32(50).fork() + ).ldelim(); + } + if (message.includedPunctuation !== "") { + writer.uint32(58).string(message.includedPunctuation); + } + if (message.excludedPunctuation !== "") { + writer.uint32(66).string(message.excludedPunctuation); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PasswordPayloadSpecification { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePasswordPayloadSpecification, + } as PasswordPayloadSpecification; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.passwordKey = reader.string(); + break; + case 2: + message.length = longToNumber(reader.int64() as Long); + break; + case 3: + message.includeUppercase = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 4: + message.includeLowercase = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 5: + message.includeDigits = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 6: + message.includePunctuation = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 7: + message.includedPunctuation = reader.string(); + break; + case 8: + message.excludedPunctuation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PasswordPayloadSpecification { + const message = { + ...basePasswordPayloadSpecification, + } as PasswordPayloadSpecification; + message.passwordKey = + object.passwordKey !== undefined && object.passwordKey !== null + ? String(object.passwordKey) + : ""; + message.length = + object.length !== undefined && object.length !== null + ? Number(object.length) + : 0; + message.includeUppercase = + object.includeUppercase !== undefined && object.includeUppercase !== null + ? Boolean(object.includeUppercase) + : undefined; + message.includeLowercase = + object.includeLowercase !== undefined && object.includeLowercase !== null + ? Boolean(object.includeLowercase) + : undefined; + message.includeDigits = + object.includeDigits !== undefined && object.includeDigits !== null + ? Boolean(object.includeDigits) + : undefined; + message.includePunctuation = + object.includePunctuation !== undefined && + object.includePunctuation !== null + ? Boolean(object.includePunctuation) + : undefined; + message.includedPunctuation = + object.includedPunctuation !== undefined && + object.includedPunctuation !== null + ? String(object.includedPunctuation) + : ""; + message.excludedPunctuation = + object.excludedPunctuation !== undefined && + object.excludedPunctuation !== null + ? String(object.excludedPunctuation) + : ""; + return message; + }, + + toJSON(message: PasswordPayloadSpecification): unknown { + const obj: any = {}; + message.passwordKey !== undefined && + (obj.passwordKey = message.passwordKey); + message.length !== undefined && (obj.length = Math.round(message.length)); + message.includeUppercase !== undefined && + (obj.includeUppercase = message.includeUppercase); + message.includeLowercase !== undefined && + (obj.includeLowercase = message.includeLowercase); + message.includeDigits !== undefined && + (obj.includeDigits = message.includeDigits); + message.includePunctuation !== undefined && + (obj.includePunctuation = message.includePunctuation); + message.includedPunctuation !== undefined && + (obj.includedPunctuation = message.includedPunctuation); + message.excludedPunctuation !== undefined && + (obj.excludedPunctuation = message.excludedPunctuation); + return obj; + }, + + fromPartial, I>>( + object: I + ): PasswordPayloadSpecification { + const message = { + ...basePasswordPayloadSpecification, + } as PasswordPayloadSpecification; + message.passwordKey = object.passwordKey ?? ""; + message.length = object.length ?? 0; + message.includeUppercase = object.includeUppercase ?? undefined; + message.includeLowercase = object.includeLowercase ?? undefined; + message.includeDigits = object.includeDigits ?? undefined; + message.includePunctuation = object.includePunctuation ?? undefined; + message.includedPunctuation = object.includedPunctuation ?? ""; + message.excludedPunctuation = object.excludedPunctuation ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + PasswordPayloadSpecification.$type, + PasswordPayloadSpecification +); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + type Builtin = | Date | Function @@ -650,6 +955,13 @@ function fromJsonTimestamp(o: any): Date { } } +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/src/generated/yandex/cloud/lockbox/v1/secret_service.ts b/src/generated/yandex/cloud/lockbox/v1/secret_service.ts index 07f712bd..988f7884 100644 --- a/src/generated/yandex/cloud/lockbox/v1/secret_service.ts +++ b/src/generated/yandex/cloud/lockbox/v1/secret_service.ts @@ -17,7 +17,11 @@ import _m0 from "protobufjs/minimal"; import { FieldMask } from "../../../../google/protobuf/field_mask"; import { Duration } from "../../../../google/protobuf/duration"; import { Timestamp } from "../../../../google/protobuf/timestamp"; -import { Secret, Version } from "../../../../yandex/cloud/lockbox/v1/secret"; +import { + Secret, + PasswordPayloadSpecification, + Version, +} from "../../../../yandex/cloud/lockbox/v1/secret"; import { Operation } from "../../../../yandex/cloud/operation/operation"; import { ListAccessBindingsRequest, @@ -101,6 +105,7 @@ export interface CreateSecretRequest { versionPayloadEntries: PayloadEntryChange[]; /** Flag that inhibits deletion of the secret. */ deletionProtection: boolean; + passwordPayloadSpecification?: PasswordPayloadSpecification | undefined; } export interface CreateSecretRequest_LabelsEntry { @@ -131,6 +136,7 @@ export interface UpdateSecretRequest { labels: { [key: string]: string }; /** Flag that inhibits deletion of the secret. */ deletionProtection: boolean; + passwordPayloadSpecification?: PasswordPayloadSpecification | undefined; } export interface UpdateSecretRequest_LabelsEntry { @@ -671,6 +677,12 @@ export const CreateSecretRequest = { if (message.deletionProtection === true) { writer.uint32(64).bool(message.deletionProtection); } + if (message.passwordPayloadSpecification !== undefined) { + PasswordPayloadSpecification.encode( + message.passwordPayloadSpecification, + writer.uint32(74).fork() + ).ldelim(); + } return writer; }, @@ -715,6 +727,10 @@ export const CreateSecretRequest = { case 8: message.deletionProtection = reader.bool(); break; + case 9: + message.passwordPayloadSpecification = + PasswordPayloadSpecification.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -760,6 +776,13 @@ export const CreateSecretRequest = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : false; + message.passwordPayloadSpecification = + object.passwordPayloadSpecification !== undefined && + object.passwordPayloadSpecification !== null + ? PasswordPayloadSpecification.fromJSON( + object.passwordPayloadSpecification + ) + : undefined; return message; }, @@ -787,6 +810,12 @@ export const CreateSecretRequest = { } message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + message.passwordPayloadSpecification !== undefined && + (obj.passwordPayloadSpecification = message.passwordPayloadSpecification + ? PasswordPayloadSpecification.toJSON( + message.passwordPayloadSpecification + ) + : undefined); return obj; }, @@ -812,6 +841,13 @@ export const CreateSecretRequest = { PayloadEntryChange.fromPartial(e) ) || []; message.deletionProtection = object.deletionProtection ?? false; + message.passwordPayloadSpecification = + object.passwordPayloadSpecification !== undefined && + object.passwordPayloadSpecification !== null + ? PasswordPayloadSpecification.fromPartial( + object.passwordPayloadSpecification + ) + : undefined; return message; }, }; @@ -1021,6 +1057,12 @@ export const UpdateSecretRequest = { if (message.deletionProtection === true) { writer.uint32(48).bool(message.deletionProtection); } + if (message.passwordPayloadSpecification !== undefined) { + PasswordPayloadSpecification.encode( + message.passwordPayloadSpecification, + writer.uint32(58).fork() + ).ldelim(); + } return writer; }, @@ -1056,6 +1098,10 @@ export const UpdateSecretRequest = { case 6: message.deletionProtection = reader.bool(); break; + case 7: + message.passwordPayloadSpecification = + PasswordPayloadSpecification.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1093,6 +1139,13 @@ export const UpdateSecretRequest = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : false; + message.passwordPayloadSpecification = + object.passwordPayloadSpecification !== undefined && + object.passwordPayloadSpecification !== null + ? PasswordPayloadSpecification.fromJSON( + object.passwordPayloadSpecification + ) + : undefined; return message; }, @@ -1114,6 +1167,12 @@ export const UpdateSecretRequest = { } message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + message.passwordPayloadSpecification !== undefined && + (obj.passwordPayloadSpecification = message.passwordPayloadSpecification + ? PasswordPayloadSpecification.toJSON( + message.passwordPayloadSpecification + ) + : undefined); return obj; }, @@ -1137,6 +1196,13 @@ export const UpdateSecretRequest = { return acc; }, {}); message.deletionProtection = object.deletionProtection ?? false; + message.passwordPayloadSpecification = + object.passwordPayloadSpecification !== undefined && + object.passwordPayloadSpecification !== null + ? PasswordPayloadSpecification.fromPartial( + object.passwordPayloadSpecification + ) + : undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/logging/index.ts b/src/generated/yandex/cloud/logging/index.ts index 56cf6eae..a03c7b88 100644 --- a/src/generated/yandex/cloud/logging/index.ts +++ b/src/generated/yandex/cloud/logging/index.ts @@ -1,10 +1,10 @@ -export * as export from './v1/export' -export * as export_service from './v1/export_service' -export * as log_entry from './v1/log_entry' -export * as log_group from './v1/log_group' -export * as log_group_service from './v1/log_group_service' -export * as log_ingestion_service from './v1/log_ingestion_service' -export * as log_reading_service from './v1/log_reading_service' -export * as log_resource from './v1/log_resource' -export * as sink from './v1/sink' -export * as sink_service from './v1/sink_service' \ No newline at end of file +export * as v1_export from './v1/export' +export * as v1_export_service from './v1/export_service' +export * as v1_log_entry from './v1/log_entry' +export * as v1_log_group from './v1/log_group' +export * as v1_log_group_service from './v1/log_group_service' +export * as v1_log_ingestion_service from './v1/log_ingestion_service' +export * as v1_log_reading_service from './v1/log_reading_service' +export * as v1_log_resource from './v1/log_resource' +export * as v1_sink from './v1/sink' +export * as v1_sink_service from './v1/sink_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/logging/v1/export.ts b/src/generated/yandex/cloud/logging/v1/export.ts index baf06e34..b020d65c 100644 --- a/src/generated/yandex/cloud/logging/v1/export.ts +++ b/src/generated/yandex/cloud/logging/v1/export.ts @@ -2,6 +2,7 @@ import { messageTypeRegistry } from "../../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; import { LogLevel_Level, logLevel_LevelFromJSON, @@ -10,6 +11,36 @@ import { export const protobufPackage = "yandex.cloud.logging.v1"; +export interface Export { + $type: "yandex.cloud.logging.v1.Export"; + /** Export ID. */ + id: string; + /** Export folder ID. */ + folderId: string; + /** Export cloud ID. */ + cloudId: string; + /** Export creation time. */ + createdAt?: Date; + /** Export name. */ + name: string; + /** Export description. */ + description: string; + /** Export lables. */ + labels: { [key: string]: string }; + /** Group logs are exported from. */ + groupId: string; + /** Sink logs are exported to. */ + sinkId: string; + /** Parameters of logs filtration. */ + params?: ExportParams; +} + +export interface Export_LabelsEntry { + $type: "yandex.cloud.logging.v1.Export.LabelsEntry"; + key: string; + value: string; +} + export interface ExportParams { $type: "yandex.cloud.logging.v1.ExportParams"; resourceTypes: string[]; @@ -19,6 +50,289 @@ export interface ExportParams { filter: string; } +const baseExport: object = { + $type: "yandex.cloud.logging.v1.Export", + id: "", + folderId: "", + cloudId: "", + name: "", + description: "", + groupId: "", + sinkId: "", +}; + +export const Export = { + $type: "yandex.cloud.logging.v1.Export" as const, + + encode( + message: Export, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.cloudId !== "") { + writer.uint32(26).string(message.cloudId); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(34).fork() + ).ldelim(); + } + if (message.name !== "") { + writer.uint32(42).string(message.name); + } + if (message.description !== "") { + writer.uint32(50).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + Export_LabelsEntry.encode( + { + $type: "yandex.cloud.logging.v1.Export.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(58).fork() + ).ldelim(); + }); + if (message.groupId !== "") { + writer.uint32(66).string(message.groupId); + } + if (message.sinkId !== "") { + writer.uint32(74).string(message.sinkId); + } + if (message.params !== undefined) { + ExportParams.encode(message.params, writer.uint32(82).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Export { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExport } as Export; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.cloudId = reader.string(); + break; + case 4: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 5: + message.name = reader.string(); + break; + case 6: + message.description = reader.string(); + break; + case 7: + const entry7 = Export_LabelsEntry.decode(reader, reader.uint32()); + if (entry7.value !== undefined) { + message.labels[entry7.key] = entry7.value; + } + break; + case 8: + message.groupId = reader.string(); + break; + case 9: + message.sinkId = reader.string(); + break; + case 10: + message.params = ExportParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Export { + const message = { ...baseExport } as Export; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.cloudId = + object.cloudId !== undefined && object.cloudId !== null + ? String(object.cloudId) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.groupId = + object.groupId !== undefined && object.groupId !== null + ? String(object.groupId) + : ""; + message.sinkId = + object.sinkId !== undefined && object.sinkId !== null + ? String(object.sinkId) + : ""; + message.params = + object.params !== undefined && object.params !== null + ? ExportParams.fromJSON(object.params) + : undefined; + return message; + }, + + toJSON(message: Export): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.cloudId !== undefined && (obj.cloudId = message.cloudId); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.groupId !== undefined && (obj.groupId = message.groupId); + message.sinkId !== undefined && (obj.sinkId = message.sinkId); + message.params !== undefined && + (obj.params = message.params + ? ExportParams.toJSON(message.params) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Export { + const message = { ...baseExport } as Export; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.cloudId = object.cloudId ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.groupId = object.groupId ?? ""; + message.sinkId = object.sinkId ?? ""; + message.params = + object.params !== undefined && object.params !== null + ? ExportParams.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Export.$type, Export); + +const baseExport_LabelsEntry: object = { + $type: "yandex.cloud.logging.v1.Export.LabelsEntry", + key: "", + value: "", +}; + +export const Export_LabelsEntry = { + $type: "yandex.cloud.logging.v1.Export.LabelsEntry" as const, + + encode( + message: Export_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Export_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExport_LabelsEntry } as Export_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Export_LabelsEntry { + const message = { ...baseExport_LabelsEntry } as Export_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Export_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Export_LabelsEntry { + const message = { ...baseExport_LabelsEntry } as Export_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Export_LabelsEntry.$type, Export_LabelsEntry); + const baseExportParams: object = { $type: "yandex.cloud.logging.v1.ExportParams", resourceTypes: "", @@ -181,6 +495,28 @@ export type Exact = P extends Builtin never >; +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/src/generated/yandex/cloud/logging/v1/export_service.ts b/src/generated/yandex/cloud/logging/v1/export_service.ts index 52654780..b4ee26bb 100644 --- a/src/generated/yandex/cloud/logging/v1/export_service.ts +++ b/src/generated/yandex/cloud/logging/v1/export_service.ts @@ -14,9 +14,19 @@ import { ServiceError, } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; -import { ExportParams } from "../../../../yandex/cloud/logging/v1/export"; +import { + ExportParams, + Export, +} from "../../../../yandex/cloud/logging/v1/export"; +import { FieldMask } from "../../../../google/protobuf/field_mask"; import { Timestamp } from "../../../../google/protobuf/timestamp"; import { Operation } from "../../../../yandex/cloud/operation/operation"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../yandex/cloud/access/access"; export const protobufPackage = "yandex.cloud.logging.v1"; @@ -47,6 +57,202 @@ export interface RunExportMetadata { resultFilename: string; } +export interface GetExportRequest { + $type: "yandex.cloud.logging.v1.GetExportRequest"; + /** + * ID of the export to return. + * + * To get a export ID make a [ExportService.List] request. + */ + exportId: string; +} + +export interface ListExportsRequest { + $type: "yandex.cloud.logging.v1.ListExportsRequest"; + /** + * Folder ID of the exports to return. + * + * To get a folder ID make a [yandex.cloud.resourcemanager.v1.FolderService.List] request. + */ + folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than `page_size`, the service returns a [ListExportssResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * [ListExportsResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters exports listed in the response. + * + * The expression must specify: + * 1. The field name. Currently filtering can only be applied to the [Export.name] field. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. + * Example of a filter: `name="my-export"`. + */ + filter: string; +} + +export interface ListExportsResponse { + $type: "yandex.cloud.logging.v1.ListExportsResponse"; + /** List of exports in the specified folder. */ + exports: Export[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListExportsRequest.page_size], use `next_page_token` as the value + * for the [ListExportsRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `next_page_token` to continue paging through the results. + */ + nextPageToken: string; +} + +export interface CreateExportRequest { + $type: "yandex.cloud.logging.v1.CreateExportRequest"; + /** + * ID of the folder to create a export in. + * + * To get a folder ID make a [yandex.cloud.resourcemanager.v1.FolderService.List] request. + */ + folderId: string; + /** + * Name of the export. + * The name must be unique within the folder. + */ + name: string; + /** Description of the export. */ + description: string; + /** Export labels as `key:value` pairs. */ + labels: { [key: string]: string }; + /** Logging Group ID logs exported from */ + groupId: string; + /** Logging Sink ID logs exported to */ + sinkId: string; + /** Parameters for logs filtration */ + params?: ExportParams; +} + +export interface CreateExportRequest_LabelsEntry { + $type: "yandex.cloud.logging.v1.CreateExportRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface CreateExportMetadata { + $type: "yandex.cloud.logging.v1.CreateExportMetadata"; + /** ID of the export being created. */ + exportId: string; +} + +export interface UpdateExportRequest { + $type: "yandex.cloud.logging.v1.UpdateExportRequest"; + /** + * ID of the export to update. + * + * To get a export ID make a [ExportService.List] request. + */ + exportId: string; + /** Field mask that specifies which attributes of the function should be updated. */ + updateMask?: FieldMask; + /** + * New name of the export. + * The name must be unique within the folder. + */ + name: string; + /** New Description of the export. */ + description: string; + /** New export labels as `key:value` pairs. */ + labels: { [key: string]: string }; + /** New logging Group ID logs exported from */ + groupId: string; + /** New logging Sink ID logs exported to */ + sinkId: string; + /** New parameters for logs filtration */ + params?: ExportParams; +} + +export interface UpdateExportRequest_LabelsEntry { + $type: "yandex.cloud.logging.v1.UpdateExportRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateExportMetadata { + $type: "yandex.cloud.logging.v1.UpdateExportMetadata"; + /** ID of the export being updated. */ + exportId: string; +} + +export interface DeleteExportRequest { + $type: "yandex.cloud.logging.v1.DeleteExportRequest"; + /** + * ID of the export to delete. + * + * To get a export ID make a [ExportService.List] request. + */ + exportId: string; +} + +export interface DeleteExportMetadata { + $type: "yandex.cloud.logging.v1.DeleteExportMetadata"; + /** ID of the export being deleted. */ + exportId: string; +} + +export interface ListExportOperationsRequest { + $type: "yandex.cloud.logging.v1.ListExportOperationsRequest"; + /** + * ID of the export to list operations for. + * + * To get a export ID make a [ExportService.List] request. + */ + exportId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than `page_size`, the service returns a [ListExportOperationsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * [ListExportOperationsResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters resources listed in the response. + * + * The expression must specify: + * 1. The field name. Currently filtering can be applied to the [operation.Operation.description], [operation.Operation.created_at], [operation.Operation.modified_at], [operation.Operation.created_by], [operation.Operation.done] fields. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. + * Examples of a filter: `done=false`, `created_by='John.Doe'`. + */ + filter: string; +} + +export interface ListExportOperationsResponse { + $type: "yandex.cloud.logging.v1.ListExportOperationsResponse"; + /** List of operations for the specified export. */ + operations: Operation[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListOExportperationsRequest.page_size], use `next_page_token` as the value + * for the [ListExportOperationsRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `next_page_token` to continue paging through the results. + */ + nextPageToken: string; +} + const baseRunExportRequest: object = { $type: "yandex.cloud.logging.v1.RunExportRequest", groupId: "", @@ -418,101 +624,1688 @@ export const RunExportMetadata = { messageTypeRegistry.set(RunExportMetadata.$type, RunExportMetadata); -export const ExportServiceService = { - run: { - path: "/yandex.cloud.logging.v1.ExportService/Run", - requestStream: false, - responseStream: false, - requestSerialize: (value: RunExportRequest) => - Buffer.from(RunExportRequest.encode(value).finish()), - requestDeserialize: (value: Buffer) => RunExportRequest.decode(value), - responseSerialize: (value: Operation) => - Buffer.from(Operation.encode(value).finish()), - responseDeserialize: (value: Buffer) => Operation.decode(value), +const baseGetExportRequest: object = { + $type: "yandex.cloud.logging.v1.GetExportRequest", + exportId: "", +}; + +export const GetExportRequest = { + $type: "yandex.cloud.logging.v1.GetExportRequest" as const, + + encode( + message: GetExportRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.exportId !== "") { + writer.uint32(10).string(message.exportId); + } + return writer; }, -} as const; -export interface ExportServiceServer extends UntypedServiceImplementation { - run: handleUnaryCall; -} + decode(input: _m0.Reader | Uint8Array, length?: number): GetExportRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetExportRequest } as GetExportRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exportId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, -export interface ExportServiceClient extends Client { - run( - request: RunExportRequest, - callback: (error: ServiceError | null, response: Operation) => void - ): ClientUnaryCall; - run( - request: RunExportRequest, - metadata: Metadata, - callback: (error: ServiceError | null, response: Operation) => void - ): ClientUnaryCall; - run( - request: RunExportRequest, - metadata: Metadata, - options: Partial, - callback: (error: ServiceError | null, response: Operation) => void - ): ClientUnaryCall; -} + fromJSON(object: any): GetExportRequest { + const message = { ...baseGetExportRequest } as GetExportRequest; + message.exportId = + object.exportId !== undefined && object.exportId !== null + ? String(object.exportId) + : ""; + return message; + }, -export const ExportServiceClient = makeGenericClientConstructor( - ExportServiceService, - "yandex.cloud.logging.v1.ExportService" -) as unknown as { - new ( - address: string, - credentials: ChannelCredentials, - options?: Partial - ): ExportServiceClient; - service: typeof ExportServiceService; + toJSON(message: GetExportRequest): unknown { + const obj: any = {}; + message.exportId !== undefined && (obj.exportId = message.exportId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetExportRequest { + const message = { ...baseGetExportRequest } as GetExportRequest; + message.exportId = object.exportId ?? ""; + return message; + }, }; -type Builtin = - | Date - | Function - | Uint8Array - | string - | number - | boolean - | undefined; +messageTypeRegistry.set(GetExportRequest.$type, GetExportRequest); -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in Exclude]?: DeepPartial } - : Partial; +const baseListExportsRequest: object = { + $type: "yandex.cloud.logging.v1.ListExportsRequest", + folderId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude | "$type">, - never - >; +export const ListExportsRequest = { + $type: "yandex.cloud.logging.v1.ListExportsRequest" as const, -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { $type: "google.protobuf.Timestamp", seconds, nanos }; -} + encode( + message: ListExportsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(24).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(34).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(42).string(message.filter); + } + return writer; + }, -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} + decode(input: _m0.Reader | Uint8Array, length?: number): ListExportsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListExportsRequest } as ListExportsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 3: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 4: + message.pageToken = reader.string(); + break; + case 5: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, -function fromJsonTimestamp(o: any): Date { - if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); - } else { - return fromTimestamp(Timestamp.fromJSON(o)); + fromJSON(object: any): ListExportsRequest { + const message = { ...baseListExportsRequest } as ListExportsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListExportsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListExportsRequest { + const message = { ...baseListExportsRequest } as ListExportsRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListExportsRequest.$type, ListExportsRequest); + +const baseListExportsResponse: object = { + $type: "yandex.cloud.logging.v1.ListExportsResponse", + nextPageToken: "", +}; + +export const ListExportsResponse = { + $type: "yandex.cloud.logging.v1.ListExportsResponse" as const, + + encode( + message: ListExportsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.exports) { + Export.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListExportsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListExportsResponse } as ListExportsResponse; + message.exports = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exports.push(Export.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListExportsResponse { + const message = { ...baseListExportsResponse } as ListExportsResponse; + message.exports = (object.exports ?? []).map((e: any) => + Export.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListExportsResponse): unknown { + const obj: any = {}; + if (message.exports) { + obj.exports = message.exports.map((e) => + e ? Export.toJSON(e) : undefined + ); + } else { + obj.exports = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListExportsResponse { + const message = { ...baseListExportsResponse } as ListExportsResponse; + message.exports = object.exports?.map((e) => Export.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListExportsResponse.$type, ListExportsResponse); + +const baseCreateExportRequest: object = { + $type: "yandex.cloud.logging.v1.CreateExportRequest", + folderId: "", + name: "", + description: "", + groupId: "", + sinkId: "", +}; + +export const CreateExportRequest = { + $type: "yandex.cloud.logging.v1.CreateExportRequest" as const, + + encode( + message: CreateExportRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateExportRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.logging.v1.CreateExportRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(34).fork() + ).ldelim(); + }); + if (message.groupId !== "") { + writer.uint32(42).string(message.groupId); + } + if (message.sinkId !== "") { + writer.uint32(50).string(message.sinkId); + } + if (message.params !== undefined) { + ExportParams.encode(message.params, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateExportRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateExportRequest } as CreateExportRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + const entry4 = CreateExportRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry4.value !== undefined) { + message.labels[entry4.key] = entry4.value; + } + break; + case 5: + message.groupId = reader.string(); + break; + case 6: + message.sinkId = reader.string(); + break; + case 7: + message.params = ExportParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateExportRequest { + const message = { ...baseCreateExportRequest } as CreateExportRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.groupId = + object.groupId !== undefined && object.groupId !== null + ? String(object.groupId) + : ""; + message.sinkId = + object.sinkId !== undefined && object.sinkId !== null + ? String(object.sinkId) + : ""; + message.params = + object.params !== undefined && object.params !== null + ? ExportParams.fromJSON(object.params) + : undefined; + return message; + }, + + toJSON(message: CreateExportRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.groupId !== undefined && (obj.groupId = message.groupId); + message.sinkId !== undefined && (obj.sinkId = message.sinkId); + message.params !== undefined && + (obj.params = message.params + ? ExportParams.toJSON(message.params) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateExportRequest { + const message = { ...baseCreateExportRequest } as CreateExportRequest; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.groupId = object.groupId ?? ""; + message.sinkId = object.sinkId ?? ""; + message.params = + object.params !== undefined && object.params !== null + ? ExportParams.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CreateExportRequest.$type, CreateExportRequest); + +const baseCreateExportRequest_LabelsEntry: object = { + $type: "yandex.cloud.logging.v1.CreateExportRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateExportRequest_LabelsEntry = { + $type: "yandex.cloud.logging.v1.CreateExportRequest.LabelsEntry" as const, + + encode( + message: CreateExportRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateExportRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateExportRequest_LabelsEntry, + } as CreateExportRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateExportRequest_LabelsEntry { + const message = { + ...baseCreateExportRequest_LabelsEntry, + } as CreateExportRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateExportRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateExportRequest_LabelsEntry { + const message = { + ...baseCreateExportRequest_LabelsEntry, + } as CreateExportRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateExportRequest_LabelsEntry.$type, + CreateExportRequest_LabelsEntry +); + +const baseCreateExportMetadata: object = { + $type: "yandex.cloud.logging.v1.CreateExportMetadata", + exportId: "", +}; + +export const CreateExportMetadata = { + $type: "yandex.cloud.logging.v1.CreateExportMetadata" as const, + + encode( + message: CreateExportMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.exportId !== "") { + writer.uint32(10).string(message.exportId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateExportMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateExportMetadata } as CreateExportMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exportId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateExportMetadata { + const message = { ...baseCreateExportMetadata } as CreateExportMetadata; + message.exportId = + object.exportId !== undefined && object.exportId !== null + ? String(object.exportId) + : ""; + return message; + }, + + toJSON(message: CreateExportMetadata): unknown { + const obj: any = {}; + message.exportId !== undefined && (obj.exportId = message.exportId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateExportMetadata { + const message = { ...baseCreateExportMetadata } as CreateExportMetadata; + message.exportId = object.exportId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateExportMetadata.$type, CreateExportMetadata); + +const baseUpdateExportRequest: object = { + $type: "yandex.cloud.logging.v1.UpdateExportRequest", + exportId: "", + name: "", + description: "", + groupId: "", + sinkId: "", +}; + +export const UpdateExportRequest = { + $type: "yandex.cloud.logging.v1.UpdateExportRequest" as const, + + encode( + message: UpdateExportRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.exportId !== "") { + writer.uint32(10).string(message.exportId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateExportRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.logging.v1.UpdateExportRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(42).fork() + ).ldelim(); + }); + if (message.groupId !== "") { + writer.uint32(50).string(message.groupId); + } + if (message.sinkId !== "") { + writer.uint32(58).string(message.sinkId); + } + if (message.params !== undefined) { + ExportParams.encode(message.params, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateExportRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateExportRequest } as UpdateExportRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exportId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + const entry5 = UpdateExportRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry5.value !== undefined) { + message.labels[entry5.key] = entry5.value; + } + break; + case 6: + message.groupId = reader.string(); + break; + case 7: + message.sinkId = reader.string(); + break; + case 8: + message.params = ExportParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateExportRequest { + const message = { ...baseUpdateExportRequest } as UpdateExportRequest; + message.exportId = + object.exportId !== undefined && object.exportId !== null + ? String(object.exportId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.groupId = + object.groupId !== undefined && object.groupId !== null + ? String(object.groupId) + : ""; + message.sinkId = + object.sinkId !== undefined && object.sinkId !== null + ? String(object.sinkId) + : ""; + message.params = + object.params !== undefined && object.params !== null + ? ExportParams.fromJSON(object.params) + : undefined; + return message; + }, + + toJSON(message: UpdateExportRequest): unknown { + const obj: any = {}; + message.exportId !== undefined && (obj.exportId = message.exportId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.groupId !== undefined && (obj.groupId = message.groupId); + message.sinkId !== undefined && (obj.sinkId = message.sinkId); + message.params !== undefined && + (obj.params = message.params + ? ExportParams.toJSON(message.params) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateExportRequest { + const message = { ...baseUpdateExportRequest } as UpdateExportRequest; + message.exportId = object.exportId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.groupId = object.groupId ?? ""; + message.sinkId = object.sinkId ?? ""; + message.params = + object.params !== undefined && object.params !== null + ? ExportParams.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UpdateExportRequest.$type, UpdateExportRequest); + +const baseUpdateExportRequest_LabelsEntry: object = { + $type: "yandex.cloud.logging.v1.UpdateExportRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateExportRequest_LabelsEntry = { + $type: "yandex.cloud.logging.v1.UpdateExportRequest.LabelsEntry" as const, + + encode( + message: UpdateExportRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateExportRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateExportRequest_LabelsEntry, + } as UpdateExportRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateExportRequest_LabelsEntry { + const message = { + ...baseUpdateExportRequest_LabelsEntry, + } as UpdateExportRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateExportRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateExportRequest_LabelsEntry { + const message = { + ...baseUpdateExportRequest_LabelsEntry, + } as UpdateExportRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateExportRequest_LabelsEntry.$type, + UpdateExportRequest_LabelsEntry +); + +const baseUpdateExportMetadata: object = { + $type: "yandex.cloud.logging.v1.UpdateExportMetadata", + exportId: "", +}; + +export const UpdateExportMetadata = { + $type: "yandex.cloud.logging.v1.UpdateExportMetadata" as const, + + encode( + message: UpdateExportMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.exportId !== "") { + writer.uint32(10).string(message.exportId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateExportMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateExportMetadata } as UpdateExportMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exportId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateExportMetadata { + const message = { ...baseUpdateExportMetadata } as UpdateExportMetadata; + message.exportId = + object.exportId !== undefined && object.exportId !== null + ? String(object.exportId) + : ""; + return message; + }, + + toJSON(message: UpdateExportMetadata): unknown { + const obj: any = {}; + message.exportId !== undefined && (obj.exportId = message.exportId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateExportMetadata { + const message = { ...baseUpdateExportMetadata } as UpdateExportMetadata; + message.exportId = object.exportId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateExportMetadata.$type, UpdateExportMetadata); + +const baseDeleteExportRequest: object = { + $type: "yandex.cloud.logging.v1.DeleteExportRequest", + exportId: "", +}; + +export const DeleteExportRequest = { + $type: "yandex.cloud.logging.v1.DeleteExportRequest" as const, + + encode( + message: DeleteExportRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.exportId !== "") { + writer.uint32(10).string(message.exportId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteExportRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteExportRequest } as DeleteExportRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exportId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteExportRequest { + const message = { ...baseDeleteExportRequest } as DeleteExportRequest; + message.exportId = + object.exportId !== undefined && object.exportId !== null + ? String(object.exportId) + : ""; + return message; + }, + + toJSON(message: DeleteExportRequest): unknown { + const obj: any = {}; + message.exportId !== undefined && (obj.exportId = message.exportId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteExportRequest { + const message = { ...baseDeleteExportRequest } as DeleteExportRequest; + message.exportId = object.exportId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteExportRequest.$type, DeleteExportRequest); + +const baseDeleteExportMetadata: object = { + $type: "yandex.cloud.logging.v1.DeleteExportMetadata", + exportId: "", +}; + +export const DeleteExportMetadata = { + $type: "yandex.cloud.logging.v1.DeleteExportMetadata" as const, + + encode( + message: DeleteExportMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.exportId !== "") { + writer.uint32(10).string(message.exportId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteExportMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteExportMetadata } as DeleteExportMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exportId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteExportMetadata { + const message = { ...baseDeleteExportMetadata } as DeleteExportMetadata; + message.exportId = + object.exportId !== undefined && object.exportId !== null + ? String(object.exportId) + : ""; + return message; + }, + + toJSON(message: DeleteExportMetadata): unknown { + const obj: any = {}; + message.exportId !== undefined && (obj.exportId = message.exportId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteExportMetadata { + const message = { ...baseDeleteExportMetadata } as DeleteExportMetadata; + message.exportId = object.exportId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteExportMetadata.$type, DeleteExportMetadata); + +const baseListExportOperationsRequest: object = { + $type: "yandex.cloud.logging.v1.ListExportOperationsRequest", + exportId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListExportOperationsRequest = { + $type: "yandex.cloud.logging.v1.ListExportOperationsRequest" as const, + + encode( + message: ListExportOperationsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.exportId !== "") { + writer.uint32(10).string(message.exportId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListExportOperationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListExportOperationsRequest, + } as ListExportOperationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exportId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListExportOperationsRequest { + const message = { + ...baseListExportOperationsRequest, + } as ListExportOperationsRequest; + message.exportId = + object.exportId !== undefined && object.exportId !== null + ? String(object.exportId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListExportOperationsRequest): unknown { + const obj: any = {}; + message.exportId !== undefined && (obj.exportId = message.exportId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListExportOperationsRequest { + const message = { + ...baseListExportOperationsRequest, + } as ListExportOperationsRequest; + message.exportId = object.exportId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListExportOperationsRequest.$type, + ListExportOperationsRequest +); + +const baseListExportOperationsResponse: object = { + $type: "yandex.cloud.logging.v1.ListExportOperationsResponse", + nextPageToken: "", +}; + +export const ListExportOperationsResponse = { + $type: "yandex.cloud.logging.v1.ListExportOperationsResponse" as const, + + encode( + message: ListExportOperationsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.operations) { + Operation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListExportOperationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListExportOperationsResponse, + } as ListExportOperationsResponse; + message.operations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operations.push(Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListExportOperationsResponse { + const message = { + ...baseListExportOperationsResponse, + } as ListExportOperationsResponse; + message.operations = (object.operations ?? []).map((e: any) => + Operation.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListExportOperationsResponse): unknown { + const obj: any = {}; + if (message.operations) { + obj.operations = message.operations.map((e) => + e ? Operation.toJSON(e) : undefined + ); + } else { + obj.operations = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListExportOperationsResponse { + const message = { + ...baseListExportOperationsResponse, + } as ListExportOperationsResponse; + message.operations = + object.operations?.map((e) => Operation.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListExportOperationsResponse.$type, + ListExportOperationsResponse +); + +/** A set of methods for managing log exports. */ +export const ExportServiceService = { + /** Run new logs export from log group to sink */ + run: { + path: "/yandex.cloud.logging.v1.ExportService/Run", + requestStream: false, + responseStream: false, + requestSerialize: (value: RunExportRequest) => + Buffer.from(RunExportRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => RunExportRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** + * Returns the specified export. + * + * To get the list of all available exports, make a [List] request. + */ + get: { + path: "/yandex.cloud.logging.v1.ExportService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetExportRequest) => + Buffer.from(GetExportRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetExportRequest.decode(value), + responseSerialize: (value: Export) => + Buffer.from(Export.encode(value).finish()), + responseDeserialize: (value: Buffer) => Export.decode(value), + }, + /** Retrieves the list of exports in the specified folder. */ + list: { + path: "/yandex.cloud.logging.v1.ExportService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListExportsRequest) => + Buffer.from(ListExportsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListExportsRequest.decode(value), + responseSerialize: (value: ListExportsResponse) => + Buffer.from(ListExportsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListExportsResponse.decode(value), + }, + /** Creates a export in the specified folder. */ + create: { + path: "/yandex.cloud.logging.v1.ExportService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateExportRequest) => + Buffer.from(CreateExportRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateExportRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates the specified export. */ + update: { + path: "/yandex.cloud.logging.v1.ExportService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateExportRequest) => + Buffer.from(UpdateExportRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateExportRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes the specified export. */ + delete: { + path: "/yandex.cloud.logging.v1.ExportService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteExportRequest) => + Buffer.from(DeleteExportRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteExportRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Lists operations for the specified export. */ + listOperations: { + path: "/yandex.cloud.logging.v1.ExportService/ListOperations", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListExportOperationsRequest) => + Buffer.from(ListExportOperationsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListExportOperationsRequest.decode(value), + responseSerialize: (value: ListExportOperationsResponse) => + Buffer.from(ListExportOperationsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListExportOperationsResponse.decode(value), + }, + /** Lists existing access bindings for the specified export. */ + listAccessBindings: { + path: "/yandex.cloud.logging.v1.ExportService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the specified export. */ + setAccessBindings: { + path: "/yandex.cloud.logging.v1.ExportService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the specified export. */ + updateAccessBindings: { + path: "/yandex.cloud.logging.v1.ExportService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface ExportServiceServer extends UntypedServiceImplementation { + /** Run new logs export from log group to sink */ + run: handleUnaryCall; + /** + * Returns the specified export. + * + * To get the list of all available exports, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of exports in the specified folder. */ + list: handleUnaryCall; + /** Creates a export in the specified folder. */ + create: handleUnaryCall; + /** Updates the specified export. */ + update: handleUnaryCall; + /** Deletes the specified export. */ + delete: handleUnaryCall; + /** Lists operations for the specified export. */ + listOperations: handleUnaryCall< + ListExportOperationsRequest, + ListExportOperationsResponse + >; + /** Lists existing access bindings for the specified export. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the specified export. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the specified export. */ + updateAccessBindings: handleUnaryCall; +} + +export interface ExportServiceClient extends Client { + /** Run new logs export from log group to sink */ + run( + request: RunExportRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + run( + request: RunExportRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + run( + request: RunExportRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** + * Returns the specified export. + * + * To get the list of all available exports, make a [List] request. + */ + get( + request: GetExportRequest, + callback: (error: ServiceError | null, response: Export) => void + ): ClientUnaryCall; + get( + request: GetExportRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Export) => void + ): ClientUnaryCall; + get( + request: GetExportRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Export) => void + ): ClientUnaryCall; + /** Retrieves the list of exports in the specified folder. */ + list( + request: ListExportsRequest, + callback: ( + error: ServiceError | null, + response: ListExportsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListExportsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListExportsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListExportsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListExportsResponse + ) => void + ): ClientUnaryCall; + /** Creates a export in the specified folder. */ + create( + request: CreateExportRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateExportRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateExportRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates the specified export. */ + update( + request: UpdateExportRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateExportRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateExportRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes the specified export. */ + delete( + request: DeleteExportRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteExportRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteExportRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Lists operations for the specified export. */ + listOperations( + request: ListExportOperationsRequest, + callback: ( + error: ServiceError | null, + response: ListExportOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListExportOperationsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListExportOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListExportOperationsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListExportOperationsResponse + ) => void + ): ClientUnaryCall; + /** Lists existing access bindings for the specified export. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the specified export. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the specified export. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const ExportServiceClient = makeGenericClientConstructor( + ExportServiceService, + "yandex.cloud.logging.v1.ExportService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ExportServiceClient; + service: typeof ExportServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); } + return long.toNumber(); } if (_m0.util.Long !== Long) { diff --git a/src/generated/yandex/cloud/marketplace/index.ts b/src/generated/yandex/cloud/marketplace/index.ts index 756eca01..ba2821b3 100644 --- a/src/generated/yandex/cloud/marketplace/index.ts +++ b/src/generated/yandex/cloud/marketplace/index.ts @@ -1,9 +1,11 @@ -export * as licensemanager_instance from './licensemanager/v1/instance' -export * as licensemanager_instance_service from './licensemanager/v1/instance_service' -export * as licensemanager_lock from './licensemanager/v1/lock' -export * as licensemanager_lock_service from './licensemanager/v1/lock_service' -export * as licensemanager_template from './licensemanager/v1/template' -export * as metering_image_product_usage_service from './metering/v1/image_product_usage_service' -export * as metering_usage_record from './metering/v1/usage_record' -export * as image_product_usage_service from './v1/metering/image_product_usage_service' -export * as usage_record from './v1/metering/usage_record' \ No newline at end of file +export * as licensemanager_v1_instance from './licensemanager/v1/instance' +export * as licensemanager_v1_instance_service from './licensemanager/v1/instance_service' +export * as licensemanager_v1_lock from './licensemanager/v1/lock' +export * as licensemanager_v1_lock_service from './licensemanager/v1/lock_service' +export * as licensemanager_v1_template from './licensemanager/v1/template' +export * as metering_v1_image_product_usage_service from './metering/v1/image_product_usage_service' +export * as metering_v1_usage_record from './metering/v1/usage_record' +export * as v1_metering_image_product_usage_service from './v1/metering/image_product_usage_service' +export * as v1_metering_usage_record from './v1/metering/usage_record' +export * as licensemanager_saas_v1_instance_service from './licensemanager/saas/v1/instance_service' +export * as licensemanager_saas_v1_lock_service from './licensemanager/saas/v1/lock_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/marketplace/licensemanager/saas/v1/instance_service.ts b/src/generated/yandex/cloud/marketplace/licensemanager/saas/v1/instance_service.ts new file mode 100644 index 00000000..e4239909 --- /dev/null +++ b/src/generated/yandex/cloud/marketplace/licensemanager/saas/v1/instance_service.ts @@ -0,0 +1,173 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { Instance } from "../../../../../../yandex/cloud/marketplace/licensemanager/v1/instance"; + +export const protobufPackage = + "yandex.cloud.marketplace.licensemanager.saas.v1"; + +export interface GetInstanceRequest { + $type: "yandex.cloud.marketplace.licensemanager.saas.v1.GetInstanceRequest"; + /** ID of the subscription instance. */ + instanceId: string; +} + +const baseGetInstanceRequest: object = { + $type: "yandex.cloud.marketplace.licensemanager.saas.v1.GetInstanceRequest", + instanceId: "", +}; + +export const GetInstanceRequest = { + $type: + "yandex.cloud.marketplace.licensemanager.saas.v1.GetInstanceRequest" as const, + + encode( + message: GetInstanceRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.instanceId !== "") { + writer.uint32(10).string(message.instanceId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetInstanceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetInstanceRequest } as GetInstanceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.instanceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetInstanceRequest { + const message = { ...baseGetInstanceRequest } as GetInstanceRequest; + message.instanceId = + object.instanceId !== undefined && object.instanceId !== null + ? String(object.instanceId) + : ""; + return message; + }, + + toJSON(message: GetInstanceRequest): unknown { + const obj: any = {}; + message.instanceId !== undefined && (obj.instanceId = message.instanceId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetInstanceRequest { + const message = { ...baseGetInstanceRequest } as GetInstanceRequest; + message.instanceId = object.instanceId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetInstanceRequest.$type, GetInstanceRequest); + +/** A set of methods for managing subscription instances. */ +export const InstanceServiceService = { + /** Returns the specified subscription instance. */ + get: { + path: "/yandex.cloud.marketplace.licensemanager.saas.v1.InstanceService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetInstanceRequest) => + Buffer.from(GetInstanceRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetInstanceRequest.decode(value), + responseSerialize: (value: Instance) => + Buffer.from(Instance.encode(value).finish()), + responseDeserialize: (value: Buffer) => Instance.decode(value), + }, +} as const; + +export interface InstanceServiceServer extends UntypedServiceImplementation { + /** Returns the specified subscription instance. */ + get: handleUnaryCall; +} + +export interface InstanceServiceClient extends Client { + /** Returns the specified subscription instance. */ + get( + request: GetInstanceRequest, + callback: (error: ServiceError | null, response: Instance) => void + ): ClientUnaryCall; + get( + request: GetInstanceRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Instance) => void + ): ClientUnaryCall; + get( + request: GetInstanceRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Instance) => void + ): ClientUnaryCall; +} + +export const InstanceServiceClient = makeGenericClientConstructor( + InstanceServiceService, + "yandex.cloud.marketplace.licensemanager.saas.v1.InstanceService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): InstanceServiceClient; + service: typeof InstanceServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/marketplace/licensemanager/saas/v1/lock_service.ts b/src/generated/yandex/cloud/marketplace/licensemanager/saas/v1/lock_service.ts new file mode 100644 index 00000000..0fd5e927 --- /dev/null +++ b/src/generated/yandex/cloud/marketplace/licensemanager/saas/v1/lock_service.ts @@ -0,0 +1,367 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { Operation } from "../../../../../../yandex/cloud/operation/operation"; +import { Lock } from "../../../../../../yandex/cloud/marketplace/licensemanager/v1/lock"; + +export const protobufPackage = + "yandex.cloud.marketplace.licensemanager.saas.v1"; + +export interface EnsureLockRequest { + $type: "yandex.cloud.marketplace.licensemanager.saas.v1.EnsureLockRequest"; + /** Signed JWT token which contains information about subscription. */ + instanceToken: string; + /** ID of the resource to which the subscription will be locked. */ + resourceId: string; +} + +export interface EnsureLockMetadata { + $type: "yandex.cloud.marketplace.licensemanager.saas.v1.EnsureLockMetadata"; + /** ID of the subscription lock. */ + lockId: string; +} + +export interface GetLockRequest { + $type: "yandex.cloud.marketplace.licensemanager.saas.v1.GetLockRequest"; + /** ID of the subscription lock. */ + lockId: string; +} + +const baseEnsureLockRequest: object = { + $type: "yandex.cloud.marketplace.licensemanager.saas.v1.EnsureLockRequest", + instanceToken: "", + resourceId: "", +}; + +export const EnsureLockRequest = { + $type: + "yandex.cloud.marketplace.licensemanager.saas.v1.EnsureLockRequest" as const, + + encode( + message: EnsureLockRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.instanceToken !== "") { + writer.uint32(10).string(message.instanceToken); + } + if (message.resourceId !== "") { + writer.uint32(18).string(message.resourceId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnsureLockRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnsureLockRequest } as EnsureLockRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.instanceToken = reader.string(); + break; + case 2: + message.resourceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnsureLockRequest { + const message = { ...baseEnsureLockRequest } as EnsureLockRequest; + message.instanceToken = + object.instanceToken !== undefined && object.instanceToken !== null + ? String(object.instanceToken) + : ""; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + return message; + }, + + toJSON(message: EnsureLockRequest): unknown { + const obj: any = {}; + message.instanceToken !== undefined && + (obj.instanceToken = message.instanceToken); + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + return obj; + }, + + fromPartial, I>>( + object: I + ): EnsureLockRequest { + const message = { ...baseEnsureLockRequest } as EnsureLockRequest; + message.instanceToken = object.instanceToken ?? ""; + message.resourceId = object.resourceId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(EnsureLockRequest.$type, EnsureLockRequest); + +const baseEnsureLockMetadata: object = { + $type: "yandex.cloud.marketplace.licensemanager.saas.v1.EnsureLockMetadata", + lockId: "", +}; + +export const EnsureLockMetadata = { + $type: + "yandex.cloud.marketplace.licensemanager.saas.v1.EnsureLockMetadata" as const, + + encode( + message: EnsureLockMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.lockId !== "") { + writer.uint32(10).string(message.lockId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnsureLockMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnsureLockMetadata } as EnsureLockMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnsureLockMetadata { + const message = { ...baseEnsureLockMetadata } as EnsureLockMetadata; + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? String(object.lockId) + : ""; + return message; + }, + + toJSON(message: EnsureLockMetadata): unknown { + const obj: any = {}; + message.lockId !== undefined && (obj.lockId = message.lockId); + return obj; + }, + + fromPartial, I>>( + object: I + ): EnsureLockMetadata { + const message = { ...baseEnsureLockMetadata } as EnsureLockMetadata; + message.lockId = object.lockId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(EnsureLockMetadata.$type, EnsureLockMetadata); + +const baseGetLockRequest: object = { + $type: "yandex.cloud.marketplace.licensemanager.saas.v1.GetLockRequest", + lockId: "", +}; + +export const GetLockRequest = { + $type: + "yandex.cloud.marketplace.licensemanager.saas.v1.GetLockRequest" as const, + + encode( + message: GetLockRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.lockId !== "") { + writer.uint32(10).string(message.lockId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetLockRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetLockRequest } as GetLockRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetLockRequest { + const message = { ...baseGetLockRequest } as GetLockRequest; + message.lockId = + object.lockId !== undefined && object.lockId !== null + ? String(object.lockId) + : ""; + return message; + }, + + toJSON(message: GetLockRequest): unknown { + const obj: any = {}; + message.lockId !== undefined && (obj.lockId = message.lockId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetLockRequest { + const message = { ...baseGetLockRequest } as GetLockRequest; + message.lockId = object.lockId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetLockRequest.$type, GetLockRequest); + +/** A set of methods for managing subscription locks. */ +export const LockServiceService = { + /** + * Checks if the she specified subscription is already locked to the specified resource. + * If it is not locked, locks the subscription to the resource. + */ + ensure: { + path: "/yandex.cloud.marketplace.licensemanager.saas.v1.LockService/Ensure", + requestStream: false, + responseStream: false, + requestSerialize: (value: EnsureLockRequest) => + Buffer.from(EnsureLockRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => EnsureLockRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Returns the specified subscription lock. */ + get: { + path: "/yandex.cloud.marketplace.licensemanager.saas.v1.LockService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetLockRequest) => + Buffer.from(GetLockRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetLockRequest.decode(value), + responseSerialize: (value: Lock) => + Buffer.from(Lock.encode(value).finish()), + responseDeserialize: (value: Buffer) => Lock.decode(value), + }, +} as const; + +export interface LockServiceServer extends UntypedServiceImplementation { + /** + * Checks if the she specified subscription is already locked to the specified resource. + * If it is not locked, locks the subscription to the resource. + */ + ensure: handleUnaryCall; + /** Returns the specified subscription lock. */ + get: handleUnaryCall; +} + +export interface LockServiceClient extends Client { + /** + * Checks if the she specified subscription is already locked to the specified resource. + * If it is not locked, locks the subscription to the resource. + */ + ensure( + request: EnsureLockRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + ensure( + request: EnsureLockRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + ensure( + request: EnsureLockRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Returns the specified subscription lock. */ + get( + request: GetLockRequest, + callback: (error: ServiceError | null, response: Lock) => void + ): ClientUnaryCall; + get( + request: GetLockRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Lock) => void + ): ClientUnaryCall; + get( + request: GetLockRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Lock) => void + ): ClientUnaryCall; +} + +export const LockServiceClient = makeGenericClientConstructor( + LockServiceService, + "yandex.cloud.marketplace.licensemanager.saas.v1.LockService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): LockServiceClient; + service: typeof LockServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/marketplace/licensemanager/v1/instance.ts b/src/generated/yandex/cloud/marketplace/licensemanager/v1/instance.ts index d3838be8..6d32822b 100644 --- a/src/generated/yandex/cloud/marketplace/licensemanager/v1/instance.ts +++ b/src/generated/yandex/cloud/marketplace/licensemanager/v1/instance.ts @@ -10,28 +10,47 @@ export const protobufPackage = "yandex.cloud.marketplace.licensemanager.v1"; export interface Instance { $type: "yandex.cloud.marketplace.licensemanager.v1.Instance"; + /** ID of the subscription instance. */ id: string; + /** ID of the cloud that the subscription instance belongs to. */ cloudId: string; + /** ID of the folder that the subscription instance belongs to. */ folderId: string; + /** ID of the subscription template that was used to create subscription instance. */ templateId: string; + /** ID of the version of subscription template. */ templateVersionId: string; + /** Description of the subscription instance. */ description: string; + /** Timestamp of the start of the subscription. */ startTime?: Date; + /** Timestamp of the end of the subscription. */ endTime?: Date; + /** Creation timestamp. */ createdAt?: Date; + /** Update timestamp. */ updatedAt?: Date; + /** Subscription state. */ state: Instance_State; + /** List of subscription locks. */ locks: Lock[]; + /** Subscription template. */ licenseTemplate?: Template; } export enum Instance_State { STATE_UNSPECIFIED = 0, + /** PENDING - Subscription created but not active yet. */ PENDING = 1, + /** ACTIVE - Subscription is active. */ ACTIVE = 2, + /** CANCELLED - Subscription canceled. It is still active, but won't be automatically renewed after the end of the current period. */ CANCELLED = 3, + /** EXPIRED - Subscription expired. */ EXPIRED = 4, + /** DEPRECATED - Subscription deprecated. */ DEPRECATED = 5, + /** DELETED - Subscription deleted. */ DELETED = 6, UNRECOGNIZED = -1, } diff --git a/src/generated/yandex/cloud/marketplace/licensemanager/v1/instance_service.ts b/src/generated/yandex/cloud/marketplace/licensemanager/v1/instance_service.ts index 53d000a8..8ab9b0d6 100644 --- a/src/generated/yandex/cloud/marketplace/licensemanager/v1/instance_service.ts +++ b/src/generated/yandex/cloud/marketplace/licensemanager/v1/instance_service.ts @@ -20,21 +20,51 @@ export const protobufPackage = "yandex.cloud.marketplace.licensemanager.v1"; export interface GetInstanceRequest { $type: "yandex.cloud.marketplace.licensemanager.v1.GetInstanceRequest"; + /** ID of the subscription instance. */ instanceId: string; } export interface ListInstancesRequest { $type: "yandex.cloud.marketplace.licensemanager.v1.ListInstancesRequest"; + /** ID of the folder that the subscription instance belongs to. */ folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than `page_size`, the service returns a [ListInstancesResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100. + */ pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * [ListInstancesResponse.next_page_token] returned by a previous list request. + */ pageToken: string; + /** + * A filter expression that filters subscription instances listed in the response. + * + * The expression must specify: + * 1. The field name. Currently you can use filtering only on [Instance.name] field. + * 2. An operator. Can be either `=` or `!=` for single values, `IN` or `NOT IN` for lists of values. + * 3. The value. Must be in double quotes `""`. Must be 3-63 characters long and match the regular expression `^[a-z][-a-z0-9]{1,61}[a-z0-9]`. + * Example of a filter: `name="my-subscription-instance"`. + */ filter: string; + /** Sorting order for the list of subscription instances. */ orderBy: string; } export interface ListInstancesResponse { $type: "yandex.cloud.marketplace.licensemanager.v1.ListInstancesResponse"; + /** List of subscription instances. */ instances: Instance[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListInstancesRequest.page_size], use `next_page_token` as the value + * for the [ListInstancesRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `next_page_token` to continue paging through the results. + */ nextPageToken: string; } @@ -306,7 +336,13 @@ export const ListInstancesResponse = { messageTypeRegistry.set(ListInstancesResponse.$type, ListInstancesResponse); +/** A set of methods for managing subscription instances. */ export const InstanceServiceService = { + /** + * Returns the specified subscription instance. + * + * To get the list of all available subscription instances, make a [List] request. + */ get: { path: "/yandex.cloud.marketplace.licensemanager.v1.InstanceService/Get", requestStream: false, @@ -318,6 +354,7 @@ export const InstanceServiceService = { Buffer.from(Instance.encode(value).finish()), responseDeserialize: (value: Buffer) => Instance.decode(value), }, + /** Retrieves the list of subscription instances in the specified folder. */ list: { path: "/yandex.cloud.marketplace.licensemanager.v1.InstanceService/List", requestStream: false, @@ -332,11 +369,22 @@ export const InstanceServiceService = { } as const; export interface InstanceServiceServer extends UntypedServiceImplementation { + /** + * Returns the specified subscription instance. + * + * To get the list of all available subscription instances, make a [List] request. + */ get: handleUnaryCall; + /** Retrieves the list of subscription instances in the specified folder. */ list: handleUnaryCall; } export interface InstanceServiceClient extends Client { + /** + * Returns the specified subscription instance. + * + * To get the list of all available subscription instances, make a [List] request. + */ get( request: GetInstanceRequest, callback: (error: ServiceError | null, response: Instance) => void @@ -352,6 +400,7 @@ export interface InstanceServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Instance) => void ): ClientUnaryCall; + /** Retrieves the list of subscription instances in the specified folder. */ list( request: ListInstancesRequest, callback: ( diff --git a/src/generated/yandex/cloud/marketplace/licensemanager/v1/lock.ts b/src/generated/yandex/cloud/marketplace/licensemanager/v1/lock.ts index d80a9bab..614b274a 100644 --- a/src/generated/yandex/cloud/marketplace/licensemanager/v1/lock.ts +++ b/src/generated/yandex/cloud/marketplace/licensemanager/v1/lock.ts @@ -8,20 +8,33 @@ export const protobufPackage = "yandex.cloud.marketplace.licensemanager.v1"; export interface Lock { $type: "yandex.cloud.marketplace.licensemanager.v1.Lock"; + /** ID of the subscription lock. */ id: string; + /** ID of the subscription instance. */ instanceId: string; + /** ID of the resource. */ resourceId: string; + /** Timestamp of the start of the subscription lock. */ startTime?: Date; + /** Timestamp of the end of the subscription lock. */ endTime?: Date; + /** Creation timestamp. */ createdAt?: Date; + /** Update timestamp. */ updatedAt?: Date; + /** Subscription lock state. */ state: Lock_State; + /** ID of the subscription template. */ + templateId: string; } export enum Lock_State { STATE_UNSPECIFIED = 0, + /** UNLOCKED - Subscription unlocked. */ UNLOCKED = 1, + /** LOCKED - Subscription locked to the resource. */ LOCKED = 2, + /** DELETED - Subscription lock deleted. */ DELETED = 3, UNRECOGNIZED = -1, } @@ -68,6 +81,7 @@ const baseLock: object = { instanceId: "", resourceId: "", state: 0, + templateId: "", }; export const Lock = { @@ -110,6 +124,9 @@ export const Lock = { if (message.state !== 0) { writer.uint32(64).int32(message.state); } + if (message.templateId !== "") { + writer.uint32(74).string(message.templateId); + } return writer; }, @@ -152,6 +169,9 @@ export const Lock = { case 8: message.state = reader.int32() as any; break; + case 9: + message.templateId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -192,6 +212,10 @@ export const Lock = { object.state !== undefined && object.state !== null ? lock_StateFromJSON(object.state) : 0; + message.templateId = + object.templateId !== undefined && object.templateId !== null + ? String(object.templateId) + : ""; return message; }, @@ -210,6 +234,7 @@ export const Lock = { (obj.updatedAt = message.updatedAt.toISOString()); message.state !== undefined && (obj.state = lock_StateToJSON(message.state)); + message.templateId !== undefined && (obj.templateId = message.templateId); return obj; }, @@ -223,6 +248,7 @@ export const Lock = { message.createdAt = object.createdAt ?? undefined; message.updatedAt = object.updatedAt ?? undefined; message.state = object.state ?? 0; + message.templateId = object.templateId ?? ""; return message; }, }; diff --git a/src/generated/yandex/cloud/marketplace/licensemanager/v1/lock_service.ts b/src/generated/yandex/cloud/marketplace/licensemanager/v1/lock_service.ts index ff87e6df..8de84288 100644 --- a/src/generated/yandex/cloud/marketplace/licensemanager/v1/lock_service.ts +++ b/src/generated/yandex/cloud/marketplace/licensemanager/v1/lock_service.ts @@ -21,50 +21,104 @@ export const protobufPackage = "yandex.cloud.marketplace.licensemanager.v1"; export interface GetLockRequest { $type: "yandex.cloud.marketplace.licensemanager.v1.GetLockRequest"; + /** ID of the subscription lock. */ lockId: string; } export interface CreateLockRequest { $type: "yandex.cloud.marketplace.licensemanager.v1.CreateLockRequest"; - /** license */ + /** ID of the subscription instance. */ instanceId: string; + /** ID of the resource to which the subscription will be locked. */ resourceId: string; } export interface EnsureLockRequest { $type: "yandex.cloud.marketplace.licensemanager.v1.EnsureLockRequest"; - /** license */ + /** ID of the subscription instance. */ instanceId: string; + /** ID of the resource to which the subscription will be locked. */ resourceId: string; } export interface CreateLockMetadata { $type: "yandex.cloud.marketplace.licensemanager.v1.CreateLockMetadata"; + /** ID of the subscription lock. */ lockId: string; } export interface EnsureLockMetadata { $type: "yandex.cloud.marketplace.licensemanager.v1.EnsureLockMetadata"; + /** ID of the subscription lock. */ lockId: string; } export interface DeleteLockRequest { $type: "yandex.cloud.marketplace.licensemanager.v1.DeleteLockRequest"; + /** ID of the subscription lock. */ lockId: string; } export interface DeleteLockMetadata { $type: "yandex.cloud.marketplace.licensemanager.v1.DeleteLockMetadata"; + /** ID of the subscription lock. */ lockId: string; } export interface GetLockByInstanceAndResourceRequest { $type: "yandex.cloud.marketplace.licensemanager.v1.GetLockByInstanceAndResourceRequest"; - /** license */ + /** ID of the subscription instance. */ instanceId: string; + /** ID of the resource to which the subscription will be locked. */ resourceId: string; } +export interface ListLocksRequest { + $type: "yandex.cloud.marketplace.licensemanager.v1.ListLocksRequest"; + /** ID of the resource that the subscription locks belong to. */ + resourceId: string; + /** ID of the folder that the subscription locks belong to. */ + folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than `page_size`, the service returns a [ListLocksResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * [ListLocksResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters subscription locks listed in the response. + * + * The expression must specify: + * 1. The field name. Currently you can use filtering only on [Lock.product_id] field. + * 2. An operator. Can be either `=` or `!=` for single values, `IN` or `NOT IN` for lists of values. + * 3. The value. Must be in double quotes `""`. Must be 3-63 characters long and match the regular expression `^[a-z][-a-z0-9]{1,61}[a-z0-9]`. + * Example of a filter: `product_id="my-product-id"`. + */ + filter: string; + /** Sorting order for the list of subscription locks. */ + orderBy: string; +} + +export interface ListLocksResponse { + $type: "yandex.cloud.marketplace.licensemanager.v1.ListLocksResponse"; + /** List of subscription locks. */ + locks: Lock[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListLocksRequest.page_size], use `next_page_token` as the value + * for the [ListLocksRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `next_page_token` to continue paging through the results. + */ + nextPageToken: string; +} + const baseGetLockRequest: object = { $type: "yandex.cloud.marketplace.licensemanager.v1.GetLockRequest", lockId: "", @@ -620,7 +674,215 @@ messageTypeRegistry.set( GetLockByInstanceAndResourceRequest ); +const baseListLocksRequest: object = { + $type: "yandex.cloud.marketplace.licensemanager.v1.ListLocksRequest", + resourceId: "", + folderId: "", + pageSize: 0, + pageToken: "", + filter: "", + orderBy: "", +}; + +export const ListLocksRequest = { + $type: "yandex.cloud.marketplace.licensemanager.v1.ListLocksRequest" as const, + + encode( + message: ListLocksRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resourceId !== "") { + writer.uint32(10).string(message.resourceId); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(24).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(34).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(42).string(message.filter); + } + if (message.orderBy !== "") { + writer.uint32(50).string(message.orderBy); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListLocksRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListLocksRequest } as ListLocksRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 4: + message.pageToken = reader.string(); + break; + case 5: + message.filter = reader.string(); + break; + case 6: + message.orderBy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListLocksRequest { + const message = { ...baseListLocksRequest } as ListLocksRequest; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + message.orderBy = + object.orderBy !== undefined && object.orderBy !== null + ? String(object.orderBy) + : ""; + return message; + }, + + toJSON(message: ListLocksRequest): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + message.orderBy !== undefined && (obj.orderBy = message.orderBy); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListLocksRequest { + const message = { ...baseListLocksRequest } as ListLocksRequest; + message.resourceId = object.resourceId ?? ""; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + message.orderBy = object.orderBy ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListLocksRequest.$type, ListLocksRequest); + +const baseListLocksResponse: object = { + $type: "yandex.cloud.marketplace.licensemanager.v1.ListLocksResponse", + nextPageToken: "", +}; + +export const ListLocksResponse = { + $type: + "yandex.cloud.marketplace.licensemanager.v1.ListLocksResponse" as const, + + encode( + message: ListLocksResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.locks) { + Lock.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListLocksResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListLocksResponse } as ListLocksResponse; + message.locks = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.locks.push(Lock.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListLocksResponse { + const message = { ...baseListLocksResponse } as ListLocksResponse; + message.locks = (object.locks ?? []).map((e: any) => Lock.fromJSON(e)); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListLocksResponse): unknown { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map((e) => (e ? Lock.toJSON(e) : undefined)); + } else { + obj.locks = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListLocksResponse { + const message = { ...baseListLocksResponse } as ListLocksResponse; + message.locks = object.locks?.map((e) => Lock.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListLocksResponse.$type, ListLocksResponse); + +/** A set of methods for managing subscription locks. */ export const LockServiceService = { + /** Returns the specified subscription lock. */ get: { path: "/yandex.cloud.marketplace.licensemanager.v1.LockService/Get", requestStream: false, @@ -632,6 +894,7 @@ export const LockServiceService = { Buffer.from(Lock.encode(value).finish()), responseDeserialize: (value: Buffer) => Lock.decode(value), }, + /** Returns the subscription lock for specified subscription instance and resource. */ getByInstanceAndResource: { path: "/yandex.cloud.marketplace.licensemanager.v1.LockService/GetByInstanceAndResource", requestStream: false, @@ -644,6 +907,19 @@ export const LockServiceService = { Buffer.from(Lock.encode(value).finish()), responseDeserialize: (value: Buffer) => Lock.decode(value), }, + /** Returns subscriptions locks for specified resource and folder. */ + list: { + path: "/yandex.cloud.marketplace.licensemanager.v1.LockService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListLocksRequest) => + Buffer.from(ListLocksRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListLocksRequest.decode(value), + responseSerialize: (value: ListLocksResponse) => + Buffer.from(ListLocksResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListLocksResponse.decode(value), + }, + /** Locks the specified subscription instance to the resource. */ create: { path: "/yandex.cloud.marketplace.licensemanager.v1.LockService/Create", requestStream: false, @@ -655,6 +931,10 @@ export const LockServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** + * Checks if the she specified subscription is already locked to the specified resource. + * If it is not locked, locks the subscription to the resource. + */ ensure: { path: "/yandex.cloud.marketplace.licensemanager.v1.LockService/Ensure", requestStream: false, @@ -666,6 +946,7 @@ export const LockServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Unlocks the specified subscription lock. */ delete: { path: "/yandex.cloud.marketplace.licensemanager.v1.LockService/Delete", requestStream: false, @@ -680,17 +961,28 @@ export const LockServiceService = { } as const; export interface LockServiceServer extends UntypedServiceImplementation { + /** Returns the specified subscription lock. */ get: handleUnaryCall; + /** Returns the subscription lock for specified subscription instance and resource. */ getByInstanceAndResource: handleUnaryCall< GetLockByInstanceAndResourceRequest, Lock >; + /** Returns subscriptions locks for specified resource and folder. */ + list: handleUnaryCall; + /** Locks the specified subscription instance to the resource. */ create: handleUnaryCall; + /** + * Checks if the she specified subscription is already locked to the specified resource. + * If it is not locked, locks the subscription to the resource. + */ ensure: handleUnaryCall; + /** Unlocks the specified subscription lock. */ delete: handleUnaryCall; } export interface LockServiceClient extends Client { + /** Returns the specified subscription lock. */ get( request: GetLockRequest, callback: (error: ServiceError | null, response: Lock) => void @@ -706,6 +998,7 @@ export interface LockServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Lock) => void ): ClientUnaryCall; + /** Returns the subscription lock for specified subscription instance and resource. */ getByInstanceAndResource( request: GetLockByInstanceAndResourceRequest, callback: (error: ServiceError | null, response: Lock) => void @@ -721,6 +1014,23 @@ export interface LockServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Lock) => void ): ClientUnaryCall; + /** Returns subscriptions locks for specified resource and folder. */ + list( + request: ListLocksRequest, + callback: (error: ServiceError | null, response: ListLocksResponse) => void + ): ClientUnaryCall; + list( + request: ListLocksRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: ListLocksResponse) => void + ): ClientUnaryCall; + list( + request: ListLocksRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: ListLocksResponse) => void + ): ClientUnaryCall; + /** Locks the specified subscription instance to the resource. */ create( request: CreateLockRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -736,6 +1046,10 @@ export interface LockServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** + * Checks if the she specified subscription is already locked to the specified resource. + * If it is not locked, locks the subscription to the resource. + */ ensure( request: EnsureLockRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -751,6 +1065,7 @@ export interface LockServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Unlocks the specified subscription lock. */ delete( request: DeleteLockRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -780,6 +1095,17 @@ export const LockServiceClient = makeGenericClientConstructor( service: typeof LockServiceService; }; +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + type Builtin = | Date | Function @@ -807,6 +1133,13 @@ export type Exact = P extends Builtin never >; +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/src/generated/yandex/cloud/marketplace/licensemanager/v1/template.ts b/src/generated/yandex/cloud/marketplace/licensemanager/v1/template.ts index 7d66bb01..5d31ce17 100644 --- a/src/generated/yandex/cloud/marketplace/licensemanager/v1/template.ts +++ b/src/generated/yandex/cloud/marketplace/licensemanager/v1/template.ts @@ -8,24 +8,39 @@ export const protobufPackage = "yandex.cloud.marketplace.licensemanager.v1"; export interface Template { $type: "yandex.cloud.marketplace.licensemanager.v1.Template"; + /** ID of the subscription template. */ id: string; + /** Version of the subscription template. */ versionId: string; + /** Name of the subscription template. */ name: string; + /** ID of publisher. */ publisherId: string; + /** ID of product. */ productId: string; + /** ID of tariff. */ tariffId: string; + /** ID of subscription SKU. */ licenseSkuId: string; + /** Subscription period. */ period: string; + /** Creation timestamp. */ createdAt?: Date; + /** Update timestamp. */ updatedAt?: Date; + /** Subscription template state. */ state: Template_State; } export enum Template_State { STATE_UNSPECIFIED = 0, + /** PENDING - Subscription template created but not active yet. */ PENDING = 1, + /** ACTIVE - Subscription template is active. */ ACTIVE = 2, + /** DEPRECATED - Subscription template deprecated. */ DEPRECATED = 3, + /** DELETED - Subscription template deleted. */ DELETED = 4, UNRECOGNIZED = -1, } diff --git a/src/generated/yandex/cloud/mdb/clickhouse/v1/backup_service.ts b/src/generated/yandex/cloud/mdb/clickhouse/v1/backup_service.ts index 9e2f6129..ca465def 100644 --- a/src/generated/yandex/cloud/mdb/clickhouse/v1/backup_service.ts +++ b/src/generated/yandex/cloud/mdb/clickhouse/v1/backup_service.ts @@ -15,6 +15,7 @@ import { } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; import { Backup } from "../../../../../yandex/cloud/mdb/clickhouse/v1/backup"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; export const protobufPackage = "yandex.cloud.mdb.clickhouse.v1"; @@ -60,6 +61,20 @@ export interface ListBackupsResponse { nextPageToken: string; } +export interface DeleteBackupRequest { + $type: "yandex.cloud.mdb.clickhouse.v1.DeleteBackupRequest"; + /** Required. ID of the backup to delete. */ + backupId: string; +} + +export interface DeleteBackupMetadata { + $type: "yandex.cloud.mdb.clickhouse.v1.DeleteBackupMetadata"; + /** Required. ID of the ClickHouse backup that is currently being deleted. */ + backupId: string; + /** ID of the ClickHouse backup that is being deleted. */ + clusterId: string; +} + const baseGetBackupRequest: object = { $type: "yandex.cloud.mdb.clickhouse.v1.GetBackupRequest", backupId: "", @@ -292,6 +307,146 @@ export const ListBackupsResponse = { messageTypeRegistry.set(ListBackupsResponse.$type, ListBackupsResponse); +const baseDeleteBackupRequest: object = { + $type: "yandex.cloud.mdb.clickhouse.v1.DeleteBackupRequest", + backupId: "", +}; + +export const DeleteBackupRequest = { + $type: "yandex.cloud.mdb.clickhouse.v1.DeleteBackupRequest" as const, + + encode( + message: DeleteBackupRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.backupId !== "") { + writer.uint32(10).string(message.backupId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteBackupRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteBackupRequest } as DeleteBackupRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.backupId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteBackupRequest { + const message = { ...baseDeleteBackupRequest } as DeleteBackupRequest; + message.backupId = + object.backupId !== undefined && object.backupId !== null + ? String(object.backupId) + : ""; + return message; + }, + + toJSON(message: DeleteBackupRequest): unknown { + const obj: any = {}; + message.backupId !== undefined && (obj.backupId = message.backupId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteBackupRequest { + const message = { ...baseDeleteBackupRequest } as DeleteBackupRequest; + message.backupId = object.backupId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteBackupRequest.$type, DeleteBackupRequest); + +const baseDeleteBackupMetadata: object = { + $type: "yandex.cloud.mdb.clickhouse.v1.DeleteBackupMetadata", + backupId: "", + clusterId: "", +}; + +export const DeleteBackupMetadata = { + $type: "yandex.cloud.mdb.clickhouse.v1.DeleteBackupMetadata" as const, + + encode( + message: DeleteBackupMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.backupId !== "") { + writer.uint32(10).string(message.backupId); + } + if (message.clusterId !== "") { + writer.uint32(18).string(message.clusterId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteBackupMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteBackupMetadata } as DeleteBackupMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.backupId = reader.string(); + break; + case 2: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteBackupMetadata { + const message = { ...baseDeleteBackupMetadata } as DeleteBackupMetadata; + message.backupId = + object.backupId !== undefined && object.backupId !== null + ? String(object.backupId) + : ""; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: DeleteBackupMetadata): unknown { + const obj: any = {}; + message.backupId !== undefined && (obj.backupId = message.backupId); + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteBackupMetadata { + const message = { ...baseDeleteBackupMetadata } as DeleteBackupMetadata; + message.backupId = object.backupId ?? ""; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteBackupMetadata.$type, DeleteBackupMetadata); + /** A set of methods for managing ClickHouse Backup resources. */ export const BackupServiceService = { /** @@ -322,6 +477,18 @@ export const BackupServiceService = { Buffer.from(ListBackupsResponse.encode(value).finish()), responseDeserialize: (value: Buffer) => ListBackupsResponse.decode(value), }, + /** Deletes the specified ClickHouse Backup. */ + delete: { + path: "/yandex.cloud.mdb.clickhouse.v1.BackupService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteBackupRequest) => + Buffer.from(DeleteBackupRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteBackupRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface BackupServiceServer extends UntypedServiceImplementation { @@ -333,6 +500,8 @@ export interface BackupServiceServer extends UntypedServiceImplementation { get: handleUnaryCall; /** Retrieves the list of Backup resources available for the specified folder. */ list: handleUnaryCall; + /** Deletes the specified ClickHouse Backup. */ + delete: handleUnaryCall; } export interface BackupServiceClient extends Client { @@ -381,6 +550,22 @@ export interface BackupServiceClient extends Client { response: ListBackupsResponse ) => void ): ClientUnaryCall; + /** Deletes the specified ClickHouse Backup. */ + delete( + request: DeleteBackupRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteBackupRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteBackupRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const BackupServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/mdb/clickhouse/v1/cluster.ts b/src/generated/yandex/cloud/mdb/clickhouse/v1/cluster.ts index 3ff077c8..05396d31 100644 --- a/src/generated/yandex/cloud/mdb/clickhouse/v1/cluster.ts +++ b/src/generated/yandex/cloud/mdb/clickhouse/v1/cluster.ts @@ -271,6 +271,8 @@ export interface ClusterConfig { sqlUserManagement?: boolean; /** Whether cluster should use embedded Keeper instead of Zookeeper. */ embeddedKeeper?: boolean; + /** Retain period of automatically created backup in days */ + backupRetainPeriodDays?: number; } export interface ClusterConfig_Clickhouse { @@ -297,6 +299,11 @@ export interface Shard { config?: ShardConfig; } +export interface Shards { + $type: "yandex.cloud.mdb.clickhouse.v1.Shards"; + shards: Shard[]; +} + export interface ShardGroup { $type: "yandex.cloud.mdb.clickhouse.v1.ShardGroup"; /** Name of the shard group. */ @@ -341,11 +348,11 @@ export interface Host { clusterId: string; /** ID of the availability zone where the ClickHouse host resides. */ zoneId: string; - /** Type of the host. */ + /** Type of the host. If the field has default value, it is not returned in the response. */ type: Host_Type; /** Resources allocated to the ClickHouse host. */ resources?: Resources; - /** Status code of the aggregated health of the host. */ + /** Aggregated health of the host. If the field has default value, it is not returned in the response. */ health: Host_Health; /** Services provided by the host. */ services: Service[]; @@ -357,6 +364,7 @@ export interface Host { } export enum Host_Type { + /** TYPE_UNSPECIFIED - Host type is unspecified. Default value. */ TYPE_UNSPECIFIED = 0, /** CLICKHOUSE - ClickHouse host. */ CLICKHOUSE = 1, @@ -446,13 +454,14 @@ export function host_HealthToJSON(object: Host_Health): string { export interface Service { $type: "yandex.cloud.mdb.clickhouse.v1.Service"; - /** Type of the service provided by the host. */ + /** Type of the service provided by the host. If the field has default value, it is not returned in the response. */ type: Service_Type; - /** Status code of server availability. */ + /** Aggregated health of the service. If the field has default value, it is not returned in the response. */ health: Service_Health; } export enum Service_Type { + /** TYPE_UNSPECIFIED - Service type of the host is unspecified. Default value. */ TYPE_UNSPECIFIED = 0, /** CLICKHOUSE - The host is a ClickHouse server. */ CLICKHOUSE = 1, @@ -493,7 +502,7 @@ export function service_TypeToJSON(object: Service_Type): string { } export enum Service_Health { - /** UNKNOWN - Health of the server is unknown. */ + /** UNKNOWN - Health of the server is unknown. Default value. */ UNKNOWN = 0, /** ALIVE - The server is working normally. */ ALIVE = 1, @@ -1155,6 +1164,15 @@ export const ClusterConfig = { writer.uint32(74).fork() ).ldelim(); } + if (message.backupRetainPeriodDays !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.backupRetainPeriodDays!, + }, + writer.uint32(82).fork() + ).ldelim(); + } return writer; }, @@ -1207,6 +1225,12 @@ export const ClusterConfig = { reader.uint32() ).value; break; + case 10: + message.backupRetainPeriodDays = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -1256,6 +1280,11 @@ export const ClusterConfig = { object.embeddedKeeper !== undefined && object.embeddedKeeper !== null ? Boolean(object.embeddedKeeper) : undefined; + message.backupRetainPeriodDays = + object.backupRetainPeriodDays !== undefined && + object.backupRetainPeriodDays !== null + ? Number(object.backupRetainPeriodDays) + : undefined; return message; }, @@ -1286,6 +1315,8 @@ export const ClusterConfig = { (obj.sqlUserManagement = message.sqlUserManagement); message.embeddedKeeper !== undefined && (obj.embeddedKeeper = message.embeddedKeeper); + message.backupRetainPeriodDays !== undefined && + (obj.backupRetainPeriodDays = message.backupRetainPeriodDays); return obj; }, @@ -1318,6 +1349,7 @@ export const ClusterConfig = { message.sqlDatabaseManagement = object.sqlDatabaseManagement ?? undefined; message.sqlUserManagement = object.sqlUserManagement ?? undefined; message.embeddedKeeper = object.embeddedKeeper ?? undefined; + message.backupRetainPeriodDays = object.backupRetainPeriodDays ?? undefined; return message; }, }; @@ -1588,6 +1620,65 @@ export const Shard = { messageTypeRegistry.set(Shard.$type, Shard); +const baseShards: object = { $type: "yandex.cloud.mdb.clickhouse.v1.Shards" }; + +export const Shards = { + $type: "yandex.cloud.mdb.clickhouse.v1.Shards" as const, + + encode( + message: Shards, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.shards) { + Shard.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Shards { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseShards } as Shards; + message.shards = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.shards.push(Shard.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Shards { + const message = { ...baseShards } as Shards; + message.shards = (object.shards ?? []).map((e: any) => Shard.fromJSON(e)); + return message; + }, + + toJSON(message: Shards): unknown { + const obj: any = {}; + if (message.shards) { + obj.shards = message.shards.map((e) => (e ? Shard.toJSON(e) : undefined)); + } else { + obj.shards = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Shards { + const message = { ...baseShards } as Shards; + message.shards = object.shards?.map((e) => Shard.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Shards.$type, Shards); + const baseShardGroup: object = { $type: "yandex.cloud.mdb.clickhouse.v1.ShardGroup", name: "", diff --git a/src/generated/yandex/cloud/mdb/clickhouse/v1/cluster_service.ts b/src/generated/yandex/cloud/mdb/clickhouse/v1/cluster_service.ts index 6598a5ce..410c3a37 100644 --- a/src/generated/yandex/cloud/mdb/clickhouse/v1/cluster_service.ts +++ b/src/generated/yandex/cloud/mdb/clickhouse/v1/cluster_service.ts @@ -177,6 +177,8 @@ export interface UpdateClusterRequest { securityGroupIds: string[]; /** Deletion Protection inhibits deletion of the cluster */ deletionProtection: boolean; + /** ID of the network to move the cluster to. */ + networkId: string; } export interface UpdateClusterRequest_LabelsEntry { @@ -256,6 +258,8 @@ export interface AddClusterZookeeperRequest { resources?: Resources; /** Configuration of ZooKeeper hosts. */ hostSpecs: HostSpec[]; + /** Enable automatic convertation of non-replicated MergeTree tables to replicated ones. */ + convertTablesToReplicated?: boolean; } export interface AddClusterZookeeperMetadata { @@ -319,6 +323,8 @@ export interface RestoreClusterRequest { serviceAccountId: string; /** User security groups */ securityGroupIds: string[]; + /** Deletion Protection inhibits deletion of the cluster */ + deletionProtection: boolean; } export interface RestoreClusterRequest_LabelsEntry { @@ -752,6 +758,22 @@ export interface DeleteClusterHostsMetadata { hostNames: string[]; } +export interface RestartClusterHostsRequest { + $type: "yandex.cloud.mdb.clickhouse.v1.RestartClusterHostsRequest"; + /** Required. ID of the Clickhouse cluster. */ + clusterId: string; + /** Required. Name of the hosts to restart. */ + hostNames: string[]; +} + +export interface RestartClusterHostsMetadata { + $type: "yandex.cloud.mdb.clickhouse.v1.RestartClusterHostsMetadata"; + /** Required. ID of the ClickHouse cluster. */ + clusterId: string; + /** Required. The name of restarting host. */ + hostNames: string[]; +} + export interface GetClusterShardRequest { $type: "yandex.cloud.mdb.clickhouse.v1.GetClusterShardRequest"; /** @@ -825,6 +847,39 @@ export interface AddClusterShardMetadata { shardName: string; } +export interface AddClusterShardsRequest { + $type: "yandex.cloud.mdb.clickhouse.v1.AddClusterShardsRequest"; + /** + * ID of the ClickHouse cluster to add shards to. + * To get the ClickHouse cluster ID, use a [ClusterService.List] request. + */ + clusterId: string; + /** + * Properties of each shard to be created. + * If [ShardSpec.config_spec] is not specified for some shard, for this shard + * it defaults to the configuration of the first shard in the cluster. + */ + shardSpecs: ShardSpec[]; + /** + * Individual configurations for hosts that should be created for the shards. + * Two options are available: + * 1. If `host_specs` is empty, each shard's number and configurations of hosts will + * be copied from those of the first shard in the cluster; + * 2. Otherwise `host_specs` should contain at least one host per created shard. + */ + hostSpecs: HostSpec[]; + /** Whether to copy schema to hosts of the new shards. The schema is copied from hosts of an existing shard. */ + copySchema?: boolean; +} + +export interface AddClusterShardsMetadata { + $type: "yandex.cloud.mdb.clickhouse.v1.AddClusterShardsMetadata"; + /** ID of the cluster that the shards are being added to. */ + clusterId: string; + /** Names of the shards being created. */ + shardNames: string[]; +} + export interface UpdateClusterShardRequest { $type: "yandex.cloud.mdb.clickhouse.v1.UpdateClusterShardRequest"; /** @@ -873,6 +928,28 @@ export interface DeleteClusterShardMetadata { shardName: string; } +export interface DeleteClusterShardsRequest { + $type: "yandex.cloud.mdb.clickhouse.v1.DeleteClusterShardsRequest"; + /** + * ID of the ClickHouse cluster the shards belong to. + * To get the cluster ID, use a [ClusterService.List] request. + */ + clusterId: string; + /** + * Names of the shards to be deleted. + * To get the name of a shard, use a [ClusterService.ListShards] request. + */ + shardNames: string[]; +} + +export interface DeleteClusterShardsMetadata { + $type: "yandex.cloud.mdb.clickhouse.v1.DeleteClusterShardsMetadata"; + /** ID of the cluster that contains the shards being deleted. */ + clusterId: string; + /** Names of the shards being deleted. */ + shardNames: string[]; +} + export interface GetClusterShardGroupRequest { $type: "yandex.cloud.mdb.clickhouse.v1.GetClusterShardGroupRequest"; /** @@ -1145,6 +1222,8 @@ export interface ConfigSpec { adminPassword: string; /** Whether cluster should use embedded Keeper instead of Zookeeper */ embeddedKeeper?: boolean; + /** Retain period of automatically created backup in days */ + backupRetainPeriodDays?: number; } export interface ConfigSpec_Clickhouse { @@ -1183,6 +1262,16 @@ export interface ShardConfigSpec_Clickhouse { weight?: number; } +export interface ShardSpec { + $type: "yandex.cloud.mdb.clickhouse.v1.ShardSpec"; + /** Name of the shard to be created. */ + name: string; + /** Configuration of the shard to be created. */ + configSpec?: ShardConfigSpec; + /** Shard groups that contain the shard. */ + shardGroupNames: string[]; +} + const baseGetClusterRequest: object = { $type: "yandex.cloud.mdb.clickhouse.v1.GetClusterRequest", clusterId: "", @@ -1913,6 +2002,7 @@ const baseUpdateClusterRequest: object = { serviceAccountId: "", securityGroupIds: "", deletionProtection: false, + networkId: "", }; export const UpdateClusterRequest = { @@ -1963,6 +2053,9 @@ export const UpdateClusterRequest = { if (message.deletionProtection === true) { writer.uint32(80).bool(message.deletionProtection); } + if (message.networkId !== "") { + writer.uint32(90).string(message.networkId); + } return writer; }, @@ -2017,6 +2110,9 @@ export const UpdateClusterRequest = { case 10: message.deletionProtection = reader.bool(); break; + case 11: + message.networkId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -2070,6 +2166,10 @@ export const UpdateClusterRequest = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : false; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; return message; }, @@ -2106,6 +2206,7 @@ export const UpdateClusterRequest = { } message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + message.networkId !== undefined && (obj.networkId = message.networkId); return obj; }, @@ -2140,6 +2241,7 @@ export const UpdateClusterRequest = { : undefined; message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; message.deletionProtection = object.deletionProtection ?? false; + message.networkId = object.networkId ?? ""; return message; }, }; @@ -2867,6 +2969,15 @@ export const AddClusterZookeeperRequest = { for (const v of message.hostSpecs) { HostSpec.encode(v!, writer.uint32(26).fork()).ldelim(); } + if (message.convertTablesToReplicated !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.convertTablesToReplicated!, + }, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -2892,6 +3003,12 @@ export const AddClusterZookeeperRequest = { case 3: message.hostSpecs.push(HostSpec.decode(reader, reader.uint32())); break; + case 4: + message.convertTablesToReplicated = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -2915,6 +3032,11 @@ export const AddClusterZookeeperRequest = { message.hostSpecs = (object.hostSpecs ?? []).map((e: any) => HostSpec.fromJSON(e) ); + message.convertTablesToReplicated = + object.convertTablesToReplicated !== undefined && + object.convertTablesToReplicated !== null + ? Boolean(object.convertTablesToReplicated) + : undefined; return message; }, @@ -2932,6 +3054,8 @@ export const AddClusterZookeeperRequest = { } else { obj.hostSpecs = []; } + message.convertTablesToReplicated !== undefined && + (obj.convertTablesToReplicated = message.convertTablesToReplicated); return obj; }, @@ -2948,6 +3072,8 @@ export const AddClusterZookeeperRequest = { : undefined; message.hostSpecs = object.hostSpecs?.map((e) => HostSpec.fromPartial(e)) || []; + message.convertTablesToReplicated = + object.convertTablesToReplicated ?? undefined; return message; }, }; @@ -3172,6 +3298,7 @@ const baseRestoreClusterRequest: object = { folderId: "", serviceAccountId: "", securityGroupIds: "", + deletionProtection: false, }; export const RestoreClusterRequest = { @@ -3225,6 +3352,9 @@ export const RestoreClusterRequest = { for (const v of message.securityGroupIds) { writer.uint32(90).string(v!); } + if (message.deletionProtection === true) { + writer.uint32(112).bool(message.deletionProtection); + } return writer; }, @@ -3284,6 +3414,9 @@ export const RestoreClusterRequest = { case 11: message.securityGroupIds.push(reader.string()); break; + case 14: + message.deletionProtection = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -3341,6 +3474,11 @@ export const RestoreClusterRequest = { message.securityGroupIds = (object.securityGroupIds ?? []).map((e: any) => String(e) ); + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; return message; }, @@ -3383,6 +3521,8 @@ export const RestoreClusterRequest = { } else { obj.securityGroupIds = []; } + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); return obj; }, @@ -3414,6 +3554,7 @@ export const RestoreClusterRequest = { message.folderId = object.folderId ?? ""; message.serviceAccountId = object.serviceAccountId ?? ""; message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; + message.deletionProtection = object.deletionProtection ?? false; return message; }, }; @@ -5686,6 +5827,184 @@ messageTypeRegistry.set( DeleteClusterHostsMetadata ); +const baseRestartClusterHostsRequest: object = { + $type: "yandex.cloud.mdb.clickhouse.v1.RestartClusterHostsRequest", + clusterId: "", + hostNames: "", +}; + +export const RestartClusterHostsRequest = { + $type: "yandex.cloud.mdb.clickhouse.v1.RestartClusterHostsRequest" as const, + + encode( + message: RestartClusterHostsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + for (const v of message.hostNames) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RestartClusterHostsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRestartClusterHostsRequest, + } as RestartClusterHostsRequest; + message.hostNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.hostNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RestartClusterHostsRequest { + const message = { + ...baseRestartClusterHostsRequest, + } as RestartClusterHostsRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: RestartClusterHostsRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.hostNames) { + obj.hostNames = message.hostNames.map((e) => e); + } else { + obj.hostNames = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): RestartClusterHostsRequest { + const message = { + ...baseRestartClusterHostsRequest, + } as RestartClusterHostsRequest; + message.clusterId = object.clusterId ?? ""; + message.hostNames = object.hostNames?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + RestartClusterHostsRequest.$type, + RestartClusterHostsRequest +); + +const baseRestartClusterHostsMetadata: object = { + $type: "yandex.cloud.mdb.clickhouse.v1.RestartClusterHostsMetadata", + clusterId: "", + hostNames: "", +}; + +export const RestartClusterHostsMetadata = { + $type: "yandex.cloud.mdb.clickhouse.v1.RestartClusterHostsMetadata" as const, + + encode( + message: RestartClusterHostsMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + for (const v of message.hostNames) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RestartClusterHostsMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRestartClusterHostsMetadata, + } as RestartClusterHostsMetadata; + message.hostNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.hostNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RestartClusterHostsMetadata { + const message = { + ...baseRestartClusterHostsMetadata, + } as RestartClusterHostsMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: RestartClusterHostsMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.hostNames) { + obj.hostNames = message.hostNames.map((e) => e); + } else { + obj.hostNames = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): RestartClusterHostsMetadata { + const message = { + ...baseRestartClusterHostsMetadata, + } as RestartClusterHostsMetadata; + message.clusterId = object.clusterId ?? ""; + message.hostNames = object.hostNames?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + RestartClusterHostsMetadata.$type, + RestartClusterHostsMetadata +); + const baseGetClusterShardRequest: object = { $type: "yandex.cloud.mdb.clickhouse.v1.GetClusterShardRequest", clusterId: "", @@ -6171,31 +6490,30 @@ export const AddClusterShardMetadata = { messageTypeRegistry.set(AddClusterShardMetadata.$type, AddClusterShardMetadata); -const baseUpdateClusterShardRequest: object = { - $type: "yandex.cloud.mdb.clickhouse.v1.UpdateClusterShardRequest", +const baseAddClusterShardsRequest: object = { + $type: "yandex.cloud.mdb.clickhouse.v1.AddClusterShardsRequest", clusterId: "", - shardName: "", }; -export const UpdateClusterShardRequest = { - $type: "yandex.cloud.mdb.clickhouse.v1.UpdateClusterShardRequest" as const, +export const AddClusterShardsRequest = { + $type: "yandex.cloud.mdb.clickhouse.v1.AddClusterShardsRequest" as const, encode( - message: UpdateClusterShardRequest, + message: AddClusterShardsRequest, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.clusterId !== "") { writer.uint32(10).string(message.clusterId); } - if (message.shardName !== "") { - writer.uint32(18).string(message.shardName); + for (const v of message.shardSpecs) { + ShardSpec.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.updateMask !== undefined) { - FieldMask.encode(message.updateMask, writer.uint32(26).fork()).ldelim(); + for (const v of message.hostSpecs) { + HostSpec.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (message.configSpec !== undefined) { - ShardConfigSpec.encode( - message.configSpec, + if (message.copySchema !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.copySchema! }, writer.uint32(34).fork() ).ldelim(); } @@ -6205,12 +6523,14 @@ export const UpdateClusterShardRequest = { decode( input: _m0.Reader | Uint8Array, length?: number - ): UpdateClusterShardRequest { + ): AddClusterShardsRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseUpdateClusterShardRequest, - } as UpdateClusterShardRequest; + ...baseAddClusterShardsRequest, + } as AddClusterShardsRequest; + message.shardSpecs = []; + message.hostSpecs = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6218,13 +6538,13 @@ export const UpdateClusterShardRequest = { message.clusterId = reader.string(); break; case 2: - message.shardName = reader.string(); + message.shardSpecs.push(ShardSpec.decode(reader, reader.uint32())); break; case 3: - message.updateMask = FieldMask.decode(reader, reader.uint32()); + message.hostSpecs.push(HostSpec.decode(reader, reader.uint32())); break; case 4: - message.configSpec = ShardConfigSpec.decode(reader, reader.uint32()); + message.copySchema = BoolValue.decode(reader, reader.uint32()).value; break; default: reader.skipType(tag & 7); @@ -6234,7 +6554,219 @@ export const UpdateClusterShardRequest = { return message; }, - fromJSON(object: any): UpdateClusterShardRequest { + fromJSON(object: any): AddClusterShardsRequest { + const message = { + ...baseAddClusterShardsRequest, + } as AddClusterShardsRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.shardSpecs = (object.shardSpecs ?? []).map((e: any) => + ShardSpec.fromJSON(e) + ); + message.hostSpecs = (object.hostSpecs ?? []).map((e: any) => + HostSpec.fromJSON(e) + ); + message.copySchema = + object.copySchema !== undefined && object.copySchema !== null + ? Boolean(object.copySchema) + : undefined; + return message; + }, + + toJSON(message: AddClusterShardsRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.shardSpecs) { + obj.shardSpecs = message.shardSpecs.map((e) => + e ? ShardSpec.toJSON(e) : undefined + ); + } else { + obj.shardSpecs = []; + } + if (message.hostSpecs) { + obj.hostSpecs = message.hostSpecs.map((e) => + e ? HostSpec.toJSON(e) : undefined + ); + } else { + obj.hostSpecs = []; + } + message.copySchema !== undefined && (obj.copySchema = message.copySchema); + return obj; + }, + + fromPartial, I>>( + object: I + ): AddClusterShardsRequest { + const message = { + ...baseAddClusterShardsRequest, + } as AddClusterShardsRequest; + message.clusterId = object.clusterId ?? ""; + message.shardSpecs = + object.shardSpecs?.map((e) => ShardSpec.fromPartial(e)) || []; + message.hostSpecs = + object.hostSpecs?.map((e) => HostSpec.fromPartial(e)) || []; + message.copySchema = object.copySchema ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(AddClusterShardsRequest.$type, AddClusterShardsRequest); + +const baseAddClusterShardsMetadata: object = { + $type: "yandex.cloud.mdb.clickhouse.v1.AddClusterShardsMetadata", + clusterId: "", + shardNames: "", +}; + +export const AddClusterShardsMetadata = { + $type: "yandex.cloud.mdb.clickhouse.v1.AddClusterShardsMetadata" as const, + + encode( + message: AddClusterShardsMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + for (const v of message.shardNames) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AddClusterShardsMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAddClusterShardsMetadata, + } as AddClusterShardsMetadata; + message.shardNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.shardNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AddClusterShardsMetadata { + const message = { + ...baseAddClusterShardsMetadata, + } as AddClusterShardsMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.shardNames = (object.shardNames ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: AddClusterShardsMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.shardNames) { + obj.shardNames = message.shardNames.map((e) => e); + } else { + obj.shardNames = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): AddClusterShardsMetadata { + const message = { + ...baseAddClusterShardsMetadata, + } as AddClusterShardsMetadata; + message.clusterId = object.clusterId ?? ""; + message.shardNames = object.shardNames?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + AddClusterShardsMetadata.$type, + AddClusterShardsMetadata +); + +const baseUpdateClusterShardRequest: object = { + $type: "yandex.cloud.mdb.clickhouse.v1.UpdateClusterShardRequest", + clusterId: "", + shardName: "", +}; + +export const UpdateClusterShardRequest = { + $type: "yandex.cloud.mdb.clickhouse.v1.UpdateClusterShardRequest" as const, + + encode( + message: UpdateClusterShardRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.shardName !== "") { + writer.uint32(18).string(message.shardName); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(26).fork()).ldelim(); + } + if (message.configSpec !== undefined) { + ShardConfigSpec.encode( + message.configSpec, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateClusterShardRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateClusterShardRequest, + } as UpdateClusterShardRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.shardName = reader.string(); + break; + case 3: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 4: + message.configSpec = ShardConfigSpec.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateClusterShardRequest { const message = { ...baseUpdateClusterShardRequest, } as UpdateClusterShardRequest; @@ -6558,6 +7090,184 @@ messageTypeRegistry.set( DeleteClusterShardMetadata ); +const baseDeleteClusterShardsRequest: object = { + $type: "yandex.cloud.mdb.clickhouse.v1.DeleteClusterShardsRequest", + clusterId: "", + shardNames: "", +}; + +export const DeleteClusterShardsRequest = { + $type: "yandex.cloud.mdb.clickhouse.v1.DeleteClusterShardsRequest" as const, + + encode( + message: DeleteClusterShardsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + for (const v of message.shardNames) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteClusterShardsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteClusterShardsRequest, + } as DeleteClusterShardsRequest; + message.shardNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.shardNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteClusterShardsRequest { + const message = { + ...baseDeleteClusterShardsRequest, + } as DeleteClusterShardsRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.shardNames = (object.shardNames ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: DeleteClusterShardsRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.shardNames) { + obj.shardNames = message.shardNames.map((e) => e); + } else { + obj.shardNames = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteClusterShardsRequest { + const message = { + ...baseDeleteClusterShardsRequest, + } as DeleteClusterShardsRequest; + message.clusterId = object.clusterId ?? ""; + message.shardNames = object.shardNames?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteClusterShardsRequest.$type, + DeleteClusterShardsRequest +); + +const baseDeleteClusterShardsMetadata: object = { + $type: "yandex.cloud.mdb.clickhouse.v1.DeleteClusterShardsMetadata", + clusterId: "", + shardNames: "", +}; + +export const DeleteClusterShardsMetadata = { + $type: "yandex.cloud.mdb.clickhouse.v1.DeleteClusterShardsMetadata" as const, + + encode( + message: DeleteClusterShardsMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + for (const v of message.shardNames) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteClusterShardsMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteClusterShardsMetadata, + } as DeleteClusterShardsMetadata; + message.shardNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.shardNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteClusterShardsMetadata { + const message = { + ...baseDeleteClusterShardsMetadata, + } as DeleteClusterShardsMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.shardNames = (object.shardNames ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: DeleteClusterShardsMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.shardNames) { + obj.shardNames = message.shardNames.map((e) => e); + } else { + obj.shardNames = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteClusterShardsMetadata { + const message = { + ...baseDeleteClusterShardsMetadata, + } as DeleteClusterShardsMetadata; + message.clusterId = object.clusterId ?? ""; + message.shardNames = object.shardNames?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteClusterShardsMetadata.$type, + DeleteClusterShardsMetadata +); + const baseGetClusterShardGroupRequest: object = { $type: "yandex.cloud.mdb.clickhouse.v1.GetClusterShardGroupRequest", clusterId: "", @@ -8402,6 +9112,15 @@ export const ConfigSpec = { writer.uint32(82).fork() ).ldelim(); } + if (message.backupRetainPeriodDays !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.backupRetainPeriodDays!, + }, + writer.uint32(90).fork() + ).ldelim(); + } return writer; }, @@ -8457,6 +9176,12 @@ export const ConfigSpec = { reader.uint32() ).value; break; + case 11: + message.backupRetainPeriodDays = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -8510,6 +9235,11 @@ export const ConfigSpec = { object.embeddedKeeper !== undefined && object.embeddedKeeper !== null ? Boolean(object.embeddedKeeper) : undefined; + message.backupRetainPeriodDays = + object.backupRetainPeriodDays !== undefined && + object.backupRetainPeriodDays !== null + ? Number(object.backupRetainPeriodDays) + : undefined; return message; }, @@ -8542,6 +9272,8 @@ export const ConfigSpec = { (obj.adminPassword = message.adminPassword); message.embeddedKeeper !== undefined && (obj.embeddedKeeper = message.embeddedKeeper); + message.backupRetainPeriodDays !== undefined && + (obj.backupRetainPeriodDays = message.backupRetainPeriodDays); return obj; }, @@ -8575,6 +9307,7 @@ export const ConfigSpec = { message.sqlUserManagement = object.sqlUserManagement ?? undefined; message.adminPassword = object.adminPassword ?? ""; message.embeddedKeeper = object.embeddedKeeper ?? undefined; + message.backupRetainPeriodDays = object.backupRetainPeriodDays ?? undefined; return message; }, }; @@ -8930,6 +9663,106 @@ messageTypeRegistry.set( ShardConfigSpec_Clickhouse ); +const baseShardSpec: object = { + $type: "yandex.cloud.mdb.clickhouse.v1.ShardSpec", + name: "", + shardGroupNames: "", +}; + +export const ShardSpec = { + $type: "yandex.cloud.mdb.clickhouse.v1.ShardSpec" as const, + + encode( + message: ShardSpec, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.configSpec !== undefined) { + ShardConfigSpec.encode( + message.configSpec, + writer.uint32(18).fork() + ).ldelim(); + } + for (const v of message.shardGroupNames) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ShardSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseShardSpec } as ShardSpec; + message.shardGroupNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.configSpec = ShardConfigSpec.decode(reader, reader.uint32()); + break; + case 3: + message.shardGroupNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ShardSpec { + const message = { ...baseShardSpec } as ShardSpec; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.configSpec = + object.configSpec !== undefined && object.configSpec !== null + ? ShardConfigSpec.fromJSON(object.configSpec) + : undefined; + message.shardGroupNames = (object.shardGroupNames ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: ShardSpec): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.configSpec !== undefined && + (obj.configSpec = message.configSpec + ? ShardConfigSpec.toJSON(message.configSpec) + : undefined); + if (message.shardGroupNames) { + obj.shardGroupNames = message.shardGroupNames.map((e) => e); + } else { + obj.shardGroupNames = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ShardSpec { + const message = { ...baseShardSpec } as ShardSpec; + message.name = object.name ?? ""; + message.configSpec = + object.configSpec !== undefined && object.configSpec !== null + ? ShardConfigSpec.fromPartial(object.configSpec) + : undefined; + message.shardGroupNames = object.shardGroupNames?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(ShardSpec.$type, ShardSpec); + /** A set of methods for managing ClickHouse clusters. */ export const ClusterServiceService = { /** @@ -9191,6 +10024,18 @@ export const ClusterServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + restartHosts: { + path: "/yandex.cloud.mdb.clickhouse.v1.ClusterService/RestartHosts", + requestStream: false, + responseStream: false, + requestSerialize: (value: RestartClusterHostsRequest) => + Buffer.from(RestartClusterHostsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + RestartClusterHostsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, /** Returns the specified shard. */ getShard: { path: "/yandex.cloud.mdb.clickhouse.v1.ClusterService/GetShard", @@ -9229,6 +10074,19 @@ export const ClusterServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Creates one or more shards in the specified cluster. */ + addShards: { + path: "/yandex.cloud.mdb.clickhouse.v1.ClusterService/AddShards", + requestStream: false, + responseStream: false, + requestSerialize: (value: AddClusterShardsRequest) => + Buffer.from(AddClusterShardsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + AddClusterShardsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, /** Modifies the specified shard. */ updateShard: { path: "/yandex.cloud.mdb.clickhouse.v1.ClusterService/UpdateShard", @@ -9255,6 +10113,19 @@ export const ClusterServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Deletes the specified shards (one or more). */ + deleteShards: { + path: "/yandex.cloud.mdb.clickhouse.v1.ClusterService/DeleteShards", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteClusterShardsRequest) => + Buffer.from(DeleteClusterShardsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteClusterShardsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, /** Returns the specified shard group. */ getShardGroup: { path: "/yandex.cloud.mdb.clickhouse.v1.ClusterService/GetShardGroup", @@ -9446,6 +10317,7 @@ export interface ClusterServiceServer extends UntypedServiceImplementation { updateHosts: handleUnaryCall; /** Deletes the specified hosts for a cluster. */ deleteHosts: handleUnaryCall; + restartHosts: handleUnaryCall; /** Returns the specified shard. */ getShard: handleUnaryCall; /** Retrieves a list of shards that belong to the specified cluster. */ @@ -9455,10 +10327,14 @@ export interface ClusterServiceServer extends UntypedServiceImplementation { >; /** Creates a new shard in the specified cluster. */ addShard: handleUnaryCall; + /** Creates one or more shards in the specified cluster. */ + addShards: handleUnaryCall; /** Modifies the specified shard. */ updateShard: handleUnaryCall; /** Deletes the specified shard. */ deleteShard: handleUnaryCall; + /** Deletes the specified shards (one or more). */ + deleteShards: handleUnaryCall; /** Returns the specified shard group. */ getShardGroup: handleUnaryCall; /** Retrieves a list of shard groups that belong to specified cluster. */ @@ -9861,6 +10737,21 @@ export interface ClusterServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + restartHosts( + request: RestartClusterHostsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + restartHosts( + request: RestartClusterHostsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + restartHosts( + request: RestartClusterHostsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; /** Returns the specified shard. */ getShard( request: GetClusterShardRequest, @@ -9918,6 +10809,22 @@ export interface ClusterServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Creates one or more shards in the specified cluster. */ + addShards( + request: AddClusterShardsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + addShards( + request: AddClusterShardsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + addShards( + request: AddClusterShardsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; /** Modifies the specified shard. */ updateShard( request: UpdateClusterShardRequest, @@ -9950,6 +10857,22 @@ export interface ClusterServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Deletes the specified shards (one or more). */ + deleteShards( + request: DeleteClusterShardsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deleteShards( + request: DeleteClusterShardsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deleteShards( + request: DeleteClusterShardsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; /** Returns the specified shard group. */ getShardGroup( request: GetClusterShardGroupRequest, diff --git a/src/generated/yandex/cloud/mdb/clickhouse/v1/config/clickhouse.ts b/src/generated/yandex/cloud/mdb/clickhouse/v1/config/clickhouse.ts index d0cd8569..698376e0 100644 --- a/src/generated/yandex/cloud/mdb/clickhouse/v1/config/clickhouse.ts +++ b/src/generated/yandex/cloud/mdb/clickhouse/v1/config/clickhouse.ts @@ -66,6 +66,8 @@ export interface ClickhouseConfig { builtinDictionariesReloadInterval?: number; /** The server's time zone to be used in DateTime fields conversions. Specified as an IANA identifier. */ timezone: string; + /** Enable or disable geobase. */ + geobaseEnabled?: boolean; /** Address of the archive with the user geobase in Object Storage. */ geobaseUri: string; /** @@ -138,8 +140,88 @@ export interface ClickhouseConfig { textLogRetentionTime?: number; /** Logging level for text_log system table. Possible values: TRACE, DEBUG, INFORMATION, WARNING, ERROR. */ textLogLevel: ClickhouseConfig_LogLevel; + /** Enable or disable opentelemetry_span_log system table. Default value: false. */ opentelemetrySpanLogEnabled?: boolean; + /** + * The maximum size that opentelemetry_span_log can grow to before old data will be removed. If set to 0 (default), + * automatic removal of opentelemetry_span_log data based on size is disabled. + */ + opentelemetrySpanLogRetentionSize?: number; + /** + * The maximum time that opentelemetry_span_log records will be retained before removal. If set to 0, + * automatic removal of opentelemetry_span_log data based on time is disabled. + */ + opentelemetrySpanLogRetentionTime?: number; + /** Enable or disable query_views_log system table. Default value: false. */ + queryViewsLogEnabled?: boolean; + /** + * The maximum size that query_views_log can grow to before old data will be removed. If set to 0 (default), + * automatic removal of query_views_log data based on size is disabled. + */ + queryViewsLogRetentionSize?: number; + /** + * The maximum time that query_views_log records will be retained before removal. If set to 0, + * automatic removal of query_views_log data based on time is disabled. + */ + queryViewsLogRetentionTime?: number; + /** Enable or disable asynchronous_metric_log system table. Default value: false. */ + asynchronousMetricLogEnabled?: boolean; + /** + * The maximum size that asynchronous_metric_log can grow to before old data will be removed. If set to 0 (default), + * automatic removal of asynchronous_metric_log data based on size is disabled. + */ + asynchronousMetricLogRetentionSize?: number; + /** + * The maximum time that asynchronous_metric_log records will be retained before removal. If set to 0, + * automatic removal of asynchronous_metric_log data based on time is disabled. + */ + asynchronousMetricLogRetentionTime?: number; + /** Enable or disable session_log system table. Default value: false. */ + sessionLogEnabled?: boolean; + /** + * The maximum size that session_log can grow to before old data will be removed. If set to 0 (default), + * automatic removal of session_log data based on size is disabled. + */ + sessionLogRetentionSize?: number; + /** + * The maximum time that session_log records will be retained before removal. If set to 0, + * automatic removal of session_log data based on time is disabled. + */ + sessionLogRetentionTime?: number; + /** Enable or disable zookeeper_log system table. Default value: false. */ + zookeeperLogEnabled?: boolean; + /** + * The maximum size that zookeeper_log can grow to before old data will be removed. If set to 0 (default), + * automatic removal of zookeeper_log data based on size is disabled. + */ + zookeeperLogRetentionSize?: number; + /** + * The maximum time that zookeeper_log records will be retained before removal. If set to 0, + * automatic removal of zookeeper_log data based on time is disabled. + */ + zookeeperLogRetentionTime?: number; + /** + * Enable or disable asynchronous_insert_log system table. Default value: false. + * Minimal required ClickHouse version: 22.10. + */ + asynchronousInsertLogEnabled?: boolean; + /** + * The maximum size that asynchronous_insert_log can grow to before old data will be removed. If set to 0 (default), + * automatic removal of asynchronous_insert_log data based on size is disabled. + */ + asynchronousInsertLogRetentionSize?: number; + /** + * The maximum time that asynchronous_insert_log records will be retained before removal. If set to 0, + * automatic removal of asynchronous_insert_log data based on time is disabled. + */ + asynchronousInsertLogRetentionTime?: number; backgroundPoolSize?: number; + /** + * Sets a ratio between the number of threads and the number of background merges and mutations that can be executed concurrently. For example, if the ratio equals to 2 and background_pool_size is set to 16 then ClickHouse can execute 32 background merges concurrently. This is possible, because background operations could be suspended and postponed. This is needed to give small merges more execution priority. You can only increase this ratio at runtime. To lower it you have to restart the server. The same as for background_pool_size setting background_merges_mutations_concurrency_ratio could be applied from the default profile for backward compatibility. + * Default: 2 + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#background_merges_mutations_concurrency_ratio) + */ + backgroundMergesMutationsConcurrencyRatio?: number; backgroundSchedulePoolSize?: number; /** * Sets the number of threads performing background fetches for tables with **ReplicatedMergeTree** engines. Default value: 8. @@ -151,10 +233,16 @@ export interface ClickhouseConfig { backgroundDistributedSchedulePoolSize?: number; backgroundBufferFlushSchedulePoolSize?: number; backgroundMessageBrokerSchedulePoolSize?: number; + /** + * The maximum number of threads that will be used for performing a variety of operations (mostly garbage collection) for *MergeTree-engine tables in a background. + * Default: 8 + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#background_common_pool_size) + */ + backgroundCommonPoolSize?: number; /** * The default database. * - * To get a list of cluster databases, see [Yandex Managed ClickHouse documentation](https://cloud.yandex.com/en/docs/managed-clickhouse/operations/databases#list-db). + * To get a list of cluster databases, see [Yandex Managed ClickHouse documentation](/docs/managed-clickhouse/operations/databases#list-db). */ defaultDatabase?: string; /** @@ -165,66 +253,23 @@ export interface ClickhouseConfig { totalMemoryProfilerStep?: number; totalMemoryTrackerSampleProbability?: number; /** - * The maximum number of threads that will be used for performing a variety of operations (mostly garbage collection) for *MergeTree-engine tables in a background. - * Default: 8 - * Min version: 21.11 - * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#background_common_pool_size) - */ - backgroundCommonPoolSize?: number; - /** - * Sets a ratio between the number of threads and the number of background merges and mutations that can be executed concurrently. For example, if the ratio equals to 2 and background_pool_size is set to 16 then ClickHouse can execute 32 background merges concurrently. This is possible, because background operations could be suspended and postponed. This is needed to give small merges more execution priority. You can only increase this ratio at runtime. To lower it you have to restart the server. The same as for background_pool_size setting background_merges_mutations_concurrency_ratio could be applied from the default profile for backward compatibility. - * Default: 2 - * Min_version: 21.11 - * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#background_merges_mutations_concurrency_ratio) - */ - backgroundMergesMutationsConcurrencyRatio?: number; - /** - * Default: false - * Min version: 21.9 - */ - queryViewsLogEnabled?: boolean; - /** Default: 0 */ - queryViewsLogRetentionSize?: number; - queryViewsLogRetentionTime?: number; - /** - * Default: false - * Min version: 20.11 - */ - asynchronousMetricLogEnabled?: boolean; - /** Default: 0 */ - asynchronousMetricLogRetentionSize?: number; - asynchronousMetricLogRetentionTime?: number; - /** - * Default: 0 - * Min version: 20.11 + * Regexp-based rules, which will be applied to queries as well as all log messages before storing them in server logs, system.query_log, system.text_log, system.processes tables, and in logs sent to the client. That allows preventing sensitive data leakage from SQL queries (like names, emails, personal identifiers or credit card numbers) to logs. + * Change of these settings is applied with ClickHouse restart + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#query-masking-rules) */ - opentelemetrySpanLogRetentionSize?: number; - opentelemetrySpanLogRetentionTime?: number; - /** - * Default: false - * Min version: 21.11 - */ - sessionLogEnabled?: boolean; - /** Default: 0 */ - sessionLogRetentionSize?: number; - sessionLogRetentionTime?: number; + queryMaskingRules: ClickhouseConfig_QueryMaskingRule[]; /** - * Default: false - * Min version: 21.9 + * Lazy loading of dictionaries. + * Default: true + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#dictionaries_lazy_load) */ - zookeeperLogEnabled?: boolean; - /** Default: 0 */ - zookeeperLogRetentionSize?: number; - zookeeperLogRetentionTime?: number; + dictionariesLazyLoad?: boolean; /** - * Default: false - * Min version: 22.10 + * [Query cache](https://clickhouse.com/docs/en/operations/query-cache) configuration. + * Min version: 23.5 + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#query_cache) */ - asynchronousInsertLogEnabled?: boolean; - /** Default: 0 */ - asynchronousInsertLogRetentionSize?: number; - asynchronousInsertLogRetentionTime?: number; - geobaseEnabled?: boolean; + queryCache?: ClickhouseConfig_QueryCache; } export enum ClickhouseConfig_LogLevel { @@ -366,6 +411,32 @@ export interface ClickhouseConfig_MergeTree { * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/settings/settings#merge_selecting_sleep_ms) */ mergeSelectingSleepMs?: number; + /** + * The number of rows that are read from the merged parts into memory. + * Default: 8192 + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/settings/settings#merge_max_block_size) + */ + mergeMaxBlockSize?: number; + /** + * Enables the check at table creation, that the data type of a column for sampling or sampling expression is correct. The data type must be one of unsigned [integer types](https://clickhouse.com/docs/en/sql-reference/data-types/int-uint): UInt8, UInt16, UInt32, UInt64. + * Default: true + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/settings/merge-tree-settings#check_sample_column_is_correct) + */ + checkSampleColumnIsCorrect?: boolean; + /** + * Maximum sleep time for merge selecting, a lower setting will trigger selecting tasks in background_schedule_pool frequently which result in large amount of requests to zookeeper in large-scale clusters. + * Default: 60000 + * Min_version: 23.6 + * See in-depth description in [ClickHouse GitHub](https://github.com/ClickHouse/ClickHouse/blob/4add9db84859bff7410cf934a3904b0414e36e51/src/Storages/MergeTree/MergeTreeSettings.h#L71) + */ + maxMergeSelectingSleepMs?: number; + /** + * Maximum period to clean old queue logs, blocks hashes and parts. + * Default: 300 + * Min_version: 23.6 + * See in-depth description in [ClickHouse GitHub](https://github.com/ClickHouse/ClickHouse/blob/4add9db84859bff7410cf934a3904b0414e36e51/src/Storages/MergeTree/MergeTreeSettings.h#L142) + */ + maxCleanupDelayPeriod?: number; } export interface ClickhouseConfig_Kafka { @@ -377,6 +448,8 @@ export interface ClickhouseConfig_Kafka { enableSslCertificateVerification?: boolean; maxPollIntervalMs?: number; sessionTimeoutMs?: number; + debug: ClickhouseConfig_Kafka_Debug; + autoOffsetReset: ClickhouseConfig_Kafka_AutoOffsetReset; } export enum ClickhouseConfig_Kafka_SecurityProtocol { @@ -487,6 +560,234 @@ export function clickhouseConfig_Kafka_SaslMechanismToJSON( } } +export enum ClickhouseConfig_Kafka_Debug { + DEBUG_UNSPECIFIED = 0, + DEBUG_GENERIC = 1, + DEBUG_BROKER = 2, + DEBUG_TOPIC = 3, + DEBUG_METADATA = 4, + DEBUG_FEATURE = 5, + DEBUG_QUEUE = 6, + DEBUG_MSG = 7, + DEBUG_PROTOCOL = 8, + DEBUG_CGRP = 9, + DEBUG_SECURITY = 10, + DEBUG_FETCH = 11, + DEBUG_INTERCEPTOR = 12, + DEBUG_PLUGIN = 13, + DEBUG_CONSUMER = 14, + DEBUG_ADMIN = 15, + DEBUG_EOS = 16, + DEBUG_MOCK = 17, + DEBUG_ASSIGNOR = 18, + DEBUG_CONF = 19, + DEBUG_TELEMETRY = 20, + DEBUG_ALL = 21, + UNRECOGNIZED = -1, +} + +export function clickhouseConfig_Kafka_DebugFromJSON( + object: any +): ClickhouseConfig_Kafka_Debug { + switch (object) { + case 0: + case "DEBUG_UNSPECIFIED": + return ClickhouseConfig_Kafka_Debug.DEBUG_UNSPECIFIED; + case 1: + case "DEBUG_GENERIC": + return ClickhouseConfig_Kafka_Debug.DEBUG_GENERIC; + case 2: + case "DEBUG_BROKER": + return ClickhouseConfig_Kafka_Debug.DEBUG_BROKER; + case 3: + case "DEBUG_TOPIC": + return ClickhouseConfig_Kafka_Debug.DEBUG_TOPIC; + case 4: + case "DEBUG_METADATA": + return ClickhouseConfig_Kafka_Debug.DEBUG_METADATA; + case 5: + case "DEBUG_FEATURE": + return ClickhouseConfig_Kafka_Debug.DEBUG_FEATURE; + case 6: + case "DEBUG_QUEUE": + return ClickhouseConfig_Kafka_Debug.DEBUG_QUEUE; + case 7: + case "DEBUG_MSG": + return ClickhouseConfig_Kafka_Debug.DEBUG_MSG; + case 8: + case "DEBUG_PROTOCOL": + return ClickhouseConfig_Kafka_Debug.DEBUG_PROTOCOL; + case 9: + case "DEBUG_CGRP": + return ClickhouseConfig_Kafka_Debug.DEBUG_CGRP; + case 10: + case "DEBUG_SECURITY": + return ClickhouseConfig_Kafka_Debug.DEBUG_SECURITY; + case 11: + case "DEBUG_FETCH": + return ClickhouseConfig_Kafka_Debug.DEBUG_FETCH; + case 12: + case "DEBUG_INTERCEPTOR": + return ClickhouseConfig_Kafka_Debug.DEBUG_INTERCEPTOR; + case 13: + case "DEBUG_PLUGIN": + return ClickhouseConfig_Kafka_Debug.DEBUG_PLUGIN; + case 14: + case "DEBUG_CONSUMER": + return ClickhouseConfig_Kafka_Debug.DEBUG_CONSUMER; + case 15: + case "DEBUG_ADMIN": + return ClickhouseConfig_Kafka_Debug.DEBUG_ADMIN; + case 16: + case "DEBUG_EOS": + return ClickhouseConfig_Kafka_Debug.DEBUG_EOS; + case 17: + case "DEBUG_MOCK": + return ClickhouseConfig_Kafka_Debug.DEBUG_MOCK; + case 18: + case "DEBUG_ASSIGNOR": + return ClickhouseConfig_Kafka_Debug.DEBUG_ASSIGNOR; + case 19: + case "DEBUG_CONF": + return ClickhouseConfig_Kafka_Debug.DEBUG_CONF; + case 20: + case "DEBUG_TELEMETRY": + return ClickhouseConfig_Kafka_Debug.DEBUG_TELEMETRY; + case 21: + case "DEBUG_ALL": + return ClickhouseConfig_Kafka_Debug.DEBUG_ALL; + case -1: + case "UNRECOGNIZED": + default: + return ClickhouseConfig_Kafka_Debug.UNRECOGNIZED; + } +} + +export function clickhouseConfig_Kafka_DebugToJSON( + object: ClickhouseConfig_Kafka_Debug +): string { + switch (object) { + case ClickhouseConfig_Kafka_Debug.DEBUG_UNSPECIFIED: + return "DEBUG_UNSPECIFIED"; + case ClickhouseConfig_Kafka_Debug.DEBUG_GENERIC: + return "DEBUG_GENERIC"; + case ClickhouseConfig_Kafka_Debug.DEBUG_BROKER: + return "DEBUG_BROKER"; + case ClickhouseConfig_Kafka_Debug.DEBUG_TOPIC: + return "DEBUG_TOPIC"; + case ClickhouseConfig_Kafka_Debug.DEBUG_METADATA: + return "DEBUG_METADATA"; + case ClickhouseConfig_Kafka_Debug.DEBUG_FEATURE: + return "DEBUG_FEATURE"; + case ClickhouseConfig_Kafka_Debug.DEBUG_QUEUE: + return "DEBUG_QUEUE"; + case ClickhouseConfig_Kafka_Debug.DEBUG_MSG: + return "DEBUG_MSG"; + case ClickhouseConfig_Kafka_Debug.DEBUG_PROTOCOL: + return "DEBUG_PROTOCOL"; + case ClickhouseConfig_Kafka_Debug.DEBUG_CGRP: + return "DEBUG_CGRP"; + case ClickhouseConfig_Kafka_Debug.DEBUG_SECURITY: + return "DEBUG_SECURITY"; + case ClickhouseConfig_Kafka_Debug.DEBUG_FETCH: + return "DEBUG_FETCH"; + case ClickhouseConfig_Kafka_Debug.DEBUG_INTERCEPTOR: + return "DEBUG_INTERCEPTOR"; + case ClickhouseConfig_Kafka_Debug.DEBUG_PLUGIN: + return "DEBUG_PLUGIN"; + case ClickhouseConfig_Kafka_Debug.DEBUG_CONSUMER: + return "DEBUG_CONSUMER"; + case ClickhouseConfig_Kafka_Debug.DEBUG_ADMIN: + return "DEBUG_ADMIN"; + case ClickhouseConfig_Kafka_Debug.DEBUG_EOS: + return "DEBUG_EOS"; + case ClickhouseConfig_Kafka_Debug.DEBUG_MOCK: + return "DEBUG_MOCK"; + case ClickhouseConfig_Kafka_Debug.DEBUG_ASSIGNOR: + return "DEBUG_ASSIGNOR"; + case ClickhouseConfig_Kafka_Debug.DEBUG_CONF: + return "DEBUG_CONF"; + case ClickhouseConfig_Kafka_Debug.DEBUG_TELEMETRY: + return "DEBUG_TELEMETRY"; + case ClickhouseConfig_Kafka_Debug.DEBUG_ALL: + return "DEBUG_ALL"; + default: + return "UNKNOWN"; + } +} + +export enum ClickhouseConfig_Kafka_AutoOffsetReset { + AUTO_OFFSET_RESET_UNSPECIFIED = 0, + AUTO_OFFSET_RESET_SMALLEST = 1, + AUTO_OFFSET_RESET_EARLIEST = 2, + AUTO_OFFSET_RESET_BEGINNING = 3, + AUTO_OFFSET_RESET_LARGEST = 4, + AUTO_OFFSET_RESET_LATEST = 5, + AUTO_OFFSET_RESET_END = 6, + AUTO_OFFSET_RESET_ERROR = 7, + UNRECOGNIZED = -1, +} + +export function clickhouseConfig_Kafka_AutoOffsetResetFromJSON( + object: any +): ClickhouseConfig_Kafka_AutoOffsetReset { + switch (object) { + case 0: + case "AUTO_OFFSET_RESET_UNSPECIFIED": + return ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_UNSPECIFIED; + case 1: + case "AUTO_OFFSET_RESET_SMALLEST": + return ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_SMALLEST; + case 2: + case "AUTO_OFFSET_RESET_EARLIEST": + return ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_EARLIEST; + case 3: + case "AUTO_OFFSET_RESET_BEGINNING": + return ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_BEGINNING; + case 4: + case "AUTO_OFFSET_RESET_LARGEST": + return ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_LARGEST; + case 5: + case "AUTO_OFFSET_RESET_LATEST": + return ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_LATEST; + case 6: + case "AUTO_OFFSET_RESET_END": + return ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_END; + case 7: + case "AUTO_OFFSET_RESET_ERROR": + return ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_ERROR; + case -1: + case "UNRECOGNIZED": + default: + return ClickhouseConfig_Kafka_AutoOffsetReset.UNRECOGNIZED; + } +} + +export function clickhouseConfig_Kafka_AutoOffsetResetToJSON( + object: ClickhouseConfig_Kafka_AutoOffsetReset +): string { + switch (object) { + case ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_UNSPECIFIED: + return "AUTO_OFFSET_RESET_UNSPECIFIED"; + case ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_SMALLEST: + return "AUTO_OFFSET_RESET_SMALLEST"; + case ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_EARLIEST: + return "AUTO_OFFSET_RESET_EARLIEST"; + case ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_BEGINNING: + return "AUTO_OFFSET_RESET_BEGINNING"; + case ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_LARGEST: + return "AUTO_OFFSET_RESET_LARGEST"; + case ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_LATEST: + return "AUTO_OFFSET_RESET_LATEST"; + case ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_END: + return "AUTO_OFFSET_RESET_END"; + case ClickhouseConfig_Kafka_AutoOffsetReset.AUTO_OFFSET_RESET_ERROR: + return "AUTO_OFFSET_RESET_ERROR"; + default: + return "UNKNOWN"; + } +} + export interface ClickhouseConfig_KafkaTopic { $type: "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.KafkaTopic"; name: string; @@ -598,6 +899,14 @@ export interface ClickhouseConfig_ExternalDictionary_HttpSource { url: string; /** The data format. Valid values are all formats supported by ClickHouse SQL dialect. */ format: string; + /** HTTP headers. */ + headers: ClickhouseConfig_ExternalDictionary_HttpSource_Header[]; +} + +export interface ClickhouseConfig_ExternalDictionary_HttpSource_Header { + $type: "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.ExternalDictionary.HttpSource.Header"; + name: string; + value: string; } export interface ClickhouseConfig_ExternalDictionary_MysqlSource { @@ -621,6 +930,10 @@ export interface ClickhouseConfig_ExternalDictionary_MysqlSource { * For more details, see [ClickHouse documentation on dictionaries](https://clickhouse.com/docs/en/query_language/dicts/external_dicts_dict_lifetime/). */ invalidateQuery: string; + /** Should the connection be closed after each request. */ + closeConnection?: boolean; + /** Should a connection be shared for some requests. */ + shareConnection?: boolean; } export interface ClickhouseConfig_ExternalDictionary_MysqlSource_Replica { @@ -659,6 +972,8 @@ export interface ClickhouseConfig_ExternalDictionary_ClickhouseSource { password: string; /** Selection criteria for the data in the specified ClickHouse table. */ where: string; + /** Use ssl for connection. */ + secure?: boolean; } export interface ClickhouseConfig_ExternalDictionary_MongodbSource { @@ -841,6 +1156,11 @@ export interface ClickhouseConfig_ExternalDictionary_Layout { * Applicable only for CACHE and COMPLEX_KEY_CACHE layout types. */ sizeInCells: number; + /** + * Maximum dictionary key size. + * Applicable only for FLAT layout type. + */ + maxArraySize: number; } export enum ClickhouseConfig_ExternalDictionary_Layout_Type { @@ -949,6 +1269,30 @@ export interface ClickhouseConfig_GraphiteRollup { name: string; /** Pattern to use for the rollup. */ patterns: ClickhouseConfig_GraphiteRollup_Pattern[]; + /** + * The name of the column storing the metric name (Graphite sensor). + * Default: Path + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/ru/engines/table-engines/mergetree-family/graphitemergetree#required-columns) + */ + pathColumnName: string; + /** + * The name of the column storing the time of measuring the metric. + * Default: Time + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/ru/engines/table-engines/mergetree-family/graphitemergetree#required-columns) + */ + timeColumnName: string; + /** + * The name of the column storing the value of the metric at the time set in time_column_name. + * Default: Value + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/ru/engines/table-engines/mergetree-family/graphitemergetree#required-columns) + */ + valueColumnName: string; + /** + * The name of the column storing the version of the metric. + * Default: Timestamp + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/ru/engines/table-engines/mergetree-family/graphitemergetree#required-columns) + */ + versionColumnName: string; } export interface ClickhouseConfig_GraphiteRollup_Pattern { @@ -969,6 +1313,46 @@ export interface ClickhouseConfig_GraphiteRollup_Pattern_Retention { precision: number; } +export interface ClickhouseConfig_QueryMaskingRule { + $type: "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.QueryMaskingRule"; + /** Name for the rule. */ + name: string; + /** + * RE2 compatible regular expression. + * Required. + */ + regexp: string; + /** + * Substitution string for sensitive data. + * Default: six asterisks + */ + replace: string; +} + +export interface ClickhouseConfig_QueryCache { + $type: "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.QueryCache"; + /** + * The maximum cache size in bytes. + * Default: 1073741824 (1 GiB) + */ + maxSizeInBytes?: number; + /** + * The maximum number of SELECT query results stored in the cache. + * Default: 1024 + */ + maxEntries?: number; + /** + * The maximum size in bytes SELECT query results may have to be saved in the cache. + * Dafault: 1048576 (1 MiB) + */ + maxEntrySizeInBytes?: number; + /** + * The maximum number of rows SELECT query results may have to be saved in the cache. + * Default: 30000000 (30 mil) + */ + maxEntrySizeInRows?: number; +} + export interface ClickhouseConfigSet { $type: "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfigSet"; /** @@ -1111,6 +1495,12 @@ export const ClickhouseConfig = { if (message.timezone !== "") { writer.uint32(114).string(message.timezone); } + if (message.geobaseEnabled !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.geobaseEnabled! }, + writer.uint32(530).fork() + ).ldelim(); + } if (message.geobaseUri !== "") { writer.uint32(122).string(message.geobaseUri); } @@ -1264,271 +1654,286 @@ export const ClickhouseConfig = { writer.uint32(338).fork() ).ldelim(); } - if (message.backgroundPoolSize !== undefined) { + if (message.opentelemetrySpanLogRetentionSize !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.backgroundPoolSize!, + value: message.opentelemetrySpanLogRetentionSize!, }, - writer.uint32(266).fork() + writer.uint32(442).fork() ).ldelim(); } - if (message.backgroundSchedulePoolSize !== undefined) { + if (message.opentelemetrySpanLogRetentionTime !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.backgroundSchedulePoolSize!, + value: message.opentelemetrySpanLogRetentionTime!, }, - writer.uint32(274).fork() + writer.uint32(450).fork() ).ldelim(); } - if (message.backgroundFetchesPoolSize !== undefined) { - Int64Value.encode( + if (message.queryViewsLogEnabled !== undefined) { + BoolValue.encode( { - $type: "google.protobuf.Int64Value", - value: message.backgroundFetchesPoolSize!, + $type: "google.protobuf.BoolValue", + value: message.queryViewsLogEnabled!, }, - writer.uint32(306).fork() + writer.uint32(394).fork() ).ldelim(); } - if (message.backgroundMovePoolSize !== undefined) { + if (message.queryViewsLogRetentionSize !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.backgroundMovePoolSize!, + value: message.queryViewsLogRetentionSize!, }, - writer.uint32(314).fork() + writer.uint32(402).fork() ).ldelim(); } - if (message.backgroundDistributedSchedulePoolSize !== undefined) { + if (message.queryViewsLogRetentionTime !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.backgroundDistributedSchedulePoolSize!, + value: message.queryViewsLogRetentionTime!, }, - writer.uint32(322).fork() + writer.uint32(410).fork() ).ldelim(); } - if (message.backgroundBufferFlushSchedulePoolSize !== undefined) { - Int64Value.encode( + if (message.asynchronousMetricLogEnabled !== undefined) { + BoolValue.encode( { - $type: "google.protobuf.Int64Value", - value: message.backgroundBufferFlushSchedulePoolSize!, + $type: "google.protobuf.BoolValue", + value: message.asynchronousMetricLogEnabled!, }, - writer.uint32(330).fork() + writer.uint32(418).fork() ).ldelim(); } - if (message.backgroundMessageBrokerSchedulePoolSize !== undefined) { + if (message.asynchronousMetricLogRetentionSize !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.backgroundMessageBrokerSchedulePoolSize!, - }, - writer.uint32(370).fork() - ).ldelim(); - } - if (message.defaultDatabase !== undefined) { - StringValue.encode( - { - $type: "google.protobuf.StringValue", - value: message.defaultDatabase!, + value: message.asynchronousMetricLogRetentionSize!, }, - writer.uint32(346).fork() + writer.uint32(426).fork() ).ldelim(); } - if (message.totalMemoryProfilerStep !== undefined) { + if (message.asynchronousMetricLogRetentionTime !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.totalMemoryProfilerStep!, + value: message.asynchronousMetricLogRetentionTime!, }, - writer.uint32(354).fork() + writer.uint32(434).fork() ).ldelim(); } - if (message.totalMemoryTrackerSampleProbability !== undefined) { - DoubleValue.encode( + if (message.sessionLogEnabled !== undefined) { + BoolValue.encode( { - $type: "google.protobuf.DoubleValue", - value: message.totalMemoryTrackerSampleProbability!, + $type: "google.protobuf.BoolValue", + value: message.sessionLogEnabled!, }, - writer.uint32(362).fork() + writer.uint32(458).fork() ).ldelim(); } - if (message.backgroundCommonPoolSize !== undefined) { + if (message.sessionLogRetentionSize !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.backgroundCommonPoolSize!, + value: message.sessionLogRetentionSize!, }, - writer.uint32(378).fork() + writer.uint32(466).fork() ).ldelim(); } - if (message.backgroundMergesMutationsConcurrencyRatio !== undefined) { + if (message.sessionLogRetentionTime !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.backgroundMergesMutationsConcurrencyRatio!, + value: message.sessionLogRetentionTime!, }, - writer.uint32(386).fork() + writer.uint32(474).fork() ).ldelim(); } - if (message.queryViewsLogEnabled !== undefined) { + if (message.zookeeperLogEnabled !== undefined) { BoolValue.encode( { $type: "google.protobuf.BoolValue", - value: message.queryViewsLogEnabled!, + value: message.zookeeperLogEnabled!, }, - writer.uint32(394).fork() + writer.uint32(482).fork() ).ldelim(); } - if (message.queryViewsLogRetentionSize !== undefined) { + if (message.zookeeperLogRetentionSize !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.queryViewsLogRetentionSize!, + value: message.zookeeperLogRetentionSize!, }, - writer.uint32(402).fork() + writer.uint32(490).fork() ).ldelim(); } - if (message.queryViewsLogRetentionTime !== undefined) { + if (message.zookeeperLogRetentionTime !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.queryViewsLogRetentionTime!, + value: message.zookeeperLogRetentionTime!, }, - writer.uint32(410).fork() + writer.uint32(498).fork() ).ldelim(); } - if (message.asynchronousMetricLogEnabled !== undefined) { + if (message.asynchronousInsertLogEnabled !== undefined) { BoolValue.encode( { $type: "google.protobuf.BoolValue", - value: message.asynchronousMetricLogEnabled!, + value: message.asynchronousInsertLogEnabled!, }, - writer.uint32(418).fork() + writer.uint32(506).fork() ).ldelim(); } - if (message.asynchronousMetricLogRetentionSize !== undefined) { + if (message.asynchronousInsertLogRetentionSize !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.asynchronousMetricLogRetentionSize!, + value: message.asynchronousInsertLogRetentionSize!, }, - writer.uint32(426).fork() + writer.uint32(514).fork() ).ldelim(); } - if (message.asynchronousMetricLogRetentionTime !== undefined) { + if (message.asynchronousInsertLogRetentionTime !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.asynchronousMetricLogRetentionTime!, + value: message.asynchronousInsertLogRetentionTime!, }, - writer.uint32(434).fork() + writer.uint32(522).fork() ).ldelim(); } - if (message.opentelemetrySpanLogRetentionSize !== undefined) { + if (message.backgroundPoolSize !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.opentelemetrySpanLogRetentionSize!, + value: message.backgroundPoolSize!, }, - writer.uint32(442).fork() + writer.uint32(266).fork() ).ldelim(); } - if (message.opentelemetrySpanLogRetentionTime !== undefined) { + if (message.backgroundMergesMutationsConcurrencyRatio !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.opentelemetrySpanLogRetentionTime!, + value: message.backgroundMergesMutationsConcurrencyRatio!, }, - writer.uint32(450).fork() + writer.uint32(386).fork() ).ldelim(); } - if (message.sessionLogEnabled !== undefined) { - BoolValue.encode( + if (message.backgroundSchedulePoolSize !== undefined) { + Int64Value.encode( { - $type: "google.protobuf.BoolValue", - value: message.sessionLogEnabled!, + $type: "google.protobuf.Int64Value", + value: message.backgroundSchedulePoolSize!, }, - writer.uint32(458).fork() + writer.uint32(274).fork() ).ldelim(); } - if (message.sessionLogRetentionSize !== undefined) { + if (message.backgroundFetchesPoolSize !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.sessionLogRetentionSize!, + value: message.backgroundFetchesPoolSize!, }, - writer.uint32(466).fork() + writer.uint32(306).fork() ).ldelim(); } - if (message.sessionLogRetentionTime !== undefined) { + if (message.backgroundMovePoolSize !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.sessionLogRetentionTime!, + value: message.backgroundMovePoolSize!, }, - writer.uint32(474).fork() + writer.uint32(314).fork() ).ldelim(); } - if (message.zookeeperLogEnabled !== undefined) { - BoolValue.encode( + if (message.backgroundDistributedSchedulePoolSize !== undefined) { + Int64Value.encode( { - $type: "google.protobuf.BoolValue", - value: message.zookeeperLogEnabled!, + $type: "google.protobuf.Int64Value", + value: message.backgroundDistributedSchedulePoolSize!, }, - writer.uint32(482).fork() + writer.uint32(322).fork() ).ldelim(); } - if (message.zookeeperLogRetentionSize !== undefined) { + if (message.backgroundBufferFlushSchedulePoolSize !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.zookeeperLogRetentionSize!, + value: message.backgroundBufferFlushSchedulePoolSize!, }, - writer.uint32(490).fork() + writer.uint32(330).fork() ).ldelim(); } - if (message.zookeeperLogRetentionTime !== undefined) { + if (message.backgroundMessageBrokerSchedulePoolSize !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.zookeeperLogRetentionTime!, + value: message.backgroundMessageBrokerSchedulePoolSize!, }, - writer.uint32(498).fork() + writer.uint32(370).fork() ).ldelim(); } - if (message.asynchronousInsertLogEnabled !== undefined) { - BoolValue.encode( + if (message.backgroundCommonPoolSize !== undefined) { + Int64Value.encode( { - $type: "google.protobuf.BoolValue", - value: message.asynchronousInsertLogEnabled!, + $type: "google.protobuf.Int64Value", + value: message.backgroundCommonPoolSize!, }, - writer.uint32(506).fork() + writer.uint32(378).fork() ).ldelim(); } - if (message.asynchronousInsertLogRetentionSize !== undefined) { - Int64Value.encode( + if (message.defaultDatabase !== undefined) { + StringValue.encode( { - $type: "google.protobuf.Int64Value", - value: message.asynchronousInsertLogRetentionSize!, + $type: "google.protobuf.StringValue", + value: message.defaultDatabase!, }, - writer.uint32(514).fork() + writer.uint32(346).fork() ).ldelim(); } - if (message.asynchronousInsertLogRetentionTime !== undefined) { + if (message.totalMemoryProfilerStep !== undefined) { Int64Value.encode( { $type: "google.protobuf.Int64Value", - value: message.asynchronousInsertLogRetentionTime!, + value: message.totalMemoryProfilerStep!, }, - writer.uint32(522).fork() + writer.uint32(354).fork() ).ldelim(); } - if (message.geobaseEnabled !== undefined) { + if (message.totalMemoryTrackerSampleProbability !== undefined) { + DoubleValue.encode( + { + $type: "google.protobuf.DoubleValue", + value: message.totalMemoryTrackerSampleProbability!, + }, + writer.uint32(362).fork() + ).ldelim(); + } + for (const v of message.queryMaskingRules) { + ClickhouseConfig_QueryMaskingRule.encode( + v!, + writer.uint32(538).fork() + ).ldelim(); + } + if (message.dictionariesLazyLoad !== undefined) { BoolValue.encode( - { $type: "google.protobuf.BoolValue", value: message.geobaseEnabled! }, - writer.uint32(530).fork() + { + $type: "google.protobuf.BoolValue", + value: message.dictionariesLazyLoad!, + }, + writer.uint32(546).fork() + ).ldelim(); + } + if (message.queryCache !== undefined) { + ClickhouseConfig_QueryCache.encode( + message.queryCache, + writer.uint32(554).fork() ).ldelim(); } return writer; @@ -1542,6 +1947,7 @@ export const ClickhouseConfig = { message.dictionaries = []; message.graphiteRollup = []; message.kafkaTopics = []; + message.queryMaskingRules = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1637,6 +2043,12 @@ export const ClickhouseConfig = { case 14: message.timezone = reader.string(); break; + case 66: + message.geobaseEnabled = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; case 15: message.geobaseUri = reader.string(); break; @@ -1745,186 +2157,197 @@ export const ClickhouseConfig = { reader.uint32() ).value; break; - case 33: - message.backgroundPoolSize = Int64Value.decode( + case 55: + message.opentelemetrySpanLogRetentionSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 34: - message.backgroundSchedulePoolSize = Int64Value.decode( + case 56: + message.opentelemetrySpanLogRetentionTime = Int64Value.decode( reader, reader.uint32() ).value; break; - case 38: - message.backgroundFetchesPoolSize = Int64Value.decode( + case 49: + message.queryViewsLogEnabled = BoolValue.decode( reader, reader.uint32() ).value; break; - case 39: - message.backgroundMovePoolSize = Int64Value.decode( + case 50: + message.queryViewsLogRetentionSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 40: - message.backgroundDistributedSchedulePoolSize = Int64Value.decode( + case 51: + message.queryViewsLogRetentionTime = Int64Value.decode( reader, reader.uint32() ).value; break; - case 41: - message.backgroundBufferFlushSchedulePoolSize = Int64Value.decode( + case 52: + message.asynchronousMetricLogEnabled = BoolValue.decode( reader, reader.uint32() ).value; break; - case 46: - message.backgroundMessageBrokerSchedulePoolSize = Int64Value.decode( + case 53: + message.asynchronousMetricLogRetentionSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 43: - message.defaultDatabase = StringValue.decode( + case 54: + message.asynchronousMetricLogRetentionTime = Int64Value.decode( reader, reader.uint32() ).value; break; - case 44: - message.totalMemoryProfilerStep = Int64Value.decode( + case 57: + message.sessionLogEnabled = BoolValue.decode( reader, reader.uint32() ).value; break; - case 45: - message.totalMemoryTrackerSampleProbability = DoubleValue.decode( + case 58: + message.sessionLogRetentionSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 47: - message.backgroundCommonPoolSize = Int64Value.decode( + case 59: + message.sessionLogRetentionTime = Int64Value.decode( reader, reader.uint32() ).value; break; - case 48: - message.backgroundMergesMutationsConcurrencyRatio = Int64Value.decode( + case 60: + message.zookeeperLogEnabled = BoolValue.decode( reader, reader.uint32() ).value; break; - case 49: - message.queryViewsLogEnabled = BoolValue.decode( + case 61: + message.zookeeperLogRetentionSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 50: - message.queryViewsLogRetentionSize = Int64Value.decode( + case 62: + message.zookeeperLogRetentionTime = Int64Value.decode( reader, reader.uint32() ).value; break; - case 51: - message.queryViewsLogRetentionTime = Int64Value.decode( + case 63: + message.asynchronousInsertLogEnabled = BoolValue.decode( reader, reader.uint32() ).value; break; - case 52: - message.asynchronousMetricLogEnabled = BoolValue.decode( + case 64: + message.asynchronousInsertLogRetentionSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 53: - message.asynchronousMetricLogRetentionSize = Int64Value.decode( + case 65: + message.asynchronousInsertLogRetentionTime = Int64Value.decode( reader, reader.uint32() ).value; break; - case 54: - message.asynchronousMetricLogRetentionTime = Int64Value.decode( + case 33: + message.backgroundPoolSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 55: - message.opentelemetrySpanLogRetentionSize = Int64Value.decode( + case 48: + message.backgroundMergesMutationsConcurrencyRatio = Int64Value.decode( reader, reader.uint32() ).value; break; - case 56: - message.opentelemetrySpanLogRetentionTime = Int64Value.decode( + case 34: + message.backgroundSchedulePoolSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 57: - message.sessionLogEnabled = BoolValue.decode( + case 38: + message.backgroundFetchesPoolSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 58: - message.sessionLogRetentionSize = Int64Value.decode( + case 39: + message.backgroundMovePoolSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 59: - message.sessionLogRetentionTime = Int64Value.decode( + case 40: + message.backgroundDistributedSchedulePoolSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 60: - message.zookeeperLogEnabled = BoolValue.decode( + case 41: + message.backgroundBufferFlushSchedulePoolSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 61: - message.zookeeperLogRetentionSize = Int64Value.decode( + case 46: + message.backgroundMessageBrokerSchedulePoolSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 62: - message.zookeeperLogRetentionTime = Int64Value.decode( + case 47: + message.backgroundCommonPoolSize = Int64Value.decode( reader, reader.uint32() ).value; break; - case 63: - message.asynchronousInsertLogEnabled = BoolValue.decode( + case 43: + message.defaultDatabase = StringValue.decode( reader, reader.uint32() ).value; break; - case 64: - message.asynchronousInsertLogRetentionSize = Int64Value.decode( + case 44: + message.totalMemoryProfilerStep = Int64Value.decode( reader, reader.uint32() ).value; break; - case 65: - message.asynchronousInsertLogRetentionTime = Int64Value.decode( + case 45: + message.totalMemoryTrackerSampleProbability = DoubleValue.decode( reader, reader.uint32() ).value; break; - case 66: - message.geobaseEnabled = BoolValue.decode( + case 67: + message.queryMaskingRules.push( + ClickhouseConfig_QueryMaskingRule.decode(reader, reader.uint32()) + ); + break; + case 68: + message.dictionariesLazyLoad = BoolValue.decode( reader, reader.uint32() ).value; break; + case 69: + message.queryCache = ClickhouseConfig_QueryCache.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2004,6 +2427,10 @@ export const ClickhouseConfig = { object.timezone !== undefined && object.timezone !== null ? String(object.timezone) : ""; + message.geobaseEnabled = + object.geobaseEnabled !== undefined && object.geobaseEnabled !== null + ? Boolean(object.geobaseEnabled) + : undefined; message.geobaseUri = object.geobaseUri !== undefined && object.geobaseUri !== null ? String(object.geobaseUri) @@ -2094,64 +2521,15 @@ export const ClickhouseConfig = { object.opentelemetrySpanLogEnabled !== null ? Boolean(object.opentelemetrySpanLogEnabled) : undefined; - message.backgroundPoolSize = - object.backgroundPoolSize !== undefined && - object.backgroundPoolSize !== null - ? Number(object.backgroundPoolSize) - : undefined; - message.backgroundSchedulePoolSize = - object.backgroundSchedulePoolSize !== undefined && - object.backgroundSchedulePoolSize !== null - ? Number(object.backgroundSchedulePoolSize) - : undefined; - message.backgroundFetchesPoolSize = - object.backgroundFetchesPoolSize !== undefined && - object.backgroundFetchesPoolSize !== null - ? Number(object.backgroundFetchesPoolSize) - : undefined; - message.backgroundMovePoolSize = - object.backgroundMovePoolSize !== undefined && - object.backgroundMovePoolSize !== null - ? Number(object.backgroundMovePoolSize) - : undefined; - message.backgroundDistributedSchedulePoolSize = - object.backgroundDistributedSchedulePoolSize !== undefined && - object.backgroundDistributedSchedulePoolSize !== null - ? Number(object.backgroundDistributedSchedulePoolSize) - : undefined; - message.backgroundBufferFlushSchedulePoolSize = - object.backgroundBufferFlushSchedulePoolSize !== undefined && - object.backgroundBufferFlushSchedulePoolSize !== null - ? Number(object.backgroundBufferFlushSchedulePoolSize) - : undefined; - message.backgroundMessageBrokerSchedulePoolSize = - object.backgroundMessageBrokerSchedulePoolSize !== undefined && - object.backgroundMessageBrokerSchedulePoolSize !== null - ? Number(object.backgroundMessageBrokerSchedulePoolSize) - : undefined; - message.defaultDatabase = - object.defaultDatabase !== undefined && object.defaultDatabase !== null - ? String(object.defaultDatabase) - : undefined; - message.totalMemoryProfilerStep = - object.totalMemoryProfilerStep !== undefined && - object.totalMemoryProfilerStep !== null - ? Number(object.totalMemoryProfilerStep) - : undefined; - message.totalMemoryTrackerSampleProbability = - object.totalMemoryTrackerSampleProbability !== undefined && - object.totalMemoryTrackerSampleProbability !== null - ? Number(object.totalMemoryTrackerSampleProbability) - : undefined; - message.backgroundCommonPoolSize = - object.backgroundCommonPoolSize !== undefined && - object.backgroundCommonPoolSize !== null - ? Number(object.backgroundCommonPoolSize) + message.opentelemetrySpanLogRetentionSize = + object.opentelemetrySpanLogRetentionSize !== undefined && + object.opentelemetrySpanLogRetentionSize !== null + ? Number(object.opentelemetrySpanLogRetentionSize) : undefined; - message.backgroundMergesMutationsConcurrencyRatio = - object.backgroundMergesMutationsConcurrencyRatio !== undefined && - object.backgroundMergesMutationsConcurrencyRatio !== null - ? Number(object.backgroundMergesMutationsConcurrencyRatio) + message.opentelemetrySpanLogRetentionTime = + object.opentelemetrySpanLogRetentionTime !== undefined && + object.opentelemetrySpanLogRetentionTime !== null + ? Number(object.opentelemetrySpanLogRetentionTime) : undefined; message.queryViewsLogEnabled = object.queryViewsLogEnabled !== undefined && @@ -2183,16 +2561,6 @@ export const ClickhouseConfig = { object.asynchronousMetricLogRetentionTime !== null ? Number(object.asynchronousMetricLogRetentionTime) : undefined; - message.opentelemetrySpanLogRetentionSize = - object.opentelemetrySpanLogRetentionSize !== undefined && - object.opentelemetrySpanLogRetentionSize !== null - ? Number(object.opentelemetrySpanLogRetentionSize) - : undefined; - message.opentelemetrySpanLogRetentionTime = - object.opentelemetrySpanLogRetentionTime !== undefined && - object.opentelemetrySpanLogRetentionTime !== null - ? Number(object.opentelemetrySpanLogRetentionTime) - : undefined; message.sessionLogEnabled = object.sessionLogEnabled !== undefined && object.sessionLogEnabled !== null @@ -2238,9 +2606,76 @@ export const ClickhouseConfig = { object.asynchronousInsertLogRetentionTime !== null ? Number(object.asynchronousInsertLogRetentionTime) : undefined; - message.geobaseEnabled = - object.geobaseEnabled !== undefined && object.geobaseEnabled !== null - ? Boolean(object.geobaseEnabled) + message.backgroundPoolSize = + object.backgroundPoolSize !== undefined && + object.backgroundPoolSize !== null + ? Number(object.backgroundPoolSize) + : undefined; + message.backgroundMergesMutationsConcurrencyRatio = + object.backgroundMergesMutationsConcurrencyRatio !== undefined && + object.backgroundMergesMutationsConcurrencyRatio !== null + ? Number(object.backgroundMergesMutationsConcurrencyRatio) + : undefined; + message.backgroundSchedulePoolSize = + object.backgroundSchedulePoolSize !== undefined && + object.backgroundSchedulePoolSize !== null + ? Number(object.backgroundSchedulePoolSize) + : undefined; + message.backgroundFetchesPoolSize = + object.backgroundFetchesPoolSize !== undefined && + object.backgroundFetchesPoolSize !== null + ? Number(object.backgroundFetchesPoolSize) + : undefined; + message.backgroundMovePoolSize = + object.backgroundMovePoolSize !== undefined && + object.backgroundMovePoolSize !== null + ? Number(object.backgroundMovePoolSize) + : undefined; + message.backgroundDistributedSchedulePoolSize = + object.backgroundDistributedSchedulePoolSize !== undefined && + object.backgroundDistributedSchedulePoolSize !== null + ? Number(object.backgroundDistributedSchedulePoolSize) + : undefined; + message.backgroundBufferFlushSchedulePoolSize = + object.backgroundBufferFlushSchedulePoolSize !== undefined && + object.backgroundBufferFlushSchedulePoolSize !== null + ? Number(object.backgroundBufferFlushSchedulePoolSize) + : undefined; + message.backgroundMessageBrokerSchedulePoolSize = + object.backgroundMessageBrokerSchedulePoolSize !== undefined && + object.backgroundMessageBrokerSchedulePoolSize !== null + ? Number(object.backgroundMessageBrokerSchedulePoolSize) + : undefined; + message.backgroundCommonPoolSize = + object.backgroundCommonPoolSize !== undefined && + object.backgroundCommonPoolSize !== null + ? Number(object.backgroundCommonPoolSize) + : undefined; + message.defaultDatabase = + object.defaultDatabase !== undefined && object.defaultDatabase !== null + ? String(object.defaultDatabase) + : undefined; + message.totalMemoryProfilerStep = + object.totalMemoryProfilerStep !== undefined && + object.totalMemoryProfilerStep !== null + ? Number(object.totalMemoryProfilerStep) + : undefined; + message.totalMemoryTrackerSampleProbability = + object.totalMemoryTrackerSampleProbability !== undefined && + object.totalMemoryTrackerSampleProbability !== null + ? Number(object.totalMemoryTrackerSampleProbability) + : undefined; + message.queryMaskingRules = (object.queryMaskingRules ?? []).map((e: any) => + ClickhouseConfig_QueryMaskingRule.fromJSON(e) + ); + message.dictionariesLazyLoad = + object.dictionariesLazyLoad !== undefined && + object.dictionariesLazyLoad !== null + ? Boolean(object.dictionariesLazyLoad) + : undefined; + message.queryCache = + object.queryCache !== undefined && object.queryCache !== null + ? ClickhouseConfig_QueryCache.fromJSON(object.queryCache) : undefined; return message; }, @@ -2307,6 +2742,8 @@ export const ClickhouseConfig = { (obj.builtinDictionariesReloadInterval = message.builtinDictionariesReloadInterval); message.timezone !== undefined && (obj.timezone = message.timezone); + message.geobaseEnabled !== undefined && + (obj.geobaseEnabled = message.geobaseEnabled); message.geobaseUri !== undefined && (obj.geobaseUri = message.geobaseUri); message.queryLogRetentionSize !== undefined && (obj.queryLogRetentionSize = message.queryLogRetentionSize); @@ -2346,35 +2783,12 @@ export const ClickhouseConfig = { )); message.opentelemetrySpanLogEnabled !== undefined && (obj.opentelemetrySpanLogEnabled = message.opentelemetrySpanLogEnabled); - message.backgroundPoolSize !== undefined && - (obj.backgroundPoolSize = message.backgroundPoolSize); - message.backgroundSchedulePoolSize !== undefined && - (obj.backgroundSchedulePoolSize = message.backgroundSchedulePoolSize); - message.backgroundFetchesPoolSize !== undefined && - (obj.backgroundFetchesPoolSize = message.backgroundFetchesPoolSize); - message.backgroundMovePoolSize !== undefined && - (obj.backgroundMovePoolSize = message.backgroundMovePoolSize); - message.backgroundDistributedSchedulePoolSize !== undefined && - (obj.backgroundDistributedSchedulePoolSize = - message.backgroundDistributedSchedulePoolSize); - message.backgroundBufferFlushSchedulePoolSize !== undefined && - (obj.backgroundBufferFlushSchedulePoolSize = - message.backgroundBufferFlushSchedulePoolSize); - message.backgroundMessageBrokerSchedulePoolSize !== undefined && - (obj.backgroundMessageBrokerSchedulePoolSize = - message.backgroundMessageBrokerSchedulePoolSize); - message.defaultDatabase !== undefined && - (obj.defaultDatabase = message.defaultDatabase); - message.totalMemoryProfilerStep !== undefined && - (obj.totalMemoryProfilerStep = message.totalMemoryProfilerStep); - message.totalMemoryTrackerSampleProbability !== undefined && - (obj.totalMemoryTrackerSampleProbability = - message.totalMemoryTrackerSampleProbability); - message.backgroundCommonPoolSize !== undefined && - (obj.backgroundCommonPoolSize = message.backgroundCommonPoolSize); - message.backgroundMergesMutationsConcurrencyRatio !== undefined && - (obj.backgroundMergesMutationsConcurrencyRatio = - message.backgroundMergesMutationsConcurrencyRatio); + message.opentelemetrySpanLogRetentionSize !== undefined && + (obj.opentelemetrySpanLogRetentionSize = + message.opentelemetrySpanLogRetentionSize); + message.opentelemetrySpanLogRetentionTime !== undefined && + (obj.opentelemetrySpanLogRetentionTime = + message.opentelemetrySpanLogRetentionTime); message.queryViewsLogEnabled !== undefined && (obj.queryViewsLogEnabled = message.queryViewsLogEnabled); message.queryViewsLogRetentionSize !== undefined && @@ -2389,12 +2803,6 @@ export const ClickhouseConfig = { message.asynchronousMetricLogRetentionTime !== undefined && (obj.asynchronousMetricLogRetentionTime = message.asynchronousMetricLogRetentionTime); - message.opentelemetrySpanLogRetentionSize !== undefined && - (obj.opentelemetrySpanLogRetentionSize = - message.opentelemetrySpanLogRetentionSize); - message.opentelemetrySpanLogRetentionTime !== undefined && - (obj.opentelemetrySpanLogRetentionTime = - message.opentelemetrySpanLogRetentionTime); message.sessionLogEnabled !== undefined && (obj.sessionLogEnabled = message.sessionLogEnabled); message.sessionLogRetentionSize !== undefined && @@ -2415,8 +2823,48 @@ export const ClickhouseConfig = { message.asynchronousInsertLogRetentionTime !== undefined && (obj.asynchronousInsertLogRetentionTime = message.asynchronousInsertLogRetentionTime); - message.geobaseEnabled !== undefined && - (obj.geobaseEnabled = message.geobaseEnabled); + message.backgroundPoolSize !== undefined && + (obj.backgroundPoolSize = message.backgroundPoolSize); + message.backgroundMergesMutationsConcurrencyRatio !== undefined && + (obj.backgroundMergesMutationsConcurrencyRatio = + message.backgroundMergesMutationsConcurrencyRatio); + message.backgroundSchedulePoolSize !== undefined && + (obj.backgroundSchedulePoolSize = message.backgroundSchedulePoolSize); + message.backgroundFetchesPoolSize !== undefined && + (obj.backgroundFetchesPoolSize = message.backgroundFetchesPoolSize); + message.backgroundMovePoolSize !== undefined && + (obj.backgroundMovePoolSize = message.backgroundMovePoolSize); + message.backgroundDistributedSchedulePoolSize !== undefined && + (obj.backgroundDistributedSchedulePoolSize = + message.backgroundDistributedSchedulePoolSize); + message.backgroundBufferFlushSchedulePoolSize !== undefined && + (obj.backgroundBufferFlushSchedulePoolSize = + message.backgroundBufferFlushSchedulePoolSize); + message.backgroundMessageBrokerSchedulePoolSize !== undefined && + (obj.backgroundMessageBrokerSchedulePoolSize = + message.backgroundMessageBrokerSchedulePoolSize); + message.backgroundCommonPoolSize !== undefined && + (obj.backgroundCommonPoolSize = message.backgroundCommonPoolSize); + message.defaultDatabase !== undefined && + (obj.defaultDatabase = message.defaultDatabase); + message.totalMemoryProfilerStep !== undefined && + (obj.totalMemoryProfilerStep = message.totalMemoryProfilerStep); + message.totalMemoryTrackerSampleProbability !== undefined && + (obj.totalMemoryTrackerSampleProbability = + message.totalMemoryTrackerSampleProbability); + if (message.queryMaskingRules) { + obj.queryMaskingRules = message.queryMaskingRules.map((e) => + e ? ClickhouseConfig_QueryMaskingRule.toJSON(e) : undefined + ); + } else { + obj.queryMaskingRules = []; + } + message.dictionariesLazyLoad !== undefined && + (obj.dictionariesLazyLoad = message.dictionariesLazyLoad); + message.queryCache !== undefined && + (obj.queryCache = message.queryCache + ? ClickhouseConfig_QueryCache.toJSON(message.queryCache) + : undefined); return obj; }, @@ -2463,6 +2911,7 @@ export const ClickhouseConfig = { message.builtinDictionariesReloadInterval = object.builtinDictionariesReloadInterval ?? undefined; message.timezone = object.timezone ?? ""; + message.geobaseEnabled = object.geobaseEnabled ?? undefined; message.geobaseUri = object.geobaseUri ?? ""; message.queryLogRetentionSize = object.queryLogRetentionSize ?? undefined; message.queryLogRetentionTime = object.queryLogRetentionTime ?? undefined; @@ -2485,27 +2934,10 @@ export const ClickhouseConfig = { message.textLogLevel = object.textLogLevel ?? 0; message.opentelemetrySpanLogEnabled = object.opentelemetrySpanLogEnabled ?? undefined; - message.backgroundPoolSize = object.backgroundPoolSize ?? undefined; - message.backgroundSchedulePoolSize = - object.backgroundSchedulePoolSize ?? undefined; - message.backgroundFetchesPoolSize = - object.backgroundFetchesPoolSize ?? undefined; - message.backgroundMovePoolSize = object.backgroundMovePoolSize ?? undefined; - message.backgroundDistributedSchedulePoolSize = - object.backgroundDistributedSchedulePoolSize ?? undefined; - message.backgroundBufferFlushSchedulePoolSize = - object.backgroundBufferFlushSchedulePoolSize ?? undefined; - message.backgroundMessageBrokerSchedulePoolSize = - object.backgroundMessageBrokerSchedulePoolSize ?? undefined; - message.defaultDatabase = object.defaultDatabase ?? undefined; - message.totalMemoryProfilerStep = - object.totalMemoryProfilerStep ?? undefined; - message.totalMemoryTrackerSampleProbability = - object.totalMemoryTrackerSampleProbability ?? undefined; - message.backgroundCommonPoolSize = - object.backgroundCommonPoolSize ?? undefined; - message.backgroundMergesMutationsConcurrencyRatio = - object.backgroundMergesMutationsConcurrencyRatio ?? undefined; + message.opentelemetrySpanLogRetentionSize = + object.opentelemetrySpanLogRetentionSize ?? undefined; + message.opentelemetrySpanLogRetentionTime = + object.opentelemetrySpanLogRetentionTime ?? undefined; message.queryViewsLogEnabled = object.queryViewsLogEnabled ?? undefined; message.queryViewsLogRetentionSize = object.queryViewsLogRetentionSize ?? undefined; @@ -2517,10 +2949,6 @@ export const ClickhouseConfig = { object.asynchronousMetricLogRetentionSize ?? undefined; message.asynchronousMetricLogRetentionTime = object.asynchronousMetricLogRetentionTime ?? undefined; - message.opentelemetrySpanLogRetentionSize = - object.opentelemetrySpanLogRetentionSize ?? undefined; - message.opentelemetrySpanLogRetentionTime = - object.opentelemetrySpanLogRetentionTime ?? undefined; message.sessionLogEnabled = object.sessionLogEnabled ?? undefined; message.sessionLogRetentionSize = object.sessionLogRetentionSize ?? undefined; @@ -2537,7 +2965,36 @@ export const ClickhouseConfig = { object.asynchronousInsertLogRetentionSize ?? undefined; message.asynchronousInsertLogRetentionTime = object.asynchronousInsertLogRetentionTime ?? undefined; - message.geobaseEnabled = object.geobaseEnabled ?? undefined; + message.backgroundPoolSize = object.backgroundPoolSize ?? undefined; + message.backgroundMergesMutationsConcurrencyRatio = + object.backgroundMergesMutationsConcurrencyRatio ?? undefined; + message.backgroundSchedulePoolSize = + object.backgroundSchedulePoolSize ?? undefined; + message.backgroundFetchesPoolSize = + object.backgroundFetchesPoolSize ?? undefined; + message.backgroundMovePoolSize = object.backgroundMovePoolSize ?? undefined; + message.backgroundDistributedSchedulePoolSize = + object.backgroundDistributedSchedulePoolSize ?? undefined; + message.backgroundBufferFlushSchedulePoolSize = + object.backgroundBufferFlushSchedulePoolSize ?? undefined; + message.backgroundMessageBrokerSchedulePoolSize = + object.backgroundMessageBrokerSchedulePoolSize ?? undefined; + message.backgroundCommonPoolSize = + object.backgroundCommonPoolSize ?? undefined; + message.defaultDatabase = object.defaultDatabase ?? undefined; + message.totalMemoryProfilerStep = + object.totalMemoryProfilerStep ?? undefined; + message.totalMemoryTrackerSampleProbability = + object.totalMemoryTrackerSampleProbability ?? undefined; + message.queryMaskingRules = + object.queryMaskingRules?.map((e) => + ClickhouseConfig_QueryMaskingRule.fromPartial(e) + ) || []; + message.dictionariesLazyLoad = object.dictionariesLazyLoad ?? undefined; + message.queryCache = + object.queryCache !== undefined && object.queryCache !== null + ? ClickhouseConfig_QueryCache.fromPartial(object.queryCache) + : undefined; return message; }, }; @@ -2772,6 +3229,42 @@ export const ClickhouseConfig_MergeTree = { writer.uint32(194).fork() ).ldelim(); } + if (message.mergeMaxBlockSize !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.mergeMaxBlockSize!, + }, + writer.uint32(202).fork() + ).ldelim(); + } + if (message.checkSampleColumnIsCorrect !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.checkSampleColumnIsCorrect!, + }, + writer.uint32(210).fork() + ).ldelim(); + } + if (message.maxMergeSelectingSleepMs !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.maxMergeSelectingSleepMs!, + }, + writer.uint32(218).fork() + ).ldelim(); + } + if (message.maxCleanupDelayPeriod !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.maxCleanupDelayPeriod!, + }, + writer.uint32(226).fork() + ).ldelim(); + } return writer; }, @@ -2927,6 +3420,30 @@ export const ClickhouseConfig_MergeTree = { reader.uint32() ).value; break; + case 25: + message.mergeMaxBlockSize = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 26: + message.checkSampleColumnIsCorrect = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 27: + message.maxMergeSelectingSleepMs = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 28: + message.maxCleanupDelayPeriod = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -3057,6 +3574,26 @@ export const ClickhouseConfig_MergeTree = { object.mergeSelectingSleepMs !== null ? Number(object.mergeSelectingSleepMs) : undefined; + message.mergeMaxBlockSize = + object.mergeMaxBlockSize !== undefined && + object.mergeMaxBlockSize !== null + ? Number(object.mergeMaxBlockSize) + : undefined; + message.checkSampleColumnIsCorrect = + object.checkSampleColumnIsCorrect !== undefined && + object.checkSampleColumnIsCorrect !== null + ? Boolean(object.checkSampleColumnIsCorrect) + : undefined; + message.maxMergeSelectingSleepMs = + object.maxMergeSelectingSleepMs !== undefined && + object.maxMergeSelectingSleepMs !== null + ? Number(object.maxMergeSelectingSleepMs) + : undefined; + message.maxCleanupDelayPeriod = + object.maxCleanupDelayPeriod !== undefined && + object.maxCleanupDelayPeriod !== null + ? Number(object.maxCleanupDelayPeriod) + : undefined; return message; }, @@ -3121,6 +3658,14 @@ export const ClickhouseConfig_MergeTree = { message.minAgeToForceMergeOnPartitionOnly); message.mergeSelectingSleepMs !== undefined && (obj.mergeSelectingSleepMs = message.mergeSelectingSleepMs); + message.mergeMaxBlockSize !== undefined && + (obj.mergeMaxBlockSize = message.mergeMaxBlockSize); + message.checkSampleColumnIsCorrect !== undefined && + (obj.checkSampleColumnIsCorrect = message.checkSampleColumnIsCorrect); + message.maxMergeSelectingSleepMs !== undefined && + (obj.maxMergeSelectingSleepMs = message.maxMergeSelectingSleepMs); + message.maxCleanupDelayPeriod !== undefined && + (obj.maxCleanupDelayPeriod = message.maxCleanupDelayPeriod); return obj; }, @@ -3169,6 +3714,12 @@ export const ClickhouseConfig_MergeTree = { message.minAgeToForceMergeOnPartitionOnly = object.minAgeToForceMergeOnPartitionOnly ?? undefined; message.mergeSelectingSleepMs = object.mergeSelectingSleepMs ?? undefined; + message.mergeMaxBlockSize = object.mergeMaxBlockSize ?? undefined; + message.checkSampleColumnIsCorrect = + object.checkSampleColumnIsCorrect ?? undefined; + message.maxMergeSelectingSleepMs = + object.maxMergeSelectingSleepMs ?? undefined; + message.maxCleanupDelayPeriod = object.maxCleanupDelayPeriod ?? undefined; return message; }, }; @@ -3184,6 +3735,8 @@ const baseClickhouseConfig_Kafka: object = { saslMechanism: 0, saslUsername: "", saslPassword: "", + debug: 0, + autoOffsetReset: 0, }; export const ClickhouseConfig_Kafka = { @@ -3233,6 +3786,12 @@ export const ClickhouseConfig_Kafka = { writer.uint32(58).fork() ).ldelim(); } + if (message.debug !== 0) { + writer.uint32(64).int32(message.debug); + } + if (message.autoOffsetReset !== 0) { + writer.uint32(72).int32(message.autoOffsetReset); + } return writer; }, @@ -3276,6 +3835,12 @@ export const ClickhouseConfig_Kafka = { reader.uint32() ).value; break; + case 8: + message.debug = reader.int32() as any; + break; + case 9: + message.autoOffsetReset = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3318,6 +3883,14 @@ export const ClickhouseConfig_Kafka = { object.sessionTimeoutMs !== undefined && object.sessionTimeoutMs !== null ? Number(object.sessionTimeoutMs) : undefined; + message.debug = + object.debug !== undefined && object.debug !== null + ? clickhouseConfig_Kafka_DebugFromJSON(object.debug) + : 0; + message.autoOffsetReset = + object.autoOffsetReset !== undefined && object.autoOffsetReset !== null + ? clickhouseConfig_Kafka_AutoOffsetResetFromJSON(object.autoOffsetReset) + : 0; return message; }, @@ -3342,6 +3915,12 @@ export const ClickhouseConfig_Kafka = { (obj.maxPollIntervalMs = message.maxPollIntervalMs); message.sessionTimeoutMs !== undefined && (obj.sessionTimeoutMs = message.sessionTimeoutMs); + message.debug !== undefined && + (obj.debug = clickhouseConfig_Kafka_DebugToJSON(message.debug)); + message.autoOffsetReset !== undefined && + (obj.autoOffsetReset = clickhouseConfig_Kafka_AutoOffsetResetToJSON( + message.autoOffsetReset + )); return obj; }, @@ -3357,6 +3936,8 @@ export const ClickhouseConfig_Kafka = { object.enableSslCertificateVerification ?? undefined; message.maxPollIntervalMs = object.maxPollIntervalMs ?? undefined; message.sessionTimeoutMs = object.sessionTimeoutMs ?? undefined; + message.debug = object.debug ?? 0; + message.autoOffsetReset = object.autoOffsetReset ?? 0; return message; }, }; @@ -4012,26 +4593,147 @@ messageTypeRegistry.set( ClickhouseConfig_ExternalDictionary ); -const baseClickhouseConfig_ExternalDictionary_HttpSource: object = { +const baseClickhouseConfig_ExternalDictionary_HttpSource: object = { + $type: + "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.ExternalDictionary.HttpSource", + url: "", + format: "", +}; + +export const ClickhouseConfig_ExternalDictionary_HttpSource = { + $type: + "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.ExternalDictionary.HttpSource" as const, + + encode( + message: ClickhouseConfig_ExternalDictionary_HttpSource, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(10).string(message.url); + } + if (message.format !== "") { + writer.uint32(18).string(message.format); + } + for (const v of message.headers) { + ClickhouseConfig_ExternalDictionary_HttpSource_Header.encode( + v!, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ClickhouseConfig_ExternalDictionary_HttpSource { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseClickhouseConfig_ExternalDictionary_HttpSource, + } as ClickhouseConfig_ExternalDictionary_HttpSource; + message.headers = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.format = reader.string(); + break; + case 3: + message.headers.push( + ClickhouseConfig_ExternalDictionary_HttpSource_Header.decode( + reader, + reader.uint32() + ) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClickhouseConfig_ExternalDictionary_HttpSource { + const message = { + ...baseClickhouseConfig_ExternalDictionary_HttpSource, + } as ClickhouseConfig_ExternalDictionary_HttpSource; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + message.format = + object.format !== undefined && object.format !== null + ? String(object.format) + : ""; + message.headers = (object.headers ?? []).map((e: any) => + ClickhouseConfig_ExternalDictionary_HttpSource_Header.fromJSON(e) + ); + return message; + }, + + toJSON(message: ClickhouseConfig_ExternalDictionary_HttpSource): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + message.format !== undefined && (obj.format = message.format); + if (message.headers) { + obj.headers = message.headers.map((e) => + e + ? ClickhouseConfig_ExternalDictionary_HttpSource_Header.toJSON(e) + : undefined + ); + } else { + obj.headers = []; + } + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): ClickhouseConfig_ExternalDictionary_HttpSource { + const message = { + ...baseClickhouseConfig_ExternalDictionary_HttpSource, + } as ClickhouseConfig_ExternalDictionary_HttpSource; + message.url = object.url ?? ""; + message.format = object.format ?? ""; + message.headers = + object.headers?.map((e) => + ClickhouseConfig_ExternalDictionary_HttpSource_Header.fromPartial(e) + ) || []; + return message; + }, +}; + +messageTypeRegistry.set( + ClickhouseConfig_ExternalDictionary_HttpSource.$type, + ClickhouseConfig_ExternalDictionary_HttpSource +); + +const baseClickhouseConfig_ExternalDictionary_HttpSource_Header: object = { $type: - "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.ExternalDictionary.HttpSource", - url: "", - format: "", + "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.ExternalDictionary.HttpSource.Header", + name: "", + value: "", }; -export const ClickhouseConfig_ExternalDictionary_HttpSource = { +export const ClickhouseConfig_ExternalDictionary_HttpSource_Header = { $type: - "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.ExternalDictionary.HttpSource" as const, + "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.ExternalDictionary.HttpSource.Header" as const, encode( - message: ClickhouseConfig_ExternalDictionary_HttpSource, + message: ClickhouseConfig_ExternalDictionary_HttpSource_Header, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - if (message.url !== "") { - writer.uint32(10).string(message.url); + if (message.name !== "") { + writer.uint32(10).string(message.name); } - if (message.format !== "") { - writer.uint32(18).string(message.format); + if (message.value !== "") { + writer.uint32(18).string(message.value); } return writer; }, @@ -4039,20 +4741,20 @@ export const ClickhouseConfig_ExternalDictionary_HttpSource = { decode( input: _m0.Reader | Uint8Array, length?: number - ): ClickhouseConfig_ExternalDictionary_HttpSource { + ): ClickhouseConfig_ExternalDictionary_HttpSource_Header { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseClickhouseConfig_ExternalDictionary_HttpSource, - } as ClickhouseConfig_ExternalDictionary_HttpSource; + ...baseClickhouseConfig_ExternalDictionary_HttpSource_Header, + } as ClickhouseConfig_ExternalDictionary_HttpSource_Header; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.url = reader.string(); + message.name = reader.string(); break; case 2: - message.format = reader.string(); + message.value = reader.string(); break; default: reader.skipType(tag & 7); @@ -4062,44 +4764,48 @@ export const ClickhouseConfig_ExternalDictionary_HttpSource = { return message; }, - fromJSON(object: any): ClickhouseConfig_ExternalDictionary_HttpSource { + fromJSON(object: any): ClickhouseConfig_ExternalDictionary_HttpSource_Header { const message = { - ...baseClickhouseConfig_ExternalDictionary_HttpSource, - } as ClickhouseConfig_ExternalDictionary_HttpSource; - message.url = - object.url !== undefined && object.url !== null ? String(object.url) : ""; - message.format = - object.format !== undefined && object.format !== null - ? String(object.format) + ...baseClickhouseConfig_ExternalDictionary_HttpSource_Header, + } as ClickhouseConfig_ExternalDictionary_HttpSource_Header; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) : ""; return message; }, - toJSON(message: ClickhouseConfig_ExternalDictionary_HttpSource): unknown { + toJSON( + message: ClickhouseConfig_ExternalDictionary_HttpSource_Header + ): unknown { const obj: any = {}; - message.url !== undefined && (obj.url = message.url); - message.format !== undefined && (obj.format = message.format); + message.name !== undefined && (obj.name = message.name); + message.value !== undefined && (obj.value = message.value); return obj; }, fromPartial< I extends Exact< - DeepPartial, + DeepPartial, I > - >(object: I): ClickhouseConfig_ExternalDictionary_HttpSource { + >(object: I): ClickhouseConfig_ExternalDictionary_HttpSource_Header { const message = { - ...baseClickhouseConfig_ExternalDictionary_HttpSource, - } as ClickhouseConfig_ExternalDictionary_HttpSource; - message.url = object.url ?? ""; - message.format = object.format ?? ""; + ...baseClickhouseConfig_ExternalDictionary_HttpSource_Header, + } as ClickhouseConfig_ExternalDictionary_HttpSource_Header; + message.name = object.name ?? ""; + message.value = object.value ?? ""; return message; }, }; messageTypeRegistry.set( - ClickhouseConfig_ExternalDictionary_HttpSource.$type, - ClickhouseConfig_ExternalDictionary_HttpSource + ClickhouseConfig_ExternalDictionary_HttpSource_Header.$type, + ClickhouseConfig_ExternalDictionary_HttpSource_Header ); const baseClickhouseConfig_ExternalDictionary_MysqlSource: object = { @@ -4149,6 +4855,18 @@ export const ClickhouseConfig_ExternalDictionary_MysqlSource = { if (message.invalidateQuery !== "") { writer.uint32(66).string(message.invalidateQuery); } + if (message.closeConnection !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.closeConnection! }, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.shareConnection !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.shareConnection! }, + writer.uint32(82).fork() + ).ldelim(); + } return writer; }, @@ -4194,6 +4912,18 @@ export const ClickhouseConfig_ExternalDictionary_MysqlSource = { case 8: message.invalidateQuery = reader.string(); break; + case 9: + message.closeConnection = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 10: + message.shareConnection = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -4235,6 +4965,14 @@ export const ClickhouseConfig_ExternalDictionary_MysqlSource = { object.invalidateQuery !== undefined && object.invalidateQuery !== null ? String(object.invalidateQuery) : ""; + message.closeConnection = + object.closeConnection !== undefined && object.closeConnection !== null + ? Boolean(object.closeConnection) + : undefined; + message.shareConnection = + object.shareConnection !== undefined && object.shareConnection !== null + ? Boolean(object.shareConnection) + : undefined; return message; }, @@ -4257,6 +4995,10 @@ export const ClickhouseConfig_ExternalDictionary_MysqlSource = { message.where !== undefined && (obj.where = message.where); message.invalidateQuery !== undefined && (obj.invalidateQuery = message.invalidateQuery); + message.closeConnection !== undefined && + (obj.closeConnection = message.closeConnection); + message.shareConnection !== undefined && + (obj.shareConnection = message.shareConnection); return obj; }, @@ -4280,6 +5022,8 @@ export const ClickhouseConfig_ExternalDictionary_MysqlSource = { ) || []; message.where = object.where ?? ""; message.invalidateQuery = object.invalidateQuery ?? ""; + message.closeConnection = object.closeConnection ?? undefined; + message.shareConnection = object.shareConnection ?? undefined; return message; }, }; @@ -4466,6 +5210,12 @@ export const ClickhouseConfig_ExternalDictionary_ClickhouseSource = { if (message.where !== "") { writer.uint32(58).string(message.where); } + if (message.secure !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.secure! }, + writer.uint32(66).fork() + ).ldelim(); + } return writer; }, @@ -4502,6 +5252,9 @@ export const ClickhouseConfig_ExternalDictionary_ClickhouseSource = { case 7: message.where = reader.string(); break; + case 8: + message.secure = BoolValue.decode(reader, reader.uint32()).value; + break; default: reader.skipType(tag & 7); break; @@ -4540,6 +5293,10 @@ export const ClickhouseConfig_ExternalDictionary_ClickhouseSource = { object.where !== undefined && object.where !== null ? String(object.where) : ""; + message.secure = + object.secure !== undefined && object.secure !== null + ? Boolean(object.secure) + : undefined; return message; }, @@ -4554,6 +5311,7 @@ export const ClickhouseConfig_ExternalDictionary_ClickhouseSource = { message.user !== undefined && (obj.user = message.user); message.password !== undefined && (obj.password = message.password); message.where !== undefined && (obj.where = message.where); + message.secure !== undefined && (obj.secure = message.secure); return obj; }, @@ -4573,6 +5331,7 @@ export const ClickhouseConfig_ExternalDictionary_ClickhouseSource = { message.user = object.user ?? ""; message.password = object.password ?? ""; message.where = object.where ?? ""; + message.secure = object.secure ?? undefined; return message; }, }; @@ -5458,6 +6217,7 @@ const baseClickhouseConfig_ExternalDictionary_Layout: object = { "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.ExternalDictionary.Layout", type: 0, sizeInCells: 0, + maxArraySize: 0, }; export const ClickhouseConfig_ExternalDictionary_Layout = { @@ -5474,6 +6234,9 @@ export const ClickhouseConfig_ExternalDictionary_Layout = { if (message.sizeInCells !== 0) { writer.uint32(16).int64(message.sizeInCells); } + if (message.maxArraySize !== 0) { + writer.uint32(24).int64(message.maxArraySize); + } return writer; }, @@ -5495,6 +6258,9 @@ export const ClickhouseConfig_ExternalDictionary_Layout = { case 2: message.sizeInCells = longToNumber(reader.int64() as Long); break; + case 3: + message.maxArraySize = longToNumber(reader.int64() as Long); + break; default: reader.skipType(tag & 7); break; @@ -5515,6 +6281,10 @@ export const ClickhouseConfig_ExternalDictionary_Layout = { object.sizeInCells !== undefined && object.sizeInCells !== null ? Number(object.sizeInCells) : 0; + message.maxArraySize = + object.maxArraySize !== undefined && object.maxArraySize !== null + ? Number(object.maxArraySize) + : 0; return message; }, @@ -5526,6 +6296,8 @@ export const ClickhouseConfig_ExternalDictionary_Layout = { )); message.sizeInCells !== undefined && (obj.sizeInCells = Math.round(message.sizeInCells)); + message.maxArraySize !== undefined && + (obj.maxArraySize = Math.round(message.maxArraySize)); return obj; }, @@ -5537,6 +6309,7 @@ export const ClickhouseConfig_ExternalDictionary_Layout = { } as ClickhouseConfig_ExternalDictionary_Layout; message.type = object.type ?? 0; message.sizeInCells = object.sizeInCells ?? 0; + message.maxArraySize = object.maxArraySize ?? 0; return message; }, }; @@ -5635,6 +6408,10 @@ const baseClickhouseConfig_GraphiteRollup: object = { $type: "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.GraphiteRollup", name: "", + pathColumnName: "", + timeColumnName: "", + valueColumnName: "", + versionColumnName: "", }; export const ClickhouseConfig_GraphiteRollup = { @@ -5654,6 +6431,18 @@ export const ClickhouseConfig_GraphiteRollup = { writer.uint32(18).fork() ).ldelim(); } + if (message.pathColumnName !== "") { + writer.uint32(26).string(message.pathColumnName); + } + if (message.timeColumnName !== "") { + writer.uint32(34).string(message.timeColumnName); + } + if (message.valueColumnName !== "") { + writer.uint32(42).string(message.valueColumnName); + } + if (message.versionColumnName !== "") { + writer.uint32(50).string(message.versionColumnName); + } return writer; }, @@ -5681,6 +6470,18 @@ export const ClickhouseConfig_GraphiteRollup = { ) ); break; + case 3: + message.pathColumnName = reader.string(); + break; + case 4: + message.timeColumnName = reader.string(); + break; + case 5: + message.valueColumnName = reader.string(); + break; + case 6: + message.versionColumnName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -5700,6 +6501,23 @@ export const ClickhouseConfig_GraphiteRollup = { message.patterns = (object.patterns ?? []).map((e: any) => ClickhouseConfig_GraphiteRollup_Pattern.fromJSON(e) ); + message.pathColumnName = + object.pathColumnName !== undefined && object.pathColumnName !== null + ? String(object.pathColumnName) + : ""; + message.timeColumnName = + object.timeColumnName !== undefined && object.timeColumnName !== null + ? String(object.timeColumnName) + : ""; + message.valueColumnName = + object.valueColumnName !== undefined && object.valueColumnName !== null + ? String(object.valueColumnName) + : ""; + message.versionColumnName = + object.versionColumnName !== undefined && + object.versionColumnName !== null + ? String(object.versionColumnName) + : ""; return message; }, @@ -5713,6 +6531,14 @@ export const ClickhouseConfig_GraphiteRollup = { } else { obj.patterns = []; } + message.pathColumnName !== undefined && + (obj.pathColumnName = message.pathColumnName); + message.timeColumnName !== undefined && + (obj.timeColumnName = message.timeColumnName); + message.valueColumnName !== undefined && + (obj.valueColumnName = message.valueColumnName); + message.versionColumnName !== undefined && + (obj.versionColumnName = message.versionColumnName); return obj; }, @@ -5727,6 +6553,10 @@ export const ClickhouseConfig_GraphiteRollup = { object.patterns?.map((e) => ClickhouseConfig_GraphiteRollup_Pattern.fromPartial(e) ) || []; + message.pathColumnName = object.pathColumnName ?? ""; + message.timeColumnName = object.timeColumnName ?? ""; + message.valueColumnName = object.valueColumnName ?? ""; + message.versionColumnName = object.versionColumnName ?? ""; return message; }, }; @@ -5947,6 +6777,250 @@ messageTypeRegistry.set( ClickhouseConfig_GraphiteRollup_Pattern_Retention ); +const baseClickhouseConfig_QueryMaskingRule: object = { + $type: + "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.QueryMaskingRule", + name: "", + regexp: "", + replace: "", +}; + +export const ClickhouseConfig_QueryMaskingRule = { + $type: + "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.QueryMaskingRule" as const, + + encode( + message: ClickhouseConfig_QueryMaskingRule, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.regexp !== "") { + writer.uint32(18).string(message.regexp); + } + if (message.replace !== "") { + writer.uint32(26).string(message.replace); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ClickhouseConfig_QueryMaskingRule { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseClickhouseConfig_QueryMaskingRule, + } as ClickhouseConfig_QueryMaskingRule; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.regexp = reader.string(); + break; + case 3: + message.replace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClickhouseConfig_QueryMaskingRule { + const message = { + ...baseClickhouseConfig_QueryMaskingRule, + } as ClickhouseConfig_QueryMaskingRule; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.regexp = + object.regexp !== undefined && object.regexp !== null + ? String(object.regexp) + : ""; + message.replace = + object.replace !== undefined && object.replace !== null + ? String(object.replace) + : ""; + return message; + }, + + toJSON(message: ClickhouseConfig_QueryMaskingRule): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.regexp !== undefined && (obj.regexp = message.regexp); + message.replace !== undefined && (obj.replace = message.replace); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): ClickhouseConfig_QueryMaskingRule { + const message = { + ...baseClickhouseConfig_QueryMaskingRule, + } as ClickhouseConfig_QueryMaskingRule; + message.name = object.name ?? ""; + message.regexp = object.regexp ?? ""; + message.replace = object.replace ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ClickhouseConfig_QueryMaskingRule.$type, + ClickhouseConfig_QueryMaskingRule +); + +const baseClickhouseConfig_QueryCache: object = { + $type: "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.QueryCache", +}; + +export const ClickhouseConfig_QueryCache = { + $type: + "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfig.QueryCache" as const, + + encode( + message: ClickhouseConfig_QueryCache, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.maxSizeInBytes !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.maxSizeInBytes! }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.maxEntries !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.maxEntries! }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.maxEntrySizeInBytes !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.maxEntrySizeInBytes!, + }, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.maxEntrySizeInRows !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.maxEntrySizeInRows!, + }, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ClickhouseConfig_QueryCache { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseClickhouseConfig_QueryCache, + } as ClickhouseConfig_QueryCache; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxSizeInBytes = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 2: + message.maxEntries = Int64Value.decode(reader, reader.uint32()).value; + break; + case 3: + message.maxEntrySizeInBytes = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 4: + message.maxEntrySizeInRows = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClickhouseConfig_QueryCache { + const message = { + ...baseClickhouseConfig_QueryCache, + } as ClickhouseConfig_QueryCache; + message.maxSizeInBytes = + object.maxSizeInBytes !== undefined && object.maxSizeInBytes !== null + ? Number(object.maxSizeInBytes) + : undefined; + message.maxEntries = + object.maxEntries !== undefined && object.maxEntries !== null + ? Number(object.maxEntries) + : undefined; + message.maxEntrySizeInBytes = + object.maxEntrySizeInBytes !== undefined && + object.maxEntrySizeInBytes !== null + ? Number(object.maxEntrySizeInBytes) + : undefined; + message.maxEntrySizeInRows = + object.maxEntrySizeInRows !== undefined && + object.maxEntrySizeInRows !== null + ? Number(object.maxEntrySizeInRows) + : undefined; + return message; + }, + + toJSON(message: ClickhouseConfig_QueryCache): unknown { + const obj: any = {}; + message.maxSizeInBytes !== undefined && + (obj.maxSizeInBytes = message.maxSizeInBytes); + message.maxEntries !== undefined && (obj.maxEntries = message.maxEntries); + message.maxEntrySizeInBytes !== undefined && + (obj.maxEntrySizeInBytes = message.maxEntrySizeInBytes); + message.maxEntrySizeInRows !== undefined && + (obj.maxEntrySizeInRows = message.maxEntrySizeInRows); + return obj; + }, + + fromPartial, I>>( + object: I + ): ClickhouseConfig_QueryCache { + const message = { + ...baseClickhouseConfig_QueryCache, + } as ClickhouseConfig_QueryCache; + message.maxSizeInBytes = object.maxSizeInBytes ?? undefined; + message.maxEntries = object.maxEntries ?? undefined; + message.maxEntrySizeInBytes = object.maxEntrySizeInBytes ?? undefined; + message.maxEntrySizeInRows = object.maxEntrySizeInRows ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + ClickhouseConfig_QueryCache.$type, + ClickhouseConfig_QueryCache +); + const baseClickhouseConfigSet: object = { $type: "yandex.cloud.mdb.clickhouse.v1.config.ClickhouseConfigSet", }; diff --git a/src/generated/yandex/cloud/mdb/clickhouse/v1/format_schema.ts b/src/generated/yandex/cloud/mdb/clickhouse/v1/format_schema.ts index b5870f55..91ec6003 100644 --- a/src/generated/yandex/cloud/mdb/clickhouse/v1/format_schema.ts +++ b/src/generated/yandex/cloud/mdb/clickhouse/v1/format_schema.ts @@ -45,9 +45,18 @@ export function formatSchemaTypeToJSON(object: FormatSchemaType): string { export interface FormatSchema { $type: "yandex.cloud.mdb.clickhouse.v1.FormatSchema"; + /** Format schema name. */ name: string; + /** ClickHouse cluster ID. */ clusterId: string; + /** + * Schema type. Possible values are the following: + * + * * FORMAT_SCHEMA_TYPE_PROTOBUF - [Protobuf](https://protobuf.dev/) data format (including [ProtobufSingle](https://clickhouse.com/docs/en/interfaces/formats#protobufsingle)). + * * FORMAT_SCHEMA_TYPE_CAPNPROTO - [Cap'n Proto](https://capnproto.org/) data format. + */ type: FormatSchemaType; + /** Link to the file of a format schema in Yandex Object Storage. Managed Service for ClickHouse works only with format schemas imported to Object Storage. */ uri: string; } diff --git a/src/generated/yandex/cloud/mdb/clickhouse/v1/format_schema_service.ts b/src/generated/yandex/cloud/mdb/clickhouse/v1/format_schema_service.ts index 6249d826..3287e779 100644 --- a/src/generated/yandex/cloud/mdb/clickhouse/v1/format_schema_service.ts +++ b/src/generated/yandex/cloud/mdb/clickhouse/v1/format_schema_service.ts @@ -27,60 +27,119 @@ export const protobufPackage = "yandex.cloud.mdb.clickhouse.v1"; export interface GetFormatSchemaRequest { $type: "yandex.cloud.mdb.clickhouse.v1.GetFormatSchemaRequest"; + /** + * ClickHouse cluster ID. + * + * To get a ClickHouse cluster ID, use the [ClusterService.List] method. + */ clusterId: string; + /** + * Format schema name. + * + * To get a format schema name, use the [FormatSchemaService.List] method. + */ formatSchemaName: string; } export interface ListFormatSchemasRequest { $type: "yandex.cloud.mdb.clickhouse.v1.ListFormatSchemasRequest"; + /** + * ClickHouse cluster ID. + * + * To get a ClickHouse cluster ID, use the [ClusterService.List] method. + */ clusterId: string; + /** The maximum number of results per page to return. If the number of the results is larger than [page_size], the service returns [ListFormatSchemasResponse.next_page_token]. You can use it to get the next page of the results in subsequent requests of a format schema list. */ pageSize: number; + /** Page token. To get the next page of results, set [page_token] to the [ListFormatSchemasResponse.next_page_token] returned by the previous format schema list request. */ pageToken: string; } export interface ListFormatSchemasResponse { $type: "yandex.cloud.mdb.clickhouse.v1.ListFormatSchemasResponse"; + /** List of format schemas. */ formatSchemas: FormatSchema[]; + /** This token allows you to get the next page of results when requesting the format schema list. If the number of the results is larger than [ListFormatSchemasRequest.page_size], use the [next_page_token] as the value for the [ListFormatSchemasRequest.page_token] parameter in the next request. Each subsequent request will have its own [next_page_token] to continue paging through the results. */ nextPageToken: string; } export interface CreateFormatSchemaRequest { $type: "yandex.cloud.mdb.clickhouse.v1.CreateFormatSchemaRequest"; + /** + * ClickHouse cluster ID. + * + * To get a ClickHouse cluster ID, use the [ClusterService.List] method. + */ clusterId: string; + /** Format schema name. */ formatSchemaName: string; + /** + * Schema type. Possible values are the following: + * + * * FORMAT_SCHEMA_TYPE_PROTOBUF - [Protobuf](https://protobuf.dev/) data format (including [ProtobufSingle](https://clickhouse.com/docs/en/interfaces/formats#protobufsingle)). + * * FORMAT_SCHEMA_TYPE_CAPNPROTO - [Cap'n Proto](https://capnproto.org/) data format. + */ type: FormatSchemaType; + /** [Link to the file](/docs/managed-clickhouse/operations/s3-access#get-link-to-object) of a format schema in Yandex Object Storage. Managed Service for ClickHouse works only with format schemas imported to Object Storage. */ uri: string; } export interface CreateFormatSchemaMetadata { $type: "yandex.cloud.mdb.clickhouse.v1.CreateFormatSchemaMetadata"; + /** ClickHouse cluster ID. */ clusterId: string; + /** Format schema name. */ formatSchemaName: string; } export interface UpdateFormatSchemaRequest { $type: "yandex.cloud.mdb.clickhouse.v1.UpdateFormatSchemaRequest"; + /** + * ClickHouse cluster ID. + * + * To get a ClickHouse cluster ID, use the [ClusterService.List] method. + */ clusterId: string; + /** + * Format schema name. + * + * To get a format schema name, use the [FormatSchemaService.List] method. + */ formatSchemaName: string; updateMask?: FieldMask; + /** [Link to the file](/docs/managed-clickhouse/operations/s3-access#get-link-to-object) of a format schema in Yandex Object Storage. Managed Service for ClickHouse works only with format schemas imported to Object Storage. */ uri: string; } export interface UpdateFormatSchemaMetadata { $type: "yandex.cloud.mdb.clickhouse.v1.UpdateFormatSchemaMetadata"; + /** ClickHouse cluster ID. */ clusterId: string; + /** Format schema name. */ formatSchemaName: string; } export interface DeleteFormatSchemaRequest { $type: "yandex.cloud.mdb.clickhouse.v1.DeleteFormatSchemaRequest"; + /** + * ClickHouse cluster ID. + * + * To get a ClickHouse cluster ID, use the [ClusterService.List] method. + */ clusterId: string; + /** + * Format schema name. + * + * To get a format schema name, use the [FormatSchemaService.List] method. + */ formatSchemaName: string; } export interface DeleteFormatSchemaMetadata { $type: "yandex.cloud.mdb.clickhouse.v1.DeleteFormatSchemaMetadata"; + /** ClickHouse cluster ID. */ clusterId: string; + /** Format schema name. */ formatSchemaName: string; } @@ -942,7 +1001,9 @@ messageTypeRegistry.set( DeleteFormatSchemaMetadata ); +/** A set of methods for managing [format schemas](https://clickhouse.com/docs/en/interfaces/formats) for input and output data. */ export const FormatSchemaServiceService = { + /** Returns detailed information about a given format schema. */ get: { path: "/yandex.cloud.mdb.clickhouse.v1.FormatSchemaService/Get", requestStream: false, @@ -954,6 +1015,7 @@ export const FormatSchemaServiceService = { Buffer.from(FormatSchema.encode(value).finish()), responseDeserialize: (value: Buffer) => FormatSchema.decode(value), }, + /** Returns a list of format schemas in a cluster. */ list: { path: "/yandex.cloud.mdb.clickhouse.v1.FormatSchemaService/List", requestStream: false, @@ -967,6 +1029,7 @@ export const FormatSchemaServiceService = { responseDeserialize: (value: Buffer) => ListFormatSchemasResponse.decode(value), }, + /** Adds a format schema to a cluster. */ create: { path: "/yandex.cloud.mdb.clickhouse.v1.FormatSchemaService/Create", requestStream: false, @@ -979,6 +1042,7 @@ export const FormatSchemaServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Changes a format schema. */ update: { path: "/yandex.cloud.mdb.clickhouse.v1.FormatSchemaService/Update", requestStream: false, @@ -991,6 +1055,7 @@ export const FormatSchemaServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Deletes a format schema from a cluster. */ delete: { path: "/yandex.cloud.mdb.clickhouse.v1.FormatSchemaService/Delete", requestStream: false, @@ -1007,14 +1072,20 @@ export const FormatSchemaServiceService = { export interface FormatSchemaServiceServer extends UntypedServiceImplementation { + /** Returns detailed information about a given format schema. */ get: handleUnaryCall; + /** Returns a list of format schemas in a cluster. */ list: handleUnaryCall; + /** Adds a format schema to a cluster. */ create: handleUnaryCall; + /** Changes a format schema. */ update: handleUnaryCall; + /** Deletes a format schema from a cluster. */ delete: handleUnaryCall; } export interface FormatSchemaServiceClient extends Client { + /** Returns detailed information about a given format schema. */ get( request: GetFormatSchemaRequest, callback: (error: ServiceError | null, response: FormatSchema) => void @@ -1030,6 +1101,7 @@ export interface FormatSchemaServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: FormatSchema) => void ): ClientUnaryCall; + /** Returns a list of format schemas in a cluster. */ list( request: ListFormatSchemasRequest, callback: ( @@ -1054,6 +1126,7 @@ export interface FormatSchemaServiceClient extends Client { response: ListFormatSchemasResponse ) => void ): ClientUnaryCall; + /** Adds a format schema to a cluster. */ create( request: CreateFormatSchemaRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -1069,6 +1142,7 @@ export interface FormatSchemaServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Changes a format schema. */ update( request: UpdateFormatSchemaRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -1084,6 +1158,7 @@ export interface FormatSchemaServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Deletes a format schema from a cluster. */ delete( request: DeleteFormatSchemaRequest, callback: (error: ServiceError | null, response: Operation) => void diff --git a/src/generated/yandex/cloud/mdb/clickhouse/v1/user.ts b/src/generated/yandex/cloud/mdb/clickhouse/v1/user.ts index 81c00bf5..7154ffa8 100644 --- a/src/generated/yandex/cloud/mdb/clickhouse/v1/user.ts +++ b/src/generated/yandex/cloud/mdb/clickhouse/v1/user.ts @@ -957,6 +957,48 @@ export interface UserSettings { * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/settings/settings#memory_usage_overcommit_max_wait_microseconds) */ memoryUsageOvercommitMaxWaitMicroseconds?: number; + /** + * Setting up query threads logging. Query threads log into the [system.query_thread_log](https://clickhouse.com/docs/en/operations/system-tables/query_thread_log) table. This setting has effect only when [log_queries](https://clickhouse.com/docs/en/operations/settings/settings#log-queries) is true. Queries threads run by ClickHouse with this setup are logged according to the rules in the [query_thread_log](https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#server_configuration_parameters-query_thread_log) server configuration parameter. + * Default: true + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/settings/settings#log_query_threads) + */ + logQueryThreads?: boolean; + /** + * The maximum number of threads to execute the INSERT SELECT query. + * Default: 0 + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/settings/settings#max_insert_threads) + */ + maxInsertThreads?: number; + /** + * Enables hedged requests logic for remote queries. It allows to establish many connections with different replicas for query. New connection is enabled in case existent connection(s) with replica(s) were not established within hedged_connection_timeout or no data was received within receive_data_timeout. Query uses the first connection which send non empty progress packet (or data packet, if allow_changing_replica_until_first_data_packet); other connections are cancelled. Queries with max_parallel_replicas > 1 are supported. + * Default: true + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/settings/settings#use_hedged_requests) + */ + useHedgedRequests?: boolean; + /** + * Timeout to close idle TCP connections after specified number of milliseconds. + * Default: 360000 (3600 seconds) + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/settings/settings#idle_connection_timeout) + */ + idleConnectionTimeout?: number; + /** + * Connection timeout for establishing connection with replica for Hedged requests. + * Default: 50 + * See in-depth description in [ClickHouse GitHub](https://github.com/ClickHouse/ClickHouse/blob/f9558345e886876b9132d9c018e357f7fa9b22a3/src/Core/Settings.h#L64) + */ + hedgedConnectionTimeoutMs?: number; + /** + * Specifies the algorithm of replicas selection that is used for distributed query processing, one of: random, nearest_hostname, in_order, first_or_random, round_robin. + * Default: random + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/settings/settings#load_balancing) + */ + loadBalancing: UserSettings_LoadBalancing; + /** + * Enables/disables preferable using the localhost replica when processing distributed queries. + * Default: true + * See in-depth description in [ClickHouse documentation](https://clickhouse.com/docs/en/operations/settings/settings#prefer_localhost_replica) + */ + preferLocalhostReplica?: boolean; /** * The setting is deprecated and has no effect. * @@ -1557,6 +1599,66 @@ export function userSettings_RemoteFilesystemReadMethodToJSON( } } +export enum UserSettings_LoadBalancing { + LOAD_BALANCING_UNSPECIFIED = 0, + LOAD_BALANCING_RANDOM = 1, + LOAD_BALANCING_NEAREST_HOSTNAME = 2, + LOAD_BALANCING_IN_ORDER = 3, + LOAD_BALANCING_FIRST_OR_RANDOM = 4, + LOAD_BALANCING_ROUND_ROBIN = 5, + UNRECOGNIZED = -1, +} + +export function userSettings_LoadBalancingFromJSON( + object: any +): UserSettings_LoadBalancing { + switch (object) { + case 0: + case "LOAD_BALANCING_UNSPECIFIED": + return UserSettings_LoadBalancing.LOAD_BALANCING_UNSPECIFIED; + case 1: + case "LOAD_BALANCING_RANDOM": + return UserSettings_LoadBalancing.LOAD_BALANCING_RANDOM; + case 2: + case "LOAD_BALANCING_NEAREST_HOSTNAME": + return UserSettings_LoadBalancing.LOAD_BALANCING_NEAREST_HOSTNAME; + case 3: + case "LOAD_BALANCING_IN_ORDER": + return UserSettings_LoadBalancing.LOAD_BALANCING_IN_ORDER; + case 4: + case "LOAD_BALANCING_FIRST_OR_RANDOM": + return UserSettings_LoadBalancing.LOAD_BALANCING_FIRST_OR_RANDOM; + case 5: + case "LOAD_BALANCING_ROUND_ROBIN": + return UserSettings_LoadBalancing.LOAD_BALANCING_ROUND_ROBIN; + case -1: + case "UNRECOGNIZED": + default: + return UserSettings_LoadBalancing.UNRECOGNIZED; + } +} + +export function userSettings_LoadBalancingToJSON( + object: UserSettings_LoadBalancing +): string { + switch (object) { + case UserSettings_LoadBalancing.LOAD_BALANCING_UNSPECIFIED: + return "LOAD_BALANCING_UNSPECIFIED"; + case UserSettings_LoadBalancing.LOAD_BALANCING_RANDOM: + return "LOAD_BALANCING_RANDOM"; + case UserSettings_LoadBalancing.LOAD_BALANCING_NEAREST_HOSTNAME: + return "LOAD_BALANCING_NEAREST_HOSTNAME"; + case UserSettings_LoadBalancing.LOAD_BALANCING_IN_ORDER: + return "LOAD_BALANCING_IN_ORDER"; + case UserSettings_LoadBalancing.LOAD_BALANCING_FIRST_OR_RANDOM: + return "LOAD_BALANCING_FIRST_OR_RANDOM"; + case UserSettings_LoadBalancing.LOAD_BALANCING_ROUND_ROBIN: + return "LOAD_BALANCING_ROUND_ROBIN"; + default: + return "UNKNOWN"; + } +} + /** * ClickHouse quota representation. Each quota associated with an user and limits it resource usage for an interval. * See in-depth description [ClickHouse documentation](https://clickhouse.com/docs/en/operations/quotas/). @@ -1932,6 +2034,7 @@ const baseUserSettings: object = { formatRegexpEscapingRule: 0, localFilesystemReadMethod: 0, remoteFilesystemReadMethod: 0, + loadBalancing: 0, }; export const UserSettings = { @@ -2948,6 +3051,60 @@ export const UserSettings = { writer.uint32(1106).fork() ).ldelim(); } + if (message.logQueryThreads !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.logQueryThreads! }, + writer.uint32(1114).fork() + ).ldelim(); + } + if (message.maxInsertThreads !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.maxInsertThreads!, + }, + writer.uint32(1122).fork() + ).ldelim(); + } + if (message.useHedgedRequests !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.useHedgedRequests!, + }, + writer.uint32(1130).fork() + ).ldelim(); + } + if (message.idleConnectionTimeout !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.idleConnectionTimeout!, + }, + writer.uint32(1138).fork() + ).ldelim(); + } + if (message.hedgedConnectionTimeoutMs !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.hedgedConnectionTimeoutMs!, + }, + writer.uint32(1146).fork() + ).ldelim(); + } + if (message.loadBalancing !== 0) { + writer.uint32(1152).int32(message.loadBalancing); + } + if (message.preferLocalhostReplica !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.preferLocalhostReplica!, + }, + writer.uint32(1162).fork() + ).ldelim(); + } if (message.compile !== undefined) { BoolValue.encode( { $type: "google.protobuf.BoolValue", value: message.compile! }, @@ -3709,6 +3866,45 @@ export const UserSettings = { reader.uint32() ).value; break; + case 139: + message.logQueryThreads = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 140: + message.maxInsertThreads = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 141: + message.useHedgedRequests = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 142: + message.idleConnectionTimeout = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 143: + message.hedgedConnectionTimeoutMs = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 144: + message.loadBalancing = reader.int32() as any; + break; + case 145: + message.preferLocalhostReplica = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; case 44: message.compile = BoolValue.decode(reader, reader.uint32()).value; break; @@ -4365,6 +4561,38 @@ export const UserSettings = { object.memoryUsageOvercommitMaxWaitMicroseconds !== null ? Number(object.memoryUsageOvercommitMaxWaitMicroseconds) : undefined; + message.logQueryThreads = + object.logQueryThreads !== undefined && object.logQueryThreads !== null + ? Boolean(object.logQueryThreads) + : undefined; + message.maxInsertThreads = + object.maxInsertThreads !== undefined && object.maxInsertThreads !== null + ? Number(object.maxInsertThreads) + : undefined; + message.useHedgedRequests = + object.useHedgedRequests !== undefined && + object.useHedgedRequests !== null + ? Boolean(object.useHedgedRequests) + : undefined; + message.idleConnectionTimeout = + object.idleConnectionTimeout !== undefined && + object.idleConnectionTimeout !== null + ? Number(object.idleConnectionTimeout) + : undefined; + message.hedgedConnectionTimeoutMs = + object.hedgedConnectionTimeoutMs !== undefined && + object.hedgedConnectionTimeoutMs !== null + ? Number(object.hedgedConnectionTimeoutMs) + : undefined; + message.loadBalancing = + object.loadBalancing !== undefined && object.loadBalancing !== null + ? userSettings_LoadBalancingFromJSON(object.loadBalancing) + : 0; + message.preferLocalhostReplica = + object.preferLocalhostReplica !== undefined && + object.preferLocalhostReplica !== null + ? Boolean(object.preferLocalhostReplica) + : undefined; message.compile = object.compile !== undefined && object.compile !== null ? Boolean(object.compile) @@ -4710,6 +4938,22 @@ export const UserSettings = { message.memoryUsageOvercommitMaxWaitMicroseconds !== undefined && (obj.memoryUsageOvercommitMaxWaitMicroseconds = message.memoryUsageOvercommitMaxWaitMicroseconds); + message.logQueryThreads !== undefined && + (obj.logQueryThreads = message.logQueryThreads); + message.maxInsertThreads !== undefined && + (obj.maxInsertThreads = message.maxInsertThreads); + message.useHedgedRequests !== undefined && + (obj.useHedgedRequests = message.useHedgedRequests); + message.idleConnectionTimeout !== undefined && + (obj.idleConnectionTimeout = message.idleConnectionTimeout); + message.hedgedConnectionTimeoutMs !== undefined && + (obj.hedgedConnectionTimeoutMs = message.hedgedConnectionTimeoutMs); + message.loadBalancing !== undefined && + (obj.loadBalancing = userSettings_LoadBalancingToJSON( + message.loadBalancing + )); + message.preferLocalhostReplica !== undefined && + (obj.preferLocalhostReplica = message.preferLocalhostReplica); message.compile !== undefined && (obj.compile = message.compile); message.minCountToCompile !== undefined && (obj.minCountToCompile = message.minCountToCompile); @@ -4904,6 +5148,14 @@ export const UserSettings = { object.memoryOvercommitRatioDenominatorForUser ?? undefined; message.memoryUsageOvercommitMaxWaitMicroseconds = object.memoryUsageOvercommitMaxWaitMicroseconds ?? undefined; + message.logQueryThreads = object.logQueryThreads ?? undefined; + message.maxInsertThreads = object.maxInsertThreads ?? undefined; + message.useHedgedRequests = object.useHedgedRequests ?? undefined; + message.idleConnectionTimeout = object.idleConnectionTimeout ?? undefined; + message.hedgedConnectionTimeoutMs = + object.hedgedConnectionTimeoutMs ?? undefined; + message.loadBalancing = object.loadBalancing ?? 0; + message.preferLocalhostReplica = object.preferLocalhostReplica ?? undefined; message.compile = object.compile ?? undefined; message.minCountToCompile = object.minCountToCompile ?? undefined; return message; diff --git a/src/generated/yandex/cloud/mdb/elasticsearch/v1/cluster.ts b/src/generated/yandex/cloud/mdb/elasticsearch/v1/cluster.ts index f4734950..e7c69a38 100644 --- a/src/generated/yandex/cloud/mdb/elasticsearch/v1/cluster.ts +++ b/src/generated/yandex/cloud/mdb/elasticsearch/v1/cluster.ts @@ -64,9 +64,9 @@ export interface Cluster { export enum Cluster_Environment { ENVIRONMENT_UNSPECIFIED = 0, - /** PRODUCTION - stable environment with a conservative update policy when only hotfixes are applied during regular maintenance. */ + /** PRODUCTION - Stable environment with a conservative update policy when only hotfixes are applied during regular maintenance. */ PRODUCTION = 1, - /** PRESTABLE - environment with a more aggressive update policy when new versions are rolled out irrespective of backward compatibility. */ + /** PRESTABLE - Environment with a more aggressive update policy when new versions are rolled out irrespective of backward compatibility. */ PRESTABLE = 2, UNRECOGNIZED = -1, } @@ -103,13 +103,13 @@ export function cluster_EnvironmentToJSON(object: Cluster_Environment): string { } export enum Cluster_Health { - /** HEALTH_UNKNOWN - state of the cluster is unknown ([Host.health] of all hosts in the cluster is `UNKNOWN`). */ + /** HEALTH_UNKNOWN - State of the cluster is unknown ([Host.health] of all hosts in the cluster is `UNKNOWN`). */ HEALTH_UNKNOWN = 0, - /** ALIVE - cluster is alive and well ([Host.health] of all hosts in the cluster is `ALIVE`). */ + /** ALIVE - Cluster is alive and well ([Host.health] of all hosts in the cluster is `ALIVE`). */ ALIVE = 1, - /** DEAD - cluster is inoperable ([Host.health] of all hosts in the cluster is `DEAD`). */ + /** DEAD - Cluster is inoperable ([Host.health] of all hosts in the cluster is `DEAD`). */ DEAD = 2, - /** DEGRADED - cluster is in degraded state ([Host.health] of at least one of the hosts in the cluster is not `ALIVE`). */ + /** DEGRADED - Cluster is in degraded state ([Host.health] of at least one of the hosts in the cluster is not `ALIVE`). */ DEGRADED = 3, UNRECOGNIZED = -1, } @@ -151,21 +151,21 @@ export function cluster_HealthToJSON(object: Cluster_Health): string { } export enum Cluster_Status { - /** STATUS_UNKNOWN - cluster state is unknown. */ + /** STATUS_UNKNOWN - Cluster state is unknown. */ STATUS_UNKNOWN = 0, - /** CREATING - cluster is being created. */ + /** CREATING - Cluster is being created. */ CREATING = 1, - /** RUNNING - cluster is running normally. */ + /** RUNNING - Cluster is running normally. */ RUNNING = 2, - /** ERROR - cluster encountered a problem and cannot operate. */ + /** ERROR - Cluster encountered a problem and cannot operate. */ ERROR = 3, - /** UPDATING - cluster is being updated. */ + /** UPDATING - Cluster is being updated. */ UPDATING = 4, - /** STOPPING - cluster is stopping. */ + /** STOPPING - Cluster is stopping. */ STOPPING = 5, - /** STOPPED - cluster stopped. */ + /** STOPPED - Cluster stopped. */ STOPPED = 6, - /** STARTING - cluster is starting. */ + /** STARTING - Cluster is starting. */ STARTING = 7, UNRECOGNIZED = -1, } @@ -306,7 +306,7 @@ export interface Host { /** Host type. */ type: Host_Type; resources?: Resources; - /** Aggregated host health data. */ + /** Aggregated host health data. If the field has default value, it is not returned in the response. */ health: Host_Health; /** Services provided by the host. */ services: Service[]; @@ -321,10 +321,11 @@ export interface Host { } export enum Host_Type { + /** TYPE_UNSPECIFIED - Host type is unspecified. Default value. */ TYPE_UNSPECIFIED = 0, - /** DATA_NODE - the host is an Elasticsearch data node. */ + /** DATA_NODE - The host is an Elasticsearch data node. */ DATA_NODE = 1, - /** MASTER_NODE - the host is an Elasticsearch master node. */ + /** MASTER_NODE - The host is an Elasticsearch master node. */ MASTER_NODE = 2, UNRECOGNIZED = -1, } @@ -361,13 +362,13 @@ export function host_TypeToJSON(object: Host_Type): string { } export enum Host_Health { - /** UNKNOWN - health of the host is unknown. */ + /** UNKNOWN - Health of the host is unknown. */ UNKNOWN = 0, - /** ALIVE - the host is performing all its functions normally. */ + /** ALIVE - The host is performing all its functions normally. */ ALIVE = 1, - /** DEAD - the host is inoperable and cannot perform any of its essential functions. */ + /** DEAD - The host is inoperable and cannot perform any of its essential functions. */ DEAD = 2, - /** DEGRADED - the host is degraded and can perform only some of its essential functions. */ + /** DEGRADED - The host is degraded and can perform only some of its essential functions. */ DEGRADED = 3, UNRECOGNIZED = -1, } @@ -413,13 +414,13 @@ export interface Service { $type: "yandex.cloud.mdb.elasticsearch.v1.Service"; /** Type of the service provided by the host. */ type: Service_Type; - /** Service health data. */ + /** Service health data. If the field has default value, it is not returned in the response. */ health: Service_Health; } export enum Service_Type { TYPE_UNSPECIFIED = 0, - /** ELASTICSEARCH - the Elasticsearch service. */ + /** ELASTICSEARCH - The Elasticsearch service. */ ELASTICSEARCH = 1, UNRECOGNIZED = -1, } @@ -451,11 +452,11 @@ export function service_TypeToJSON(object: Service_Type): string { } export enum Service_Health { - /** UNKNOWN - health of the service is unknown. */ + /** UNKNOWN - Health of the service is unknown. */ UNKNOWN = 0, - /** ALIVE - the service is working normally. */ + /** ALIVE - The service is working normally. */ ALIVE = 1, - /** DEAD - the service is dead or unresponsive. */ + /** DEAD - The service is dead or unresponsive. */ DEAD = 2, UNRECOGNIZED = -1, } diff --git a/src/generated/yandex/cloud/mdb/elasticsearch/v1/cluster_service.ts b/src/generated/yandex/cloud/mdb/elasticsearch/v1/cluster_service.ts index 068c21a0..fbb4f2ef 100644 --- a/src/generated/yandex/cloud/mdb/elasticsearch/v1/cluster_service.ts +++ b/src/generated/yandex/cloud/mdb/elasticsearch/v1/cluster_service.ts @@ -177,6 +177,8 @@ export interface UpdateClusterRequest { deletionProtection: boolean; /** Window of maintenance operations. */ maintenanceWindow?: MaintenanceWindow; + /** ID of the network to move the cluster to. */ + networkId: string; } export interface UpdateClusterRequest_LabelsEntry { @@ -1533,6 +1535,7 @@ const baseUpdateClusterRequest: object = { securityGroupIds: "", serviceAccountId: "", deletionProtection: false, + networkId: "", }; export const UpdateClusterRequest = { @@ -1586,6 +1589,9 @@ export const UpdateClusterRequest = { writer.uint32(82).fork() ).ldelim(); } + if (message.networkId !== "") { + writer.uint32(90).string(message.networkId); + } return writer; }, @@ -1640,6 +1646,9 @@ export const UpdateClusterRequest = { reader.uint32() ); break; + case 11: + message.networkId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1693,6 +1702,10 @@ export const UpdateClusterRequest = { object.maintenanceWindow !== null ? MaintenanceWindow.fromJSON(object.maintenanceWindow) : undefined; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; return message; }, @@ -1729,6 +1742,7 @@ export const UpdateClusterRequest = { (obj.maintenanceWindow = message.maintenanceWindow ? MaintenanceWindow.toJSON(message.maintenanceWindow) : undefined); + message.networkId !== undefined && (obj.networkId = message.networkId); return obj; }, @@ -1763,6 +1777,7 @@ export const UpdateClusterRequest = { object.maintenanceWindow !== null ? MaintenanceWindow.fromPartial(object.maintenanceWindow) : undefined; + message.networkId = object.networkId ?? ""; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/greenplum/v1/backup.ts b/src/generated/yandex/cloud/mdb/greenplum/v1/backup.ts index aa40dd8f..01cce032 100644 --- a/src/generated/yandex/cloud/mdb/greenplum/v1/backup.ts +++ b/src/generated/yandex/cloud/mdb/greenplum/v1/backup.ts @@ -20,6 +20,96 @@ export interface Backup { startedAt?: Date; /** Size of the backup in bytes. */ size: number; + /** How this backup was created (manual/automatic/etc...) */ + type: Backup_BackupCreationType; + /** Method of backup creation */ + method: Backup_BackupMethod; + /** Size of the journal associated with backup, in bytes */ + journalSize: number; +} + +export enum Backup_BackupMethod { + BACKUP_METHOD_UNSPECIFIED = 0, + /** BASE - Base backup */ + BASE = 1, + /** INCREMENTAL - Delta (incremental) Greenplum backup */ + INCREMENTAL = 2, + UNRECOGNIZED = -1, +} + +export function backup_BackupMethodFromJSON(object: any): Backup_BackupMethod { + switch (object) { + case 0: + case "BACKUP_METHOD_UNSPECIFIED": + return Backup_BackupMethod.BACKUP_METHOD_UNSPECIFIED; + case 1: + case "BASE": + return Backup_BackupMethod.BASE; + case 2: + case "INCREMENTAL": + return Backup_BackupMethod.INCREMENTAL; + case -1: + case "UNRECOGNIZED": + default: + return Backup_BackupMethod.UNRECOGNIZED; + } +} + +export function backup_BackupMethodToJSON(object: Backup_BackupMethod): string { + switch (object) { + case Backup_BackupMethod.BACKUP_METHOD_UNSPECIFIED: + return "BACKUP_METHOD_UNSPECIFIED"; + case Backup_BackupMethod.BASE: + return "BASE"; + case Backup_BackupMethod.INCREMENTAL: + return "INCREMENTAL"; + default: + return "UNKNOWN"; + } +} + +export enum Backup_BackupCreationType { + BACKUP_CREATION_TYPE_UNSPECIFIED = 0, + /** AUTOMATED - Backup created by automated daily schedule */ + AUTOMATED = 1, + /** MANUAL - Backup created by user request */ + MANUAL = 2, + UNRECOGNIZED = -1, +} + +export function backup_BackupCreationTypeFromJSON( + object: any +): Backup_BackupCreationType { + switch (object) { + case 0: + case "BACKUP_CREATION_TYPE_UNSPECIFIED": + return Backup_BackupCreationType.BACKUP_CREATION_TYPE_UNSPECIFIED; + case 1: + case "AUTOMATED": + return Backup_BackupCreationType.AUTOMATED; + case 2: + case "MANUAL": + return Backup_BackupCreationType.MANUAL; + case -1: + case "UNRECOGNIZED": + default: + return Backup_BackupCreationType.UNRECOGNIZED; + } +} + +export function backup_BackupCreationTypeToJSON( + object: Backup_BackupCreationType +): string { + switch (object) { + case Backup_BackupCreationType.BACKUP_CREATION_TYPE_UNSPECIFIED: + return "BACKUP_CREATION_TYPE_UNSPECIFIED"; + case Backup_BackupCreationType.AUTOMATED: + return "AUTOMATED"; + case Backup_BackupCreationType.MANUAL: + return "MANUAL"; + default: + return "UNKNOWN"; + } } const baseBackup: object = { @@ -28,6 +118,9 @@ const baseBackup: object = { folderId: "", sourceClusterId: "", size: 0, + type: 0, + method: 0, + journalSize: 0, }; export const Backup = { @@ -61,6 +154,15 @@ export const Backup = { if (message.size !== 0) { writer.uint32(48).int64(message.size); } + if (message.type !== 0) { + writer.uint32(56).int32(message.type); + } + if (message.method !== 0) { + writer.uint32(64).int32(message.method); + } + if (message.journalSize !== 0) { + writer.uint32(72).int64(message.journalSize); + } return writer; }, @@ -93,6 +195,15 @@ export const Backup = { case 6: message.size = longToNumber(reader.int64() as Long); break; + case 7: + message.type = reader.int32() as any; + break; + case 8: + message.method = reader.int32() as any; + break; + case 9: + message.journalSize = longToNumber(reader.int64() as Long); + break; default: reader.skipType(tag & 7); break; @@ -125,6 +236,18 @@ export const Backup = { object.size !== undefined && object.size !== null ? Number(object.size) : 0; + message.type = + object.type !== undefined && object.type !== null + ? backup_BackupCreationTypeFromJSON(object.type) + : 0; + message.method = + object.method !== undefined && object.method !== null + ? backup_BackupMethodFromJSON(object.method) + : 0; + message.journalSize = + object.journalSize !== undefined && object.journalSize !== null + ? Number(object.journalSize) + : 0; return message; }, @@ -139,6 +262,12 @@ export const Backup = { message.startedAt !== undefined && (obj.startedAt = message.startedAt.toISOString()); message.size !== undefined && (obj.size = Math.round(message.size)); + message.type !== undefined && + (obj.type = backup_BackupCreationTypeToJSON(message.type)); + message.method !== undefined && + (obj.method = backup_BackupMethodToJSON(message.method)); + message.journalSize !== undefined && + (obj.journalSize = Math.round(message.journalSize)); return obj; }, @@ -150,6 +279,9 @@ export const Backup = { message.sourceClusterId = object.sourceClusterId ?? ""; message.startedAt = object.startedAt ?? undefined; message.size = object.size ?? 0; + message.type = object.type ?? 0; + message.method = object.method ?? 0; + message.journalSize = object.journalSize ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/greenplum/v1/backup_service.ts b/src/generated/yandex/cloud/mdb/greenplum/v1/backup_service.ts index a502e06b..3124e9ff 100644 --- a/src/generated/yandex/cloud/mdb/greenplum/v1/backup_service.ts +++ b/src/generated/yandex/cloud/mdb/greenplum/v1/backup_service.ts @@ -15,6 +15,7 @@ import { } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; import { Backup } from "../../../../../yandex/cloud/mdb/greenplum/v1/backup"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; export const protobufPackage = "yandex.cloud.mdb.greenplum.v1"; @@ -64,7 +65,7 @@ export interface DeleteBackupMetadata { $type: "yandex.cloud.mdb.greenplum.v1.DeleteBackupMetadata"; /** Required. ID of the Greenplum backup that is currently being deleted. */ backupId: string; - /** ID of the Greenplum backup that is being created. */ + /** ID of the Greenplum backup that is being deleted. */ clusterId: string; } @@ -466,6 +467,17 @@ export const BackupServiceService = { Buffer.from(ListBackupsResponse.encode(value).finish()), responseDeserialize: (value: Buffer) => ListBackupsResponse.decode(value), }, + delete: { + path: "/yandex.cloud.mdb.greenplum.v1.BackupService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteBackupRequest) => + Buffer.from(DeleteBackupRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteBackupRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface BackupServiceServer extends UntypedServiceImplementation { @@ -473,6 +485,7 @@ export interface BackupServiceServer extends UntypedServiceImplementation { get: handleUnaryCall; /** Returns the list of available backups for the specified Greenplum® cluster. */ list: handleUnaryCall; + delete: handleUnaryCall; } export interface BackupServiceClient extends Client { @@ -517,6 +530,21 @@ export interface BackupServiceClient extends Client { response: ListBackupsResponse ) => void ): ClientUnaryCall; + delete( + request: DeleteBackupRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteBackupRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteBackupRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const BackupServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/mdb/greenplum/v1/cluster.ts b/src/generated/yandex/cloud/mdb/greenplum/v1/cluster.ts index 1fad603c..21ab9011 100644 --- a/src/generated/yandex/cloud/mdb/greenplum/v1/cluster.ts +++ b/src/generated/yandex/cloud/mdb/greenplum/v1/cluster.ts @@ -20,6 +20,7 @@ import { import { PXFConfigSet } from "../../../../../yandex/cloud/mdb/greenplum/v1/pxf"; import { TimeOfDay } from "../../../../../google/type/timeofday"; import { Timestamp } from "../../../../../google/protobuf/timestamp"; +import { Int64Value } from "../../../../../google/protobuf/wrappers"; export const protobufPackage = "yandex.cloud.mdb.greenplum.v1"; @@ -82,6 +83,10 @@ export interface Cluster { clusterConfig?: ClusterConfigSet; /** Cloud storage settings */ cloudStorage?: CloudStorage; + /** Host groups hosting VMs of the master subcluster. */ + masterHostGroupIds: string[]; + /** Host groups hosting VMs of the segment subcluster. */ + segmentHostGroupIds: string[]; } export enum Cluster_Environment { @@ -270,6 +275,7 @@ export interface ClusterConfigSet { greenplumConfigSet6?: GreenplumConfigSet6 | undefined; /** Odyssey® pool settings. */ pool?: ConnectionPoolerConfigSet; + /** Managed Greenplum® background tasks configuration. */ backgroundActivities?: BackgroundActivitiesConfig; pxfConfig?: PXFConfigSet; } @@ -291,6 +297,8 @@ export interface GreenplumConfig { version: string; /** Time to start the daily backup, in the UTC timezone. */ backupWindowStart?: TimeOfDay; + /** Retention policy of automated backups. */ + backupRetainPeriodDays?: number; /** Access policy for external services. */ access?: Access; /** @@ -316,6 +324,8 @@ export interface Access { webSql: boolean; /** Allows access for DataTransfer. */ dataTransfer: boolean; + /** Allow access for YandexQuery. */ + yandexQuery: boolean; } export interface GreenplumRestoreConfig { @@ -381,6 +391,8 @@ const baseCluster: object = { userName: "", deletionProtection: false, hostGroupIds: "", + masterHostGroupIds: "", + segmentHostGroupIds: "", }; export const Cluster = { @@ -493,6 +505,12 @@ export const Cluster = { writer.uint32(210).fork() ).ldelim(); } + for (const v of message.masterHostGroupIds) { + writer.uint32(218).string(v!); + } + for (const v of message.segmentHostGroupIds) { + writer.uint32(226).string(v!); + } return writer; }, @@ -504,6 +522,8 @@ export const Cluster = { message.monitoring = []; message.securityGroupIds = []; message.hostGroupIds = []; + message.masterHostGroupIds = []; + message.segmentHostGroupIds = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -602,6 +622,12 @@ export const Cluster = { case 26: message.cloudStorage = CloudStorage.decode(reader, reader.uint32()); break; + case 27: + message.masterHostGroupIds.push(reader.string()); + break; + case 28: + message.segmentHostGroupIds.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -711,6 +737,12 @@ export const Cluster = { object.cloudStorage !== undefined && object.cloudStorage !== null ? CloudStorage.fromJSON(object.cloudStorage) : undefined; + message.masterHostGroupIds = (object.masterHostGroupIds ?? []).map( + (e: any) => String(e) + ); + message.segmentHostGroupIds = (object.segmentHostGroupIds ?? []).map( + (e: any) => String(e) + ); return message; }, @@ -790,6 +822,16 @@ export const Cluster = { (obj.cloudStorage = message.cloudStorage ? CloudStorage.toJSON(message.cloudStorage) : undefined); + if (message.masterHostGroupIds) { + obj.masterHostGroupIds = message.masterHostGroupIds.map((e) => e); + } else { + obj.masterHostGroupIds = []; + } + if (message.segmentHostGroupIds) { + obj.segmentHostGroupIds = message.segmentHostGroupIds.map((e) => e); + } else { + obj.segmentHostGroupIds = []; + } return obj; }, @@ -850,6 +892,9 @@ export const Cluster = { object.cloudStorage !== undefined && object.cloudStorage !== null ? CloudStorage.fromPartial(object.cloudStorage) : undefined; + message.masterHostGroupIds = object.masterHostGroupIds?.map((e) => e) || []; + message.segmentHostGroupIds = + object.segmentHostGroupIds?.map((e) => e) || []; return message; }, }; @@ -1289,6 +1334,15 @@ export const GreenplumConfig = { writer.uint32(18).fork() ).ldelim(); } + if (message.backupRetainPeriodDays !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.backupRetainPeriodDays!, + }, + writer.uint32(74).fork() + ).ldelim(); + } if (message.access !== undefined) { Access.encode(message.access, writer.uint32(26).fork()).ldelim(); } @@ -1317,6 +1371,12 @@ export const GreenplumConfig = { case 2: message.backupWindowStart = TimeOfDay.decode(reader, reader.uint32()); break; + case 9: + message.backupRetainPeriodDays = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; case 3: message.access = Access.decode(reader, reader.uint32()); break; @@ -1348,6 +1408,11 @@ export const GreenplumConfig = { object.backupWindowStart !== null ? TimeOfDay.fromJSON(object.backupWindowStart) : undefined; + message.backupRetainPeriodDays = + object.backupRetainPeriodDays !== undefined && + object.backupRetainPeriodDays !== null + ? Number(object.backupRetainPeriodDays) + : undefined; message.access = object.access !== undefined && object.access !== null ? Access.fromJSON(object.access) @@ -1374,6 +1439,8 @@ export const GreenplumConfig = { (obj.backupWindowStart = message.backupWindowStart ? TimeOfDay.toJSON(message.backupWindowStart) : undefined); + message.backupRetainPeriodDays !== undefined && + (obj.backupRetainPeriodDays = message.backupRetainPeriodDays); message.access !== undefined && (obj.access = message.access ? Access.toJSON(message.access) : undefined); message.zoneId !== undefined && (obj.zoneId = message.zoneId); @@ -1393,6 +1460,7 @@ export const GreenplumConfig = { object.backupWindowStart !== null ? TimeOfDay.fromPartial(object.backupWindowStart) : undefined; + message.backupRetainPeriodDays = object.backupRetainPeriodDays ?? undefined; message.access = object.access !== undefined && object.access !== null ? Access.fromPartial(object.access) @@ -1411,6 +1479,7 @@ const baseAccess: object = { dataLens: false, webSql: false, dataTransfer: false, + yandexQuery: false, }; export const Access = { @@ -1429,6 +1498,9 @@ export const Access = { if (message.dataTransfer === true) { writer.uint32(24).bool(message.dataTransfer); } + if (message.yandexQuery === true) { + writer.uint32(40).bool(message.yandexQuery); + } return writer; }, @@ -1448,6 +1520,9 @@ export const Access = { case 3: message.dataTransfer = reader.bool(); break; + case 5: + message.yandexQuery = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -1470,6 +1545,10 @@ export const Access = { object.dataTransfer !== undefined && object.dataTransfer !== null ? Boolean(object.dataTransfer) : false; + message.yandexQuery = + object.yandexQuery !== undefined && object.yandexQuery !== null + ? Boolean(object.yandexQuery) + : false; return message; }, @@ -1479,6 +1558,8 @@ export const Access = { message.webSql !== undefined && (obj.webSql = message.webSql); message.dataTransfer !== undefined && (obj.dataTransfer = message.dataTransfer); + message.yandexQuery !== undefined && + (obj.yandexQuery = message.yandexQuery); return obj; }, @@ -1487,6 +1568,7 @@ export const Access = { message.dataLens = object.dataLens ?? false; message.webSql = object.webSql ?? false; message.dataTransfer = object.dataTransfer ?? false; + message.yandexQuery = object.yandexQuery ?? false; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/greenplum/v1/cluster_service.ts b/src/generated/yandex/cloud/mdb/greenplum/v1/cluster_service.ts index 9ad77b14..4631efca 100644 --- a/src/generated/yandex/cloud/mdb/greenplum/v1/cluster_service.ts +++ b/src/generated/yandex/cloud/mdb/greenplum/v1/cluster_service.ts @@ -144,6 +144,10 @@ export interface CreateClusterRequest { configSpec?: ConfigSpec; /** Cloud storage settings */ cloudStorage?: CloudStorage; + /** Host groups hosting VMs of the master subcluster. */ + masterHostGroupIds: string[]; + /** Host groups hosting VMs of the segment subcluster. */ + segmentHostGroupIds: string[]; } export interface CreateClusterRequest_LabelsEntry { @@ -161,6 +165,7 @@ export interface ConfigSpec { greenplumConfig6?: GreenplumConfig6 | undefined; /** Odyssey® pool settings. */ pool?: ConnectionPoolerConfig; + /** Managed Greenplum® background tasks configuration. */ backgroundActivities?: BackgroundActivitiesConfig; pxfConfig?: PXFConfig; } @@ -200,6 +205,8 @@ export interface UpdateClusterRequest { segmentConfig?: SegmentSubclusterConfigSpec; /** Owner user password. */ userPassword: string; + /** ID of the network to move the cluster to. */ + networkId: string; /** The Greenplum® cluster maintenance window. Should be defined by either one of the two options. */ maintenanceWindow?: MaintenanceWindow; /** User security groups. */ @@ -243,6 +250,12 @@ export interface ExpandRequest { addSegmentsPerHostCount: number; /** Redistribute duration, in seconds */ duration: number; + /** Redistribute process parallelism, 0 - for automatic detection */ + parallel: number; + /** Deny all client connections during the expand operation */ + closeCluster: boolean; + /** Perform redistribution process by small chunks as background activity */ + delayRedistribution: boolean; } export interface DeleteClusterRequest { @@ -290,6 +303,24 @@ export interface StopClusterMetadata { clusterId: string; } +export interface MoveClusterRequest { + $type: "yandex.cloud.mdb.greenplum.v1.MoveClusterRequest"; + /** ID of the Greenplum® cluster to move. */ + clusterId: string; + /** ID of the destination folder. */ + destinationFolderId: string; +} + +export interface MoveClusterMetadata { + $type: "yandex.cloud.mdb.greenplum.v1.MoveClusterMetadata"; + /** ID of the Greenplum® cluster being moved. */ + clusterId: string; + /** ID of the source folder. */ + sourceFolderId: string; + /** ID of the destination folder. */ + destinationFolderId: string; +} + export interface ListClusterOperationsRequest { $type: "yandex.cloud.mdb.greenplum.v1.ListClusterOperationsRequest"; /** ID of the Greenplum® cluster resource to list operations for. */ @@ -631,6 +662,22 @@ export interface ListClusterBackupsResponse { nextPageToken: string; } +export interface BackupClusterRequest { + $type: "yandex.cloud.mdb.greenplum.v1.BackupClusterRequest"; + /** + * ID of the Greenplum cluster to back up. + * To get the Greenplum cluster ID, use a [ClusterService.List] request. + */ + clusterId: string; +} + +export interface BackupClusterMetadata { + $type: "yandex.cloud.mdb.greenplum.v1.BackupClusterMetadata"; + /** ID of the Greenplum cluster to back up. */ + clusterId: string; + backupId: string; +} + export interface RestoreClusterRequest { $type: "yandex.cloud.mdb.greenplum.v1.RestoreClusterRequest"; /** @@ -676,6 +723,12 @@ export interface RestoreClusterRequest { segmentHostCount: number; /** Number of segments on each host */ segmentInHost: number; + /** List of databases and tables to restore */ + restoreOnly: string[]; + /** Host groups hosting VMs of the master subcluster. */ + masterHostGroupIds: string[]; + /** Host groups hosting VMs of the segment subcluster. */ + segmentHostGroupIds: string[]; } export interface RestoreClusterRequest_LabelsEntry { @@ -956,6 +1009,8 @@ const baseCreateClusterRequest: object = { securityGroupIds: "", deletionProtection: false, hostGroupIds: "", + masterHostGroupIds: "", + segmentHostGroupIds: "", }; export const CreateClusterRequest = { @@ -1045,6 +1100,12 @@ export const CreateClusterRequest = { writer.uint32(170).fork() ).ldelim(); } + for (const v of message.masterHostGroupIds) { + writer.uint32(178).string(v!); + } + for (const v of message.segmentHostGroupIds) { + writer.uint32(186).string(v!); + } return writer; }, @@ -1058,6 +1119,8 @@ export const CreateClusterRequest = { message.labels = {}; message.securityGroupIds = []; message.hostGroupIds = []; + message.masterHostGroupIds = []; + message.segmentHostGroupIds = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1136,6 +1199,12 @@ export const CreateClusterRequest = { case 21: message.cloudStorage = CloudStorage.decode(reader, reader.uint32()); break; + case 22: + message.masterHostGroupIds.push(reader.string()); + break; + case 23: + message.segmentHostGroupIds.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -1228,6 +1297,12 @@ export const CreateClusterRequest = { object.cloudStorage !== undefined && object.cloudStorage !== null ? CloudStorage.fromJSON(object.cloudStorage) : undefined; + message.masterHostGroupIds = (object.masterHostGroupIds ?? []).map( + (e: any) => String(e) + ); + message.segmentHostGroupIds = (object.segmentHostGroupIds ?? []).map( + (e: any) => String(e) + ); return message; }, @@ -1291,6 +1366,16 @@ export const CreateClusterRequest = { (obj.cloudStorage = message.cloudStorage ? CloudStorage.toJSON(message.cloudStorage) : undefined); + if (message.masterHostGroupIds) { + obj.masterHostGroupIds = message.masterHostGroupIds.map((e) => e); + } else { + obj.masterHostGroupIds = []; + } + if (message.segmentHostGroupIds) { + obj.segmentHostGroupIds = message.segmentHostGroupIds.map((e) => e); + } else { + obj.segmentHostGroupIds = []; + } return obj; }, @@ -1344,6 +1429,9 @@ export const CreateClusterRequest = { object.cloudStorage !== undefined && object.cloudStorage !== null ? CloudStorage.fromPartial(object.cloudStorage) : undefined; + message.masterHostGroupIds = object.masterHostGroupIds?.map((e) => e) || []; + message.segmentHostGroupIds = + object.segmentHostGroupIds?.map((e) => e) || []; return message; }, }; @@ -1750,6 +1838,7 @@ const baseUpdateClusterRequest: object = { description: "", name: "", userPassword: "", + networkId: "", securityGroupIds: "", deletionProtection: false, }; @@ -1802,6 +1891,9 @@ export const UpdateClusterRequest = { if (message.userPassword !== "") { writer.uint32(106).string(message.userPassword); } + if (message.networkId !== "") { + writer.uint32(114).string(message.networkId); + } if (message.maintenanceWindow !== undefined) { MaintenanceWindow.encode( message.maintenanceWindow, @@ -1877,6 +1969,9 @@ export const UpdateClusterRequest = { case 13: message.userPassword = reader.string(); break; + case 14: + message.networkId = reader.string(); + break; case 15: message.maintenanceWindow = MaintenanceWindow.decode( reader, @@ -1943,6 +2038,10 @@ export const UpdateClusterRequest = { object.userPassword !== undefined && object.userPassword !== null ? String(object.userPassword) : ""; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; message.maintenanceWindow = object.maintenanceWindow !== undefined && object.maintenanceWindow !== null @@ -1997,6 +2096,7 @@ export const UpdateClusterRequest = { : undefined); message.userPassword !== undefined && (obj.userPassword = message.userPassword); + message.networkId !== undefined && (obj.networkId = message.networkId); message.maintenanceWindow !== undefined && (obj.maintenanceWindow = message.maintenanceWindow ? MaintenanceWindow.toJSON(message.maintenanceWindow) @@ -2051,6 +2151,7 @@ export const UpdateClusterRequest = { ? SegmentSubclusterConfigSpec.fromPartial(object.segmentConfig) : undefined; message.userPassword = object.userPassword ?? ""; + message.networkId = object.networkId ?? ""; message.maintenanceWindow = object.maintenanceWindow !== undefined && object.maintenanceWindow !== null @@ -2300,6 +2401,9 @@ const baseExpandRequest: object = { segmentHostCount: 0, addSegmentsPerHostCount: 0, duration: 0, + parallel: 0, + closeCluster: false, + delayRedistribution: false, }; export const ExpandRequest = { @@ -2321,6 +2425,15 @@ export const ExpandRequest = { if (message.duration !== 0) { writer.uint32(32).int64(message.duration); } + if (message.parallel !== 0) { + writer.uint32(40).int64(message.parallel); + } + if (message.closeCluster === true) { + writer.uint32(48).bool(message.closeCluster); + } + if (message.delayRedistribution === true) { + writer.uint32(56).bool(message.delayRedistribution); + } return writer; }, @@ -2345,6 +2458,15 @@ export const ExpandRequest = { case 4: message.duration = longToNumber(reader.int64() as Long); break; + case 5: + message.parallel = longToNumber(reader.int64() as Long); + break; + case 6: + message.closeCluster = reader.bool(); + break; + case 7: + message.delayRedistribution = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -2372,6 +2494,19 @@ export const ExpandRequest = { object.duration !== undefined && object.duration !== null ? Number(object.duration) : 0; + message.parallel = + object.parallel !== undefined && object.parallel !== null + ? Number(object.parallel) + : 0; + message.closeCluster = + object.closeCluster !== undefined && object.closeCluster !== null + ? Boolean(object.closeCluster) + : false; + message.delayRedistribution = + object.delayRedistribution !== undefined && + object.delayRedistribution !== null + ? Boolean(object.delayRedistribution) + : false; return message; }, @@ -2386,6 +2521,12 @@ export const ExpandRequest = { )); message.duration !== undefined && (obj.duration = Math.round(message.duration)); + message.parallel !== undefined && + (obj.parallel = Math.round(message.parallel)); + message.closeCluster !== undefined && + (obj.closeCluster = message.closeCluster); + message.delayRedistribution !== undefined && + (obj.delayRedistribution = message.delayRedistribution); return obj; }, @@ -2397,6 +2538,9 @@ export const ExpandRequest = { message.segmentHostCount = object.segmentHostCount ?? 0; message.addSegmentsPerHostCount = object.addSegmentsPerHostCount ?? 0; message.duration = object.duration ?? 0; + message.parallel = object.parallel ?? 0; + message.closeCluster = object.closeCluster ?? false; + message.delayRedistribution = object.delayRedistribution ?? false; return message; }, }; @@ -2784,6 +2928,174 @@ export const StopClusterMetadata = { messageTypeRegistry.set(StopClusterMetadata.$type, StopClusterMetadata); +const baseMoveClusterRequest: object = { + $type: "yandex.cloud.mdb.greenplum.v1.MoveClusterRequest", + clusterId: "", + destinationFolderId: "", +}; + +export const MoveClusterRequest = { + $type: "yandex.cloud.mdb.greenplum.v1.MoveClusterRequest" as const, + + encode( + message: MoveClusterRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.destinationFolderId !== "") { + writer.uint32(18).string(message.destinationFolderId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MoveClusterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMoveClusterRequest } as MoveClusterRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.destinationFolderId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MoveClusterRequest { + const message = { ...baseMoveClusterRequest } as MoveClusterRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.destinationFolderId = + object.destinationFolderId !== undefined && + object.destinationFolderId !== null + ? String(object.destinationFolderId) + : ""; + return message; + }, + + toJSON(message: MoveClusterRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.destinationFolderId !== undefined && + (obj.destinationFolderId = message.destinationFolderId); + return obj; + }, + + fromPartial, I>>( + object: I + ): MoveClusterRequest { + const message = { ...baseMoveClusterRequest } as MoveClusterRequest; + message.clusterId = object.clusterId ?? ""; + message.destinationFolderId = object.destinationFolderId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(MoveClusterRequest.$type, MoveClusterRequest); + +const baseMoveClusterMetadata: object = { + $type: "yandex.cloud.mdb.greenplum.v1.MoveClusterMetadata", + clusterId: "", + sourceFolderId: "", + destinationFolderId: "", +}; + +export const MoveClusterMetadata = { + $type: "yandex.cloud.mdb.greenplum.v1.MoveClusterMetadata" as const, + + encode( + message: MoveClusterMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.sourceFolderId !== "") { + writer.uint32(18).string(message.sourceFolderId); + } + if (message.destinationFolderId !== "") { + writer.uint32(26).string(message.destinationFolderId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MoveClusterMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMoveClusterMetadata } as MoveClusterMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.sourceFolderId = reader.string(); + break; + case 3: + message.destinationFolderId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MoveClusterMetadata { + const message = { ...baseMoveClusterMetadata } as MoveClusterMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.sourceFolderId = + object.sourceFolderId !== undefined && object.sourceFolderId !== null + ? String(object.sourceFolderId) + : ""; + message.destinationFolderId = + object.destinationFolderId !== undefined && + object.destinationFolderId !== null + ? String(object.destinationFolderId) + : ""; + return message; + }, + + toJSON(message: MoveClusterMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.sourceFolderId !== undefined && + (obj.sourceFolderId = message.sourceFolderId); + message.destinationFolderId !== undefined && + (obj.destinationFolderId = message.destinationFolderId); + return obj; + }, + + fromPartial, I>>( + object: I + ): MoveClusterMetadata { + const message = { ...baseMoveClusterMetadata } as MoveClusterMetadata; + message.clusterId = object.clusterId ?? ""; + message.sourceFolderId = object.sourceFolderId ?? ""; + message.destinationFolderId = object.destinationFolderId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(MoveClusterMetadata.$type, MoveClusterMetadata); + const baseListClusterOperationsRequest: object = { $type: "yandex.cloud.mdb.greenplum.v1.ListClusterOperationsRequest", clusterId: "", @@ -4222,6 +4534,149 @@ messageTypeRegistry.set( ListClusterBackupsResponse ); +const baseBackupClusterRequest: object = { + $type: "yandex.cloud.mdb.greenplum.v1.BackupClusterRequest", + clusterId: "", +}; + +export const BackupClusterRequest = { + $type: "yandex.cloud.mdb.greenplum.v1.BackupClusterRequest" as const, + + encode( + message: BackupClusterRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): BackupClusterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBackupClusterRequest } as BackupClusterRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BackupClusterRequest { + const message = { ...baseBackupClusterRequest } as BackupClusterRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: BackupClusterRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): BackupClusterRequest { + const message = { ...baseBackupClusterRequest } as BackupClusterRequest; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(BackupClusterRequest.$type, BackupClusterRequest); + +const baseBackupClusterMetadata: object = { + $type: "yandex.cloud.mdb.greenplum.v1.BackupClusterMetadata", + clusterId: "", + backupId: "", +}; + +export const BackupClusterMetadata = { + $type: "yandex.cloud.mdb.greenplum.v1.BackupClusterMetadata" as const, + + encode( + message: BackupClusterMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.backupId !== "") { + writer.uint32(18).string(message.backupId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): BackupClusterMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBackupClusterMetadata } as BackupClusterMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.backupId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BackupClusterMetadata { + const message = { ...baseBackupClusterMetadata } as BackupClusterMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.backupId = + object.backupId !== undefined && object.backupId !== null + ? String(object.backupId) + : ""; + return message; + }, + + toJSON(message: BackupClusterMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.backupId !== undefined && (obj.backupId = message.backupId); + return obj; + }, + + fromPartial, I>>( + object: I + ): BackupClusterMetadata { + const message = { ...baseBackupClusterMetadata } as BackupClusterMetadata; + message.clusterId = object.clusterId ?? ""; + message.backupId = object.backupId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(BackupClusterMetadata.$type, BackupClusterMetadata); + const baseRestoreClusterRequest: object = { $type: "yandex.cloud.mdb.greenplum.v1.RestoreClusterRequest", backupId: "", @@ -4236,6 +4691,9 @@ const baseRestoreClusterRequest: object = { placementGroupId: "", segmentHostCount: 0, segmentInHost: 0, + restoreOnly: "", + masterHostGroupIds: "", + segmentHostGroupIds: "", }; export const RestoreClusterRequest = { @@ -4322,6 +4780,15 @@ export const RestoreClusterRequest = { if (message.segmentInHost !== 0) { writer.uint32(144).int64(message.segmentInHost); } + for (const v of message.restoreOnly) { + writer.uint32(154).string(v!); + } + for (const v of message.masterHostGroupIds) { + writer.uint32(162).string(v!); + } + for (const v of message.segmentHostGroupIds) { + writer.uint32(170).string(v!); + } return writer; }, @@ -4335,6 +4802,9 @@ export const RestoreClusterRequest = { message.labels = {}; message.securityGroupIds = []; message.hostGroupIds = []; + message.restoreOnly = []; + message.masterHostGroupIds = []; + message.segmentHostGroupIds = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4406,6 +4876,15 @@ export const RestoreClusterRequest = { case 18: message.segmentInHost = longToNumber(reader.int64() as Long); break; + case 19: + message.restoreOnly.push(reader.string()); + break; + case 20: + message.masterHostGroupIds.push(reader.string()); + break; + case 21: + message.segmentHostGroupIds.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -4490,6 +4969,13 @@ export const RestoreClusterRequest = { object.segmentInHost !== undefined && object.segmentInHost !== null ? Number(object.segmentInHost) : 0; + message.restoreOnly = (object.restoreOnly ?? []).map((e: any) => String(e)); + message.masterHostGroupIds = (object.masterHostGroupIds ?? []).map( + (e: any) => String(e) + ); + message.segmentHostGroupIds = (object.segmentHostGroupIds ?? []).map( + (e: any) => String(e) + ); return message; }, @@ -4544,6 +5030,21 @@ export const RestoreClusterRequest = { (obj.segmentHostCount = Math.round(message.segmentHostCount)); message.segmentInHost !== undefined && (obj.segmentInHost = Math.round(message.segmentInHost)); + if (message.restoreOnly) { + obj.restoreOnly = message.restoreOnly.map((e) => e); + } else { + obj.restoreOnly = []; + } + if (message.masterHostGroupIds) { + obj.masterHostGroupIds = message.masterHostGroupIds.map((e) => e); + } else { + obj.masterHostGroupIds = []; + } + if (message.segmentHostGroupIds) { + obj.segmentHostGroupIds = message.segmentHostGroupIds.map((e) => e); + } else { + obj.segmentHostGroupIds = []; + } return obj; }, @@ -4589,6 +5090,10 @@ export const RestoreClusterRequest = { : undefined; message.segmentHostCount = object.segmentHostCount ?? 0; message.segmentInHost = object.segmentInHost ?? 0; + message.restoreOnly = object.restoreOnly?.map((e) => e) || []; + message.masterHostGroupIds = object.masterHostGroupIds?.map((e) => e) || []; + message.segmentHostGroupIds = + object.segmentHostGroupIds?.map((e) => e) || []; return message; }, }; @@ -4861,6 +5366,18 @@ export const ClusterServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Moves the specified Greenplum® cluster to the specified folder. */ + move: { + path: "/yandex.cloud.mdb.greenplum.v1.ClusterService/Move", + requestStream: false, + responseStream: false, + requestSerialize: (value: MoveClusterRequest) => + Buffer.from(MoveClusterRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => MoveClusterRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, /** Retrieves the list of Operation resources for the specified cluster. */ listOperations: { path: "/yandex.cloud.mdb.greenplum.v1.ClusterService/ListOperations", @@ -4943,6 +5460,18 @@ export const ClusterServiceService = { responseDeserialize: (value: Buffer) => ListClusterBackupsResponse.decode(value), }, + /** Creates a backup for the specified Greenplum cluster. */ + backup: { + path: "/yandex.cloud.mdb.greenplum.v1.ClusterService/Backup", + requestStream: false, + responseStream: false, + requestSerialize: (value: BackupClusterRequest) => + Buffer.from(BackupClusterRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => BackupClusterRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, /** Creates a new Greenplum® cluster using the specified backup. */ restore: { path: "/yandex.cloud.mdb.greenplum.v1.ClusterService/Restore", @@ -4978,6 +5507,8 @@ export interface ClusterServiceServer extends UntypedServiceImplementation { start: handleUnaryCall; /** Stops the specified Greenplum® cluster. */ stop: handleUnaryCall; + /** Moves the specified Greenplum® cluster to the specified folder. */ + move: handleUnaryCall; /** Retrieves the list of Operation resources for the specified cluster. */ listOperations: handleUnaryCall< ListClusterOperationsRequest, @@ -5005,6 +5536,8 @@ export interface ClusterServiceServer extends UntypedServiceImplementation { ListClusterBackupsRequest, ListClusterBackupsResponse >; + /** Creates a backup for the specified Greenplum cluster. */ + backup: handleUnaryCall; /** Creates a new Greenplum® cluster using the specified backup. */ restore: handleUnaryCall; } @@ -5151,6 +5684,22 @@ export interface ClusterServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Moves the specified Greenplum® cluster to the specified folder. */ + move( + request: MoveClusterRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + move( + request: MoveClusterRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + move( + request: MoveClusterRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; /** Retrieves the list of Operation resources for the specified cluster. */ listOperations( request: ListClusterOperationsRequest, @@ -5286,6 +5835,22 @@ export interface ClusterServiceClient extends Client { response: ListClusterBackupsResponse ) => void ): ClientUnaryCall; + /** Creates a backup for the specified Greenplum cluster. */ + backup( + request: BackupClusterRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + backup( + request: BackupClusterRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + backup( + request: BackupClusterRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; /** Creates a new Greenplum® cluster using the specified backup. */ restore( request: RestoreClusterRequest, diff --git a/src/generated/yandex/cloud/mdb/greenplum/v1/config.ts b/src/generated/yandex/cloud/mdb/greenplum/v1/config.ts index a00b6e81..7b878363 100644 --- a/src/generated/yandex/cloud/mdb/greenplum/v1/config.ts +++ b/src/generated/yandex/cloud/mdb/greenplum/v1/config.ts @@ -152,16 +152,39 @@ export interface TableSizes { export interface AnalyzeAndVacuum { $type: "yandex.cloud.mdb.greenplum.v1.AnalyzeAndVacuum"; start?: BackgroundActivityStartAt; - /** in seconds 24*60*60-1 = 86399 */ + /** Maximum duration of the `ANALYZE` operation, in seconds. The default value is `36000`. As soon as this period expires, the `ANALYZE` operation will be forced to terminate. */ analyzeTimeout?: number; - /** in seconds 24*60*60-1 = 86399 */ + /** Maximum duration of the `VACUUM` operation, in seconds. The default value is `36000`. As soon as this period expires, the `VACUUM` operation will be forced to terminate. */ vacuumTimeout?: number; } export interface BackgroundActivitiesConfig { $type: "yandex.cloud.mdb.greenplum.v1.BackgroundActivitiesConfig"; + /** Enables scripts that collects tables sizes to `*_sizes` tables in `mdb_toolkit` schema. */ tableSizes?: TableSizes; + /** Configuration for `ANALYZE` and `VACUUM` operations. */ analyzeAndVacuum?: AnalyzeAndVacuum; + /** Configuration for long running queries killer. */ + queryKillerScripts?: QueryKillerScripts; +} + +export interface QueryKiller { + $type: "yandex.cloud.mdb.greenplum.v1.QueryKiller"; + enable?: boolean; + /** Maximum duration for this type of queries (in seconds). */ + maxAge?: number; + /** Ignore these users when considering queries to terminate */ + ignoreUsers: string[]; +} + +export interface QueryKillerScripts { + $type: "yandex.cloud.mdb.greenplum.v1.QueryKillerScripts"; + /** Configuration of script that kills long running queries that are in `idle` state. */ + idle?: QueryKiller; + /** Configuration of script that kills long running queries that are in `idle in transaction` state. */ + idleInTransaction?: QueryKiller; + /** Configuration of script that kills long running queries (in any state). */ + longRunning?: QueryKiller; } export interface MasterSubclusterConfig { @@ -1041,6 +1064,12 @@ export const BackgroundActivitiesConfig = { writer.uint32(18).fork() ).ldelim(); } + if (message.queryKillerScripts !== undefined) { + QueryKillerScripts.encode( + message.queryKillerScripts, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -1065,6 +1094,12 @@ export const BackgroundActivitiesConfig = { reader.uint32() ); break; + case 3: + message.queryKillerScripts = QueryKillerScripts.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1085,6 +1120,11 @@ export const BackgroundActivitiesConfig = { object.analyzeAndVacuum !== undefined && object.analyzeAndVacuum !== null ? AnalyzeAndVacuum.fromJSON(object.analyzeAndVacuum) : undefined; + message.queryKillerScripts = + object.queryKillerScripts !== undefined && + object.queryKillerScripts !== null + ? QueryKillerScripts.fromJSON(object.queryKillerScripts) + : undefined; return message; }, @@ -1098,6 +1138,10 @@ export const BackgroundActivitiesConfig = { (obj.analyzeAndVacuum = message.analyzeAndVacuum ? AnalyzeAndVacuum.toJSON(message.analyzeAndVacuum) : undefined); + message.queryKillerScripts !== undefined && + (obj.queryKillerScripts = message.queryKillerScripts + ? QueryKillerScripts.toJSON(message.queryKillerScripts) + : undefined); return obj; }, @@ -1115,6 +1159,11 @@ export const BackgroundActivitiesConfig = { object.analyzeAndVacuum !== undefined && object.analyzeAndVacuum !== null ? AnalyzeAndVacuum.fromPartial(object.analyzeAndVacuum) : undefined; + message.queryKillerScripts = + object.queryKillerScripts !== undefined && + object.queryKillerScripts !== null + ? QueryKillerScripts.fromPartial(object.queryKillerScripts) + : undefined; return message; }, }; @@ -1124,6 +1173,212 @@ messageTypeRegistry.set( BackgroundActivitiesConfig ); +const baseQueryKiller: object = { + $type: "yandex.cloud.mdb.greenplum.v1.QueryKiller", + ignoreUsers: "", +}; + +export const QueryKiller = { + $type: "yandex.cloud.mdb.greenplum.v1.QueryKiller" as const, + + encode( + message: QueryKiller, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enable !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.enable! }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.maxAge !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.maxAge! }, + writer.uint32(18).fork() + ).ldelim(); + } + for (const v of message.ignoreUsers) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryKiller { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryKiller } as QueryKiller; + message.ignoreUsers = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enable = BoolValue.decode(reader, reader.uint32()).value; + break; + case 2: + message.maxAge = Int64Value.decode(reader, reader.uint32()).value; + break; + case 3: + message.ignoreUsers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryKiller { + const message = { ...baseQueryKiller } as QueryKiller; + message.enable = + object.enable !== undefined && object.enable !== null + ? Boolean(object.enable) + : undefined; + message.maxAge = + object.maxAge !== undefined && object.maxAge !== null + ? Number(object.maxAge) + : undefined; + message.ignoreUsers = (object.ignoreUsers ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: QueryKiller): unknown { + const obj: any = {}; + message.enable !== undefined && (obj.enable = message.enable); + message.maxAge !== undefined && (obj.maxAge = message.maxAge); + if (message.ignoreUsers) { + obj.ignoreUsers = message.ignoreUsers.map((e) => e); + } else { + obj.ignoreUsers = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): QueryKiller { + const message = { ...baseQueryKiller } as QueryKiller; + message.enable = object.enable ?? undefined; + message.maxAge = object.maxAge ?? undefined; + message.ignoreUsers = object.ignoreUsers?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(QueryKiller.$type, QueryKiller); + +const baseQueryKillerScripts: object = { + $type: "yandex.cloud.mdb.greenplum.v1.QueryKillerScripts", +}; + +export const QueryKillerScripts = { + $type: "yandex.cloud.mdb.greenplum.v1.QueryKillerScripts" as const, + + encode( + message: QueryKillerScripts, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.idle !== undefined) { + QueryKiller.encode(message.idle, writer.uint32(10).fork()).ldelim(); + } + if (message.idleInTransaction !== undefined) { + QueryKiller.encode( + message.idleInTransaction, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.longRunning !== undefined) { + QueryKiller.encode( + message.longRunning, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryKillerScripts { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryKillerScripts } as QueryKillerScripts; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.idle = QueryKiller.decode(reader, reader.uint32()); + break; + case 2: + message.idleInTransaction = QueryKiller.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.longRunning = QueryKiller.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryKillerScripts { + const message = { ...baseQueryKillerScripts } as QueryKillerScripts; + message.idle = + object.idle !== undefined && object.idle !== null + ? QueryKiller.fromJSON(object.idle) + : undefined; + message.idleInTransaction = + object.idleInTransaction !== undefined && + object.idleInTransaction !== null + ? QueryKiller.fromJSON(object.idleInTransaction) + : undefined; + message.longRunning = + object.longRunning !== undefined && object.longRunning !== null + ? QueryKiller.fromJSON(object.longRunning) + : undefined; + return message; + }, + + toJSON(message: QueryKillerScripts): unknown { + const obj: any = {}; + message.idle !== undefined && + (obj.idle = message.idle ? QueryKiller.toJSON(message.idle) : undefined); + message.idleInTransaction !== undefined && + (obj.idleInTransaction = message.idleInTransaction + ? QueryKiller.toJSON(message.idleInTransaction) + : undefined); + message.longRunning !== undefined && + (obj.longRunning = message.longRunning + ? QueryKiller.toJSON(message.longRunning) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): QueryKillerScripts { + const message = { ...baseQueryKillerScripts } as QueryKillerScripts; + message.idle = + object.idle !== undefined && object.idle !== null + ? QueryKiller.fromPartial(object.idle) + : undefined; + message.idleInTransaction = + object.idleInTransaction !== undefined && + object.idleInTransaction !== null + ? QueryKiller.fromPartial(object.idleInTransaction) + : undefined; + message.longRunning = + object.longRunning !== undefined && object.longRunning !== null + ? QueryKiller.fromPartial(object.longRunning) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(QueryKillerScripts.$type, QueryKillerScripts); + const baseMasterSubclusterConfig: object = { $type: "yandex.cloud.mdb.greenplum.v1.MasterSubclusterConfig", }; diff --git a/src/generated/yandex/cloud/mdb/greenplum/v1/hba_rule.ts b/src/generated/yandex/cloud/mdb/greenplum/v1/hba_rule.ts new file mode 100644 index 00000000..f66cad47 --- /dev/null +++ b/src/generated/yandex/cloud/mdb/greenplum/v1/hba_rule.ts @@ -0,0 +1,302 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.mdb.greenplum.v1"; + +export interface HBARule { + $type: "yandex.cloud.mdb.greenplum.v1.HBARule"; + /** Priority of the Greenplum cluster rule. */ + priority: number; + connectionType: HBARule_ConnectionType; + /** Specifies which database names this record matches. */ + database: string; + /** Specifies which database role names this user matches. */ + user: string; + /** Specifies the client machine addresses that this record matches. */ + address: string; + /** + * Specifies the authentication method to use when a connection matches this record. + * https://gpdb.docs.pivotal.io/6-6/security-guide/topics/Authenticate.html + */ + authMethod: HBARule_AuthMethod; +} + +export enum HBARule_ConnectionType { + CONNECTION_TYPE_UNSPECIFIED = 0, + /** HOST - Matches connection attempts made using TCP/IP. */ + HOST = 1, + /** HOSTSSL - Matches connection attempts made using TCP/IP, but only when the connection is made with SSL encryption. */ + HOSTSSL = 2, + /** HOSTNOSSL - Matches connection attempts made over TCP/IP that do not use SSL. */ + HOSTNOSSL = 3, + UNRECOGNIZED = -1, +} + +export function hBARule_ConnectionTypeFromJSON( + object: any +): HBARule_ConnectionType { + switch (object) { + case 0: + case "CONNECTION_TYPE_UNSPECIFIED": + return HBARule_ConnectionType.CONNECTION_TYPE_UNSPECIFIED; + case 1: + case "HOST": + return HBARule_ConnectionType.HOST; + case 2: + case "HOSTSSL": + return HBARule_ConnectionType.HOSTSSL; + case 3: + case "HOSTNOSSL": + return HBARule_ConnectionType.HOSTNOSSL; + case -1: + case "UNRECOGNIZED": + default: + return HBARule_ConnectionType.UNRECOGNIZED; + } +} + +export function hBARule_ConnectionTypeToJSON( + object: HBARule_ConnectionType +): string { + switch (object) { + case HBARule_ConnectionType.CONNECTION_TYPE_UNSPECIFIED: + return "CONNECTION_TYPE_UNSPECIFIED"; + case HBARule_ConnectionType.HOST: + return "HOST"; + case HBARule_ConnectionType.HOSTSSL: + return "HOSTSSL"; + case HBARule_ConnectionType.HOSTNOSSL: + return "HOSTNOSSL"; + default: + return "UNKNOWN"; + } +} + +export enum HBARule_AuthMethod { + AUTH_METHOD_UNSPECIFIED = 0, + /** MD5 - Perform SCRAM-SHA-256 or MD5 authentication to verify the user's password. */ + MD5 = 1, + /** LDAP - Perform LDAP authentication, if MDB_GREENPLUM_LDAP flag is set */ + LDAP = 2, + /** REJECT - Disable authentication */ + REJECT = 3, + UNRECOGNIZED = -1, +} + +export function hBARule_AuthMethodFromJSON(object: any): HBARule_AuthMethod { + switch (object) { + case 0: + case "AUTH_METHOD_UNSPECIFIED": + return HBARule_AuthMethod.AUTH_METHOD_UNSPECIFIED; + case 1: + case "MD5": + return HBARule_AuthMethod.MD5; + case 2: + case "LDAP": + return HBARule_AuthMethod.LDAP; + case 3: + case "REJECT": + return HBARule_AuthMethod.REJECT; + case -1: + case "UNRECOGNIZED": + default: + return HBARule_AuthMethod.UNRECOGNIZED; + } +} + +export function hBARule_AuthMethodToJSON(object: HBARule_AuthMethod): string { + switch (object) { + case HBARule_AuthMethod.AUTH_METHOD_UNSPECIFIED: + return "AUTH_METHOD_UNSPECIFIED"; + case HBARule_AuthMethod.MD5: + return "MD5"; + case HBARule_AuthMethod.LDAP: + return "LDAP"; + case HBARule_AuthMethod.REJECT: + return "REJECT"; + default: + return "UNKNOWN"; + } +} + +const baseHBARule: object = { + $type: "yandex.cloud.mdb.greenplum.v1.HBARule", + priority: 0, + connectionType: 0, + database: "", + user: "", + address: "", + authMethod: 0, +}; + +export const HBARule = { + $type: "yandex.cloud.mdb.greenplum.v1.HBARule" as const, + + encode( + message: HBARule, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.priority !== 0) { + writer.uint32(8).int64(message.priority); + } + if (message.connectionType !== 0) { + writer.uint32(16).int32(message.connectionType); + } + if (message.database !== "") { + writer.uint32(26).string(message.database); + } + if (message.user !== "") { + writer.uint32(34).string(message.user); + } + if (message.address !== "") { + writer.uint32(42).string(message.address); + } + if (message.authMethod !== 0) { + writer.uint32(48).int32(message.authMethod); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HBARule { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHBARule } as HBARule; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priority = longToNumber(reader.int64() as Long); + break; + case 2: + message.connectionType = reader.int32() as any; + break; + case 3: + message.database = reader.string(); + break; + case 4: + message.user = reader.string(); + break; + case 5: + message.address = reader.string(); + break; + case 6: + message.authMethod = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HBARule { + const message = { ...baseHBARule } as HBARule; + message.priority = + object.priority !== undefined && object.priority !== null + ? Number(object.priority) + : 0; + message.connectionType = + object.connectionType !== undefined && object.connectionType !== null + ? hBARule_ConnectionTypeFromJSON(object.connectionType) + : 0; + message.database = + object.database !== undefined && object.database !== null + ? String(object.database) + : ""; + message.user = + object.user !== undefined && object.user !== null + ? String(object.user) + : ""; + message.address = + object.address !== undefined && object.address !== null + ? String(object.address) + : ""; + message.authMethod = + object.authMethod !== undefined && object.authMethod !== null + ? hBARule_AuthMethodFromJSON(object.authMethod) + : 0; + return message; + }, + + toJSON(message: HBARule): unknown { + const obj: any = {}; + message.priority !== undefined && + (obj.priority = Math.round(message.priority)); + message.connectionType !== undefined && + (obj.connectionType = hBARule_ConnectionTypeToJSON( + message.connectionType + )); + message.database !== undefined && (obj.database = message.database); + message.user !== undefined && (obj.user = message.user); + message.address !== undefined && (obj.address = message.address); + message.authMethod !== undefined && + (obj.authMethod = hBARule_AuthMethodToJSON(message.authMethod)); + return obj; + }, + + fromPartial, I>>(object: I): HBARule { + const message = { ...baseHBARule } as HBARule; + message.priority = object.priority ?? 0; + message.connectionType = object.connectionType ?? 0; + message.database = object.database ?? ""; + message.user = object.user ?? ""; + message.address = object.address ?? ""; + message.authMethod = object.authMethod ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(HBARule.$type, HBARule); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/mdb/greenplum/v1/hba_rule_service.ts b/src/generated/yandex/cloud/mdb/greenplum/v1/hba_rule_service.ts new file mode 100644 index 00000000..c8ee674c --- /dev/null +++ b/src/generated/yandex/cloud/mdb/greenplum/v1/hba_rule_service.ts @@ -0,0 +1,992 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { HBARule } from "../../../../../yandex/cloud/mdb/greenplum/v1/hba_rule"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.mdb.greenplum.v1"; + +export interface CreateHBARuleRequest { + $type: "yandex.cloud.mdb.greenplum.v1.CreateHBARuleRequest"; + /** + * ID of the Greenplum cluster. + * To get the Greenplum cluster ID use a [ClusterService.List] request. + */ + clusterId: string; + /** New hba rule for the cluster. */ + hbaRule?: HBARule; +} + +export interface UpdateHBARuleRequest { + $type: "yandex.cloud.mdb.greenplum.v1.UpdateHBARuleRequest"; + /** + * ID of the Greenplum cluster. + * To get the Greenplum cluster ID use a [ClusterService.List] request. + */ + clusterId: string; + /** Updated hba rule for the cluster. */ + hbaRule?: HBARule; +} + +export interface DeleteHBARuleRequest { + $type: "yandex.cloud.mdb.greenplum.v1.DeleteHBARuleRequest"; + /** + * ID of the Greenplum cluster. + * To get the Greenplum cluster ID use a [ClusterService.List] request. + */ + clusterId: string; + /** Priority of the Greenplum cluster rule. */ + priority: number; +} + +export interface ListHBARulesRequest { + $type: "yandex.cloud.mdb.greenplum.v1.ListHBARulesRequest"; + /** + * ID of the Greenplum cluster. + * To get the Greenplum cluster ID use a [ClusterService.List] request. + */ + clusterId: string; +} + +export interface ListHBARulesAtRevisionRequest { + $type: "yandex.cloud.mdb.greenplum.v1.ListHBARulesAtRevisionRequest"; + /** + * ID of the Greenplum cluster. + * To get the Greenplum cluster ID use a [ClusterService.List] request. + */ + clusterId: string; + /** Cluster revision */ + revision: number; +} + +export interface ListHBARulesResponse { + $type: "yandex.cloud.mdb.greenplum.v1.ListHBARulesResponse"; + /** Requested list of hba rules for the cluster. */ + hbaRules: HBARule[]; +} + +export interface BatchUpdateHBARulesRequest { + $type: "yandex.cloud.mdb.greenplum.v1.BatchUpdateHBARulesRequest"; + /** + * ID of the Greenplum cluster. + * To get the Greenplum cluster ID use a [ClusterService.List] request. + */ + clusterId: string; + /** List of new hba rules for the cluster. */ + hbaRules: HBARule[]; +} + +export interface HBARulesMetadata { + $type: "yandex.cloud.mdb.greenplum.v1.HBARulesMetadata"; + /** ID of the Greenplum cluster which HBA rules was affected. */ + clusterId: string; +} + +const baseCreateHBARuleRequest: object = { + $type: "yandex.cloud.mdb.greenplum.v1.CreateHBARuleRequest", + clusterId: "", +}; + +export const CreateHBARuleRequest = { + $type: "yandex.cloud.mdb.greenplum.v1.CreateHBARuleRequest" as const, + + encode( + message: CreateHBARuleRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.hbaRule !== undefined) { + HBARule.encode(message.hbaRule, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateHBARuleRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateHBARuleRequest } as CreateHBARuleRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.hbaRule = HBARule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateHBARuleRequest { + const message = { ...baseCreateHBARuleRequest } as CreateHBARuleRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.hbaRule = + object.hbaRule !== undefined && object.hbaRule !== null + ? HBARule.fromJSON(object.hbaRule) + : undefined; + return message; + }, + + toJSON(message: CreateHBARuleRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.hbaRule !== undefined && + (obj.hbaRule = message.hbaRule + ? HBARule.toJSON(message.hbaRule) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateHBARuleRequest { + const message = { ...baseCreateHBARuleRequest } as CreateHBARuleRequest; + message.clusterId = object.clusterId ?? ""; + message.hbaRule = + object.hbaRule !== undefined && object.hbaRule !== null + ? HBARule.fromPartial(object.hbaRule) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CreateHBARuleRequest.$type, CreateHBARuleRequest); + +const baseUpdateHBARuleRequest: object = { + $type: "yandex.cloud.mdb.greenplum.v1.UpdateHBARuleRequest", + clusterId: "", +}; + +export const UpdateHBARuleRequest = { + $type: "yandex.cloud.mdb.greenplum.v1.UpdateHBARuleRequest" as const, + + encode( + message: UpdateHBARuleRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.hbaRule !== undefined) { + HBARule.encode(message.hbaRule, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateHBARuleRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateHBARuleRequest } as UpdateHBARuleRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.hbaRule = HBARule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateHBARuleRequest { + const message = { ...baseUpdateHBARuleRequest } as UpdateHBARuleRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.hbaRule = + object.hbaRule !== undefined && object.hbaRule !== null + ? HBARule.fromJSON(object.hbaRule) + : undefined; + return message; + }, + + toJSON(message: UpdateHBARuleRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.hbaRule !== undefined && + (obj.hbaRule = message.hbaRule + ? HBARule.toJSON(message.hbaRule) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateHBARuleRequest { + const message = { ...baseUpdateHBARuleRequest } as UpdateHBARuleRequest; + message.clusterId = object.clusterId ?? ""; + message.hbaRule = + object.hbaRule !== undefined && object.hbaRule !== null + ? HBARule.fromPartial(object.hbaRule) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UpdateHBARuleRequest.$type, UpdateHBARuleRequest); + +const baseDeleteHBARuleRequest: object = { + $type: "yandex.cloud.mdb.greenplum.v1.DeleteHBARuleRequest", + clusterId: "", + priority: 0, +}; + +export const DeleteHBARuleRequest = { + $type: "yandex.cloud.mdb.greenplum.v1.DeleteHBARuleRequest" as const, + + encode( + message: DeleteHBARuleRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.priority !== 0) { + writer.uint32(16).int64(message.priority); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteHBARuleRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteHBARuleRequest } as DeleteHBARuleRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.priority = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteHBARuleRequest { + const message = { ...baseDeleteHBARuleRequest } as DeleteHBARuleRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.priority = + object.priority !== undefined && object.priority !== null + ? Number(object.priority) + : 0; + return message; + }, + + toJSON(message: DeleteHBARuleRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.priority !== undefined && + (obj.priority = Math.round(message.priority)); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteHBARuleRequest { + const message = { ...baseDeleteHBARuleRequest } as DeleteHBARuleRequest; + message.clusterId = object.clusterId ?? ""; + message.priority = object.priority ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(DeleteHBARuleRequest.$type, DeleteHBARuleRequest); + +const baseListHBARulesRequest: object = { + $type: "yandex.cloud.mdb.greenplum.v1.ListHBARulesRequest", + clusterId: "", +}; + +export const ListHBARulesRequest = { + $type: "yandex.cloud.mdb.greenplum.v1.ListHBARulesRequest" as const, + + encode( + message: ListHBARulesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListHBARulesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListHBARulesRequest } as ListHBARulesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListHBARulesRequest { + const message = { ...baseListHBARulesRequest } as ListHBARulesRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: ListHBARulesRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListHBARulesRequest { + const message = { ...baseListHBARulesRequest } as ListHBARulesRequest; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListHBARulesRequest.$type, ListHBARulesRequest); + +const baseListHBARulesAtRevisionRequest: object = { + $type: "yandex.cloud.mdb.greenplum.v1.ListHBARulesAtRevisionRequest", + clusterId: "", + revision: 0, +}; + +export const ListHBARulesAtRevisionRequest = { + $type: "yandex.cloud.mdb.greenplum.v1.ListHBARulesAtRevisionRequest" as const, + + encode( + message: ListHBARulesAtRevisionRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.revision !== 0) { + writer.uint32(16).int64(message.revision); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListHBARulesAtRevisionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListHBARulesAtRevisionRequest, + } as ListHBARulesAtRevisionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.revision = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListHBARulesAtRevisionRequest { + const message = { + ...baseListHBARulesAtRevisionRequest, + } as ListHBARulesAtRevisionRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.revision = + object.revision !== undefined && object.revision !== null + ? Number(object.revision) + : 0; + return message; + }, + + toJSON(message: ListHBARulesAtRevisionRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.revision !== undefined && + (obj.revision = Math.round(message.revision)); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListHBARulesAtRevisionRequest { + const message = { + ...baseListHBARulesAtRevisionRequest, + } as ListHBARulesAtRevisionRequest; + message.clusterId = object.clusterId ?? ""; + message.revision = object.revision ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + ListHBARulesAtRevisionRequest.$type, + ListHBARulesAtRevisionRequest +); + +const baseListHBARulesResponse: object = { + $type: "yandex.cloud.mdb.greenplum.v1.ListHBARulesResponse", +}; + +export const ListHBARulesResponse = { + $type: "yandex.cloud.mdb.greenplum.v1.ListHBARulesResponse" as const, + + encode( + message: ListHBARulesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.hbaRules) { + HBARule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListHBARulesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListHBARulesResponse } as ListHBARulesResponse; + message.hbaRules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hbaRules.push(HBARule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListHBARulesResponse { + const message = { ...baseListHBARulesResponse } as ListHBARulesResponse; + message.hbaRules = (object.hbaRules ?? []).map((e: any) => + HBARule.fromJSON(e) + ); + return message; + }, + + toJSON(message: ListHBARulesResponse): unknown { + const obj: any = {}; + if (message.hbaRules) { + obj.hbaRules = message.hbaRules.map((e) => + e ? HBARule.toJSON(e) : undefined + ); + } else { + obj.hbaRules = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ListHBARulesResponse { + const message = { ...baseListHBARulesResponse } as ListHBARulesResponse; + message.hbaRules = + object.hbaRules?.map((e) => HBARule.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ListHBARulesResponse.$type, ListHBARulesResponse); + +const baseBatchUpdateHBARulesRequest: object = { + $type: "yandex.cloud.mdb.greenplum.v1.BatchUpdateHBARulesRequest", + clusterId: "", +}; + +export const BatchUpdateHBARulesRequest = { + $type: "yandex.cloud.mdb.greenplum.v1.BatchUpdateHBARulesRequest" as const, + + encode( + message: BatchUpdateHBARulesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + for (const v of message.hbaRules) { + HBARule.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): BatchUpdateHBARulesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseBatchUpdateHBARulesRequest, + } as BatchUpdateHBARulesRequest; + message.hbaRules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.hbaRules.push(HBARule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BatchUpdateHBARulesRequest { + const message = { + ...baseBatchUpdateHBARulesRequest, + } as BatchUpdateHBARulesRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.hbaRules = (object.hbaRules ?? []).map((e: any) => + HBARule.fromJSON(e) + ); + return message; + }, + + toJSON(message: BatchUpdateHBARulesRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.hbaRules) { + obj.hbaRules = message.hbaRules.map((e) => + e ? HBARule.toJSON(e) : undefined + ); + } else { + obj.hbaRules = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): BatchUpdateHBARulesRequest { + const message = { + ...baseBatchUpdateHBARulesRequest, + } as BatchUpdateHBARulesRequest; + message.clusterId = object.clusterId ?? ""; + message.hbaRules = + object.hbaRules?.map((e) => HBARule.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + BatchUpdateHBARulesRequest.$type, + BatchUpdateHBARulesRequest +); + +const baseHBARulesMetadata: object = { + $type: "yandex.cloud.mdb.greenplum.v1.HBARulesMetadata", + clusterId: "", +}; + +export const HBARulesMetadata = { + $type: "yandex.cloud.mdb.greenplum.v1.HBARulesMetadata" as const, + + encode( + message: HBARulesMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HBARulesMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHBARulesMetadata } as HBARulesMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HBARulesMetadata { + const message = { ...baseHBARulesMetadata } as HBARulesMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: HBARulesMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): HBARulesMetadata { + const message = { ...baseHBARulesMetadata } as HBARulesMetadata; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(HBARulesMetadata.$type, HBARulesMetadata); + +/** A set of methods for managing Greenplum clusters. */ +export const HBARuleServiceService = { + /** Retrieves a list of HBA rules for Greenplum clusters. */ + list: { + path: "/yandex.cloud.mdb.greenplum.v1.HBARuleService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListHBARulesRequest) => + Buffer.from(ListHBARulesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListHBARulesRequest.decode(value), + responseSerialize: (value: ListHBARulesResponse) => + Buffer.from(ListHBARulesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListHBARulesResponse.decode(value), + }, + /** Retrieves a list of HBA rules for Greenplum clusters for particular revision. */ + listAtRevision: { + path: "/yandex.cloud.mdb.greenplum.v1.HBARuleService/ListAtRevision", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListHBARulesAtRevisionRequest) => + Buffer.from(ListHBARulesAtRevisionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListHBARulesAtRevisionRequest.decode(value), + responseSerialize: (value: ListHBARulesResponse) => + Buffer.from(ListHBARulesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListHBARulesResponse.decode(value), + }, + /** Create single HBA rule for the specified Greenplum cluster to the end of HBA rules list. */ + create: { + path: "/yandex.cloud.mdb.greenplum.v1.HBARuleService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateHBARuleRequest) => + Buffer.from(CreateHBARuleRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateHBARuleRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Update specified HBA rule for the specified Greenplum cluster without changind it order. */ + update: { + path: "/yandex.cloud.mdb.greenplum.v1.HBARuleService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateHBARuleRequest) => + Buffer.from(UpdateHBARuleRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateHBARuleRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Delete specified HBA rule for the specified Greenplum cluster. */ + delete: { + path: "/yandex.cloud.mdb.greenplum.v1.HBARuleService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteHBARuleRequest) => + Buffer.from(DeleteHBARuleRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteHBARuleRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Modifies all HBA rules for the specified Greenplum cluster. */ + batchUpdate: { + path: "/yandex.cloud.mdb.greenplum.v1.HBARuleService/BatchUpdate", + requestStream: false, + responseStream: false, + requestSerialize: (value: BatchUpdateHBARulesRequest) => + Buffer.from(BatchUpdateHBARulesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + BatchUpdateHBARulesRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface HBARuleServiceServer extends UntypedServiceImplementation { + /** Retrieves a list of HBA rules for Greenplum clusters. */ + list: handleUnaryCall; + /** Retrieves a list of HBA rules for Greenplum clusters for particular revision. */ + listAtRevision: handleUnaryCall< + ListHBARulesAtRevisionRequest, + ListHBARulesResponse + >; + /** Create single HBA rule for the specified Greenplum cluster to the end of HBA rules list. */ + create: handleUnaryCall; + /** Update specified HBA rule for the specified Greenplum cluster without changind it order. */ + update: handleUnaryCall; + /** Delete specified HBA rule for the specified Greenplum cluster. */ + delete: handleUnaryCall; + /** Modifies all HBA rules for the specified Greenplum cluster. */ + batchUpdate: handleUnaryCall; +} + +export interface HBARuleServiceClient extends Client { + /** Retrieves a list of HBA rules for Greenplum clusters. */ + list( + request: ListHBARulesRequest, + callback: ( + error: ServiceError | null, + response: ListHBARulesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListHBARulesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListHBARulesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListHBARulesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListHBARulesResponse + ) => void + ): ClientUnaryCall; + /** Retrieves a list of HBA rules for Greenplum clusters for particular revision. */ + listAtRevision( + request: ListHBARulesAtRevisionRequest, + callback: ( + error: ServiceError | null, + response: ListHBARulesResponse + ) => void + ): ClientUnaryCall; + listAtRevision( + request: ListHBARulesAtRevisionRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListHBARulesResponse + ) => void + ): ClientUnaryCall; + listAtRevision( + request: ListHBARulesAtRevisionRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListHBARulesResponse + ) => void + ): ClientUnaryCall; + /** Create single HBA rule for the specified Greenplum cluster to the end of HBA rules list. */ + create( + request: CreateHBARuleRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateHBARuleRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateHBARuleRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Update specified HBA rule for the specified Greenplum cluster without changind it order. */ + update( + request: UpdateHBARuleRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateHBARuleRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateHBARuleRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Delete specified HBA rule for the specified Greenplum cluster. */ + delete( + request: DeleteHBARuleRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteHBARuleRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteHBARuleRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Modifies all HBA rules for the specified Greenplum cluster. */ + batchUpdate( + request: BatchUpdateHBARulesRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + batchUpdate( + request: BatchUpdateHBARulesRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + batchUpdate( + request: BatchUpdateHBARulesRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const HBARuleServiceClient = makeGenericClientConstructor( + HBARuleServiceService, + "yandex.cloud.mdb.greenplum.v1.HBARuleService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): HBARuleServiceClient; + service: typeof HBARuleServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/mdb/greenplum/v1/host.ts b/src/generated/yandex/cloud/mdb/greenplum/v1/host.ts index cf8a637c..91a5402d 100644 --- a/src/generated/yandex/cloud/mdb/greenplum/v1/host.ts +++ b/src/generated/yandex/cloud/mdb/greenplum/v1/host.ts @@ -21,11 +21,11 @@ export interface Host { clusterId: string; /** ID of the availability zone the Greenplum® host belongs to. */ zoneId: string; - /** Type of the host. */ + /** Type of the host. If the field has default value, it is not returned in the response. */ type: Host_Type; /** Resources allocated to the Greenplum® host. */ resources?: Resources; - /** Status code of the aggregated health of the host. */ + /** Aggregated health of the host. If the field has default value, it is not returned in the response. */ health: Host_Health; /** ID of the subnet that the host belongs to. */ subnetId: string; @@ -34,7 +34,7 @@ export interface Host { } export enum Host_Type { - /** TYPE_UNSPECIFIED - The type is not specified. */ + /** TYPE_UNSPECIFIED - Host type is not specified. Default value. */ TYPE_UNSPECIFIED = 0, /** MASTER - A Greenplum® master host. */ MASTER = 1, @@ -82,7 +82,7 @@ export function host_TypeToJSON(object: Host_Type): string { } export enum Host_Health { - /** UNKNOWN - Health of the host is unknown. */ + /** UNKNOWN - Health of the host is unknown. Default value. */ UNKNOWN = 0, /** ALIVE - The host is performing all its functions normally. */ ALIVE = 1, diff --git a/src/generated/yandex/cloud/mdb/greenplum/v1/pxf.ts b/src/generated/yandex/cloud/mdb/greenplum/v1/pxf.ts index 9e21d4e9..2f187c9e 100644 --- a/src/generated/yandex/cloud/mdb/greenplum/v1/pxf.ts +++ b/src/generated/yandex/cloud/mdb/greenplum/v1/pxf.ts @@ -8,29 +8,331 @@ export const protobufPackage = "yandex.cloud.mdb.greenplum.v1"; export interface PXFConfig { $type: "yandex.cloud.mdb.greenplum.v1.PXFConfig"; - /** Connection */ + /** + * Timeout for connection to the Apache Tomcat® server when making read requests. + * + * Specify values in seconds. + */ connectionTimeout?: number; + /** + * Timeout for connection to the Apache Tomcat® server when making write requests. + * + * Specify the values in seconds. + */ uploadTimeout?: number; - /** Thread pool */ + /** + * Maximum number of the Apache Tomcat® threads. + * + * To prevent situations when requests get stuck or fail due to running out of memory or malfunctioning of the Java garbage collector, specify the number of the Apache Tomcat® threads. Learn more about adjusting the number of threads in the [VMware Greenplum® Platform Extension Framework](https://docs.vmware.com/en/VMware-Greenplum-Platform-Extension-Framework/6.9/greenplum-platform-extension-framework/cfg_mem.html) documentation. + */ maxThreads?: number; + /** Determines whether the timeout for core streaming threads is permitted. */ poolAllowCoreThreadTimeout?: boolean; + /** Number of core streaming threads per pool. */ poolCoreSize?: number; + /** + * Maximum number of requests you can add to a pool queue for core streaming threads. + * + * If `0`, no pool queue is generated. + */ poolQueueCapacity?: number; + /** Maximum allowed number of core streaming threads. */ poolMaxSize?: number; - /** JVM */ + /** Initial size, in megabytes, of the JVM heap for the PXF daemon. */ xmx?: number; + /** Maximum size, in megabytes, of the JVM heap for the PXF daemon. */ xms?: number; } export interface PXFConfigSet { $type: "yandex.cloud.mdb.greenplum.v1.PXFConfigSet"; effectiveConfig?: PXFConfig; - /** User-defined settings */ + /** User-defined settings. */ userConfig?: PXFConfig; - /** Default configuration */ + /** Default configuration. */ defaultConfig?: PXFConfig; } +export interface PXFDatasourceS3 { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceS3"; + /** Public key to access S3 storage. */ + accessKey: string; + /** Secret key to access S3 storage. */ + secretKey: string; + /** + * Manages a fast upload of big files to S3 storage. In case of the `false` value, the PXF generates files on disk before sending them to the S3 storage. In case of the `true` value, the PXF generates files in RAM (the PXF writes to disc only if there is not enough RAM). + * + * The fast upload is enabled by default. + */ + fastUpload?: boolean; + /** S3 storage address. The default value is `storage.yandexcloud.net` used for Yandex Object Storage. */ + endpoint: string; +} + +export interface PXFDatasourceJDBC { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceJDBC"; + /** + * JDBC driver class in Java. The possible values are the following: + * + * * `com.simba.athena.jdbc.Driver` + * * `com.clickhouse.jdbc.ClickHouseDriver` + * * `com.ibm.as400.access.AS400JDBCDriver` + * * `com.microsoft.sqlserver.jdbc.SQLServerDriver` + * * `com.mysql.cj.jdbc.Driver` + * * `org.postgresql.Driver` + * * `oracle.jdbc.driver.OracleDriver` + * * `net.snowflake.client.jdbc.SnowflakeDriver` + * * `io.trino.jdbc.TrinoDriver` + */ + driver: string; + /** + * URL that the JDBC driver uses to connect to the database. Examples: + * + * * `jdbc:mysql://mysqlhost:3306/testdb`: Local MySQL DB. + * * `jdbc:postgresql://c-.rw.mdb.yandexcloud.net:6432/db1`: Managed Service for PostgreSQL cluster. The address contains the special FQDN of the cluster's master. + * * `jdbc:oracle:thin:@host.example:1521:orcl`: Oracle DB. + */ + url: string; + /** Username of the DB owner. */ + user: string; + /** Password of the DB owner. */ + password: string; + /** + * Number of rows to read in an external table, in a batch. + * + * The default value is `100`. + */ + statementBatchSize?: number; + /** + * Number of rows to fetch (buffer) when reading from an external table. + * + * The default value is `1000`. + */ + statementFetchSize?: number; + /** + * Amount of time (in seconds) the JDBC driver waits for a statement to run. This timeout applies to statements created for both read and write operations. + * + * The default value is `60`. + */ + statementQueryTimeout?: number; + /** Determines whether JDBC connection pooling is used in a server configuration. By default, it is used. */ + poolEnabled?: boolean; + /** + * Maximum number of connections to the DB backend. + * + * The default value is `5`. + */ + poolMaximumSize?: number; + /** + * Maximum time, in milliseconds, to wait for a connection from the pool. + * + * The default value is `30000`. + */ + poolConnectionTimeout?: number; + /** + * Maximum amount of time, in milliseconds, after which an inactive connection is considered idle. + * + * The default value is `30000`. + */ + poolIdleTimeout?: number; + /** + * Minimum number of idle connections maintained in the connection pool. + * + * The default value is `0`. + */ + poolMinimumIdle?: number; +} + +export interface PXFDatasourceCore { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceCore"; + /** URI whose scheme and authority determine the file system implementation. */ + defaultFs: string; + /** Rules for mapping Kerberos principals to operating system user accounts. */ + securityAuthToLocal: string; +} + +export interface PXFDatasourceKerberos { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceKerberos"; + /** Determines whether the Kerberos authentication server is used. By default, it is not used. */ + enable?: boolean; + /** Host of the primary KDC server (Key Distribution Center). */ + primary: string; + /** Kerberos realm for a Greenplum® DB. */ + realm: string; + /** KDC server hosts. */ + kdcServers: string[]; + /** Administration server host. Usually, this is the primary Kerberos server. */ + adminServer: string; + /** Domain that is used for the host name extension. Applicable when Kerberos 4 service members become Kerberos 5 service members (for example, when rcmd.hostname is replaced with host/hostname.domain). */ + defaultDomain: string; + /** Base64 encoded contents of the keytab file. */ + keytabBase64: string; +} + +export interface PXFDatasourceHDFSDfsNamenode { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSDfsNamenode"; + rpcAddress: string; + serviceRpcAddress: string; + httpAddress: string; + httpsAddress: string; +} + +export interface PXFDatasourceHDFSDfs { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSDfs"; + /** + * Determines whether automatic failover is enabled for the high availability of the file system. + * + * The automatic failover is enabled by default. + */ + haAutomaticFailoverEnabled?: boolean; + /** + * If `true`, access tokens are used as capabilities for accessing datanodes. If `false`, no access tokens are checked on accessing datanodes. + * + * The check of access tokens is enabled by default. + */ + blockAccessTokenEnabled?: boolean; + /** Determines whether the datanode hostname is used when connecting to datanodes. */ + useDatanodeHostname?: boolean; + /** + * List of HDFS service logical names. + * + * Specify them separated by commas. The names can be arbitrary. + */ + namenodes: { [key: string]: PXFDatasourceHDFSDfsNamenode }; + /** Corresponds well-known HDFS client setting "dfs.nameservices" for this datasource */ + nameservices: string; +} + +export interface PXFDatasourceHDFSDfs_NamenodesEntry { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSDfs.NamenodesEntry"; + key: string; + value?: PXFDatasourceHDFSDfsNamenode; +} + +export interface PXFDatasourceHDFSYarnHaRm { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSYarnHaRm"; + resourcemanagerAddress: string; + resourcemanagerSchedulerAddress: string; + resourcemanagerResourceTrackerAddress: string; + resourcemanagerAdminAddress: string; + resourcemanagerWebappAddress: string; + resourcemanagerWebappHttpsAddress: string; +} + +export interface PXFDatasourceHDFSYarn { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSYarn"; + /** + * Determines whether high availability is enabled for YARN's ResourceManager services. + * + * The high availability is enabled by default. + */ + resourcemanagerHaEnabled?: boolean; + /** + * Determines whether another ResourceManager should automatically become active when the active ResourceManager has failed and does not respond. + * + * The switch of ResourceManagers is enabled by default if the high availability is enabled. + */ + resourcemanagerHaAutoFailoverEnabled?: boolean; + /** Determines whether the embedded ActiveStandbyElector method should be used for the election of the active ResourceManager. If the current active ResourceManager has failed and does not respond, the ActiveStandbyElector method makes another ResourceManager active which then takes over. */ + resourcemanagerHaAutoFailoverEmbedded?: boolean; + /** Cluster ID. Specify it, so the ResourceManager service does not become active for a different cluster. */ + resourcemanagerClusterId: string; + /** Highly available ResourceManager service. */ + haRm: { [key: string]: PXFDatasourceHDFSYarnHaRm }; +} + +export interface PXFDatasourceHDFSYarn_HaRmEntry { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSYarn.HaRmEntry"; + key: string; + value?: PXFDatasourceHDFSYarnHaRm; +} + +export interface PXFDatasourceHDFS { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFS"; + /** Settings of the file system and security rules. */ + core?: PXFDatasourceCore; + /** Settings of the Kerberos network authentication protocol. */ + kerberos?: PXFDatasourceKerberos; + /** + * Enables authentication on behalf of the Greenplum® user when connecting to the remote file storage or DBMS. + * + * The authentication is disabled by default. + */ + userImpersonation?: boolean; + /** Login username for the remote file storage or DBMS if authentication on behalf of the Greenplum® user is enabled. */ + username: string; + /** + * Maximum number of times that PXF retries a SASL connection request after a refused connection returns a `GSS initiate failed` error. + * + * The default value is `5`. + */ + saslConnectionRetries?: number; + /** + * ZooKeeper server hosts. + * + * Specify values in the `
:` format. + */ + zkHosts: string[]; + /** Settings of the distributed file system. */ + dfs?: PXFDatasourceHDFSDfs; + /** Settings of the ResourceManager service that is responsible for tracking resources in a cluster and scheduling applications (e.g., MapReduce jobs). */ + yarn?: PXFDatasourceHDFSYarn; +} + +export interface PXFDatasourceHive { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHive"; + /** Settings of the file system and security rules. */ + core?: PXFDatasourceCore; + /** Settings of the Kerberos network authentication protocol. */ + kerberos?: PXFDatasourceKerberos; + /** + * Enables authentication on behalf of the Greenplum® user when connecting to the remote file storage or DBMS. + * + * The authentication is disabled by default. + */ + userImpersonation?: boolean; + /** Login username for the remote file storage or DBMS if authentication on behalf of the Greenplum® user is enabled. */ + username: string; + /** + * Maximum number of times that PXF retries a SASL connection request after a refused connection returns a `GSS initiate failed` error. + * + * The default value is `5`. + */ + saslConnectionRetries?: number; + /** + * ZooKeeper server hosts. + * + * Specify values in the `
:` format. + */ + zkHosts: string[]; + /** + * Specifies if predicate pushdown is enabled for queries on external tables. + * + * The predicate pushdown is enabled by default. + */ + ppd?: boolean; + /** List of URIs separated by commas. To request metadata, the remote DBMS connects to Metastore by one of these URIs. */ + metastoreUris: string[]; + /** Service principal for the Metastore Thrift server. */ + metastoreKerberosPrincipal: string; + /** Kerberos server principal. */ + authKerberosPrincipal: string; +} + +export interface PXFDatasource { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasource"; + /** Data source name. */ + name: string; + /** Settings of an external S3 data source. */ + s3?: PXFDatasourceS3 | undefined; + /** Settings of an external JDBC data source. */ + jdbc?: PXFDatasourceJDBC | undefined; + /** Settings of an external HDFS data source. */ + hdfs?: PXFDatasourceHDFS | undefined; + /** Settings of an external Hive data source. */ + hive?: PXFDatasourceHive | undefined; +} + const basePXFConfig: object = { $type: "yandex.cloud.mdb.greenplum.v1.PXFConfig", }; @@ -361,6 +663,2006 @@ export const PXFConfigSet = { messageTypeRegistry.set(PXFConfigSet.$type, PXFConfigSet); +const basePXFDatasourceS3: object = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceS3", + accessKey: "", + secretKey: "", + endpoint: "", +}; + +export const PXFDatasourceS3 = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceS3" as const, + + encode( + message: PXFDatasourceS3, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.accessKey !== "") { + writer.uint32(10).string(message.accessKey); + } + if (message.secretKey !== "") { + writer.uint32(18).string(message.secretKey); + } + if (message.fastUpload !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.fastUpload! }, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.endpoint !== "") { + writer.uint32(34).string(message.endpoint); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PXFDatasourceS3 { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePXFDatasourceS3 } as PXFDatasourceS3; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accessKey = reader.string(); + break; + case 2: + message.secretKey = reader.string(); + break; + case 3: + message.fastUpload = BoolValue.decode(reader, reader.uint32()).value; + break; + case 4: + message.endpoint = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PXFDatasourceS3 { + const message = { ...basePXFDatasourceS3 } as PXFDatasourceS3; + message.accessKey = + object.accessKey !== undefined && object.accessKey !== null + ? String(object.accessKey) + : ""; + message.secretKey = + object.secretKey !== undefined && object.secretKey !== null + ? String(object.secretKey) + : ""; + message.fastUpload = + object.fastUpload !== undefined && object.fastUpload !== null + ? Boolean(object.fastUpload) + : undefined; + message.endpoint = + object.endpoint !== undefined && object.endpoint !== null + ? String(object.endpoint) + : ""; + return message; + }, + + toJSON(message: PXFDatasourceS3): unknown { + const obj: any = {}; + message.accessKey !== undefined && (obj.accessKey = message.accessKey); + message.secretKey !== undefined && (obj.secretKey = message.secretKey); + message.fastUpload !== undefined && (obj.fastUpload = message.fastUpload); + message.endpoint !== undefined && (obj.endpoint = message.endpoint); + return obj; + }, + + fromPartial, I>>( + object: I + ): PXFDatasourceS3 { + const message = { ...basePXFDatasourceS3 } as PXFDatasourceS3; + message.accessKey = object.accessKey ?? ""; + message.secretKey = object.secretKey ?? ""; + message.fastUpload = object.fastUpload ?? undefined; + message.endpoint = object.endpoint ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(PXFDatasourceS3.$type, PXFDatasourceS3); + +const basePXFDatasourceJDBC: object = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceJDBC", + driver: "", + url: "", + user: "", + password: "", +}; + +export const PXFDatasourceJDBC = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceJDBC" as const, + + encode( + message: PXFDatasourceJDBC, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.driver !== "") { + writer.uint32(10).string(message.driver); + } + if (message.url !== "") { + writer.uint32(18).string(message.url); + } + if (message.user !== "") { + writer.uint32(26).string(message.user); + } + if (message.password !== "") { + writer.uint32(34).string(message.password); + } + if (message.statementBatchSize !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.statementBatchSize!, + }, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.statementFetchSize !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.statementFetchSize!, + }, + writer.uint32(50).fork() + ).ldelim(); + } + if (message.statementQueryTimeout !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.statementQueryTimeout!, + }, + writer.uint32(58).fork() + ).ldelim(); + } + if (message.poolEnabled !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.poolEnabled! }, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.poolMaximumSize !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.poolMaximumSize!, + }, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.poolConnectionTimeout !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.poolConnectionTimeout!, + }, + writer.uint32(82).fork() + ).ldelim(); + } + if (message.poolIdleTimeout !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.poolIdleTimeout!, + }, + writer.uint32(90).fork() + ).ldelim(); + } + if (message.poolMinimumIdle !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.poolMinimumIdle!, + }, + writer.uint32(98).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PXFDatasourceJDBC { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePXFDatasourceJDBC } as PXFDatasourceJDBC; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.driver = reader.string(); + break; + case 2: + message.url = reader.string(); + break; + case 3: + message.user = reader.string(); + break; + case 4: + message.password = reader.string(); + break; + case 5: + message.statementBatchSize = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 6: + message.statementFetchSize = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 7: + message.statementQueryTimeout = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 8: + message.poolEnabled = BoolValue.decode(reader, reader.uint32()).value; + break; + case 9: + message.poolMaximumSize = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 10: + message.poolConnectionTimeout = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 11: + message.poolIdleTimeout = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 12: + message.poolMinimumIdle = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PXFDatasourceJDBC { + const message = { ...basePXFDatasourceJDBC } as PXFDatasourceJDBC; + message.driver = + object.driver !== undefined && object.driver !== null + ? String(object.driver) + : ""; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + message.user = + object.user !== undefined && object.user !== null + ? String(object.user) + : ""; + message.password = + object.password !== undefined && object.password !== null + ? String(object.password) + : ""; + message.statementBatchSize = + object.statementBatchSize !== undefined && + object.statementBatchSize !== null + ? Number(object.statementBatchSize) + : undefined; + message.statementFetchSize = + object.statementFetchSize !== undefined && + object.statementFetchSize !== null + ? Number(object.statementFetchSize) + : undefined; + message.statementQueryTimeout = + object.statementQueryTimeout !== undefined && + object.statementQueryTimeout !== null + ? Number(object.statementQueryTimeout) + : undefined; + message.poolEnabled = + object.poolEnabled !== undefined && object.poolEnabled !== null + ? Boolean(object.poolEnabled) + : undefined; + message.poolMaximumSize = + object.poolMaximumSize !== undefined && object.poolMaximumSize !== null + ? Number(object.poolMaximumSize) + : undefined; + message.poolConnectionTimeout = + object.poolConnectionTimeout !== undefined && + object.poolConnectionTimeout !== null + ? Number(object.poolConnectionTimeout) + : undefined; + message.poolIdleTimeout = + object.poolIdleTimeout !== undefined && object.poolIdleTimeout !== null + ? Number(object.poolIdleTimeout) + : undefined; + message.poolMinimumIdle = + object.poolMinimumIdle !== undefined && object.poolMinimumIdle !== null + ? Number(object.poolMinimumIdle) + : undefined; + return message; + }, + + toJSON(message: PXFDatasourceJDBC): unknown { + const obj: any = {}; + message.driver !== undefined && (obj.driver = message.driver); + message.url !== undefined && (obj.url = message.url); + message.user !== undefined && (obj.user = message.user); + message.password !== undefined && (obj.password = message.password); + message.statementBatchSize !== undefined && + (obj.statementBatchSize = message.statementBatchSize); + message.statementFetchSize !== undefined && + (obj.statementFetchSize = message.statementFetchSize); + message.statementQueryTimeout !== undefined && + (obj.statementQueryTimeout = message.statementQueryTimeout); + message.poolEnabled !== undefined && + (obj.poolEnabled = message.poolEnabled); + message.poolMaximumSize !== undefined && + (obj.poolMaximumSize = message.poolMaximumSize); + message.poolConnectionTimeout !== undefined && + (obj.poolConnectionTimeout = message.poolConnectionTimeout); + message.poolIdleTimeout !== undefined && + (obj.poolIdleTimeout = message.poolIdleTimeout); + message.poolMinimumIdle !== undefined && + (obj.poolMinimumIdle = message.poolMinimumIdle); + return obj; + }, + + fromPartial, I>>( + object: I + ): PXFDatasourceJDBC { + const message = { ...basePXFDatasourceJDBC } as PXFDatasourceJDBC; + message.driver = object.driver ?? ""; + message.url = object.url ?? ""; + message.user = object.user ?? ""; + message.password = object.password ?? ""; + message.statementBatchSize = object.statementBatchSize ?? undefined; + message.statementFetchSize = object.statementFetchSize ?? undefined; + message.statementQueryTimeout = object.statementQueryTimeout ?? undefined; + message.poolEnabled = object.poolEnabled ?? undefined; + message.poolMaximumSize = object.poolMaximumSize ?? undefined; + message.poolConnectionTimeout = object.poolConnectionTimeout ?? undefined; + message.poolIdleTimeout = object.poolIdleTimeout ?? undefined; + message.poolMinimumIdle = object.poolMinimumIdle ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(PXFDatasourceJDBC.$type, PXFDatasourceJDBC); + +const basePXFDatasourceCore: object = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceCore", + defaultFs: "", + securityAuthToLocal: "", +}; + +export const PXFDatasourceCore = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceCore" as const, + + encode( + message: PXFDatasourceCore, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.defaultFs !== "") { + writer.uint32(10).string(message.defaultFs); + } + if (message.securityAuthToLocal !== "") { + writer.uint32(18).string(message.securityAuthToLocal); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PXFDatasourceCore { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePXFDatasourceCore } as PXFDatasourceCore; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.defaultFs = reader.string(); + break; + case 2: + message.securityAuthToLocal = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PXFDatasourceCore { + const message = { ...basePXFDatasourceCore } as PXFDatasourceCore; + message.defaultFs = + object.defaultFs !== undefined && object.defaultFs !== null + ? String(object.defaultFs) + : ""; + message.securityAuthToLocal = + object.securityAuthToLocal !== undefined && + object.securityAuthToLocal !== null + ? String(object.securityAuthToLocal) + : ""; + return message; + }, + + toJSON(message: PXFDatasourceCore): unknown { + const obj: any = {}; + message.defaultFs !== undefined && (obj.defaultFs = message.defaultFs); + message.securityAuthToLocal !== undefined && + (obj.securityAuthToLocal = message.securityAuthToLocal); + return obj; + }, + + fromPartial, I>>( + object: I + ): PXFDatasourceCore { + const message = { ...basePXFDatasourceCore } as PXFDatasourceCore; + message.defaultFs = object.defaultFs ?? ""; + message.securityAuthToLocal = object.securityAuthToLocal ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(PXFDatasourceCore.$type, PXFDatasourceCore); + +const basePXFDatasourceKerberos: object = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceKerberos", + primary: "", + realm: "", + kdcServers: "", + adminServer: "", + defaultDomain: "", + keytabBase64: "", +}; + +export const PXFDatasourceKerberos = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceKerberos" as const, + + encode( + message: PXFDatasourceKerberos, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enable !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.enable! }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.primary !== "") { + writer.uint32(18).string(message.primary); + } + if (message.realm !== "") { + writer.uint32(26).string(message.realm); + } + for (const v of message.kdcServers) { + writer.uint32(34).string(v!); + } + if (message.adminServer !== "") { + writer.uint32(42).string(message.adminServer); + } + if (message.defaultDomain !== "") { + writer.uint32(50).string(message.defaultDomain); + } + if (message.keytabBase64 !== "") { + writer.uint32(58).string(message.keytabBase64); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PXFDatasourceKerberos { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePXFDatasourceKerberos } as PXFDatasourceKerberos; + message.kdcServers = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enable = BoolValue.decode(reader, reader.uint32()).value; + break; + case 2: + message.primary = reader.string(); + break; + case 3: + message.realm = reader.string(); + break; + case 4: + message.kdcServers.push(reader.string()); + break; + case 5: + message.adminServer = reader.string(); + break; + case 6: + message.defaultDomain = reader.string(); + break; + case 7: + message.keytabBase64 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PXFDatasourceKerberos { + const message = { ...basePXFDatasourceKerberos } as PXFDatasourceKerberos; + message.enable = + object.enable !== undefined && object.enable !== null + ? Boolean(object.enable) + : undefined; + message.primary = + object.primary !== undefined && object.primary !== null + ? String(object.primary) + : ""; + message.realm = + object.realm !== undefined && object.realm !== null + ? String(object.realm) + : ""; + message.kdcServers = (object.kdcServers ?? []).map((e: any) => String(e)); + message.adminServer = + object.adminServer !== undefined && object.adminServer !== null + ? String(object.adminServer) + : ""; + message.defaultDomain = + object.defaultDomain !== undefined && object.defaultDomain !== null + ? String(object.defaultDomain) + : ""; + message.keytabBase64 = + object.keytabBase64 !== undefined && object.keytabBase64 !== null + ? String(object.keytabBase64) + : ""; + return message; + }, + + toJSON(message: PXFDatasourceKerberos): unknown { + const obj: any = {}; + message.enable !== undefined && (obj.enable = message.enable); + message.primary !== undefined && (obj.primary = message.primary); + message.realm !== undefined && (obj.realm = message.realm); + if (message.kdcServers) { + obj.kdcServers = message.kdcServers.map((e) => e); + } else { + obj.kdcServers = []; + } + message.adminServer !== undefined && + (obj.adminServer = message.adminServer); + message.defaultDomain !== undefined && + (obj.defaultDomain = message.defaultDomain); + message.keytabBase64 !== undefined && + (obj.keytabBase64 = message.keytabBase64); + return obj; + }, + + fromPartial, I>>( + object: I + ): PXFDatasourceKerberos { + const message = { ...basePXFDatasourceKerberos } as PXFDatasourceKerberos; + message.enable = object.enable ?? undefined; + message.primary = object.primary ?? ""; + message.realm = object.realm ?? ""; + message.kdcServers = object.kdcServers?.map((e) => e) || []; + message.adminServer = object.adminServer ?? ""; + message.defaultDomain = object.defaultDomain ?? ""; + message.keytabBase64 = object.keytabBase64 ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(PXFDatasourceKerberos.$type, PXFDatasourceKerberos); + +const basePXFDatasourceHDFSDfsNamenode: object = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSDfsNamenode", + rpcAddress: "", + serviceRpcAddress: "", + httpAddress: "", + httpsAddress: "", +}; + +export const PXFDatasourceHDFSDfsNamenode = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSDfsNamenode" as const, + + encode( + message: PXFDatasourceHDFSDfsNamenode, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.rpcAddress !== "") { + writer.uint32(10).string(message.rpcAddress); + } + if (message.serviceRpcAddress !== "") { + writer.uint32(18).string(message.serviceRpcAddress); + } + if (message.httpAddress !== "") { + writer.uint32(26).string(message.httpAddress); + } + if (message.httpsAddress !== "") { + writer.uint32(34).string(message.httpsAddress); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PXFDatasourceHDFSDfsNamenode { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePXFDatasourceHDFSDfsNamenode, + } as PXFDatasourceHDFSDfsNamenode; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rpcAddress = reader.string(); + break; + case 2: + message.serviceRpcAddress = reader.string(); + break; + case 3: + message.httpAddress = reader.string(); + break; + case 4: + message.httpsAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PXFDatasourceHDFSDfsNamenode { + const message = { + ...basePXFDatasourceHDFSDfsNamenode, + } as PXFDatasourceHDFSDfsNamenode; + message.rpcAddress = + object.rpcAddress !== undefined && object.rpcAddress !== null + ? String(object.rpcAddress) + : ""; + message.serviceRpcAddress = + object.serviceRpcAddress !== undefined && + object.serviceRpcAddress !== null + ? String(object.serviceRpcAddress) + : ""; + message.httpAddress = + object.httpAddress !== undefined && object.httpAddress !== null + ? String(object.httpAddress) + : ""; + message.httpsAddress = + object.httpsAddress !== undefined && object.httpsAddress !== null + ? String(object.httpsAddress) + : ""; + return message; + }, + + toJSON(message: PXFDatasourceHDFSDfsNamenode): unknown { + const obj: any = {}; + message.rpcAddress !== undefined && (obj.rpcAddress = message.rpcAddress); + message.serviceRpcAddress !== undefined && + (obj.serviceRpcAddress = message.serviceRpcAddress); + message.httpAddress !== undefined && + (obj.httpAddress = message.httpAddress); + message.httpsAddress !== undefined && + (obj.httpsAddress = message.httpsAddress); + return obj; + }, + + fromPartial, I>>( + object: I + ): PXFDatasourceHDFSDfsNamenode { + const message = { + ...basePXFDatasourceHDFSDfsNamenode, + } as PXFDatasourceHDFSDfsNamenode; + message.rpcAddress = object.rpcAddress ?? ""; + message.serviceRpcAddress = object.serviceRpcAddress ?? ""; + message.httpAddress = object.httpAddress ?? ""; + message.httpsAddress = object.httpsAddress ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + PXFDatasourceHDFSDfsNamenode.$type, + PXFDatasourceHDFSDfsNamenode +); + +const basePXFDatasourceHDFSDfs: object = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSDfs", + nameservices: "", +}; + +export const PXFDatasourceHDFSDfs = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSDfs" as const, + + encode( + message: PXFDatasourceHDFSDfs, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.haAutomaticFailoverEnabled !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.haAutomaticFailoverEnabled!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.blockAccessTokenEnabled !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.blockAccessTokenEnabled!, + }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.useDatanodeHostname !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.useDatanodeHostname!, + }, + writer.uint32(26).fork() + ).ldelim(); + } + Object.entries(message.namenodes).forEach(([key, value]) => { + PXFDatasourceHDFSDfs_NamenodesEntry.encode( + { + $type: + "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSDfs.NamenodesEntry", + key: key as any, + value, + }, + writer.uint32(34).fork() + ).ldelim(); + }); + if (message.nameservices !== "") { + writer.uint32(42).string(message.nameservices); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PXFDatasourceHDFSDfs { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePXFDatasourceHDFSDfs } as PXFDatasourceHDFSDfs; + message.namenodes = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.haAutomaticFailoverEnabled = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 2: + message.blockAccessTokenEnabled = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 3: + message.useDatanodeHostname = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 4: + const entry4 = PXFDatasourceHDFSDfs_NamenodesEntry.decode( + reader, + reader.uint32() + ); + if (entry4.value !== undefined) { + message.namenodes[entry4.key] = entry4.value; + } + break; + case 5: + message.nameservices = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PXFDatasourceHDFSDfs { + const message = { ...basePXFDatasourceHDFSDfs } as PXFDatasourceHDFSDfs; + message.haAutomaticFailoverEnabled = + object.haAutomaticFailoverEnabled !== undefined && + object.haAutomaticFailoverEnabled !== null + ? Boolean(object.haAutomaticFailoverEnabled) + : undefined; + message.blockAccessTokenEnabled = + object.blockAccessTokenEnabled !== undefined && + object.blockAccessTokenEnabled !== null + ? Boolean(object.blockAccessTokenEnabled) + : undefined; + message.useDatanodeHostname = + object.useDatanodeHostname !== undefined && + object.useDatanodeHostname !== null + ? Boolean(object.useDatanodeHostname) + : undefined; + message.namenodes = Object.entries(object.namenodes ?? {}).reduce<{ + [key: string]: PXFDatasourceHDFSDfsNamenode; + }>((acc, [key, value]) => { + acc[key] = PXFDatasourceHDFSDfsNamenode.fromJSON(value); + return acc; + }, {}); + message.nameservices = + object.nameservices !== undefined && object.nameservices !== null + ? String(object.nameservices) + : ""; + return message; + }, + + toJSON(message: PXFDatasourceHDFSDfs): unknown { + const obj: any = {}; + message.haAutomaticFailoverEnabled !== undefined && + (obj.haAutomaticFailoverEnabled = message.haAutomaticFailoverEnabled); + message.blockAccessTokenEnabled !== undefined && + (obj.blockAccessTokenEnabled = message.blockAccessTokenEnabled); + message.useDatanodeHostname !== undefined && + (obj.useDatanodeHostname = message.useDatanodeHostname); + obj.namenodes = {}; + if (message.namenodes) { + Object.entries(message.namenodes).forEach(([k, v]) => { + obj.namenodes[k] = PXFDatasourceHDFSDfsNamenode.toJSON(v); + }); + } + message.nameservices !== undefined && + (obj.nameservices = message.nameservices); + return obj; + }, + + fromPartial, I>>( + object: I + ): PXFDatasourceHDFSDfs { + const message = { ...basePXFDatasourceHDFSDfs } as PXFDatasourceHDFSDfs; + message.haAutomaticFailoverEnabled = + object.haAutomaticFailoverEnabled ?? undefined; + message.blockAccessTokenEnabled = + object.blockAccessTokenEnabled ?? undefined; + message.useDatanodeHostname = object.useDatanodeHostname ?? undefined; + message.namenodes = Object.entries(object.namenodes ?? {}).reduce<{ + [key: string]: PXFDatasourceHDFSDfsNamenode; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = PXFDatasourceHDFSDfsNamenode.fromPartial(value); + } + return acc; + }, {}); + message.nameservices = object.nameservices ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(PXFDatasourceHDFSDfs.$type, PXFDatasourceHDFSDfs); + +const basePXFDatasourceHDFSDfs_NamenodesEntry: object = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSDfs.NamenodesEntry", + key: "", +}; + +export const PXFDatasourceHDFSDfs_NamenodesEntry = { + $type: + "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSDfs.NamenodesEntry" as const, + + encode( + message: PXFDatasourceHDFSDfs_NamenodesEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + PXFDatasourceHDFSDfsNamenode.encode( + message.value, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PXFDatasourceHDFSDfs_NamenodesEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePXFDatasourceHDFSDfs_NamenodesEntry, + } as PXFDatasourceHDFSDfs_NamenodesEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = PXFDatasourceHDFSDfsNamenode.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PXFDatasourceHDFSDfs_NamenodesEntry { + const message = { + ...basePXFDatasourceHDFSDfs_NamenodesEntry, + } as PXFDatasourceHDFSDfs_NamenodesEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? PXFDatasourceHDFSDfsNamenode.fromJSON(object.value) + : undefined; + return message; + }, + + toJSON(message: PXFDatasourceHDFSDfs_NamenodesEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && + (obj.value = message.value + ? PXFDatasourceHDFSDfsNamenode.toJSON(message.value) + : undefined); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): PXFDatasourceHDFSDfs_NamenodesEntry { + const message = { + ...basePXFDatasourceHDFSDfs_NamenodesEntry, + } as PXFDatasourceHDFSDfs_NamenodesEntry; + message.key = object.key ?? ""; + message.value = + object.value !== undefined && object.value !== null + ? PXFDatasourceHDFSDfsNamenode.fromPartial(object.value) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + PXFDatasourceHDFSDfs_NamenodesEntry.$type, + PXFDatasourceHDFSDfs_NamenodesEntry +); + +const basePXFDatasourceHDFSYarnHaRm: object = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSYarnHaRm", + resourcemanagerAddress: "", + resourcemanagerSchedulerAddress: "", + resourcemanagerResourceTrackerAddress: "", + resourcemanagerAdminAddress: "", + resourcemanagerWebappAddress: "", + resourcemanagerWebappHttpsAddress: "", +}; + +export const PXFDatasourceHDFSYarnHaRm = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSYarnHaRm" as const, + + encode( + message: PXFDatasourceHDFSYarnHaRm, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resourcemanagerAddress !== "") { + writer.uint32(10).string(message.resourcemanagerAddress); + } + if (message.resourcemanagerSchedulerAddress !== "") { + writer.uint32(18).string(message.resourcemanagerSchedulerAddress); + } + if (message.resourcemanagerResourceTrackerAddress !== "") { + writer.uint32(26).string(message.resourcemanagerResourceTrackerAddress); + } + if (message.resourcemanagerAdminAddress !== "") { + writer.uint32(34).string(message.resourcemanagerAdminAddress); + } + if (message.resourcemanagerWebappAddress !== "") { + writer.uint32(42).string(message.resourcemanagerWebappAddress); + } + if (message.resourcemanagerWebappHttpsAddress !== "") { + writer.uint32(50).string(message.resourcemanagerWebappHttpsAddress); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PXFDatasourceHDFSYarnHaRm { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePXFDatasourceHDFSYarnHaRm, + } as PXFDatasourceHDFSYarnHaRm; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourcemanagerAddress = reader.string(); + break; + case 2: + message.resourcemanagerSchedulerAddress = reader.string(); + break; + case 3: + message.resourcemanagerResourceTrackerAddress = reader.string(); + break; + case 4: + message.resourcemanagerAdminAddress = reader.string(); + break; + case 5: + message.resourcemanagerWebappAddress = reader.string(); + break; + case 6: + message.resourcemanagerWebappHttpsAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PXFDatasourceHDFSYarnHaRm { + const message = { + ...basePXFDatasourceHDFSYarnHaRm, + } as PXFDatasourceHDFSYarnHaRm; + message.resourcemanagerAddress = + object.resourcemanagerAddress !== undefined && + object.resourcemanagerAddress !== null + ? String(object.resourcemanagerAddress) + : ""; + message.resourcemanagerSchedulerAddress = + object.resourcemanagerSchedulerAddress !== undefined && + object.resourcemanagerSchedulerAddress !== null + ? String(object.resourcemanagerSchedulerAddress) + : ""; + message.resourcemanagerResourceTrackerAddress = + object.resourcemanagerResourceTrackerAddress !== undefined && + object.resourcemanagerResourceTrackerAddress !== null + ? String(object.resourcemanagerResourceTrackerAddress) + : ""; + message.resourcemanagerAdminAddress = + object.resourcemanagerAdminAddress !== undefined && + object.resourcemanagerAdminAddress !== null + ? String(object.resourcemanagerAdminAddress) + : ""; + message.resourcemanagerWebappAddress = + object.resourcemanagerWebappAddress !== undefined && + object.resourcemanagerWebappAddress !== null + ? String(object.resourcemanagerWebappAddress) + : ""; + message.resourcemanagerWebappHttpsAddress = + object.resourcemanagerWebappHttpsAddress !== undefined && + object.resourcemanagerWebappHttpsAddress !== null + ? String(object.resourcemanagerWebappHttpsAddress) + : ""; + return message; + }, + + toJSON(message: PXFDatasourceHDFSYarnHaRm): unknown { + const obj: any = {}; + message.resourcemanagerAddress !== undefined && + (obj.resourcemanagerAddress = message.resourcemanagerAddress); + message.resourcemanagerSchedulerAddress !== undefined && + (obj.resourcemanagerSchedulerAddress = + message.resourcemanagerSchedulerAddress); + message.resourcemanagerResourceTrackerAddress !== undefined && + (obj.resourcemanagerResourceTrackerAddress = + message.resourcemanagerResourceTrackerAddress); + message.resourcemanagerAdminAddress !== undefined && + (obj.resourcemanagerAdminAddress = message.resourcemanagerAdminAddress); + message.resourcemanagerWebappAddress !== undefined && + (obj.resourcemanagerWebappAddress = message.resourcemanagerWebappAddress); + message.resourcemanagerWebappHttpsAddress !== undefined && + (obj.resourcemanagerWebappHttpsAddress = + message.resourcemanagerWebappHttpsAddress); + return obj; + }, + + fromPartial, I>>( + object: I + ): PXFDatasourceHDFSYarnHaRm { + const message = { + ...basePXFDatasourceHDFSYarnHaRm, + } as PXFDatasourceHDFSYarnHaRm; + message.resourcemanagerAddress = object.resourcemanagerAddress ?? ""; + message.resourcemanagerSchedulerAddress = + object.resourcemanagerSchedulerAddress ?? ""; + message.resourcemanagerResourceTrackerAddress = + object.resourcemanagerResourceTrackerAddress ?? ""; + message.resourcemanagerAdminAddress = + object.resourcemanagerAdminAddress ?? ""; + message.resourcemanagerWebappAddress = + object.resourcemanagerWebappAddress ?? ""; + message.resourcemanagerWebappHttpsAddress = + object.resourcemanagerWebappHttpsAddress ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + PXFDatasourceHDFSYarnHaRm.$type, + PXFDatasourceHDFSYarnHaRm +); + +const basePXFDatasourceHDFSYarn: object = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSYarn", + resourcemanagerClusterId: "", +}; + +export const PXFDatasourceHDFSYarn = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSYarn" as const, + + encode( + message: PXFDatasourceHDFSYarn, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resourcemanagerHaEnabled !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.resourcemanagerHaEnabled!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.resourcemanagerHaAutoFailoverEnabled !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.resourcemanagerHaAutoFailoverEnabled!, + }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.resourcemanagerHaAutoFailoverEmbedded !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.resourcemanagerHaAutoFailoverEmbedded!, + }, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.resourcemanagerClusterId !== "") { + writer.uint32(34).string(message.resourcemanagerClusterId); + } + Object.entries(message.haRm).forEach(([key, value]) => { + PXFDatasourceHDFSYarn_HaRmEntry.encode( + { + $type: + "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSYarn.HaRmEntry", + key: key as any, + value, + }, + writer.uint32(42).fork() + ).ldelim(); + }); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PXFDatasourceHDFSYarn { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePXFDatasourceHDFSYarn } as PXFDatasourceHDFSYarn; + message.haRm = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourcemanagerHaEnabled = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 2: + message.resourcemanagerHaAutoFailoverEnabled = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 3: + message.resourcemanagerHaAutoFailoverEmbedded = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 4: + message.resourcemanagerClusterId = reader.string(); + break; + case 5: + const entry5 = PXFDatasourceHDFSYarn_HaRmEntry.decode( + reader, + reader.uint32() + ); + if (entry5.value !== undefined) { + message.haRm[entry5.key] = entry5.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PXFDatasourceHDFSYarn { + const message = { ...basePXFDatasourceHDFSYarn } as PXFDatasourceHDFSYarn; + message.resourcemanagerHaEnabled = + object.resourcemanagerHaEnabled !== undefined && + object.resourcemanagerHaEnabled !== null + ? Boolean(object.resourcemanagerHaEnabled) + : undefined; + message.resourcemanagerHaAutoFailoverEnabled = + object.resourcemanagerHaAutoFailoverEnabled !== undefined && + object.resourcemanagerHaAutoFailoverEnabled !== null + ? Boolean(object.resourcemanagerHaAutoFailoverEnabled) + : undefined; + message.resourcemanagerHaAutoFailoverEmbedded = + object.resourcemanagerHaAutoFailoverEmbedded !== undefined && + object.resourcemanagerHaAutoFailoverEmbedded !== null + ? Boolean(object.resourcemanagerHaAutoFailoverEmbedded) + : undefined; + message.resourcemanagerClusterId = + object.resourcemanagerClusterId !== undefined && + object.resourcemanagerClusterId !== null + ? String(object.resourcemanagerClusterId) + : ""; + message.haRm = Object.entries(object.haRm ?? {}).reduce<{ + [key: string]: PXFDatasourceHDFSYarnHaRm; + }>((acc, [key, value]) => { + acc[key] = PXFDatasourceHDFSYarnHaRm.fromJSON(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: PXFDatasourceHDFSYarn): unknown { + const obj: any = {}; + message.resourcemanagerHaEnabled !== undefined && + (obj.resourcemanagerHaEnabled = message.resourcemanagerHaEnabled); + message.resourcemanagerHaAutoFailoverEnabled !== undefined && + (obj.resourcemanagerHaAutoFailoverEnabled = + message.resourcemanagerHaAutoFailoverEnabled); + message.resourcemanagerHaAutoFailoverEmbedded !== undefined && + (obj.resourcemanagerHaAutoFailoverEmbedded = + message.resourcemanagerHaAutoFailoverEmbedded); + message.resourcemanagerClusterId !== undefined && + (obj.resourcemanagerClusterId = message.resourcemanagerClusterId); + obj.haRm = {}; + if (message.haRm) { + Object.entries(message.haRm).forEach(([k, v]) => { + obj.haRm[k] = PXFDatasourceHDFSYarnHaRm.toJSON(v); + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): PXFDatasourceHDFSYarn { + const message = { ...basePXFDatasourceHDFSYarn } as PXFDatasourceHDFSYarn; + message.resourcemanagerHaEnabled = + object.resourcemanagerHaEnabled ?? undefined; + message.resourcemanagerHaAutoFailoverEnabled = + object.resourcemanagerHaAutoFailoverEnabled ?? undefined; + message.resourcemanagerHaAutoFailoverEmbedded = + object.resourcemanagerHaAutoFailoverEmbedded ?? undefined; + message.resourcemanagerClusterId = object.resourcemanagerClusterId ?? ""; + message.haRm = Object.entries(object.haRm ?? {}).reduce<{ + [key: string]: PXFDatasourceHDFSYarnHaRm; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = PXFDatasourceHDFSYarnHaRm.fromPartial(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(PXFDatasourceHDFSYarn.$type, PXFDatasourceHDFSYarn); + +const basePXFDatasourceHDFSYarn_HaRmEntry: object = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSYarn.HaRmEntry", + key: "", +}; + +export const PXFDatasourceHDFSYarn_HaRmEntry = { + $type: + "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFSYarn.HaRmEntry" as const, + + encode( + message: PXFDatasourceHDFSYarn_HaRmEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + PXFDatasourceHDFSYarnHaRm.encode( + message.value, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PXFDatasourceHDFSYarn_HaRmEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePXFDatasourceHDFSYarn_HaRmEntry, + } as PXFDatasourceHDFSYarn_HaRmEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = PXFDatasourceHDFSYarnHaRm.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PXFDatasourceHDFSYarn_HaRmEntry { + const message = { + ...basePXFDatasourceHDFSYarn_HaRmEntry, + } as PXFDatasourceHDFSYarn_HaRmEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? PXFDatasourceHDFSYarnHaRm.fromJSON(object.value) + : undefined; + return message; + }, + + toJSON(message: PXFDatasourceHDFSYarn_HaRmEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && + (obj.value = message.value + ? PXFDatasourceHDFSYarnHaRm.toJSON(message.value) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): PXFDatasourceHDFSYarn_HaRmEntry { + const message = { + ...basePXFDatasourceHDFSYarn_HaRmEntry, + } as PXFDatasourceHDFSYarn_HaRmEntry; + message.key = object.key ?? ""; + message.value = + object.value !== undefined && object.value !== null + ? PXFDatasourceHDFSYarnHaRm.fromPartial(object.value) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + PXFDatasourceHDFSYarn_HaRmEntry.$type, + PXFDatasourceHDFSYarn_HaRmEntry +); + +const basePXFDatasourceHDFS: object = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFS", + username: "", + zkHosts: "", +}; + +export const PXFDatasourceHDFS = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHDFS" as const, + + encode( + message: PXFDatasourceHDFS, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.core !== undefined) { + PXFDatasourceCore.encode(message.core, writer.uint32(10).fork()).ldelim(); + } + if (message.kerberos !== undefined) { + PXFDatasourceKerberos.encode( + message.kerberos, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.userImpersonation !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.userImpersonation!, + }, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.username !== "") { + writer.uint32(34).string(message.username); + } + if (message.saslConnectionRetries !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.saslConnectionRetries!, + }, + writer.uint32(42).fork() + ).ldelim(); + } + for (const v of message.zkHosts) { + writer.uint32(50).string(v!); + } + if (message.dfs !== undefined) { + PXFDatasourceHDFSDfs.encode( + message.dfs, + writer.uint32(58).fork() + ).ldelim(); + } + if (message.yarn !== undefined) { + PXFDatasourceHDFSYarn.encode( + message.yarn, + writer.uint32(66).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PXFDatasourceHDFS { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePXFDatasourceHDFS } as PXFDatasourceHDFS; + message.zkHosts = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.core = PXFDatasourceCore.decode(reader, reader.uint32()); + break; + case 2: + message.kerberos = PXFDatasourceKerberos.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.userImpersonation = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 4: + message.username = reader.string(); + break; + case 5: + message.saslConnectionRetries = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 6: + message.zkHosts.push(reader.string()); + break; + case 7: + message.dfs = PXFDatasourceHDFSDfs.decode(reader, reader.uint32()); + break; + case 8: + message.yarn = PXFDatasourceHDFSYarn.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PXFDatasourceHDFS { + const message = { ...basePXFDatasourceHDFS } as PXFDatasourceHDFS; + message.core = + object.core !== undefined && object.core !== null + ? PXFDatasourceCore.fromJSON(object.core) + : undefined; + message.kerberos = + object.kerberos !== undefined && object.kerberos !== null + ? PXFDatasourceKerberos.fromJSON(object.kerberos) + : undefined; + message.userImpersonation = + object.userImpersonation !== undefined && + object.userImpersonation !== null + ? Boolean(object.userImpersonation) + : undefined; + message.username = + object.username !== undefined && object.username !== null + ? String(object.username) + : ""; + message.saslConnectionRetries = + object.saslConnectionRetries !== undefined && + object.saslConnectionRetries !== null + ? Number(object.saslConnectionRetries) + : undefined; + message.zkHosts = (object.zkHosts ?? []).map((e: any) => String(e)); + message.dfs = + object.dfs !== undefined && object.dfs !== null + ? PXFDatasourceHDFSDfs.fromJSON(object.dfs) + : undefined; + message.yarn = + object.yarn !== undefined && object.yarn !== null + ? PXFDatasourceHDFSYarn.fromJSON(object.yarn) + : undefined; + return message; + }, + + toJSON(message: PXFDatasourceHDFS): unknown { + const obj: any = {}; + message.core !== undefined && + (obj.core = message.core + ? PXFDatasourceCore.toJSON(message.core) + : undefined); + message.kerberos !== undefined && + (obj.kerberos = message.kerberos + ? PXFDatasourceKerberos.toJSON(message.kerberos) + : undefined); + message.userImpersonation !== undefined && + (obj.userImpersonation = message.userImpersonation); + message.username !== undefined && (obj.username = message.username); + message.saslConnectionRetries !== undefined && + (obj.saslConnectionRetries = message.saslConnectionRetries); + if (message.zkHosts) { + obj.zkHosts = message.zkHosts.map((e) => e); + } else { + obj.zkHosts = []; + } + message.dfs !== undefined && + (obj.dfs = message.dfs + ? PXFDatasourceHDFSDfs.toJSON(message.dfs) + : undefined); + message.yarn !== undefined && + (obj.yarn = message.yarn + ? PXFDatasourceHDFSYarn.toJSON(message.yarn) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): PXFDatasourceHDFS { + const message = { ...basePXFDatasourceHDFS } as PXFDatasourceHDFS; + message.core = + object.core !== undefined && object.core !== null + ? PXFDatasourceCore.fromPartial(object.core) + : undefined; + message.kerberos = + object.kerberos !== undefined && object.kerberos !== null + ? PXFDatasourceKerberos.fromPartial(object.kerberos) + : undefined; + message.userImpersonation = object.userImpersonation ?? undefined; + message.username = object.username ?? ""; + message.saslConnectionRetries = object.saslConnectionRetries ?? undefined; + message.zkHosts = object.zkHosts?.map((e) => e) || []; + message.dfs = + object.dfs !== undefined && object.dfs !== null + ? PXFDatasourceHDFSDfs.fromPartial(object.dfs) + : undefined; + message.yarn = + object.yarn !== undefined && object.yarn !== null + ? PXFDatasourceHDFSYarn.fromPartial(object.yarn) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(PXFDatasourceHDFS.$type, PXFDatasourceHDFS); + +const basePXFDatasourceHive: object = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHive", + username: "", + zkHosts: "", + metastoreUris: "", + metastoreKerberosPrincipal: "", + authKerberosPrincipal: "", +}; + +export const PXFDatasourceHive = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasourceHive" as const, + + encode( + message: PXFDatasourceHive, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.core !== undefined) { + PXFDatasourceCore.encode(message.core, writer.uint32(10).fork()).ldelim(); + } + if (message.kerberos !== undefined) { + PXFDatasourceKerberos.encode( + message.kerberos, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.userImpersonation !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.userImpersonation!, + }, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.username !== "") { + writer.uint32(34).string(message.username); + } + if (message.saslConnectionRetries !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.saslConnectionRetries!, + }, + writer.uint32(42).fork() + ).ldelim(); + } + for (const v of message.zkHosts) { + writer.uint32(50).string(v!); + } + if (message.ppd !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.ppd! }, + writer.uint32(58).fork() + ).ldelim(); + } + for (const v of message.metastoreUris) { + writer.uint32(66).string(v!); + } + if (message.metastoreKerberosPrincipal !== "") { + writer.uint32(74).string(message.metastoreKerberosPrincipal); + } + if (message.authKerberosPrincipal !== "") { + writer.uint32(82).string(message.authKerberosPrincipal); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PXFDatasourceHive { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePXFDatasourceHive } as PXFDatasourceHive; + message.zkHosts = []; + message.metastoreUris = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.core = PXFDatasourceCore.decode(reader, reader.uint32()); + break; + case 2: + message.kerberos = PXFDatasourceKerberos.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.userImpersonation = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 4: + message.username = reader.string(); + break; + case 5: + message.saslConnectionRetries = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 6: + message.zkHosts.push(reader.string()); + break; + case 7: + message.ppd = BoolValue.decode(reader, reader.uint32()).value; + break; + case 8: + message.metastoreUris.push(reader.string()); + break; + case 9: + message.metastoreKerberosPrincipal = reader.string(); + break; + case 10: + message.authKerberosPrincipal = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PXFDatasourceHive { + const message = { ...basePXFDatasourceHive } as PXFDatasourceHive; + message.core = + object.core !== undefined && object.core !== null + ? PXFDatasourceCore.fromJSON(object.core) + : undefined; + message.kerberos = + object.kerberos !== undefined && object.kerberos !== null + ? PXFDatasourceKerberos.fromJSON(object.kerberos) + : undefined; + message.userImpersonation = + object.userImpersonation !== undefined && + object.userImpersonation !== null + ? Boolean(object.userImpersonation) + : undefined; + message.username = + object.username !== undefined && object.username !== null + ? String(object.username) + : ""; + message.saslConnectionRetries = + object.saslConnectionRetries !== undefined && + object.saslConnectionRetries !== null + ? Number(object.saslConnectionRetries) + : undefined; + message.zkHosts = (object.zkHosts ?? []).map((e: any) => String(e)); + message.ppd = + object.ppd !== undefined && object.ppd !== null + ? Boolean(object.ppd) + : undefined; + message.metastoreUris = (object.metastoreUris ?? []).map((e: any) => + String(e) + ); + message.metastoreKerberosPrincipal = + object.metastoreKerberosPrincipal !== undefined && + object.metastoreKerberosPrincipal !== null + ? String(object.metastoreKerberosPrincipal) + : ""; + message.authKerberosPrincipal = + object.authKerberosPrincipal !== undefined && + object.authKerberosPrincipal !== null + ? String(object.authKerberosPrincipal) + : ""; + return message; + }, + + toJSON(message: PXFDatasourceHive): unknown { + const obj: any = {}; + message.core !== undefined && + (obj.core = message.core + ? PXFDatasourceCore.toJSON(message.core) + : undefined); + message.kerberos !== undefined && + (obj.kerberos = message.kerberos + ? PXFDatasourceKerberos.toJSON(message.kerberos) + : undefined); + message.userImpersonation !== undefined && + (obj.userImpersonation = message.userImpersonation); + message.username !== undefined && (obj.username = message.username); + message.saslConnectionRetries !== undefined && + (obj.saslConnectionRetries = message.saslConnectionRetries); + if (message.zkHosts) { + obj.zkHosts = message.zkHosts.map((e) => e); + } else { + obj.zkHosts = []; + } + message.ppd !== undefined && (obj.ppd = message.ppd); + if (message.metastoreUris) { + obj.metastoreUris = message.metastoreUris.map((e) => e); + } else { + obj.metastoreUris = []; + } + message.metastoreKerberosPrincipal !== undefined && + (obj.metastoreKerberosPrincipal = message.metastoreKerberosPrincipal); + message.authKerberosPrincipal !== undefined && + (obj.authKerberosPrincipal = message.authKerberosPrincipal); + return obj; + }, + + fromPartial, I>>( + object: I + ): PXFDatasourceHive { + const message = { ...basePXFDatasourceHive } as PXFDatasourceHive; + message.core = + object.core !== undefined && object.core !== null + ? PXFDatasourceCore.fromPartial(object.core) + : undefined; + message.kerberos = + object.kerberos !== undefined && object.kerberos !== null + ? PXFDatasourceKerberos.fromPartial(object.kerberos) + : undefined; + message.userImpersonation = object.userImpersonation ?? undefined; + message.username = object.username ?? ""; + message.saslConnectionRetries = object.saslConnectionRetries ?? undefined; + message.zkHosts = object.zkHosts?.map((e) => e) || []; + message.ppd = object.ppd ?? undefined; + message.metastoreUris = object.metastoreUris?.map((e) => e) || []; + message.metastoreKerberosPrincipal = + object.metastoreKerberosPrincipal ?? ""; + message.authKerberosPrincipal = object.authKerberosPrincipal ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(PXFDatasourceHive.$type, PXFDatasourceHive); + +const basePXFDatasource: object = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasource", + name: "", +}; + +export const PXFDatasource = { + $type: "yandex.cloud.mdb.greenplum.v1.PXFDatasource" as const, + + encode( + message: PXFDatasource, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.s3 !== undefined) { + PXFDatasourceS3.encode(message.s3, writer.uint32(18).fork()).ldelim(); + } + if (message.jdbc !== undefined) { + PXFDatasourceJDBC.encode(message.jdbc, writer.uint32(26).fork()).ldelim(); + } + if (message.hdfs !== undefined) { + PXFDatasourceHDFS.encode(message.hdfs, writer.uint32(34).fork()).ldelim(); + } + if (message.hive !== undefined) { + PXFDatasourceHive.encode(message.hive, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PXFDatasource { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePXFDatasource } as PXFDatasource; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.s3 = PXFDatasourceS3.decode(reader, reader.uint32()); + break; + case 3: + message.jdbc = PXFDatasourceJDBC.decode(reader, reader.uint32()); + break; + case 4: + message.hdfs = PXFDatasourceHDFS.decode(reader, reader.uint32()); + break; + case 5: + message.hive = PXFDatasourceHive.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PXFDatasource { + const message = { ...basePXFDatasource } as PXFDatasource; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.s3 = + object.s3 !== undefined && object.s3 !== null + ? PXFDatasourceS3.fromJSON(object.s3) + : undefined; + message.jdbc = + object.jdbc !== undefined && object.jdbc !== null + ? PXFDatasourceJDBC.fromJSON(object.jdbc) + : undefined; + message.hdfs = + object.hdfs !== undefined && object.hdfs !== null + ? PXFDatasourceHDFS.fromJSON(object.hdfs) + : undefined; + message.hive = + object.hive !== undefined && object.hive !== null + ? PXFDatasourceHive.fromJSON(object.hive) + : undefined; + return message; + }, + + toJSON(message: PXFDatasource): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.s3 !== undefined && + (obj.s3 = message.s3 ? PXFDatasourceS3.toJSON(message.s3) : undefined); + message.jdbc !== undefined && + (obj.jdbc = message.jdbc + ? PXFDatasourceJDBC.toJSON(message.jdbc) + : undefined); + message.hdfs !== undefined && + (obj.hdfs = message.hdfs + ? PXFDatasourceHDFS.toJSON(message.hdfs) + : undefined); + message.hive !== undefined && + (obj.hive = message.hive + ? PXFDatasourceHive.toJSON(message.hive) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): PXFDatasource { + const message = { ...basePXFDatasource } as PXFDatasource; + message.name = object.name ?? ""; + message.s3 = + object.s3 !== undefined && object.s3 !== null + ? PXFDatasourceS3.fromPartial(object.s3) + : undefined; + message.jdbc = + object.jdbc !== undefined && object.jdbc !== null + ? PXFDatasourceJDBC.fromPartial(object.jdbc) + : undefined; + message.hdfs = + object.hdfs !== undefined && object.hdfs !== null + ? PXFDatasourceHDFS.fromPartial(object.hdfs) + : undefined; + message.hive = + object.hive !== undefined && object.hive !== null + ? PXFDatasourceHive.fromPartial(object.hive) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(PXFDatasource.$type, PXFDatasource); + type Builtin = | Date | Function diff --git a/src/generated/yandex/cloud/mdb/greenplum/v1/pxf_service.ts b/src/generated/yandex/cloud/mdb/greenplum/v1/pxf_service.ts new file mode 100644 index 00000000..b160d607 --- /dev/null +++ b/src/generated/yandex/cloud/mdb/greenplum/v1/pxf_service.ts @@ -0,0 +1,972 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { PXFDatasource } from "../../../../../yandex/cloud/mdb/greenplum/v1/pxf"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.mdb.greenplum.v1"; + +export interface CreatePXFDatasourceMetadata { + $type: "yandex.cloud.mdb.greenplum.v1.CreatePXFDatasourceMetadata"; + clusterId: string; + datasourceName: string; +} + +export interface UpdatePXFDatasourceMetadata { + $type: "yandex.cloud.mdb.greenplum.v1.UpdatePXFDatasourceMetadata"; + clusterId: string; + datasourceName: string; +} + +export interface DeletePXFDatasourceMetadata { + $type: "yandex.cloud.mdb.greenplum.v1.DeletePXFDatasourceMetadata"; + clusterId: string; + datasourceName: string; +} + +export interface ListPXFDatasourcesRequest { + $type: "yandex.cloud.mdb.greenplum.v1.ListPXFDatasourcesRequest"; + clusterId: string; +} + +export interface ListPXFDatasourcesResponse { + $type: "yandex.cloud.mdb.greenplum.v1.ListPXFDatasourcesResponse"; + datasources: PXFDatasource[]; +} + +export interface CreatePXFDatasourceRequest { + $type: "yandex.cloud.mdb.greenplum.v1.CreatePXFDatasourceRequest"; + clusterId: string; + datasource?: PXFDatasource; +} + +export interface UpdatePXFDatasourceRequest { + $type: "yandex.cloud.mdb.greenplum.v1.UpdatePXFDatasourceRequest"; + clusterId: string; + updateMask?: FieldMask; + datasource?: PXFDatasource; +} + +export interface DeletePXFDatasourceRequest { + $type: "yandex.cloud.mdb.greenplum.v1.DeletePXFDatasourceRequest"; + clusterId: string; + datasourceName: string; +} + +const baseCreatePXFDatasourceMetadata: object = { + $type: "yandex.cloud.mdb.greenplum.v1.CreatePXFDatasourceMetadata", + clusterId: "", + datasourceName: "", +}; + +export const CreatePXFDatasourceMetadata = { + $type: "yandex.cloud.mdb.greenplum.v1.CreatePXFDatasourceMetadata" as const, + + encode( + message: CreatePXFDatasourceMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.datasourceName !== "") { + writer.uint32(18).string(message.datasourceName); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreatePXFDatasourceMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreatePXFDatasourceMetadata, + } as CreatePXFDatasourceMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.datasourceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreatePXFDatasourceMetadata { + const message = { + ...baseCreatePXFDatasourceMetadata, + } as CreatePXFDatasourceMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.datasourceName = + object.datasourceName !== undefined && object.datasourceName !== null + ? String(object.datasourceName) + : ""; + return message; + }, + + toJSON(message: CreatePXFDatasourceMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.datasourceName !== undefined && + (obj.datasourceName = message.datasourceName); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreatePXFDatasourceMetadata { + const message = { + ...baseCreatePXFDatasourceMetadata, + } as CreatePXFDatasourceMetadata; + message.clusterId = object.clusterId ?? ""; + message.datasourceName = object.datasourceName ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreatePXFDatasourceMetadata.$type, + CreatePXFDatasourceMetadata +); + +const baseUpdatePXFDatasourceMetadata: object = { + $type: "yandex.cloud.mdb.greenplum.v1.UpdatePXFDatasourceMetadata", + clusterId: "", + datasourceName: "", +}; + +export const UpdatePXFDatasourceMetadata = { + $type: "yandex.cloud.mdb.greenplum.v1.UpdatePXFDatasourceMetadata" as const, + + encode( + message: UpdatePXFDatasourceMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.datasourceName !== "") { + writer.uint32(18).string(message.datasourceName); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdatePXFDatasourceMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdatePXFDatasourceMetadata, + } as UpdatePXFDatasourceMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.datasourceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdatePXFDatasourceMetadata { + const message = { + ...baseUpdatePXFDatasourceMetadata, + } as UpdatePXFDatasourceMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.datasourceName = + object.datasourceName !== undefined && object.datasourceName !== null + ? String(object.datasourceName) + : ""; + return message; + }, + + toJSON(message: UpdatePXFDatasourceMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.datasourceName !== undefined && + (obj.datasourceName = message.datasourceName); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdatePXFDatasourceMetadata { + const message = { + ...baseUpdatePXFDatasourceMetadata, + } as UpdatePXFDatasourceMetadata; + message.clusterId = object.clusterId ?? ""; + message.datasourceName = object.datasourceName ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdatePXFDatasourceMetadata.$type, + UpdatePXFDatasourceMetadata +); + +const baseDeletePXFDatasourceMetadata: object = { + $type: "yandex.cloud.mdb.greenplum.v1.DeletePXFDatasourceMetadata", + clusterId: "", + datasourceName: "", +}; + +export const DeletePXFDatasourceMetadata = { + $type: "yandex.cloud.mdb.greenplum.v1.DeletePXFDatasourceMetadata" as const, + + encode( + message: DeletePXFDatasourceMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.datasourceName !== "") { + writer.uint32(18).string(message.datasourceName); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeletePXFDatasourceMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeletePXFDatasourceMetadata, + } as DeletePXFDatasourceMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.datasourceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeletePXFDatasourceMetadata { + const message = { + ...baseDeletePXFDatasourceMetadata, + } as DeletePXFDatasourceMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.datasourceName = + object.datasourceName !== undefined && object.datasourceName !== null + ? String(object.datasourceName) + : ""; + return message; + }, + + toJSON(message: DeletePXFDatasourceMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.datasourceName !== undefined && + (obj.datasourceName = message.datasourceName); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeletePXFDatasourceMetadata { + const message = { + ...baseDeletePXFDatasourceMetadata, + } as DeletePXFDatasourceMetadata; + message.clusterId = object.clusterId ?? ""; + message.datasourceName = object.datasourceName ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeletePXFDatasourceMetadata.$type, + DeletePXFDatasourceMetadata +); + +const baseListPXFDatasourcesRequest: object = { + $type: "yandex.cloud.mdb.greenplum.v1.ListPXFDatasourcesRequest", + clusterId: "", +}; + +export const ListPXFDatasourcesRequest = { + $type: "yandex.cloud.mdb.greenplum.v1.ListPXFDatasourcesRequest" as const, + + encode( + message: ListPXFDatasourcesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListPXFDatasourcesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListPXFDatasourcesRequest, + } as ListPXFDatasourcesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPXFDatasourcesRequest { + const message = { + ...baseListPXFDatasourcesRequest, + } as ListPXFDatasourcesRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: ListPXFDatasourcesRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListPXFDatasourcesRequest { + const message = { + ...baseListPXFDatasourcesRequest, + } as ListPXFDatasourcesRequest; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListPXFDatasourcesRequest.$type, + ListPXFDatasourcesRequest +); + +const baseListPXFDatasourcesResponse: object = { + $type: "yandex.cloud.mdb.greenplum.v1.ListPXFDatasourcesResponse", +}; + +export const ListPXFDatasourcesResponse = { + $type: "yandex.cloud.mdb.greenplum.v1.ListPXFDatasourcesResponse" as const, + + encode( + message: ListPXFDatasourcesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.datasources) { + PXFDatasource.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListPXFDatasourcesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListPXFDatasourcesResponse, + } as ListPXFDatasourcesResponse; + message.datasources = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.datasources.push( + PXFDatasource.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPXFDatasourcesResponse { + const message = { + ...baseListPXFDatasourcesResponse, + } as ListPXFDatasourcesResponse; + message.datasources = (object.datasources ?? []).map((e: any) => + PXFDatasource.fromJSON(e) + ); + return message; + }, + + toJSON(message: ListPXFDatasourcesResponse): unknown { + const obj: any = {}; + if (message.datasources) { + obj.datasources = message.datasources.map((e) => + e ? PXFDatasource.toJSON(e) : undefined + ); + } else { + obj.datasources = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ListPXFDatasourcesResponse { + const message = { + ...baseListPXFDatasourcesResponse, + } as ListPXFDatasourcesResponse; + message.datasources = + object.datasources?.map((e) => PXFDatasource.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + ListPXFDatasourcesResponse.$type, + ListPXFDatasourcesResponse +); + +const baseCreatePXFDatasourceRequest: object = { + $type: "yandex.cloud.mdb.greenplum.v1.CreatePXFDatasourceRequest", + clusterId: "", +}; + +export const CreatePXFDatasourceRequest = { + $type: "yandex.cloud.mdb.greenplum.v1.CreatePXFDatasourceRequest" as const, + + encode( + message: CreatePXFDatasourceRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.datasource !== undefined) { + PXFDatasource.encode( + message.datasource, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreatePXFDatasourceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreatePXFDatasourceRequest, + } as CreatePXFDatasourceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.datasource = PXFDatasource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreatePXFDatasourceRequest { + const message = { + ...baseCreatePXFDatasourceRequest, + } as CreatePXFDatasourceRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.datasource = + object.datasource !== undefined && object.datasource !== null + ? PXFDatasource.fromJSON(object.datasource) + : undefined; + return message; + }, + + toJSON(message: CreatePXFDatasourceRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.datasource !== undefined && + (obj.datasource = message.datasource + ? PXFDatasource.toJSON(message.datasource) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreatePXFDatasourceRequest { + const message = { + ...baseCreatePXFDatasourceRequest, + } as CreatePXFDatasourceRequest; + message.clusterId = object.clusterId ?? ""; + message.datasource = + object.datasource !== undefined && object.datasource !== null + ? PXFDatasource.fromPartial(object.datasource) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + CreatePXFDatasourceRequest.$type, + CreatePXFDatasourceRequest +); + +const baseUpdatePXFDatasourceRequest: object = { + $type: "yandex.cloud.mdb.greenplum.v1.UpdatePXFDatasourceRequest", + clusterId: "", +}; + +export const UpdatePXFDatasourceRequest = { + $type: "yandex.cloud.mdb.greenplum.v1.UpdatePXFDatasourceRequest" as const, + + encode( + message: UpdatePXFDatasourceRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.datasource !== undefined) { + PXFDatasource.encode( + message.datasource, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdatePXFDatasourceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdatePXFDatasourceRequest, + } as UpdatePXFDatasourceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.datasource = PXFDatasource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdatePXFDatasourceRequest { + const message = { + ...baseUpdatePXFDatasourceRequest, + } as UpdatePXFDatasourceRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.datasource = + object.datasource !== undefined && object.datasource !== null + ? PXFDatasource.fromJSON(object.datasource) + : undefined; + return message; + }, + + toJSON(message: UpdatePXFDatasourceRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.datasource !== undefined && + (obj.datasource = message.datasource + ? PXFDatasource.toJSON(message.datasource) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdatePXFDatasourceRequest { + const message = { + ...baseUpdatePXFDatasourceRequest, + } as UpdatePXFDatasourceRequest; + message.clusterId = object.clusterId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.datasource = + object.datasource !== undefined && object.datasource !== null + ? PXFDatasource.fromPartial(object.datasource) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + UpdatePXFDatasourceRequest.$type, + UpdatePXFDatasourceRequest +); + +const baseDeletePXFDatasourceRequest: object = { + $type: "yandex.cloud.mdb.greenplum.v1.DeletePXFDatasourceRequest", + clusterId: "", + datasourceName: "", +}; + +export const DeletePXFDatasourceRequest = { + $type: "yandex.cloud.mdb.greenplum.v1.DeletePXFDatasourceRequest" as const, + + encode( + message: DeletePXFDatasourceRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.datasourceName !== "") { + writer.uint32(18).string(message.datasourceName); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeletePXFDatasourceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeletePXFDatasourceRequest, + } as DeletePXFDatasourceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.datasourceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeletePXFDatasourceRequest { + const message = { + ...baseDeletePXFDatasourceRequest, + } as DeletePXFDatasourceRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.datasourceName = + object.datasourceName !== undefined && object.datasourceName !== null + ? String(object.datasourceName) + : ""; + return message; + }, + + toJSON(message: DeletePXFDatasourceRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.datasourceName !== undefined && + (obj.datasourceName = message.datasourceName); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeletePXFDatasourceRequest { + const message = { + ...baseDeletePXFDatasourceRequest, + } as DeletePXFDatasourceRequest; + message.clusterId = object.clusterId ?? ""; + message.datasourceName = object.datasourceName ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeletePXFDatasourceRequest.$type, + DeletePXFDatasourceRequest +); + +export const PXFDatasourceServiceService = { + /** List all PXF datasources */ + list: { + path: "/yandex.cloud.mdb.greenplum.v1.PXFDatasourceService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListPXFDatasourcesRequest) => + Buffer.from(ListPXFDatasourcesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListPXFDatasourcesRequest.decode(value), + responseSerialize: (value: ListPXFDatasourcesResponse) => + Buffer.from(ListPXFDatasourcesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListPXFDatasourcesResponse.decode(value), + }, + /** Creates PXF datasource */ + create: { + path: "/yandex.cloud.mdb.greenplum.v1.PXFDatasourceService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreatePXFDatasourceRequest) => + Buffer.from(CreatePXFDatasourceRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CreatePXFDatasourceRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Update PXF datasource */ + update: { + path: "/yandex.cloud.mdb.greenplum.v1.PXFDatasourceService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdatePXFDatasourceRequest) => + Buffer.from(UpdatePXFDatasourceRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdatePXFDatasourceRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Delete PXF datasource */ + delete: { + path: "/yandex.cloud.mdb.greenplum.v1.PXFDatasourceService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeletePXFDatasourceRequest) => + Buffer.from(DeletePXFDatasourceRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeletePXFDatasourceRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface PXFDatasourceServiceServer + extends UntypedServiceImplementation { + /** List all PXF datasources */ + list: handleUnaryCall; + /** Creates PXF datasource */ + create: handleUnaryCall; + /** Update PXF datasource */ + update: handleUnaryCall; + /** Delete PXF datasource */ + delete: handleUnaryCall; +} + +export interface PXFDatasourceServiceClient extends Client { + /** List all PXF datasources */ + list( + request: ListPXFDatasourcesRequest, + callback: ( + error: ServiceError | null, + response: ListPXFDatasourcesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListPXFDatasourcesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListPXFDatasourcesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListPXFDatasourcesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListPXFDatasourcesResponse + ) => void + ): ClientUnaryCall; + /** Creates PXF datasource */ + create( + request: CreatePXFDatasourceRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreatePXFDatasourceRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreatePXFDatasourceRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Update PXF datasource */ + update( + request: UpdatePXFDatasourceRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdatePXFDatasourceRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdatePXFDatasourceRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Delete PXF datasource */ + delete( + request: DeletePXFDatasourceRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeletePXFDatasourceRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeletePXFDatasourceRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const PXFDatasourceServiceClient = makeGenericClientConstructor( + PXFDatasourceServiceService, + "yandex.cloud.mdb.greenplum.v1.PXFDatasourceService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): PXFDatasourceServiceClient; + service: typeof PXFDatasourceServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/mdb/index.ts b/src/generated/yandex/cloud/mdb/index.ts index ab2c2123..8d0b3a89 100644 --- a/src/generated/yandex/cloud/mdb/index.ts +++ b/src/generated/yandex/cloud/mdb/index.ts @@ -1,164 +1,168 @@ -export * as clickhouse_backup from './clickhouse/v1/backup' -export * as clickhouse_backup_service from './clickhouse/v1/backup_service' -export * as clickhouse_cluster from './clickhouse/v1/cluster' -export * as clickhouse_cluster_service from './clickhouse/v1/cluster_service' -export * as clickhouse_database from './clickhouse/v1/database' -export * as clickhouse_database_service from './clickhouse/v1/database_service' -export * as clickhouse_format_schema from './clickhouse/v1/format_schema' -export * as clickhouse_format_schema_service from './clickhouse/v1/format_schema_service' -export * as clickhouse_maintenance from './clickhouse/v1/maintenance' -export * as clickhouse_ml_model from './clickhouse/v1/ml_model' -export * as clickhouse_ml_model_service from './clickhouse/v1/ml_model_service' -export * as clickhouse_resource_preset from './clickhouse/v1/resource_preset' -export * as clickhouse_resource_preset_service from './clickhouse/v1/resource_preset_service' -export * as clickhouse_user from './clickhouse/v1/user' -export * as clickhouse_user_service from './clickhouse/v1/user_service' -export * as clickhouse_version from './clickhouse/v1/version' -export * as clickhouse_versions_service from './clickhouse/v1/versions_service' -export * as elasticsearch_auth from './elasticsearch/v1/auth' -export * as elasticsearch_auth_service from './elasticsearch/v1/auth_service' -export * as elasticsearch_backup from './elasticsearch/v1/backup' -export * as elasticsearch_backup_service from './elasticsearch/v1/backup_service' -export * as elasticsearch_cluster from './elasticsearch/v1/cluster' -export * as elasticsearch_cluster_service from './elasticsearch/v1/cluster_service' -export * as elasticsearch_extension from './elasticsearch/v1/extension' -export * as elasticsearch_extension_service from './elasticsearch/v1/extension_service' -export * as elasticsearch_maintenance from './elasticsearch/v1/maintenance' -export * as elasticsearch_resource_preset from './elasticsearch/v1/resource_preset' -export * as elasticsearch_resource_preset_service from './elasticsearch/v1/resource_preset_service' -export * as elasticsearch_user from './elasticsearch/v1/user' -export * as elasticsearch_user_service from './elasticsearch/v1/user_service' -export * as greenplum_backup from './greenplum/v1/backup' -export * as greenplum_backup_service from './greenplum/v1/backup_service' -export * as greenplum_cluster from './greenplum/v1/cluster' -export * as greenplum_cluster_service from './greenplum/v1/cluster_service' -export * as greenplum_config from './greenplum/v1/config' -export * as greenplum_host from './greenplum/v1/host' -export * as greenplum_maintenance from './greenplum/v1/maintenance' -export * as greenplum_pxf from './greenplum/v1/pxf' -export * as greenplum_resource_preset from './greenplum/v1/resource_preset' -export * as greenplum_resource_preset_service from './greenplum/v1/resource_preset_service' -export * as kafka_cluster from './kafka/v1/cluster' -export * as kafka_cluster_service from './kafka/v1/cluster_service' -export * as kafka_common from './kafka/v1/common' -export * as kafka_connector from './kafka/v1/connector' -export * as kafka_connector_service from './kafka/v1/connector_service' -export * as kafka_maintenance from './kafka/v1/maintenance' -export * as kafka_resource_preset from './kafka/v1/resource_preset' -export * as kafka_resource_preset_service from './kafka/v1/resource_preset_service' -export * as kafka_topic from './kafka/v1/topic' -export * as kafka_topic_service from './kafka/v1/topic_service' -export * as kafka_user from './kafka/v1/user' -export * as kafka_user_service from './kafka/v1/user_service' -export * as mongodb_backup from './mongodb/v1/backup' -export * as mongodb_backup_service from './mongodb/v1/backup_service' -export * as mongodb_cluster from './mongodb/v1/cluster' -export * as mongodb_cluster_service from './mongodb/v1/cluster_service' -export * as mongodb_database from './mongodb/v1/database' -export * as mongodb_database_service from './mongodb/v1/database_service' -export * as mongodb_maintenance from './mongodb/v1/maintenance' -export * as mongodb_resource_preset from './mongodb/v1/resource_preset' -export * as mongodb_resource_preset_service from './mongodb/v1/resource_preset_service' -export * as mongodb_user from './mongodb/v1/user' -export * as mongodb_user_service from './mongodb/v1/user_service' -export * as mysql_backup from './mysql/v1/backup' -export * as mysql_backup_service from './mysql/v1/backup_service' -export * as mysql_cluster from './mysql/v1/cluster' -export * as mysql_cluster_service from './mysql/v1/cluster_service' -export * as mysql_database from './mysql/v1/database' -export * as mysql_database_service from './mysql/v1/database_service' -export * as mysql_maintenance from './mysql/v1/maintenance' -export * as mysql_resource_preset from './mysql/v1/resource_preset' -export * as mysql_resource_preset_service from './mysql/v1/resource_preset_service' -export * as mysql_user from './mysql/v1/user' -export * as mysql_user_service from './mysql/v1/user_service' -export * as opensearch_auth from './opensearch/v1/auth' -export * as opensearch_backup from './opensearch/v1/backup' -export * as opensearch_backup_service from './opensearch/v1/backup_service' -export * as opensearch_cluster from './opensearch/v1/cluster' -export * as opensearch_cluster_service from './opensearch/v1/cluster_service' -export * as opensearch_maintenance from './opensearch/v1/maintenance' -export * as opensearch_resource_preset from './opensearch/v1/resource_preset' -export * as opensearch_resource_preset_service from './opensearch/v1/resource_preset_service' -export * as postgresql_backup from './postgresql/v1/backup' -export * as postgresql_backup_service from './postgresql/v1/backup_service' -export * as postgresql_cluster from './postgresql/v1/cluster' -export * as postgresql_cluster_service from './postgresql/v1/cluster_service' -export * as postgresql_database from './postgresql/v1/database' -export * as postgresql_database_service from './postgresql/v1/database_service' -export * as postgresql_maintenance from './postgresql/v1/maintenance' -export * as postgresql_perf_diag from './postgresql/v1/perf_diag' -export * as postgresql_perf_diag_service from './postgresql/v1/perf_diag_service' -export * as postgresql_resource_preset from './postgresql/v1/resource_preset' -export * as postgresql_resource_preset_service from './postgresql/v1/resource_preset_service' -export * as postgresql_user from './postgresql/v1/user' -export * as postgresql_user_service from './postgresql/v1/user_service' -export * as redis_backup from './redis/v1/backup' -export * as redis_backup_service from './redis/v1/backup_service' -export * as redis_cluster from './redis/v1/cluster' -export * as redis_cluster_service from './redis/v1/cluster_service' -export * as redis_maintenance from './redis/v1/maintenance' -export * as redis_resource_preset from './redis/v1/resource_preset' -export * as redis_resource_preset_service from './redis/v1/resource_preset_service' -export * as sqlserver_backup from './sqlserver/v1/backup' -export * as sqlserver_backup_service from './sqlserver/v1/backup_service' -export * as sqlserver_cluster from './sqlserver/v1/cluster' -export * as sqlserver_cluster_service from './sqlserver/v1/cluster_service' -export * as sqlserver_database from './sqlserver/v1/database' -export * as sqlserver_database_service from './sqlserver/v1/database_service' -export * as sqlserver_resource_preset from './sqlserver/v1/resource_preset' -export * as sqlserver_resource_preset_service from './sqlserver/v1/resource_preset_service' -export * as sqlserver_user from './sqlserver/v1/user' -export * as sqlserver_user_service from './sqlserver/v1/user_service' -export * as clickhouse from './clickhouse/v1/config/clickhouse' -export * as elasticsearch from './elasticsearch/v1/config/elasticsearch' -export * as mongodb_mongodb3_6 from './mongodb/v1/config/mongodb3_6' -export * as mongodb_mongodb4_0 from './mongodb/v1/config/mongodb4_0' -export * as mongodb_mongodb4_2 from './mongodb/v1/config/mongodb4_2' -export * as mongodb_mongodb4_4 from './mongodb/v1/config/mongodb4_4' -export * as mongodb_mongodb4_4_enterprise from './mongodb/v1/config/mongodb4_4_enterprise' -export * as mongodb_mongodb5_0 from './mongodb/v1/config/mongodb5_0' -export * as mongodb_mongodb5_0_enterprise from './mongodb/v1/config/mongodb5_0_enterprise' -export * as mongodb_mongodb6_0 from './mongodb/v1/config/mongodb6_0' -export * as mongodb_mongodb6_0_enterprise from './mongodb/v1/config/mongodb6_0_enterprise' -export * as mysql_mysql5_7 from './mysql/v1/config/mysql5_7' -export * as mysql_mysql8_0 from './mysql/v1/config/mysql8_0' -export * as opensearch from './opensearch/v1/config/opensearch' -export * as postgresql_host10 from './postgresql/v1/config/host10' -export * as postgresql_host10_1c from './postgresql/v1/config/host10_1c' -export * as postgresql_host11 from './postgresql/v1/config/host11' -export * as postgresql_host11_1c from './postgresql/v1/config/host11_1c' -export * as postgresql_host12 from './postgresql/v1/config/host12' -export * as postgresql_host12_1c from './postgresql/v1/config/host12_1c' -export * as postgresql_host13 from './postgresql/v1/config/host13' -export * as postgresql_host13_1c from './postgresql/v1/config/host13_1c' -export * as postgresql_host14 from './postgresql/v1/config/host14' -export * as postgresql_host14_1c from './postgresql/v1/config/host14_1c' -export * as postgresql_host15 from './postgresql/v1/config/host15' -export * as postgresql_host15_1c from './postgresql/v1/config/host15_1c' -export * as postgresql_host16 from './postgresql/v1/config/host16' -export * as postgresql_host16_1c from './postgresql/v1/config/host16_1c' -export * as postgresql_host9_6 from './postgresql/v1/config/host9_6' -export * as postgresql_postgresql10 from './postgresql/v1/config/postgresql10' -export * as postgresql_postgresql10_1c from './postgresql/v1/config/postgresql10_1c' -export * as postgresql_postgresql11 from './postgresql/v1/config/postgresql11' -export * as postgresql_postgresql11_1c from './postgresql/v1/config/postgresql11_1c' -export * as postgresql_postgresql12 from './postgresql/v1/config/postgresql12' -export * as postgresql_postgresql12_1c from './postgresql/v1/config/postgresql12_1c' -export * as postgresql_postgresql13 from './postgresql/v1/config/postgresql13' -export * as postgresql_postgresql13_1c from './postgresql/v1/config/postgresql13_1c' -export * as postgresql_postgresql14 from './postgresql/v1/config/postgresql14' -export * as postgresql_postgresql14_1c from './postgresql/v1/config/postgresql14_1c' -export * as postgresql_postgresql15 from './postgresql/v1/config/postgresql15' -export * as postgresql_postgresql15_1c from './postgresql/v1/config/postgresql15_1c' -export * as postgresql_postgresql16 from './postgresql/v1/config/postgresql16' -export * as postgresql_postgresql16_1c from './postgresql/v1/config/postgresql16_1c' -export * as postgresql_postgresql9_6 from './postgresql/v1/config/postgresql9_6' -export * as redis from './redis/v1/config/redis' -export * as redis_redis5_0 from './redis/v1/config/redis5_0' -export * as redis_redis6_0 from './redis/v1/config/redis6_0' -export * as redis_redis6_2 from './redis/v1/config/redis6_2' -export * as redis_redis7_0 from './redis/v1/config/redis7_0' -export * as sqlserver_sqlserver2016sp2 from './sqlserver/v1/config/sqlserver2016sp2' -export * as sqlserver_sqlserver2017 from './sqlserver/v1/config/sqlserver2017' -export * as sqlserver_sqlserver2019 from './sqlserver/v1/config/sqlserver2019' \ No newline at end of file +export * as clickhouse_v1_backup from './clickhouse/v1/backup' +export * as clickhouse_v1_backup_service from './clickhouse/v1/backup_service' +export * as clickhouse_v1_cluster from './clickhouse/v1/cluster' +export * as clickhouse_v1_cluster_service from './clickhouse/v1/cluster_service' +export * as clickhouse_v1_database from './clickhouse/v1/database' +export * as clickhouse_v1_database_service from './clickhouse/v1/database_service' +export * as clickhouse_v1_format_schema from './clickhouse/v1/format_schema' +export * as clickhouse_v1_format_schema_service from './clickhouse/v1/format_schema_service' +export * as clickhouse_v1_maintenance from './clickhouse/v1/maintenance' +export * as clickhouse_v1_ml_model from './clickhouse/v1/ml_model' +export * as clickhouse_v1_ml_model_service from './clickhouse/v1/ml_model_service' +export * as clickhouse_v1_resource_preset from './clickhouse/v1/resource_preset' +export * as clickhouse_v1_resource_preset_service from './clickhouse/v1/resource_preset_service' +export * as clickhouse_v1_user from './clickhouse/v1/user' +export * as clickhouse_v1_user_service from './clickhouse/v1/user_service' +export * as clickhouse_v1_version from './clickhouse/v1/version' +export * as clickhouse_v1_versions_service from './clickhouse/v1/versions_service' +export * as elasticsearch_v1_auth from './elasticsearch/v1/auth' +export * as elasticsearch_v1_auth_service from './elasticsearch/v1/auth_service' +export * as elasticsearch_v1_backup from './elasticsearch/v1/backup' +export * as elasticsearch_v1_backup_service from './elasticsearch/v1/backup_service' +export * as elasticsearch_v1_cluster from './elasticsearch/v1/cluster' +export * as elasticsearch_v1_cluster_service from './elasticsearch/v1/cluster_service' +export * as elasticsearch_v1_extension from './elasticsearch/v1/extension' +export * as elasticsearch_v1_extension_service from './elasticsearch/v1/extension_service' +export * as elasticsearch_v1_maintenance from './elasticsearch/v1/maintenance' +export * as elasticsearch_v1_resource_preset from './elasticsearch/v1/resource_preset' +export * as elasticsearch_v1_resource_preset_service from './elasticsearch/v1/resource_preset_service' +export * as elasticsearch_v1_user from './elasticsearch/v1/user' +export * as elasticsearch_v1_user_service from './elasticsearch/v1/user_service' +export * as greenplum_v1_backup from './greenplum/v1/backup' +export * as greenplum_v1_backup_service from './greenplum/v1/backup_service' +export * as greenplum_v1_cluster from './greenplum/v1/cluster' +export * as greenplum_v1_cluster_service from './greenplum/v1/cluster_service' +export * as greenplum_v1_config from './greenplum/v1/config' +export * as greenplum_v1_hba_rule from './greenplum/v1/hba_rule' +export * as greenplum_v1_hba_rule_service from './greenplum/v1/hba_rule_service' +export * as greenplum_v1_host from './greenplum/v1/host' +export * as greenplum_v1_maintenance from './greenplum/v1/maintenance' +export * as greenplum_v1_pxf from './greenplum/v1/pxf' +export * as greenplum_v1_pxf_service from './greenplum/v1/pxf_service' +export * as greenplum_v1_resource_preset from './greenplum/v1/resource_preset' +export * as greenplum_v1_resource_preset_service from './greenplum/v1/resource_preset_service' +export * as kafka_v1_cluster from './kafka/v1/cluster' +export * as kafka_v1_cluster_service from './kafka/v1/cluster_service' +export * as kafka_v1_common from './kafka/v1/common' +export * as kafka_v1_connector from './kafka/v1/connector' +export * as kafka_v1_connector_service from './kafka/v1/connector_service' +export * as kafka_v1_maintenance from './kafka/v1/maintenance' +export * as kafka_v1_resource_preset from './kafka/v1/resource_preset' +export * as kafka_v1_resource_preset_service from './kafka/v1/resource_preset_service' +export * as kafka_v1_topic from './kafka/v1/topic' +export * as kafka_v1_topic_service from './kafka/v1/topic_service' +export * as kafka_v1_user from './kafka/v1/user' +export * as kafka_v1_user_service from './kafka/v1/user_service' +export * as mongodb_v1_backup from './mongodb/v1/backup' +export * as mongodb_v1_backup_service from './mongodb/v1/backup_service' +export * as mongodb_v1_cluster from './mongodb/v1/cluster' +export * as mongodb_v1_cluster_service from './mongodb/v1/cluster_service' +export * as mongodb_v1_database from './mongodb/v1/database' +export * as mongodb_v1_database_service from './mongodb/v1/database_service' +export * as mongodb_v1_maintenance from './mongodb/v1/maintenance' +export * as mongodb_v1_resource_preset from './mongodb/v1/resource_preset' +export * as mongodb_v1_resource_preset_service from './mongodb/v1/resource_preset_service' +export * as mongodb_v1_user from './mongodb/v1/user' +export * as mongodb_v1_user_service from './mongodb/v1/user_service' +export * as mysql_v1_backup from './mysql/v1/backup' +export * as mysql_v1_backup_service from './mysql/v1/backup_service' +export * as mysql_v1_cluster from './mysql/v1/cluster' +export * as mysql_v1_cluster_service from './mysql/v1/cluster_service' +export * as mysql_v1_database from './mysql/v1/database' +export * as mysql_v1_database_service from './mysql/v1/database_service' +export * as mysql_v1_maintenance from './mysql/v1/maintenance' +export * as mysql_v1_resource_preset from './mysql/v1/resource_preset' +export * as mysql_v1_resource_preset_service from './mysql/v1/resource_preset_service' +export * as mysql_v1_user from './mysql/v1/user' +export * as mysql_v1_user_service from './mysql/v1/user_service' +export * as opensearch_v1_auth from './opensearch/v1/auth' +export * as opensearch_v1_backup from './opensearch/v1/backup' +export * as opensearch_v1_backup_service from './opensearch/v1/backup_service' +export * as opensearch_v1_cluster from './opensearch/v1/cluster' +export * as opensearch_v1_cluster_service from './opensearch/v1/cluster_service' +export * as opensearch_v1_maintenance from './opensearch/v1/maintenance' +export * as opensearch_v1_resource_preset from './opensearch/v1/resource_preset' +export * as opensearch_v1_resource_preset_service from './opensearch/v1/resource_preset_service' +export * as postgresql_v1_backup from './postgresql/v1/backup' +export * as postgresql_v1_backup_service from './postgresql/v1/backup_service' +export * as postgresql_v1_cluster from './postgresql/v1/cluster' +export * as postgresql_v1_cluster_service from './postgresql/v1/cluster_service' +export * as postgresql_v1_database from './postgresql/v1/database' +export * as postgresql_v1_database_service from './postgresql/v1/database_service' +export * as postgresql_v1_maintenance from './postgresql/v1/maintenance' +export * as postgresql_v1_perf_diag from './postgresql/v1/perf_diag' +export * as postgresql_v1_perf_diag_service from './postgresql/v1/perf_diag_service' +export * as postgresql_v1_resource_preset from './postgresql/v1/resource_preset' +export * as postgresql_v1_resource_preset_service from './postgresql/v1/resource_preset_service' +export * as postgresql_v1_user from './postgresql/v1/user' +export * as postgresql_v1_user_service from './postgresql/v1/user_service' +export * as redis_v1_backup from './redis/v1/backup' +export * as redis_v1_backup_service from './redis/v1/backup_service' +export * as redis_v1_cluster from './redis/v1/cluster' +export * as redis_v1_cluster_service from './redis/v1/cluster_service' +export * as redis_v1_maintenance from './redis/v1/maintenance' +export * as redis_v1_resource_preset from './redis/v1/resource_preset' +export * as redis_v1_resource_preset_service from './redis/v1/resource_preset_service' +export * as sqlserver_v1_backup from './sqlserver/v1/backup' +export * as sqlserver_v1_backup_service from './sqlserver/v1/backup_service' +export * as sqlserver_v1_cluster from './sqlserver/v1/cluster' +export * as sqlserver_v1_cluster_service from './sqlserver/v1/cluster_service' +export * as sqlserver_v1_database from './sqlserver/v1/database' +export * as sqlserver_v1_database_service from './sqlserver/v1/database_service' +export * as sqlserver_v1_resource_preset from './sqlserver/v1/resource_preset' +export * as sqlserver_v1_resource_preset_service from './sqlserver/v1/resource_preset_service' +export * as sqlserver_v1_user from './sqlserver/v1/user' +export * as sqlserver_v1_user_service from './sqlserver/v1/user_service' +export * as clickhouse_v1_config_clickhouse from './clickhouse/v1/config/clickhouse' +export * as elasticsearch_v1_config_elasticsearch from './elasticsearch/v1/config/elasticsearch' +export * as mongodb_v1_config_mongodb from './mongodb/v1/config/mongodb' +export * as mongodb_v1_config_mongodb3_6 from './mongodb/v1/config/mongodb3_6' +export * as mongodb_v1_config_mongodb4_0 from './mongodb/v1/config/mongodb4_0' +export * as mongodb_v1_config_mongodb4_2 from './mongodb/v1/config/mongodb4_2' +export * as mongodb_v1_config_mongodb4_4 from './mongodb/v1/config/mongodb4_4' +export * as mongodb_v1_config_mongodb4_4_enterprise from './mongodb/v1/config/mongodb4_4_enterprise' +export * as mongodb_v1_config_mongodb5_0 from './mongodb/v1/config/mongodb5_0' +export * as mongodb_v1_config_mongodb5_0_enterprise from './mongodb/v1/config/mongodb5_0_enterprise' +export * as mongodb_v1_config_mongodb6_0 from './mongodb/v1/config/mongodb6_0' +export * as mongodb_v1_config_mongodb6_0_enterprise from './mongodb/v1/config/mongodb6_0_enterprise' +export * as mysql_v1_config_mysql5_7 from './mysql/v1/config/mysql5_7' +export * as mysql_v1_config_mysql8_0 from './mysql/v1/config/mysql8_0' +export * as opensearch_v1_config_opensearch from './opensearch/v1/config/opensearch' +export * as postgresql_v1_config_host10 from './postgresql/v1/config/host10' +export * as postgresql_v1_config_host10_1c from './postgresql/v1/config/host10_1c' +export * as postgresql_v1_config_host11 from './postgresql/v1/config/host11' +export * as postgresql_v1_config_host11_1c from './postgresql/v1/config/host11_1c' +export * as postgresql_v1_config_host12 from './postgresql/v1/config/host12' +export * as postgresql_v1_config_host12_1c from './postgresql/v1/config/host12_1c' +export * as postgresql_v1_config_host13 from './postgresql/v1/config/host13' +export * as postgresql_v1_config_host13_1c from './postgresql/v1/config/host13_1c' +export * as postgresql_v1_config_host14 from './postgresql/v1/config/host14' +export * as postgresql_v1_config_host14_1c from './postgresql/v1/config/host14_1c' +export * as postgresql_v1_config_host15 from './postgresql/v1/config/host15' +export * as postgresql_v1_config_host15_1c from './postgresql/v1/config/host15_1c' +export * as postgresql_v1_config_host16 from './postgresql/v1/config/host16' +export * as postgresql_v1_config_host16_1c from './postgresql/v1/config/host16_1c' +export * as postgresql_v1_config_host9_6 from './postgresql/v1/config/host9_6' +export * as postgresql_v1_config_postgresql10 from './postgresql/v1/config/postgresql10' +export * as postgresql_v1_config_postgresql10_1c from './postgresql/v1/config/postgresql10_1c' +export * as postgresql_v1_config_postgresql11 from './postgresql/v1/config/postgresql11' +export * as postgresql_v1_config_postgresql11_1c from './postgresql/v1/config/postgresql11_1c' +export * as postgresql_v1_config_postgresql12 from './postgresql/v1/config/postgresql12' +export * as postgresql_v1_config_postgresql12_1c from './postgresql/v1/config/postgresql12_1c' +export * as postgresql_v1_config_postgresql13 from './postgresql/v1/config/postgresql13' +export * as postgresql_v1_config_postgresql13_1c from './postgresql/v1/config/postgresql13_1c' +export * as postgresql_v1_config_postgresql14 from './postgresql/v1/config/postgresql14' +export * as postgresql_v1_config_postgresql14_1c from './postgresql/v1/config/postgresql14_1c' +export * as postgresql_v1_config_postgresql15 from './postgresql/v1/config/postgresql15' +export * as postgresql_v1_config_postgresql15_1c from './postgresql/v1/config/postgresql15_1c' +export * as postgresql_v1_config_postgresql16 from './postgresql/v1/config/postgresql16' +export * as postgresql_v1_config_postgresql16_1c from './postgresql/v1/config/postgresql16_1c' +export * as postgresql_v1_config_postgresql9_6 from './postgresql/v1/config/postgresql9_6' +export * as redis_v1_config_redis from './redis/v1/config/redis' +export * as redis_v1_config_redis5_0 from './redis/v1/config/redis5_0' +export * as redis_v1_config_redis6_0 from './redis/v1/config/redis6_0' +export * as redis_v1_config_redis6_2 from './redis/v1/config/redis6_2' +export * as redis_v1_config_redis7_0 from './redis/v1/config/redis7_0' +export * as sqlserver_v1_config_sqlserver2016sp2 from './sqlserver/v1/config/sqlserver2016sp2' +export * as sqlserver_v1_config_sqlserver2017 from './sqlserver/v1/config/sqlserver2017' +export * as sqlserver_v1_config_sqlserver2019 from './sqlserver/v1/config/sqlserver2019' \ No newline at end of file diff --git a/src/generated/yandex/cloud/mdb/kafka/v1/cluster.ts b/src/generated/yandex/cloud/mdb/kafka/v1/cluster.ts index 22abcd17..a8183175 100644 --- a/src/generated/yandex/cloud/mdb/kafka/v1/cluster.ts +++ b/src/generated/yandex/cloud/mdb/kafka/v1/cluster.ts @@ -72,9 +72,9 @@ export interface Cluster { export enum Cluster_Environment { ENVIRONMENT_UNSPECIFIED = 0, - /** PRODUCTION - stable environment with a conservative update policy when only hotfixes are applied during regular maintenance. */ + /** PRODUCTION - Stable environment with a conservative update policy when only hotfixes are applied during regular maintenance. */ PRODUCTION = 1, - /** PRESTABLE - environment with a more aggressive update policy when new versions are rolled out irrespective of backward compatibility. */ + /** PRESTABLE - Environment with a more aggressive update policy when new versions are rolled out irrespective of backward compatibility. */ PRESTABLE = 2, UNRECOGNIZED = -1, } @@ -111,13 +111,13 @@ export function cluster_EnvironmentToJSON(object: Cluster_Environment): string { } export enum Cluster_Health { - /** HEALTH_UNKNOWN - state of the cluster is unknown ([Host.health] of all hosts in the cluster is `UNKNOWN`). */ + /** HEALTH_UNKNOWN - State of the cluster is unknown ([Host.health] of all hosts in the cluster is `UNKNOWN`). */ HEALTH_UNKNOWN = 0, - /** ALIVE - cluster is alive and well ([Host.health] of all hosts in the cluster is `ALIVE`). */ + /** ALIVE - Cluster is alive and well ([Host.health] of all hosts in the cluster is `ALIVE`). */ ALIVE = 1, - /** DEAD - cluster is inoperable ([Host.health] of all hosts in the cluster is `DEAD`). */ + /** DEAD - Cluster is inoperable ([Host.health] of all hosts in the cluster is `DEAD`). */ DEAD = 2, - /** DEGRADED - cluster is in degraded state ([Host.health] of at least one of the hosts in the cluster is not `ALIVE`). */ + /** DEGRADED - Cluster is in degraded state ([Host.health] of at least one of the hosts in the cluster is not `ALIVE`). */ DEGRADED = 3, UNRECOGNIZED = -1, } @@ -159,21 +159,21 @@ export function cluster_HealthToJSON(object: Cluster_Health): string { } export enum Cluster_Status { - /** STATUS_UNKNOWN - cluster state is unknown. */ + /** STATUS_UNKNOWN - Cluster state is unknown. */ STATUS_UNKNOWN = 0, - /** CREATING - cluster is being created. */ + /** CREATING - Cluster is being created. */ CREATING = 1, - /** RUNNING - cluster is running normally. */ + /** RUNNING - Cluster is running normally. */ RUNNING = 2, - /** ERROR - cluster encountered a problem and cannot operate. */ + /** ERROR - Cluster encountered a problem and cannot operate. */ ERROR = 3, - /** UPDATING - cluster is being updated. */ + /** UPDATING - Cluster is being updated. */ UPDATING = 4, - /** STOPPING - cluster is stopping. */ + /** STOPPING - Cluster is stopping. */ STOPPING = 5, - /** STOPPED - cluster stopped. */ + /** STOPPED - Cluster stopped. */ STOPPED = 6, - /** STARTING - cluster is starting. */ + /** STARTING - Cluster is starting. */ STARTING = 7, UNRECOGNIZED = -1, } @@ -268,7 +268,12 @@ export interface ConfigSpec { * If the value is `true`, then Apache Kafka® cluster is available on the Internet via it's public IP address. */ assignPublicIp: boolean; - /** Allows to manage topics via AdminAPI */ + /** + * Allows to manage topics via AdminAPI + * Deprecated. Feature enabled permanently. + * + * @deprecated + */ unmanagedTopics: boolean; /** Enables managed schema registry on cluster */ schemaRegistry: boolean; @@ -276,6 +281,8 @@ export interface ConfigSpec { access?: Access; /** Configuration of REST API. */ restApiConfig?: ConfigSpec_RestAPIConfig; + /** DiskSizeAutoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface ConfigSpec_Kafka { @@ -480,11 +487,11 @@ export interface Host { clusterId: string; /** ID of the availability zone where the host resides. */ zoneId: string; - /** Host role. */ + /** Host role. If the field has default value, it is not returned in the response. */ role: Host_Role; /** Computational resources allocated to the host. */ resources?: Resources; - /** Aggregated host health data. */ + /** Aggregated host health data. If the field has default value, it is not returned in the response. */ health: Host_Health; /** ID of the subnet the host resides in. */ subnetId: string; @@ -497,10 +504,11 @@ export interface Host { } export enum Host_Role { + /** ROLE_UNSPECIFIED - Role of the host is unspecified. Default value. */ ROLE_UNSPECIFIED = 0, - /** KAFKA - the host is a Kafka broker. */ + /** KAFKA - The host is a Kafka broker. */ KAFKA = 1, - /** ZOOKEEPER - the host is a ZooKeeper server. */ + /** ZOOKEEPER - The host is a ZooKeeper server. */ ZOOKEEPER = 2, UNRECOGNIZED = -1, } @@ -537,13 +545,13 @@ export function host_RoleToJSON(object: Host_Role): string { } export enum Host_Health { - /** UNKNOWN - health of the host is unknown. */ + /** UNKNOWN - Health of the host is unknown. Default value. */ UNKNOWN = 0, - /** ALIVE - the host is performing all its functions normally. */ + /** ALIVE - The host is performing all its functions normally. */ ALIVE = 1, - /** DEAD - the host is inoperable and cannot perform any of its essential functions. */ + /** DEAD - The host is inoperable and cannot perform any of its essential functions. */ DEAD = 2, - /** DEGRADED - the host is degraded and can perform only some of its essential functions. */ + /** DEGRADED - The host is degraded and can perform only some of its essential functions. */ DEGRADED = 3, UNRECOGNIZED = -1, } @@ -590,6 +598,16 @@ export interface Access { dataTransfer: boolean; } +export interface DiskSizeAutoscaling { + $type: "yandex.cloud.mdb.kafka.v1.DiskSizeAutoscaling"; + /** Threshold of storage usage (in percent) that triggers automatic scaling of the storage during the maintenance window. Zero value means disabled threshold. */ + plannedUsageThreshold: number; + /** Threshold of storage usage (in percent) that triggers immediate automatic scaling of the storage. Zero value means disabled threshold. */ + emergencyUsageThreshold: number; + /** New storage size (in bytes) that is set when one of the thresholds is achieved. */ + diskSizeLimit: number; +} + const baseCluster: object = { $type: "yandex.cloud.mdb.kafka.v1.Cluster", id: "", @@ -1151,6 +1169,12 @@ export const ConfigSpec = { writer.uint32(82).fork() ).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(90).fork() + ).ldelim(); + } return writer; }, @@ -1201,6 +1225,12 @@ export const ConfigSpec = { reader.uint32() ); break; + case 11: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1248,6 +1278,11 @@ export const ConfigSpec = { object.restApiConfig !== undefined && object.restApiConfig !== null ? ConfigSpec_RestAPIConfig.fromJSON(object.restApiConfig) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -1281,6 +1316,10 @@ export const ConfigSpec = { (obj.restApiConfig = message.restApiConfig ? ConfigSpec_RestAPIConfig.toJSON(message.restApiConfig) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -1310,6 +1349,11 @@ export const ConfigSpec = { object.restApiConfig !== undefined && object.restApiConfig !== null ? ConfigSpec_RestAPIConfig.fromPartial(object.restApiConfig) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -2857,6 +2901,103 @@ export const Access = { messageTypeRegistry.set(Access.$type, Access); +const baseDiskSizeAutoscaling: object = { + $type: "yandex.cloud.mdb.kafka.v1.DiskSizeAutoscaling", + plannedUsageThreshold: 0, + emergencyUsageThreshold: 0, + diskSizeLimit: 0, +}; + +export const DiskSizeAutoscaling = { + $type: "yandex.cloud.mdb.kafka.v1.DiskSizeAutoscaling" as const, + + encode( + message: DiskSizeAutoscaling, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.plannedUsageThreshold !== 0) { + writer.uint32(8).int64(message.plannedUsageThreshold); + } + if (message.emergencyUsageThreshold !== 0) { + writer.uint32(16).int64(message.emergencyUsageThreshold); + } + if (message.diskSizeLimit !== 0) { + writer.uint32(24).int64(message.diskSizeLimit); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DiskSizeAutoscaling { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDiskSizeAutoscaling } as DiskSizeAutoscaling; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plannedUsageThreshold = longToNumber(reader.int64() as Long); + break; + case 2: + message.emergencyUsageThreshold = longToNumber( + reader.int64() as Long + ); + break; + case 3: + message.diskSizeLimit = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DiskSizeAutoscaling { + const message = { ...baseDiskSizeAutoscaling } as DiskSizeAutoscaling; + message.plannedUsageThreshold = + object.plannedUsageThreshold !== undefined && + object.plannedUsageThreshold !== null + ? Number(object.plannedUsageThreshold) + : 0; + message.emergencyUsageThreshold = + object.emergencyUsageThreshold !== undefined && + object.emergencyUsageThreshold !== null + ? Number(object.emergencyUsageThreshold) + : 0; + message.diskSizeLimit = + object.diskSizeLimit !== undefined && object.diskSizeLimit !== null + ? Number(object.diskSizeLimit) + : 0; + return message; + }, + + toJSON(message: DiskSizeAutoscaling): unknown { + const obj: any = {}; + message.plannedUsageThreshold !== undefined && + (obj.plannedUsageThreshold = Math.round(message.plannedUsageThreshold)); + message.emergencyUsageThreshold !== undefined && + (obj.emergencyUsageThreshold = Math.round( + message.emergencyUsageThreshold + )); + message.diskSizeLimit !== undefined && + (obj.diskSizeLimit = Math.round(message.diskSizeLimit)); + return obj; + }, + + fromPartial, I>>( + object: I + ): DiskSizeAutoscaling { + const message = { ...baseDiskSizeAutoscaling } as DiskSizeAutoscaling; + message.plannedUsageThreshold = object.plannedUsageThreshold ?? 0; + message.emergencyUsageThreshold = object.emergencyUsageThreshold ?? 0; + message.diskSizeLimit = object.diskSizeLimit ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(DiskSizeAutoscaling.$type, DiskSizeAutoscaling); + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/generated/yandex/cloud/mdb/kafka/v1/cluster_service.ts b/src/generated/yandex/cloud/mdb/kafka/v1/cluster_service.ts index 88afdb34..326220e0 100644 --- a/src/generated/yandex/cloud/mdb/kafka/v1/cluster_service.ts +++ b/src/generated/yandex/cloud/mdb/kafka/v1/cluster_service.ts @@ -166,6 +166,10 @@ export interface UpdateClusterRequest { deletionProtection: boolean; /** New maintenance window settings for the cluster. */ maintenanceWindow?: MaintenanceWindow; + /** ID of the network to move the cluster to. */ + networkId: string; + /** IDs of subnets where the hosts are located or a new host is being created */ + subnetIds: string[]; } export interface UpdateClusterRequest_LabelsEntry { @@ -1230,6 +1234,8 @@ const baseUpdateClusterRequest: object = { name: "", securityGroupIds: "", deletionProtection: false, + networkId: "", + subnetIds: "", }; export const UpdateClusterRequest = { @@ -1276,6 +1282,12 @@ export const UpdateClusterRequest = { writer.uint32(74).fork() ).ldelim(); } + if (message.networkId !== "") { + writer.uint32(82).string(message.networkId); + } + for (const v of message.subnetIds) { + writer.uint32(90).string(v!); + } return writer; }, @@ -1288,6 +1300,7 @@ export const UpdateClusterRequest = { const message = { ...baseUpdateClusterRequest } as UpdateClusterRequest; message.labels = {}; message.securityGroupIds = []; + message.subnetIds = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1327,6 +1340,12 @@ export const UpdateClusterRequest = { reader.uint32() ); break; + case 10: + message.networkId = reader.string(); + break; + case 11: + message.subnetIds.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -1376,6 +1395,11 @@ export const UpdateClusterRequest = { object.maintenanceWindow !== null ? MaintenanceWindow.fromJSON(object.maintenanceWindow) : undefined; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; + message.subnetIds = (object.subnetIds ?? []).map((e: any) => String(e)); return message; }, @@ -1410,6 +1434,12 @@ export const UpdateClusterRequest = { (obj.maintenanceWindow = message.maintenanceWindow ? MaintenanceWindow.toJSON(message.maintenanceWindow) : undefined); + message.networkId !== undefined && (obj.networkId = message.networkId); + if (message.subnetIds) { + obj.subnetIds = message.subnetIds.map((e) => e); + } else { + obj.subnetIds = []; + } return obj; }, @@ -1443,6 +1473,8 @@ export const UpdateClusterRequest = { object.maintenanceWindow !== null ? MaintenanceWindow.fromPartial(object.maintenanceWindow) : undefined; + message.networkId = object.networkId ?? ""; + message.subnetIds = object.subnetIds?.map((e) => e) || []; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/kafka/v1/topic.ts b/src/generated/yandex/cloud/mdb/kafka/v1/topic.ts index a9aca345..a17170f6 100644 --- a/src/generated/yandex/cloud/mdb/kafka/v1/topic.ts +++ b/src/generated/yandex/cloud/mdb/kafka/v1/topic.ts @@ -29,10 +29,6 @@ export interface Topic { partitions?: number; /** Amount of data copies (replicas) for the topic in the cluster. */ replicationFactor?: number; - /** @deprecated */ - topicConfig21?: Topicconfig21 | undefined; - /** @deprecated */ - topicConfig26?: Topicconfig26 | undefined; topicConfig28?: Topicconfig28 | undefined; topicConfig3?: TopicConfig3 | undefined; } @@ -45,244 +41,10 @@ export interface TopicSpec { partitions?: number; /** Amount of copies of a topic data kept in the cluster. */ replicationFactor?: number; - /** @deprecated */ - topicConfig21?: Topicconfig21 | undefined; - /** @deprecated */ - topicConfig26?: Topicconfig26 | undefined; topicConfig28?: Topicconfig28 | undefined; topicConfig3?: TopicConfig3 | undefined; } -/** - * Deprecated. Version `2.1` of Kafka not supported in Yandex Cloud. - * - * @deprecated - */ -export interface Topicconfig21 { - $type: "yandex.cloud.mdb.kafka.v1.TopicConfig2_1"; - /** Retention policy to use on old log messages. */ - cleanupPolicy: Topicconfig21_CleanupPolicy; - /** The compression type for a given topic. */ - compressionType: CompressionType; - /** The amount of time in milliseconds to retain delete tombstone markers for log compacted topics. */ - deleteRetentionMs?: number; - /** The time to wait before deleting a file from the filesystem. */ - fileDeleteDelayMs?: number; - /** - * The number of messages accumulated on a log partition before messages are flushed to disk. - * - * This setting overrides the cluster-level [KafkaConfig2_1.log_flush_interval_messages] setting on the topic level. - */ - flushMessages?: number; - /** - * The maximum time in milliseconds that a message in the topic is kept in memory before flushed to disk. - * - * This setting overrides the cluster-level [KafkaConfig2_1.log_flush_interval_ms] setting on the topic level. - */ - flushMs?: number; - /** The minimum time in milliseconds a message will remain uncompacted in the log. */ - minCompactionLagMs?: number; - /** - * The maximum size a partition can grow to before Kafka will discard old log segments to free up space if the `delete` [cleanup_policy] is in effect. - * It is helpful if you need to control the size of log due to limited disk space. - * - * This setting overrides the cluster-level [KafkaConfig2_1.log_retention_bytes] setting on the topic level. - */ - retentionBytes?: number; - /** - * The number of milliseconds to keep a log segment's file before deleting it. - * - * This setting overrides the cluster-level [KafkaConfig2_1.log_retention_ms] setting on the topic level. - */ - retentionMs?: number; - /** The largest record batch size allowed in topic. */ - maxMessageBytes?: number; - /** - * This configuration specifies the minimum number of replicas that must acknowledge a write to topic for the write - * to be considered successful (when a producer sets acks to "all"). - */ - minInsyncReplicas?: number; - /** - * This configuration controls the segment file size for the log. Retention and cleaning is always done a file - * at a time so a larger segment size means fewer files but less granular control over retention. - * - * This setting overrides the cluster-level [KafkaConfig2_1.log_segment_bytes] setting on the topic level. - */ - segmentBytes?: number; - /** - * True if we should preallocate the file on disk when creating a new log segment. - * - * This setting overrides the cluster-level [KafkaConfig2_1.log_preallocate] setting on the topic level. - */ - preallocate?: boolean; -} - -export enum Topicconfig21_CleanupPolicy { - CLEANUP_POLICY_UNSPECIFIED = 0, - /** CLEANUP_POLICY_DELETE - this policy discards log segments when either their retention time or log size limit is reached. See also: [KafkaConfig2_1.log_retention_ms] and other similar parameters. */ - CLEANUP_POLICY_DELETE = 1, - /** CLEANUP_POLICY_COMPACT - this policy compacts messages in log. */ - CLEANUP_POLICY_COMPACT = 2, - /** CLEANUP_POLICY_COMPACT_AND_DELETE - this policy use both compaction and deletion for messages and log segments. */ - CLEANUP_POLICY_COMPACT_AND_DELETE = 3, - UNRECOGNIZED = -1, -} - -export function topicconfig21_CleanupPolicyFromJSON( - object: any -): Topicconfig21_CleanupPolicy { - switch (object) { - case 0: - case "CLEANUP_POLICY_UNSPECIFIED": - return Topicconfig21_CleanupPolicy.CLEANUP_POLICY_UNSPECIFIED; - case 1: - case "CLEANUP_POLICY_DELETE": - return Topicconfig21_CleanupPolicy.CLEANUP_POLICY_DELETE; - case 2: - case "CLEANUP_POLICY_COMPACT": - return Topicconfig21_CleanupPolicy.CLEANUP_POLICY_COMPACT; - case 3: - case "CLEANUP_POLICY_COMPACT_AND_DELETE": - return Topicconfig21_CleanupPolicy.CLEANUP_POLICY_COMPACT_AND_DELETE; - case -1: - case "UNRECOGNIZED": - default: - return Topicconfig21_CleanupPolicy.UNRECOGNIZED; - } -} - -export function topicconfig21_CleanupPolicyToJSON( - object: Topicconfig21_CleanupPolicy -): string { - switch (object) { - case Topicconfig21_CleanupPolicy.CLEANUP_POLICY_UNSPECIFIED: - return "CLEANUP_POLICY_UNSPECIFIED"; - case Topicconfig21_CleanupPolicy.CLEANUP_POLICY_DELETE: - return "CLEANUP_POLICY_DELETE"; - case Topicconfig21_CleanupPolicy.CLEANUP_POLICY_COMPACT: - return "CLEANUP_POLICY_COMPACT"; - case Topicconfig21_CleanupPolicy.CLEANUP_POLICY_COMPACT_AND_DELETE: - return "CLEANUP_POLICY_COMPACT_AND_DELETE"; - default: - return "UNKNOWN"; - } -} - -/** - * Deprecated. Version `2.6` of Kafka not supported in Yandex Cloud. - * - * @deprecated - */ -export interface Topicconfig26 { - $type: "yandex.cloud.mdb.kafka.v1.TopicConfig2_6"; - /** Retention policy to use on old log messages. */ - cleanupPolicy: Topicconfig26_CleanupPolicy; - /** The compression type for a given topic. */ - compressionType: CompressionType; - /** The amount of time in milliseconds to retain delete tombstone markers for log compacted topics. */ - deleteRetentionMs?: number; - /** The time to wait before deleting a file from the filesystem. */ - fileDeleteDelayMs?: number; - /** - * The number of messages accumulated on a log partition before messages are flushed to disk. - * - * This setting overrides the cluster-level [KafkaConfig2_6.log_flush_interval_messages] setting on the topic level. - */ - flushMessages?: number; - /** - * The maximum time in milliseconds that a message in the topic is kept in memory before flushed to disk. - * - * This setting overrides the cluster-level [KafkaConfig2_6.log_flush_interval_ms] setting on the topic level. - */ - flushMs?: number; - /** The minimum time in milliseconds a message will remain uncompacted in the log. */ - minCompactionLagMs?: number; - /** - * The maximum size a partition can grow to before Kafka will discard old log segments to free up space if the `delete` [cleanup_policy] is in effect. - * It is helpful if you need to control the size of log due to limited disk space. - * - * This setting overrides the cluster-level [KafkaConfig2_6.log_retention_bytes] setting on the topic level. - */ - retentionBytes?: number; - /** - * The number of milliseconds to keep a log segment's file before deleting it. - * - * This setting overrides the cluster-level [KafkaConfig2_6.log_retention_ms] setting on the topic level. - */ - retentionMs?: number; - /** The largest record batch size allowed in topic. */ - maxMessageBytes?: number; - /** - * This configuration specifies the minimum number of replicas that must acknowledge a write to topic for the write - * to be considered successful (when a producer sets acks to "all"). - */ - minInsyncReplicas?: number; - /** - * This configuration controls the segment file size for the log. Retention and cleaning is always done a file - * at a time so a larger segment size means fewer files but less granular control over retention. - * - * This setting overrides the cluster-level [KafkaConfig2_6.log_segment_bytes] setting on the topic level. - */ - segmentBytes?: number; - /** - * True if we should preallocate the file on disk when creating a new log segment. - * - * This setting overrides the cluster-level [KafkaConfig2_6.log_preallocate] setting on the topic level. - */ - preallocate?: boolean; -} - -export enum Topicconfig26_CleanupPolicy { - CLEANUP_POLICY_UNSPECIFIED = 0, - /** CLEANUP_POLICY_DELETE - this policy discards log segments when either their retention time or log size limit is reached. See also: [KafkaConfig2_1.log_retention_ms] and other similar parameters. */ - CLEANUP_POLICY_DELETE = 1, - /** CLEANUP_POLICY_COMPACT - this policy compacts messages in log. */ - CLEANUP_POLICY_COMPACT = 2, - /** CLEANUP_POLICY_COMPACT_AND_DELETE - this policy use both compaction and deletion for messages and log segments. */ - CLEANUP_POLICY_COMPACT_AND_DELETE = 3, - UNRECOGNIZED = -1, -} - -export function topicconfig26_CleanupPolicyFromJSON( - object: any -): Topicconfig26_CleanupPolicy { - switch (object) { - case 0: - case "CLEANUP_POLICY_UNSPECIFIED": - return Topicconfig26_CleanupPolicy.CLEANUP_POLICY_UNSPECIFIED; - case 1: - case "CLEANUP_POLICY_DELETE": - return Topicconfig26_CleanupPolicy.CLEANUP_POLICY_DELETE; - case 2: - case "CLEANUP_POLICY_COMPACT": - return Topicconfig26_CleanupPolicy.CLEANUP_POLICY_COMPACT; - case 3: - case "CLEANUP_POLICY_COMPACT_AND_DELETE": - return Topicconfig26_CleanupPolicy.CLEANUP_POLICY_COMPACT_AND_DELETE; - case -1: - case "UNRECOGNIZED": - default: - return Topicconfig26_CleanupPolicy.UNRECOGNIZED; - } -} - -export function topicconfig26_CleanupPolicyToJSON( - object: Topicconfig26_CleanupPolicy -): string { - switch (object) { - case Topicconfig26_CleanupPolicy.CLEANUP_POLICY_UNSPECIFIED: - return "CLEANUP_POLICY_UNSPECIFIED"; - case Topicconfig26_CleanupPolicy.CLEANUP_POLICY_DELETE: - return "CLEANUP_POLICY_DELETE"; - case Topicconfig26_CleanupPolicy.CLEANUP_POLICY_COMPACT: - return "CLEANUP_POLICY_COMPACT"; - case Topicconfig26_CleanupPolicy.CLEANUP_POLICY_COMPACT_AND_DELETE: - return "CLEANUP_POLICY_COMPACT_AND_DELETE"; - default: - return "UNKNOWN"; - } -} - /** A topic settings for 2.8 */ export interface Topicconfig28 { $type: "yandex.cloud.mdb.kafka.v1.TopicConfig2_8"; @@ -345,11 +107,11 @@ export interface Topicconfig28 { export enum Topicconfig28_CleanupPolicy { CLEANUP_POLICY_UNSPECIFIED = 0, - /** CLEANUP_POLICY_DELETE - this policy discards log segments when either their retention time or log size limit is reached. See also: [KafkaConfig2_1.log_retention_ms] and other similar parameters. */ + /** CLEANUP_POLICY_DELETE - This policy discards log segments when either their retention time or log size limit is reached. See also: [KafkaConfig2_8.log_retention_ms] and other similar parameters. */ CLEANUP_POLICY_DELETE = 1, - /** CLEANUP_POLICY_COMPACT - this policy compacts messages in log. */ + /** CLEANUP_POLICY_COMPACT - This policy compacts messages in log. */ CLEANUP_POLICY_COMPACT = 2, - /** CLEANUP_POLICY_COMPACT_AND_DELETE - this policy use both compaction and deletion for messages and log segments. */ + /** CLEANUP_POLICY_COMPACT_AND_DELETE - This policy use both compaction and deletion for messages and log segments. */ CLEANUP_POLICY_COMPACT_AND_DELETE = 3, UNRECOGNIZED = -1, } @@ -456,11 +218,11 @@ export interface TopicConfig3 { export enum TopicConfig3_CleanupPolicy { CLEANUP_POLICY_UNSPECIFIED = 0, - /** CLEANUP_POLICY_DELETE - this policy discards log segments when either their retention time or log size limit is reached. See also: [KafkaConfig3.log_retention_ms] and other similar parameters. */ + /** CLEANUP_POLICY_DELETE - This policy discards log segments when either their retention time or log size limit is reached. See also: [KafkaConfig3.log_retention_ms] and other similar parameters. */ CLEANUP_POLICY_DELETE = 1, - /** CLEANUP_POLICY_COMPACT - this policy compacts messages in log. */ + /** CLEANUP_POLICY_COMPACT - This policy compacts messages in log. */ CLEANUP_POLICY_COMPACT = 2, - /** CLEANUP_POLICY_COMPACT_AND_DELETE - this policy use both compaction and deletion for messages and log segments. */ + /** CLEANUP_POLICY_COMPACT_AND_DELETE - This policy use both compaction and deletion for messages and log segments. */ CLEANUP_POLICY_COMPACT_AND_DELETE = 3, UNRECOGNIZED = -1, } @@ -536,18 +298,6 @@ export const Topic = { writer.uint32(34).fork() ).ldelim(); } - if (message.topicConfig21 !== undefined) { - Topicconfig21.encode( - message.topicConfig21, - writer.uint32(42).fork() - ).ldelim(); - } - if (message.topicConfig26 !== undefined) { - Topicconfig26.encode( - message.topicConfig26, - writer.uint32(50).fork() - ).ldelim(); - } if (message.topicConfig28 !== undefined) { Topicconfig28.encode( message.topicConfig28, @@ -585,12 +335,6 @@ export const Topic = { reader.uint32() ).value; break; - case 5: - message.topicConfig21 = Topicconfig21.decode(reader, reader.uint32()); - break; - case 6: - message.topicConfig26 = Topicconfig26.decode(reader, reader.uint32()); - break; case 7: message.topicConfig28 = Topicconfig28.decode(reader, reader.uint32()); break; @@ -624,14 +368,6 @@ export const Topic = { object.replicationFactor !== null ? Number(object.replicationFactor) : undefined; - message.topicConfig21 = - object.topicConfig_2_1 !== undefined && object.topicConfig_2_1 !== null - ? Topicconfig21.fromJSON(object.topicConfig_2_1) - : undefined; - message.topicConfig26 = - object.topicConfig_2_6 !== undefined && object.topicConfig_2_6 !== null - ? Topicconfig26.fromJSON(object.topicConfig_2_6) - : undefined; message.topicConfig28 = object.topicConfig_2_8 !== undefined && object.topicConfig_2_8 !== null ? Topicconfig28.fromJSON(object.topicConfig_2_8) @@ -650,14 +386,6 @@ export const Topic = { message.partitions !== undefined && (obj.partitions = message.partitions); message.replicationFactor !== undefined && (obj.replicationFactor = message.replicationFactor); - message.topicConfig21 !== undefined && - (obj.topicConfig_2_1 = message.topicConfig21 - ? Topicconfig21.toJSON(message.topicConfig21) - : undefined); - message.topicConfig26 !== undefined && - (obj.topicConfig_2_6 = message.topicConfig26 - ? Topicconfig26.toJSON(message.topicConfig26) - : undefined); message.topicConfig28 !== undefined && (obj.topicConfig_2_8 = message.topicConfig28 ? Topicconfig28.toJSON(message.topicConfig28) @@ -675,14 +403,6 @@ export const Topic = { message.clusterId = object.clusterId ?? ""; message.partitions = object.partitions ?? undefined; message.replicationFactor = object.replicationFactor ?? undefined; - message.topicConfig21 = - object.topicConfig21 !== undefined && object.topicConfig21 !== null - ? Topicconfig21.fromPartial(object.topicConfig21) - : undefined; - message.topicConfig26 = - object.topicConfig26 !== undefined && object.topicConfig26 !== null - ? Topicconfig26.fromPartial(object.topicConfig26) - : undefined; message.topicConfig28 = object.topicConfig28 !== undefined && object.topicConfig28 !== null ? Topicconfig28.fromPartial(object.topicConfig28) @@ -727,18 +447,6 @@ export const TopicSpec = { writer.uint32(26).fork() ).ldelim(); } - if (message.topicConfig21 !== undefined) { - Topicconfig21.encode( - message.topicConfig21, - writer.uint32(34).fork() - ).ldelim(); - } - if (message.topicConfig26 !== undefined) { - Topicconfig26.encode( - message.topicConfig26, - writer.uint32(42).fork() - ).ldelim(); - } if (message.topicConfig28 !== undefined) { Topicconfig28.encode( message.topicConfig28, @@ -773,12 +481,6 @@ export const TopicSpec = { reader.uint32() ).value; break; - case 4: - message.topicConfig21 = Topicconfig21.decode(reader, reader.uint32()); - break; - case 5: - message.topicConfig26 = Topicconfig26.decode(reader, reader.uint32()); - break; case 6: message.topicConfig28 = Topicconfig28.decode(reader, reader.uint32()); break; @@ -808,14 +510,6 @@ export const TopicSpec = { object.replicationFactor !== null ? Number(object.replicationFactor) : undefined; - message.topicConfig21 = - object.topicConfig_2_1 !== undefined && object.topicConfig_2_1 !== null - ? Topicconfig21.fromJSON(object.topicConfig_2_1) - : undefined; - message.topicConfig26 = - object.topicConfig_2_6 !== undefined && object.topicConfig_2_6 !== null - ? Topicconfig26.fromJSON(object.topicConfig_2_6) - : undefined; message.topicConfig28 = object.topicConfig_2_8 !== undefined && object.topicConfig_2_8 !== null ? Topicconfig28.fromJSON(object.topicConfig_2_8) @@ -833,14 +527,6 @@ export const TopicSpec = { message.partitions !== undefined && (obj.partitions = message.partitions); message.replicationFactor !== undefined && (obj.replicationFactor = message.replicationFactor); - message.topicConfig21 !== undefined && - (obj.topicConfig_2_1 = message.topicConfig21 - ? Topicconfig21.toJSON(message.topicConfig21) - : undefined); - message.topicConfig26 !== undefined && - (obj.topicConfig_2_6 = message.topicConfig26 - ? Topicconfig26.toJSON(message.topicConfig26) - : undefined); message.topicConfig28 !== undefined && (obj.topicConfig_2_8 = message.topicConfig28 ? Topicconfig28.toJSON(message.topicConfig28) @@ -859,14 +545,6 @@ export const TopicSpec = { message.name = object.name ?? ""; message.partitions = object.partitions ?? undefined; message.replicationFactor = object.replicationFactor ?? undefined; - message.topicConfig21 = - object.topicConfig21 !== undefined && object.topicConfig21 !== null - ? Topicconfig21.fromPartial(object.topicConfig21) - : undefined; - message.topicConfig26 = - object.topicConfig26 !== undefined && object.topicConfig26 !== null - ? Topicconfig26.fromPartial(object.topicConfig26) - : undefined; message.topicConfig28 = object.topicConfig28 !== undefined && object.topicConfig28 !== null ? Topicconfig28.fromPartial(object.topicConfig28) @@ -881,606 +559,6 @@ export const TopicSpec = { messageTypeRegistry.set(TopicSpec.$type, TopicSpec); -const baseTopicconfig21: object = { - $type: "yandex.cloud.mdb.kafka.v1.TopicConfig2_1", - cleanupPolicy: 0, - compressionType: 0, -}; - -export const Topicconfig21 = { - $type: "yandex.cloud.mdb.kafka.v1.TopicConfig2_1" as const, - - encode( - message: Topicconfig21, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.cleanupPolicy !== 0) { - writer.uint32(8).int32(message.cleanupPolicy); - } - if (message.compressionType !== 0) { - writer.uint32(16).int32(message.compressionType); - } - if (message.deleteRetentionMs !== undefined) { - Int64Value.encode( - { - $type: "google.protobuf.Int64Value", - value: message.deleteRetentionMs!, - }, - writer.uint32(26).fork() - ).ldelim(); - } - if (message.fileDeleteDelayMs !== undefined) { - Int64Value.encode( - { - $type: "google.protobuf.Int64Value", - value: message.fileDeleteDelayMs!, - }, - writer.uint32(34).fork() - ).ldelim(); - } - if (message.flushMessages !== undefined) { - Int64Value.encode( - { $type: "google.protobuf.Int64Value", value: message.flushMessages! }, - writer.uint32(42).fork() - ).ldelim(); - } - if (message.flushMs !== undefined) { - Int64Value.encode( - { $type: "google.protobuf.Int64Value", value: message.flushMs! }, - writer.uint32(50).fork() - ).ldelim(); - } - if (message.minCompactionLagMs !== undefined) { - Int64Value.encode( - { - $type: "google.protobuf.Int64Value", - value: message.minCompactionLagMs!, - }, - writer.uint32(58).fork() - ).ldelim(); - } - if (message.retentionBytes !== undefined) { - Int64Value.encode( - { $type: "google.protobuf.Int64Value", value: message.retentionBytes! }, - writer.uint32(66).fork() - ).ldelim(); - } - if (message.retentionMs !== undefined) { - Int64Value.encode( - { $type: "google.protobuf.Int64Value", value: message.retentionMs! }, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.maxMessageBytes !== undefined) { - Int64Value.encode( - { - $type: "google.protobuf.Int64Value", - value: message.maxMessageBytes!, - }, - writer.uint32(82).fork() - ).ldelim(); - } - if (message.minInsyncReplicas !== undefined) { - Int64Value.encode( - { - $type: "google.protobuf.Int64Value", - value: message.minInsyncReplicas!, - }, - writer.uint32(90).fork() - ).ldelim(); - } - if (message.segmentBytes !== undefined) { - Int64Value.encode( - { $type: "google.protobuf.Int64Value", value: message.segmentBytes! }, - writer.uint32(98).fork() - ).ldelim(); - } - if (message.preallocate !== undefined) { - BoolValue.encode( - { $type: "google.protobuf.BoolValue", value: message.preallocate! }, - writer.uint32(106).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Topicconfig21 { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTopicconfig21 } as Topicconfig21; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.cleanupPolicy = reader.int32() as any; - break; - case 2: - message.compressionType = reader.int32() as any; - break; - case 3: - message.deleteRetentionMs = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 4: - message.fileDeleteDelayMs = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 5: - message.flushMessages = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 6: - message.flushMs = Int64Value.decode(reader, reader.uint32()).value; - break; - case 7: - message.minCompactionLagMs = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 8: - message.retentionBytes = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 9: - message.retentionMs = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 10: - message.maxMessageBytes = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 11: - message.minInsyncReplicas = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 12: - message.segmentBytes = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 13: - message.preallocate = BoolValue.decode(reader, reader.uint32()).value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Topicconfig21 { - const message = { ...baseTopicconfig21 } as Topicconfig21; - message.cleanupPolicy = - object.cleanupPolicy !== undefined && object.cleanupPolicy !== null - ? topicconfig21_CleanupPolicyFromJSON(object.cleanupPolicy) - : 0; - message.compressionType = - object.compressionType !== undefined && object.compressionType !== null - ? compressionTypeFromJSON(object.compressionType) - : 0; - message.deleteRetentionMs = - object.deleteRetentionMs !== undefined && - object.deleteRetentionMs !== null - ? Number(object.deleteRetentionMs) - : undefined; - message.fileDeleteDelayMs = - object.fileDeleteDelayMs !== undefined && - object.fileDeleteDelayMs !== null - ? Number(object.fileDeleteDelayMs) - : undefined; - message.flushMessages = - object.flushMessages !== undefined && object.flushMessages !== null - ? Number(object.flushMessages) - : undefined; - message.flushMs = - object.flushMs !== undefined && object.flushMs !== null - ? Number(object.flushMs) - : undefined; - message.minCompactionLagMs = - object.minCompactionLagMs !== undefined && - object.minCompactionLagMs !== null - ? Number(object.minCompactionLagMs) - : undefined; - message.retentionBytes = - object.retentionBytes !== undefined && object.retentionBytes !== null - ? Number(object.retentionBytes) - : undefined; - message.retentionMs = - object.retentionMs !== undefined && object.retentionMs !== null - ? Number(object.retentionMs) - : undefined; - message.maxMessageBytes = - object.maxMessageBytes !== undefined && object.maxMessageBytes !== null - ? Number(object.maxMessageBytes) - : undefined; - message.minInsyncReplicas = - object.minInsyncReplicas !== undefined && - object.minInsyncReplicas !== null - ? Number(object.minInsyncReplicas) - : undefined; - message.segmentBytes = - object.segmentBytes !== undefined && object.segmentBytes !== null - ? Number(object.segmentBytes) - : undefined; - message.preallocate = - object.preallocate !== undefined && object.preallocate !== null - ? Boolean(object.preallocate) - : undefined; - return message; - }, - - toJSON(message: Topicconfig21): unknown { - const obj: any = {}; - message.cleanupPolicy !== undefined && - (obj.cleanupPolicy = topicconfig21_CleanupPolicyToJSON( - message.cleanupPolicy - )); - message.compressionType !== undefined && - (obj.compressionType = compressionTypeToJSON(message.compressionType)); - message.deleteRetentionMs !== undefined && - (obj.deleteRetentionMs = message.deleteRetentionMs); - message.fileDeleteDelayMs !== undefined && - (obj.fileDeleteDelayMs = message.fileDeleteDelayMs); - message.flushMessages !== undefined && - (obj.flushMessages = message.flushMessages); - message.flushMs !== undefined && (obj.flushMs = message.flushMs); - message.minCompactionLagMs !== undefined && - (obj.minCompactionLagMs = message.minCompactionLagMs); - message.retentionBytes !== undefined && - (obj.retentionBytes = message.retentionBytes); - message.retentionMs !== undefined && - (obj.retentionMs = message.retentionMs); - message.maxMessageBytes !== undefined && - (obj.maxMessageBytes = message.maxMessageBytes); - message.minInsyncReplicas !== undefined && - (obj.minInsyncReplicas = message.minInsyncReplicas); - message.segmentBytes !== undefined && - (obj.segmentBytes = message.segmentBytes); - message.preallocate !== undefined && - (obj.preallocate = message.preallocate); - return obj; - }, - - fromPartial, I>>( - object: I - ): Topicconfig21 { - const message = { ...baseTopicconfig21 } as Topicconfig21; - message.cleanupPolicy = object.cleanupPolicy ?? 0; - message.compressionType = object.compressionType ?? 0; - message.deleteRetentionMs = object.deleteRetentionMs ?? undefined; - message.fileDeleteDelayMs = object.fileDeleteDelayMs ?? undefined; - message.flushMessages = object.flushMessages ?? undefined; - message.flushMs = object.flushMs ?? undefined; - message.minCompactionLagMs = object.minCompactionLagMs ?? undefined; - message.retentionBytes = object.retentionBytes ?? undefined; - message.retentionMs = object.retentionMs ?? undefined; - message.maxMessageBytes = object.maxMessageBytes ?? undefined; - message.minInsyncReplicas = object.minInsyncReplicas ?? undefined; - message.segmentBytes = object.segmentBytes ?? undefined; - message.preallocate = object.preallocate ?? undefined; - return message; - }, -}; - -messageTypeRegistry.set(Topicconfig21.$type, Topicconfig21); - -const baseTopicconfig26: object = { - $type: "yandex.cloud.mdb.kafka.v1.TopicConfig2_6", - cleanupPolicy: 0, - compressionType: 0, -}; - -export const Topicconfig26 = { - $type: "yandex.cloud.mdb.kafka.v1.TopicConfig2_6" as const, - - encode( - message: Topicconfig26, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.cleanupPolicy !== 0) { - writer.uint32(8).int32(message.cleanupPolicy); - } - if (message.compressionType !== 0) { - writer.uint32(16).int32(message.compressionType); - } - if (message.deleteRetentionMs !== undefined) { - Int64Value.encode( - { - $type: "google.protobuf.Int64Value", - value: message.deleteRetentionMs!, - }, - writer.uint32(26).fork() - ).ldelim(); - } - if (message.fileDeleteDelayMs !== undefined) { - Int64Value.encode( - { - $type: "google.protobuf.Int64Value", - value: message.fileDeleteDelayMs!, - }, - writer.uint32(34).fork() - ).ldelim(); - } - if (message.flushMessages !== undefined) { - Int64Value.encode( - { $type: "google.protobuf.Int64Value", value: message.flushMessages! }, - writer.uint32(42).fork() - ).ldelim(); - } - if (message.flushMs !== undefined) { - Int64Value.encode( - { $type: "google.protobuf.Int64Value", value: message.flushMs! }, - writer.uint32(50).fork() - ).ldelim(); - } - if (message.minCompactionLagMs !== undefined) { - Int64Value.encode( - { - $type: "google.protobuf.Int64Value", - value: message.minCompactionLagMs!, - }, - writer.uint32(58).fork() - ).ldelim(); - } - if (message.retentionBytes !== undefined) { - Int64Value.encode( - { $type: "google.protobuf.Int64Value", value: message.retentionBytes! }, - writer.uint32(66).fork() - ).ldelim(); - } - if (message.retentionMs !== undefined) { - Int64Value.encode( - { $type: "google.protobuf.Int64Value", value: message.retentionMs! }, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.maxMessageBytes !== undefined) { - Int64Value.encode( - { - $type: "google.protobuf.Int64Value", - value: message.maxMessageBytes!, - }, - writer.uint32(82).fork() - ).ldelim(); - } - if (message.minInsyncReplicas !== undefined) { - Int64Value.encode( - { - $type: "google.protobuf.Int64Value", - value: message.minInsyncReplicas!, - }, - writer.uint32(90).fork() - ).ldelim(); - } - if (message.segmentBytes !== undefined) { - Int64Value.encode( - { $type: "google.protobuf.Int64Value", value: message.segmentBytes! }, - writer.uint32(98).fork() - ).ldelim(); - } - if (message.preallocate !== undefined) { - BoolValue.encode( - { $type: "google.protobuf.BoolValue", value: message.preallocate! }, - writer.uint32(106).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Topicconfig26 { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseTopicconfig26 } as Topicconfig26; - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.cleanupPolicy = reader.int32() as any; - break; - case 2: - message.compressionType = reader.int32() as any; - break; - case 3: - message.deleteRetentionMs = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 4: - message.fileDeleteDelayMs = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 5: - message.flushMessages = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 6: - message.flushMs = Int64Value.decode(reader, reader.uint32()).value; - break; - case 7: - message.minCompactionLagMs = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 8: - message.retentionBytes = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 9: - message.retentionMs = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 10: - message.maxMessageBytes = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 11: - message.minInsyncReplicas = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 12: - message.segmentBytes = Int64Value.decode( - reader, - reader.uint32() - ).value; - break; - case 13: - message.preallocate = BoolValue.decode(reader, reader.uint32()).value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Topicconfig26 { - const message = { ...baseTopicconfig26 } as Topicconfig26; - message.cleanupPolicy = - object.cleanupPolicy !== undefined && object.cleanupPolicy !== null - ? topicconfig26_CleanupPolicyFromJSON(object.cleanupPolicy) - : 0; - message.compressionType = - object.compressionType !== undefined && object.compressionType !== null - ? compressionTypeFromJSON(object.compressionType) - : 0; - message.deleteRetentionMs = - object.deleteRetentionMs !== undefined && - object.deleteRetentionMs !== null - ? Number(object.deleteRetentionMs) - : undefined; - message.fileDeleteDelayMs = - object.fileDeleteDelayMs !== undefined && - object.fileDeleteDelayMs !== null - ? Number(object.fileDeleteDelayMs) - : undefined; - message.flushMessages = - object.flushMessages !== undefined && object.flushMessages !== null - ? Number(object.flushMessages) - : undefined; - message.flushMs = - object.flushMs !== undefined && object.flushMs !== null - ? Number(object.flushMs) - : undefined; - message.minCompactionLagMs = - object.minCompactionLagMs !== undefined && - object.minCompactionLagMs !== null - ? Number(object.minCompactionLagMs) - : undefined; - message.retentionBytes = - object.retentionBytes !== undefined && object.retentionBytes !== null - ? Number(object.retentionBytes) - : undefined; - message.retentionMs = - object.retentionMs !== undefined && object.retentionMs !== null - ? Number(object.retentionMs) - : undefined; - message.maxMessageBytes = - object.maxMessageBytes !== undefined && object.maxMessageBytes !== null - ? Number(object.maxMessageBytes) - : undefined; - message.minInsyncReplicas = - object.minInsyncReplicas !== undefined && - object.minInsyncReplicas !== null - ? Number(object.minInsyncReplicas) - : undefined; - message.segmentBytes = - object.segmentBytes !== undefined && object.segmentBytes !== null - ? Number(object.segmentBytes) - : undefined; - message.preallocate = - object.preallocate !== undefined && object.preallocate !== null - ? Boolean(object.preallocate) - : undefined; - return message; - }, - - toJSON(message: Topicconfig26): unknown { - const obj: any = {}; - message.cleanupPolicy !== undefined && - (obj.cleanupPolicy = topicconfig26_CleanupPolicyToJSON( - message.cleanupPolicy - )); - message.compressionType !== undefined && - (obj.compressionType = compressionTypeToJSON(message.compressionType)); - message.deleteRetentionMs !== undefined && - (obj.deleteRetentionMs = message.deleteRetentionMs); - message.fileDeleteDelayMs !== undefined && - (obj.fileDeleteDelayMs = message.fileDeleteDelayMs); - message.flushMessages !== undefined && - (obj.flushMessages = message.flushMessages); - message.flushMs !== undefined && (obj.flushMs = message.flushMs); - message.minCompactionLagMs !== undefined && - (obj.minCompactionLagMs = message.minCompactionLagMs); - message.retentionBytes !== undefined && - (obj.retentionBytes = message.retentionBytes); - message.retentionMs !== undefined && - (obj.retentionMs = message.retentionMs); - message.maxMessageBytes !== undefined && - (obj.maxMessageBytes = message.maxMessageBytes); - message.minInsyncReplicas !== undefined && - (obj.minInsyncReplicas = message.minInsyncReplicas); - message.segmentBytes !== undefined && - (obj.segmentBytes = message.segmentBytes); - message.preallocate !== undefined && - (obj.preallocate = message.preallocate); - return obj; - }, - - fromPartial, I>>( - object: I - ): Topicconfig26 { - const message = { ...baseTopicconfig26 } as Topicconfig26; - message.cleanupPolicy = object.cleanupPolicy ?? 0; - message.compressionType = object.compressionType ?? 0; - message.deleteRetentionMs = object.deleteRetentionMs ?? undefined; - message.fileDeleteDelayMs = object.fileDeleteDelayMs ?? undefined; - message.flushMessages = object.flushMessages ?? undefined; - message.flushMs = object.flushMs ?? undefined; - message.minCompactionLagMs = object.minCompactionLagMs ?? undefined; - message.retentionBytes = object.retentionBytes ?? undefined; - message.retentionMs = object.retentionMs ?? undefined; - message.maxMessageBytes = object.maxMessageBytes ?? undefined; - message.minInsyncReplicas = object.minInsyncReplicas ?? undefined; - message.segmentBytes = object.segmentBytes ?? undefined; - message.preallocate = object.preallocate ?? undefined; - return message; - }, -}; - -messageTypeRegistry.set(Topicconfig26.$type, Topicconfig26); - const baseTopicconfig28: object = { $type: "yandex.cloud.mdb.kafka.v1.TopicConfig2_8", cleanupPolicy: 0, diff --git a/src/generated/yandex/cloud/mdb/kafka/v1/user.ts b/src/generated/yandex/cloud/mdb/kafka/v1/user.ts index 40acaa2f..38e2dcef 100644 --- a/src/generated/yandex/cloud/mdb/kafka/v1/user.ts +++ b/src/generated/yandex/cloud/mdb/kafka/v1/user.ts @@ -56,11 +56,11 @@ export interface Permission { export enum Permission_AccessRole { ACCESS_ROLE_UNSPECIFIED = 0, - /** ACCESS_ROLE_PRODUCER - producer role for the user. */ + /** ACCESS_ROLE_PRODUCER - Producer role for the user. */ ACCESS_ROLE_PRODUCER = 1, - /** ACCESS_ROLE_CONSUMER - consumer role for the user. */ + /** ACCESS_ROLE_CONSUMER - Consumer role for the user. */ ACCESS_ROLE_CONSUMER = 2, - /** ACCESS_ROLE_ADMIN - admin role for the user. */ + /** ACCESS_ROLE_ADMIN - Admin role for the user. */ ACCESS_ROLE_ADMIN = 3, UNRECOGNIZED = -1, } diff --git a/src/generated/yandex/cloud/mdb/mongodb/v1/backup.ts b/src/generated/yandex/cloud/mdb/mongodb/v1/backup.ts index d56d301d..fba1adb4 100644 --- a/src/generated/yandex/cloud/mdb/mongodb/v1/backup.ts +++ b/src/generated/yandex/cloud/mdb/mongodb/v1/backup.ts @@ -31,6 +31,8 @@ export interface Backup { size: number; /** How this backup was created (manual/automatic/etc...) */ type: Backup_BackupType; + /** Size of the journal associated with backup, in bytes */ + journalSize: number; } export enum Backup_BackupType { @@ -81,6 +83,7 @@ const baseBackup: object = { sourceShardNames: "", size: 0, type: 0, + journalSize: 0, }; export const Backup = { @@ -120,6 +123,9 @@ export const Backup = { if (message.type !== 0) { writer.uint32(64).int32(message.type); } + if (message.journalSize !== 0) { + writer.uint32(72).int64(message.journalSize); + } return writer; }, @@ -159,6 +165,9 @@ export const Backup = { case 8: message.type = reader.int32() as any; break; + case 9: + message.journalSize = longToNumber(reader.int64() as Long); + break; default: reader.skipType(tag & 7); break; @@ -198,6 +207,10 @@ export const Backup = { object.type !== undefined && object.type !== null ? backup_BackupTypeFromJSON(object.type) : 0; + message.journalSize = + object.journalSize !== undefined && object.journalSize !== null + ? Number(object.journalSize) + : 0; return message; }, @@ -219,6 +232,8 @@ export const Backup = { message.size !== undefined && (obj.size = Math.round(message.size)); message.type !== undefined && (obj.type = backup_BackupTypeToJSON(message.type)); + message.journalSize !== undefined && + (obj.journalSize = Math.round(message.journalSize)); return obj; }, @@ -232,6 +247,7 @@ export const Backup = { message.sourceShardNames = object.sourceShardNames?.map((e) => e) || []; message.size = object.size ?? 0; message.type = object.type ?? 0; + message.journalSize = object.journalSize ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/mongodb/v1/cluster.ts b/src/generated/yandex/cloud/mdb/mongodb/v1/cluster.ts index 4eabf42e..99fb4564 100644 --- a/src/generated/yandex/cloud/mdb/mongodb/v1/cluster.ts +++ b/src/generated/yandex/cloud/mdb/mongodb/v1/cluster.ts @@ -52,6 +52,11 @@ import { Mongocfgconfigset60Enterprise, Mongosconfigset60Enterprise, } from "../../../../../yandex/cloud/mdb/mongodb/v1/config/mongodb6_0_enterprise"; +import { + MongodConfigSet, + MongoCfgConfigSet, + MongosConfigSet, +} from "../../../../../yandex/cloud/mdb/mongodb/v1/config/mongodb"; import { Timestamp } from "../../../../../google/protobuf/timestamp"; import { Int64Value } from "../../../../../google/protobuf/wrappers"; @@ -102,7 +107,6 @@ export interface Cluster { deletionProtection: boolean; } -/** Deployment environment. */ export enum Cluster_Environment { ENVIRONMENT_UNSPECIFIED = 0, /** @@ -292,7 +296,7 @@ export interface Monitoring { export interface ClusterConfig { $type: "yandex.cloud.mdb.mongodb.v1.ClusterConfig"; - /** Version of MongoDB server software. Possible values: `3.6`, `4.0`, `4.2`, `4.4`, `4.4-enterprise`, `5.0`, `5.0-enterprise`, `6.0`, `6.0-enterprise`. */ + /** Version of MongoDB server software. Possible values: `3.6`, `4.0`, `4.2`, `4.4`, `4.4-enterprise`, `5.0`, `5.0-enterprise`, `6.0`, `6.0-enterprise`, `7.0`, `7.0-enterprise`. */ version: string; /** * MongoDB feature compatibility version. See usage details in [MongoDB documentation](https://docs.mongodb.com/manual/reference/command/setFeatureCompatibilityVersion/). @@ -332,6 +336,8 @@ export interface ClusterConfig { performanceDiagnostics?: PerformanceDiagnosticsConfig; /** Access policy to DB */ access?: Access; + /** Configuration and resource allocation for a MongoDB Enterprise cluster. */ + mongodbConfig?: Mongodb; } export interface Mongodb36 { @@ -352,6 +358,8 @@ export interface Mongodb36_Mongod { config?: Mongodconfigset36; /** Resources allocated to MongoDB hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb36_MongoCfg { @@ -359,6 +367,8 @@ export interface Mongodb36_MongoCfg { config?: Mongocfgconfigset36; /** Resources allocated to mongocfg hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb36_Mongos { @@ -366,6 +376,8 @@ export interface Mongodb36_Mongos { config?: Mongosconfigset36; /** Resources allocated to mongos hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb36_MongoInfra { @@ -374,6 +386,8 @@ export interface Mongodb36_MongoInfra { configMongocfg?: Mongocfgconfigset36; /** Resources allocated to mongoinfra (mongos+mongocfg) hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb40 { @@ -394,6 +408,8 @@ export interface Mongodb40_Mongod { config?: Mongodconfigset40; /** Resources allocated to mongod hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb40_MongoCfg { @@ -402,6 +418,8 @@ export interface Mongodb40_MongoCfg { config?: Mongocfgconfigset40; /** Resources allocated to mongocfg hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb40_Mongos { @@ -410,6 +428,8 @@ export interface Mongodb40_Mongos { config?: Mongosconfigset40; /** Resources allocated to mongos hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb40_MongoInfra { @@ -418,6 +438,8 @@ export interface Mongodb40_MongoInfra { configMongocfg?: Mongocfgconfigset40; /** Resources allocated to mongoinfra (mongos+mongocfg) hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb42 { @@ -438,6 +460,8 @@ export interface Mongodb42_Mongod { config?: Mongodconfigset42; /** Resources allocated to mongod hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb42_MongoCfg { @@ -446,6 +470,8 @@ export interface Mongodb42_MongoCfg { config?: Mongocfgconfigset42; /** Resources allocated to mongocfg hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb42_Mongos { @@ -454,6 +480,8 @@ export interface Mongodb42_Mongos { config?: Mongosconfigset42; /** Resources allocated to mongos hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb42_MongoInfra { @@ -462,6 +490,8 @@ export interface Mongodb42_MongoInfra { configMongocfg?: Mongocfgconfigset42; /** Resources allocated to mongoinfra (mongos+mongocfg) hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb44 { @@ -482,6 +512,8 @@ export interface Mongodb44_Mongod { config?: Mongodconfigset44; /** Resources allocated to mongod hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb44_MongoCfg { @@ -490,6 +522,8 @@ export interface Mongodb44_MongoCfg { config?: Mongocfgconfigset44; /** Resources allocated to mongocfg hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb44_Mongos { @@ -498,6 +532,8 @@ export interface Mongodb44_Mongos { config?: Mongosconfigset44; /** Resources allocated to mongos hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb44_MongoInfra { @@ -506,6 +542,8 @@ export interface Mongodb44_MongoInfra { configMongocfg?: Mongocfgconfigset44; /** Resources allocated to mongoinfra (mongos+mongocfg) hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb44Enterprise { @@ -526,6 +564,8 @@ export interface Mongodb44Enterprise_Mongod { config?: Mongodconfigset44Enterprise; /** Resources allocated to mongod hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb44Enterprise_MongoCfg { @@ -534,6 +574,8 @@ export interface Mongodb44Enterprise_MongoCfg { config?: Mongocfgconfigset44Enterprise; /** Resources allocated to mongocfg hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb44Enterprise_Mongos { @@ -542,6 +584,8 @@ export interface Mongodb44Enterprise_Mongos { config?: Mongosconfigset44Enterprise; /** Resources allocated to mongos hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb44Enterprise_MongoInfra { @@ -550,6 +594,8 @@ export interface Mongodb44Enterprise_MongoInfra { configMongocfg?: Mongocfgconfigset44Enterprise; /** Resources allocated to mongoinfra (mongos+mongocfg) hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb50 { @@ -570,6 +616,8 @@ export interface Mongodb50_Mongod { config?: Mongodconfigset50; /** Resources allocated to mongod hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb50_MongoCfg { @@ -578,6 +626,8 @@ export interface Mongodb50_MongoCfg { config?: Mongocfgconfigset50; /** Resources allocated to mongocfg hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb50_Mongos { @@ -586,6 +636,8 @@ export interface Mongodb50_Mongos { config?: Mongosconfigset50; /** Resources allocated to mongos hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb50_MongoInfra { @@ -594,6 +646,8 @@ export interface Mongodb50_MongoInfra { configMongocfg?: Mongocfgconfigset50; /** Resources allocated to mongoinfra (mongos+mongocfg) hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb50Enterprise { @@ -614,6 +668,8 @@ export interface Mongodb50Enterprise_Mongod { config?: Mongodconfigset50Enterprise; /** Resources allocated to mongod hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb50Enterprise_MongoCfg { @@ -622,6 +678,8 @@ export interface Mongodb50Enterprise_MongoCfg { config?: Mongocfgconfigset50Enterprise; /** Resources allocated to mongocfg hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb50Enterprise_Mongos { @@ -630,6 +688,8 @@ export interface Mongodb50Enterprise_Mongos { config?: Mongosconfigset50Enterprise; /** Resources allocated to mongos hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb50Enterprise_MongoInfra { @@ -638,6 +698,8 @@ export interface Mongodb50Enterprise_MongoInfra { configMongocfg?: Mongocfgconfigset50Enterprise; /** Resources allocated to mongoinfra (mongos+mongocfg) hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb60 { @@ -658,6 +720,8 @@ export interface Mongodb60_Mongod { config?: Mongodconfigset60; /** Resources allocated to mongod hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb60_MongoCfg { @@ -666,6 +730,8 @@ export interface Mongodb60_MongoCfg { config?: Mongocfgconfigset60; /** Resources allocated to mongocfg hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb60_Mongos { @@ -674,6 +740,8 @@ export interface Mongodb60_Mongos { config?: Mongosconfigset60; /** Resources allocated to mongos hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb60_MongoInfra { @@ -682,6 +750,8 @@ export interface Mongodb60_MongoInfra { configMongocfg?: Mongocfgconfigset60; /** Resources allocated to mongoinfra (mongos+mongocfg) hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb60Enterprise { @@ -702,6 +772,8 @@ export interface Mongodb60Enterprise_Mongod { config?: Mongodconfigset60Enterprise; /** Resources allocated to mongod hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb60Enterprise_MongoCfg { @@ -710,6 +782,8 @@ export interface Mongodb60Enterprise_MongoCfg { config?: Mongocfgconfigset60Enterprise; /** Resources allocated to mongocfg hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb60Enterprise_Mongos { @@ -718,6 +792,8 @@ export interface Mongodb60Enterprise_Mongos { config?: Mongosconfigset60Enterprise; /** Resources allocated to mongos hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodb60Enterprise_MongoInfra { @@ -726,6 +802,60 @@ export interface Mongodb60Enterprise_MongoInfra { configMongocfg?: Mongocfgconfigset60Enterprise; /** Resources allocated to mongoinfra (mongos+mongocfg) hosts. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; +} + +export interface Mongodb { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb"; + /** Configuration and resource allocation for mongod in a MongoDB cluster. */ + mongod?: Mongodb_Mongod; + /** Configuration and resource allocation for mongocfg in a MongoDB cluster. */ + mongocfg?: Mongodb_MongoCfg; + /** Configuration and resource allocation for mongos in a MongoDB cluster. */ + mongos?: Mongodb_Mongos; + /** Configuration and resource allocation for mongoinfra (mongos+mongocfg) in a MongoDB cluster. */ + mongoinfra?: Mongodb_MongoInfra; +} + +export interface Mongodb_Mongod { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb.Mongod"; + /** Configuration for mongod hosts. */ + config?: MongodConfigSet; + /** Resources allocated to mongod hosts. */ + resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; +} + +export interface Mongodb_MongoCfg { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb.MongoCfg"; + /** Configuration for mongocfg hosts. */ + config?: MongoCfgConfigSet; + /** Resources allocated to mongocfg hosts. */ + resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; +} + +export interface Mongodb_Mongos { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb.Mongos"; + /** Configuration for mongos hosts. */ + config?: MongosConfigSet; + /** Resources allocated to mongos hosts. */ + resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; +} + +export interface Mongodb_MongoInfra { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb.MongoInfra"; + configMongos?: MongosConfigSet; + configMongocfg?: MongoCfgConfigSet; + /** Resources allocated to mongoinfra (mongos+mongocfg) hosts. */ + resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Shard { @@ -751,9 +881,9 @@ export interface Host { zoneId: string; /** Resources allocated to the MongoDB host. */ resources?: Resources; - /** Role of the host in the cluster. */ + /** Role of the host in the cluster. If the field has default value, it is not returned in the response. */ role: Host_Role; - /** Status code of the aggregated health of the host. */ + /** Aggregated health of the host. If the field has default value, it is not returned in the response. */ health: Host_Health; /** Services provided by the host. */ services: Service[]; @@ -763,11 +893,14 @@ export interface Host { assignPublicIp: boolean; /** Shard which this host belongs to. */ shardName: string; - /** Host type */ + /** Host type. If the field has default value, it is not returned in the response. */ type: Host_Type; + /** Host parameters */ + hostParameters?: Host_HostParameters; } export enum Host_Type { + /** TYPE_UNSPECIFIED - Type of the host is unspecified. Default value. */ TYPE_UNSPECIFIED = 0, /** MONGOD - A mongod host. */ MONGOD = 1, @@ -822,7 +955,7 @@ export function host_TypeToJSON(object: Host_Type): string { } export enum Host_Role { - /** ROLE_UNKNOWN - Role of the host in the cluster is unknown. */ + /** ROLE_UNKNOWN - Role of the host in the cluster is unknown. Default value. */ ROLE_UNKNOWN = 0, /** PRIMARY - Host is the primary MongoDB server in the cluster. */ PRIMARY = 1, @@ -863,7 +996,7 @@ export function host_RoleToJSON(object: Host_Role): string { } export enum Host_Health { - /** HEALTH_UNKNOWN - Health of the host is unknown. */ + /** HEALTH_UNKNOWN - Health of the host is unknown. Default value. */ HEALTH_UNKNOWN = 0, /** ALIVE - The host is performing all its functions normally. */ ALIVE = 1, @@ -910,15 +1043,30 @@ export function host_HealthToJSON(object: Host_Health): string { } } +export interface Host_HostParameters { + $type: "yandex.cloud.mdb.mongodb.v1.Host.HostParameters"; + hidden: boolean; + secondaryDelaySecs: number; + priority: number; + tags: { [key: string]: string }; +} + +export interface Host_HostParameters_TagsEntry { + $type: "yandex.cloud.mdb.mongodb.v1.Host.HostParameters.TagsEntry"; + key: string; + value: string; +} + export interface Service { $type: "yandex.cloud.mdb.mongodb.v1.Service"; - /** Type of the service provided by the host. */ + /** Type of the service provided by the host. If the field has default value, it is not returned in the response. */ type: Service_Type; - /** Status code of server availability. */ + /** Aggregated health of the service. If the field has default value, it is not returned in the response. */ health: Service_Health; } export enum Service_Type { + /** TYPE_UNSPECIFIED - Service type of the host is unspecified. Default value. */ TYPE_UNSPECIFIED = 0, /** MONGOD - The host is running a mongod daemon. */ MONGOD = 1, @@ -1038,6 +1186,16 @@ export interface PerformanceDiagnosticsConfig { profilingEnabled: boolean; } +export interface DiskSizeAutoscaling { + $type: "yandex.cloud.mdb.mongodb.v1.DiskSizeAutoscaling"; + /** Amount of used storage for automatic disk scaling in the maintenance window, 0 means disabled, in percent. */ + plannedUsageThreshold?: number; + /** Amount of used storage for immediately automatic disk scaling, 0 means disabled, in percent. */ + emergencyUsageThreshold?: number; + /** Limit on how large the storage for database instances can automatically grow, in bytes. */ + diskSizeLimit?: number; +} + const baseCluster: object = { $type: "yandex.cloud.mdb.mongodb.v1.Cluster", id: "", @@ -1619,6 +1777,9 @@ export const ClusterConfig = { if (message.access !== undefined) { Access.encode(message.access, writer.uint32(50).fork()).ldelim(); } + if (message.mongodbConfig !== undefined) { + Mongodb.encode(message.mongodbConfig, writer.uint32(154).fork()).ldelim(); + } return writer; }, @@ -1689,6 +1850,9 @@ export const ClusterConfig = { case 6: message.access = Access.decode(reader, reader.uint32()); break; + case 19: + message.mongodbConfig = Mongodb.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1766,6 +1930,10 @@ export const ClusterConfig = { object.access !== undefined && object.access !== null ? Access.fromJSON(object.access) : undefined; + message.mongodbConfig = + object.mongodbConfig !== undefined && object.mongodbConfig !== null + ? Mongodb.fromJSON(object.mongodbConfig) + : undefined; return message; }, @@ -1822,6 +1990,10 @@ export const ClusterConfig = { : undefined); message.access !== undefined && (obj.access = message.access ? Access.toJSON(message.access) : undefined); + message.mongodbConfig !== undefined && + (obj.mongodbConfig = message.mongodbConfig + ? Mongodb.toJSON(message.mongodbConfig) + : undefined); return obj; }, @@ -1888,6 +2060,10 @@ export const ClusterConfig = { object.access !== undefined && object.access !== null ? Access.fromPartial(object.access) : undefined; + message.mongodbConfig = + object.mongodbConfig !== undefined && object.mongodbConfig !== null + ? Mongodb.fromPartial(object.mongodbConfig) + : undefined; return message; }, }; @@ -2050,6 +2226,12 @@ export const Mongodb36_Mongod = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -2066,6 +2248,12 @@ export const Mongodb36_Mongod = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2084,6 +2272,11 @@ export const Mongodb36_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -2097,6 +2290,10 @@ export const Mongodb36_Mongod = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -2112,6 +2309,11 @@ export const Mongodb36_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -2138,6 +2340,12 @@ export const Mongodb36_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -2154,6 +2362,12 @@ export const Mongodb36_MongoCfg = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2172,6 +2386,11 @@ export const Mongodb36_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -2185,6 +2404,10 @@ export const Mongodb36_MongoCfg = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -2200,6 +2423,11 @@ export const Mongodb36_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -2226,6 +2454,12 @@ export const Mongodb36_Mongos = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -2242,6 +2476,12 @@ export const Mongodb36_Mongos = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2260,6 +2500,11 @@ export const Mongodb36_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -2273,6 +2518,10 @@ export const Mongodb36_Mongos = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -2288,6 +2537,11 @@ export const Mongodb36_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -2320,6 +2574,12 @@ export const Mongodb36_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -2348,6 +2608,12 @@ export const Mongodb36_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2370,6 +2636,11 @@ export const Mongodb36_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -2387,6 +2658,10 @@ export const Mongodb36_MongoInfra = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -2406,6 +2681,11 @@ export const Mongodb36_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -2568,6 +2848,12 @@ export const Mongodb40_Mongod = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -2584,6 +2870,12 @@ export const Mongodb40_Mongod = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2602,6 +2894,11 @@ export const Mongodb40_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -2615,6 +2912,10 @@ export const Mongodb40_Mongod = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -2630,6 +2931,11 @@ export const Mongodb40_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -2656,6 +2962,12 @@ export const Mongodb40_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -2672,6 +2984,12 @@ export const Mongodb40_MongoCfg = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2690,6 +3008,11 @@ export const Mongodb40_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -2703,6 +3026,10 @@ export const Mongodb40_MongoCfg = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -2718,6 +3045,11 @@ export const Mongodb40_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -2744,6 +3076,12 @@ export const Mongodb40_Mongos = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -2760,6 +3098,12 @@ export const Mongodb40_Mongos = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2778,6 +3122,11 @@ export const Mongodb40_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -2791,6 +3140,10 @@ export const Mongodb40_Mongos = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -2806,6 +3159,11 @@ export const Mongodb40_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -2838,6 +3196,12 @@ export const Mongodb40_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -2866,6 +3230,12 @@ export const Mongodb40_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2888,6 +3258,11 @@ export const Mongodb40_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -2905,6 +3280,10 @@ export const Mongodb40_MongoInfra = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -2924,6 +3303,11 @@ export const Mongodb40_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -3086,6 +3470,12 @@ export const Mongodb42_Mongod = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -3102,6 +3492,12 @@ export const Mongodb42_Mongod = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3120,6 +3516,11 @@ export const Mongodb42_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -3133,6 +3534,10 @@ export const Mongodb42_Mongod = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -3148,6 +3553,11 @@ export const Mongodb42_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -3174,6 +3584,12 @@ export const Mongodb42_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -3190,6 +3606,12 @@ export const Mongodb42_MongoCfg = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3208,6 +3630,11 @@ export const Mongodb42_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -3221,6 +3648,10 @@ export const Mongodb42_MongoCfg = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -3236,6 +3667,11 @@ export const Mongodb42_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -3262,6 +3698,12 @@ export const Mongodb42_Mongos = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -3278,6 +3720,12 @@ export const Mongodb42_Mongos = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3296,6 +3744,11 @@ export const Mongodb42_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -3309,6 +3762,10 @@ export const Mongodb42_Mongos = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -3324,6 +3781,11 @@ export const Mongodb42_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -3356,6 +3818,12 @@ export const Mongodb42_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -3384,6 +3852,12 @@ export const Mongodb42_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3406,6 +3880,11 @@ export const Mongodb42_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -3423,6 +3902,10 @@ export const Mongodb42_MongoInfra = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -3442,6 +3925,11 @@ export const Mongodb42_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -3604,6 +4092,12 @@ export const Mongodb44_Mongod = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -3620,6 +4114,12 @@ export const Mongodb44_Mongod = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3638,6 +4138,11 @@ export const Mongodb44_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -3651,6 +4156,10 @@ export const Mongodb44_Mongod = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -3666,6 +4175,11 @@ export const Mongodb44_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -3692,6 +4206,12 @@ export const Mongodb44_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -3708,6 +4228,12 @@ export const Mongodb44_MongoCfg = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3726,6 +4252,11 @@ export const Mongodb44_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -3739,6 +4270,10 @@ export const Mongodb44_MongoCfg = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -3754,6 +4289,11 @@ export const Mongodb44_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -3780,6 +4320,12 @@ export const Mongodb44_Mongos = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -3796,6 +4342,12 @@ export const Mongodb44_Mongos = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3814,6 +4366,11 @@ export const Mongodb44_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -3827,6 +4384,10 @@ export const Mongodb44_Mongos = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -3842,6 +4403,11 @@ export const Mongodb44_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -3874,6 +4440,12 @@ export const Mongodb44_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -3902,6 +4474,12 @@ export const Mongodb44_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3924,6 +4502,11 @@ export const Mongodb44_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -3941,6 +4524,10 @@ export const Mongodb44_MongoInfra = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -3960,6 +4547,11 @@ export const Mongodb44_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -4131,6 +4723,12 @@ export const Mongodb44Enterprise_Mongod = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -4155,6 +4753,12 @@ export const Mongodb44Enterprise_Mongod = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -4175,6 +4779,11 @@ export const Mongodb44Enterprise_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -4188,6 +4797,10 @@ export const Mongodb44Enterprise_Mongod = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -4205,6 +4818,11 @@ export const Mongodb44Enterprise_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -4234,6 +4852,12 @@ export const Mongodb44Enterprise_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -4258,6 +4882,12 @@ export const Mongodb44Enterprise_MongoCfg = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -4278,6 +4908,11 @@ export const Mongodb44Enterprise_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -4291,6 +4926,10 @@ export const Mongodb44Enterprise_MongoCfg = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -4308,6 +4947,11 @@ export const Mongodb44Enterprise_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -4337,6 +4981,12 @@ export const Mongodb44Enterprise_Mongos = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -4361,6 +5011,12 @@ export const Mongodb44Enterprise_Mongos = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -4381,6 +5037,11 @@ export const Mongodb44Enterprise_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -4394,6 +5055,10 @@ export const Mongodb44Enterprise_Mongos = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -4411,6 +5076,11 @@ export const Mongodb44Enterprise_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -4447,6 +5117,12 @@ export const Mongodb44Enterprise_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -4477,6 +5153,12 @@ export const Mongodb44Enterprise_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -4501,6 +5183,11 @@ export const Mongodb44Enterprise_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -4518,6 +5205,10 @@ export const Mongodb44Enterprise_MongoInfra = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -4539,6 +5230,11 @@ export const Mongodb44Enterprise_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -4704,6 +5400,12 @@ export const Mongodb50_Mongod = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -4720,7 +5422,13 @@ export const Mongodb50_Mongod = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; - default: + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; + default: reader.skipType(tag & 7); break; } @@ -4738,6 +5446,11 @@ export const Mongodb50_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -4751,6 +5464,10 @@ export const Mongodb50_Mongod = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -4766,6 +5483,11 @@ export const Mongodb50_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -4792,6 +5514,12 @@ export const Mongodb50_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -4808,6 +5536,12 @@ export const Mongodb50_MongoCfg = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -4826,6 +5560,11 @@ export const Mongodb50_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -4839,6 +5578,10 @@ export const Mongodb50_MongoCfg = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -4854,6 +5597,11 @@ export const Mongodb50_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -4880,6 +5628,12 @@ export const Mongodb50_Mongos = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -4896,6 +5650,12 @@ export const Mongodb50_Mongos = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -4914,6 +5674,11 @@ export const Mongodb50_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -4927,6 +5692,10 @@ export const Mongodb50_Mongos = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -4942,6 +5711,11 @@ export const Mongodb50_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -4974,6 +5748,12 @@ export const Mongodb50_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -5002,6 +5782,12 @@ export const Mongodb50_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -5024,6 +5810,11 @@ export const Mongodb50_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -5041,6 +5832,10 @@ export const Mongodb50_MongoInfra = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -5060,6 +5855,11 @@ export const Mongodb50_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -5231,6 +6031,12 @@ export const Mongodb50Enterprise_Mongod = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -5255,6 +6061,12 @@ export const Mongodb50Enterprise_Mongod = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -5275,6 +6087,11 @@ export const Mongodb50Enterprise_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -5288,6 +6105,10 @@ export const Mongodb50Enterprise_Mongod = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -5305,6 +6126,11 @@ export const Mongodb50Enterprise_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -5334,6 +6160,12 @@ export const Mongodb50Enterprise_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -5358,6 +6190,12 @@ export const Mongodb50Enterprise_MongoCfg = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -5378,6 +6216,11 @@ export const Mongodb50Enterprise_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -5391,6 +6234,10 @@ export const Mongodb50Enterprise_MongoCfg = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -5408,6 +6255,11 @@ export const Mongodb50Enterprise_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -5437,6 +6289,12 @@ export const Mongodb50Enterprise_Mongos = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -5461,6 +6319,12 @@ export const Mongodb50Enterprise_Mongos = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -5481,6 +6345,11 @@ export const Mongodb50Enterprise_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -5494,6 +6363,10 @@ export const Mongodb50Enterprise_Mongos = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -5511,6 +6384,11 @@ export const Mongodb50Enterprise_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -5547,6 +6425,12 @@ export const Mongodb50Enterprise_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -5577,6 +6461,12 @@ export const Mongodb50Enterprise_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -5601,6 +6491,11 @@ export const Mongodb50Enterprise_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -5618,6 +6513,10 @@ export const Mongodb50Enterprise_MongoInfra = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -5639,6 +6538,11 @@ export const Mongodb50Enterprise_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -5804,6 +6708,12 @@ export const Mongodb60_Mongod = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -5820,6 +6730,12 @@ export const Mongodb60_Mongod = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -5838,6 +6754,11 @@ export const Mongodb60_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -5851,6 +6772,10 @@ export const Mongodb60_Mongod = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -5866,6 +6791,11 @@ export const Mongodb60_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -5892,6 +6822,12 @@ export const Mongodb60_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -5908,6 +6844,12 @@ export const Mongodb60_MongoCfg = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -5926,6 +6868,11 @@ export const Mongodb60_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -5939,6 +6886,10 @@ export const Mongodb60_MongoCfg = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -5954,6 +6905,11 @@ export const Mongodb60_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -5980,6 +6936,12 @@ export const Mongodb60_Mongos = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -5996,6 +6958,12 @@ export const Mongodb60_Mongos = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -6014,6 +6982,11 @@ export const Mongodb60_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -6027,6 +7000,10 @@ export const Mongodb60_Mongos = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -6042,6 +7019,11 @@ export const Mongodb60_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -6074,6 +7056,12 @@ export const Mongodb60_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -6102,6 +7090,12 @@ export const Mongodb60_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -6124,6 +7118,11 @@ export const Mongodb60_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -6141,6 +7140,10 @@ export const Mongodb60_MongoInfra = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -6160,6 +7163,11 @@ export const Mongodb60_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -6331,6 +7339,12 @@ export const Mongodb60Enterprise_Mongod = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -6355,6 +7369,12 @@ export const Mongodb60Enterprise_Mongod = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -6375,6 +7395,11 @@ export const Mongodb60Enterprise_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -6388,6 +7413,10 @@ export const Mongodb60Enterprise_Mongod = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -6405,6 +7434,11 @@ export const Mongodb60Enterprise_Mongod = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -6434,6 +7468,12 @@ export const Mongodb60Enterprise_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -6458,6 +7498,12 @@ export const Mongodb60Enterprise_MongoCfg = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -6478,6 +7524,11 @@ export const Mongodb60Enterprise_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -6491,6 +7542,10 @@ export const Mongodb60Enterprise_MongoCfg = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -6508,6 +7563,11 @@ export const Mongodb60Enterprise_MongoCfg = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -6537,6 +7597,12 @@ export const Mongodb60Enterprise_Mongos = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -6561,6 +7627,12 @@ export const Mongodb60Enterprise_Mongos = { case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -6581,6 +7653,11 @@ export const Mongodb60Enterprise_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -6594,6 +7671,10 @@ export const Mongodb60Enterprise_Mongos = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -6611,6 +7692,11 @@ export const Mongodb60Enterprise_Mongos = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -6647,6 +7733,12 @@ export const Mongodb60Enterprise_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -6677,6 +7769,12 @@ export const Mongodb60Enterprise_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -6701,6 +7799,11 @@ export const Mongodb60Enterprise_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -6718,6 +7821,10 @@ export const Mongodb60Enterprise_MongoInfra = { (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -6739,6 +7846,11 @@ export const Mongodb60Enterprise_MongoInfra = { object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -6748,37 +7860,57 @@ messageTypeRegistry.set( Mongodb60Enterprise_MongoInfra ); -const baseShard: object = { - $type: "yandex.cloud.mdb.mongodb.v1.Shard", - name: "", - clusterId: "", -}; +const baseMongodb: object = { $type: "yandex.cloud.mdb.mongodb.v1.Mongodb" }; -export const Shard = { - $type: "yandex.cloud.mdb.mongodb.v1.Shard" as const, +export const Mongodb = { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb" as const, - encode(message: Shard, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); + encode( + message: Mongodb, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.mongod !== undefined) { + Mongodb_Mongod.encode(message.mongod, writer.uint32(10).fork()).ldelim(); } - if (message.clusterId !== "") { - writer.uint32(18).string(message.clusterId); + if (message.mongocfg !== undefined) { + Mongodb_MongoCfg.encode( + message.mongocfg, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.mongos !== undefined) { + Mongodb_Mongos.encode(message.mongos, writer.uint32(26).fork()).ldelim(); + } + if (message.mongoinfra !== undefined) { + Mongodb_MongoInfra.encode( + message.mongoinfra, + writer.uint32(34).fork() + ).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Shard { + decode(input: _m0.Reader | Uint8Array, length?: number): Mongodb { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseShard } as Shard; + const message = { ...baseMongodb } as Mongodb; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.mongod = Mongodb_Mongod.decode(reader, reader.uint32()); break; case 2: - message.clusterId = reader.string(); + message.mongocfg = Mongodb_MongoCfg.decode(reader, reader.uint32()); + break; + case 3: + message.mongos = Mongodb_Mongos.decode(reader, reader.uint32()); + break; + case 4: + message.mongoinfra = Mongodb_MongoInfra.decode( + reader, + reader.uint32() + ); break; default: reader.skipType(tag & 7); @@ -6788,33 +7920,616 @@ export const Shard = { return message; }, - fromJSON(object: any): Shard { - const message = { ...baseShard } as Shard; - message.name = - object.name !== undefined && object.name !== null - ? String(object.name) - : ""; - message.clusterId = - object.clusterId !== undefined && object.clusterId !== null - ? String(object.clusterId) - : ""; + fromJSON(object: any): Mongodb { + const message = { ...baseMongodb } as Mongodb; + message.mongod = + object.mongod !== undefined && object.mongod !== null + ? Mongodb_Mongod.fromJSON(object.mongod) + : undefined; + message.mongocfg = + object.mongocfg !== undefined && object.mongocfg !== null + ? Mongodb_MongoCfg.fromJSON(object.mongocfg) + : undefined; + message.mongos = + object.mongos !== undefined && object.mongos !== null + ? Mongodb_Mongos.fromJSON(object.mongos) + : undefined; + message.mongoinfra = + object.mongoinfra !== undefined && object.mongoinfra !== null + ? Mongodb_MongoInfra.fromJSON(object.mongoinfra) + : undefined; return message; }, - toJSON(message: Shard): unknown { + toJSON(message: Mongodb): unknown { const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.mongod !== undefined && + (obj.mongod = message.mongod + ? Mongodb_Mongod.toJSON(message.mongod) + : undefined); + message.mongocfg !== undefined && + (obj.mongocfg = message.mongocfg + ? Mongodb_MongoCfg.toJSON(message.mongocfg) + : undefined); + message.mongos !== undefined && + (obj.mongos = message.mongos + ? Mongodb_Mongos.toJSON(message.mongos) + : undefined); + message.mongoinfra !== undefined && + (obj.mongoinfra = message.mongoinfra + ? Mongodb_MongoInfra.toJSON(message.mongoinfra) + : undefined); return obj; }, - fromPartial, I>>(object: I): Shard { - const message = { ...baseShard } as Shard; - message.name = object.name ?? ""; - message.clusterId = object.clusterId ?? ""; - return message; - }, -}; + fromPartial, I>>(object: I): Mongodb { + const message = { ...baseMongodb } as Mongodb; + message.mongod = + object.mongod !== undefined && object.mongod !== null + ? Mongodb_Mongod.fromPartial(object.mongod) + : undefined; + message.mongocfg = + object.mongocfg !== undefined && object.mongocfg !== null + ? Mongodb_MongoCfg.fromPartial(object.mongocfg) + : undefined; + message.mongos = + object.mongos !== undefined && object.mongos !== null + ? Mongodb_Mongos.fromPartial(object.mongos) + : undefined; + message.mongoinfra = + object.mongoinfra !== undefined && object.mongoinfra !== null + ? Mongodb_MongoInfra.fromPartial(object.mongoinfra) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Mongodb.$type, Mongodb); + +const baseMongodb_Mongod: object = { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb.Mongod", +}; + +export const Mongodb_Mongod = { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb.Mongod" as const, + + encode( + message: Mongodb_Mongod, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.config !== undefined) { + MongodConfigSet.encode(message.config, writer.uint32(10).fork()).ldelim(); + } + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); + } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Mongodb_Mongod { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongodb_Mongod } as Mongodb_Mongod; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.config = MongodConfigSet.decode(reader, reader.uint32()); + break; + case 2: + message.resources = Resources.decode(reader, reader.uint32()); + break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodb_Mongod { + const message = { ...baseMongodb_Mongod } as Mongodb_Mongod; + message.config = + object.config !== undefined && object.config !== null + ? MongodConfigSet.fromJSON(object.config) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; + return message; + }, + + toJSON(message: Mongodb_Mongod): unknown { + const obj: any = {}; + message.config !== undefined && + (obj.config = message.config + ? MongodConfigSet.toJSON(message.config) + : undefined); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Mongodb_Mongod { + const message = { ...baseMongodb_Mongod } as Mongodb_Mongod; + message.config = + object.config !== undefined && object.config !== null + ? MongodConfigSet.fromPartial(object.config) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Mongodb_Mongod.$type, Mongodb_Mongod); + +const baseMongodb_MongoCfg: object = { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb.MongoCfg", +}; + +export const Mongodb_MongoCfg = { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb.MongoCfg" as const, + + encode( + message: Mongodb_MongoCfg, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.config !== undefined) { + MongoCfgConfigSet.encode( + message.config, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); + } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Mongodb_MongoCfg { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongodb_MongoCfg } as Mongodb_MongoCfg; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.config = MongoCfgConfigSet.decode(reader, reader.uint32()); + break; + case 2: + message.resources = Resources.decode(reader, reader.uint32()); + break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodb_MongoCfg { + const message = { ...baseMongodb_MongoCfg } as Mongodb_MongoCfg; + message.config = + object.config !== undefined && object.config !== null + ? MongoCfgConfigSet.fromJSON(object.config) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; + return message; + }, + + toJSON(message: Mongodb_MongoCfg): unknown { + const obj: any = {}; + message.config !== undefined && + (obj.config = message.config + ? MongoCfgConfigSet.toJSON(message.config) + : undefined); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Mongodb_MongoCfg { + const message = { ...baseMongodb_MongoCfg } as Mongodb_MongoCfg; + message.config = + object.config !== undefined && object.config !== null + ? MongoCfgConfigSet.fromPartial(object.config) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Mongodb_MongoCfg.$type, Mongodb_MongoCfg); + +const baseMongodb_Mongos: object = { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb.Mongos", +}; + +export const Mongodb_Mongos = { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb.Mongos" as const, + + encode( + message: Mongodb_Mongos, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.config !== undefined) { + MongosConfigSet.encode(message.config, writer.uint32(10).fork()).ldelim(); + } + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); + } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Mongodb_Mongos { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongodb_Mongos } as Mongodb_Mongos; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.config = MongosConfigSet.decode(reader, reader.uint32()); + break; + case 2: + message.resources = Resources.decode(reader, reader.uint32()); + break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodb_Mongos { + const message = { ...baseMongodb_Mongos } as Mongodb_Mongos; + message.config = + object.config !== undefined && object.config !== null + ? MongosConfigSet.fromJSON(object.config) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; + return message; + }, + + toJSON(message: Mongodb_Mongos): unknown { + const obj: any = {}; + message.config !== undefined && + (obj.config = message.config + ? MongosConfigSet.toJSON(message.config) + : undefined); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Mongodb_Mongos { + const message = { ...baseMongodb_Mongos } as Mongodb_Mongos; + message.config = + object.config !== undefined && object.config !== null + ? MongosConfigSet.fromPartial(object.config) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Mongodb_Mongos.$type, Mongodb_Mongos); + +const baseMongodb_MongoInfra: object = { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb.MongoInfra", +}; + +export const Mongodb_MongoInfra = { + $type: "yandex.cloud.mdb.mongodb.v1.Mongodb.MongoInfra" as const, + + encode( + message: Mongodb_MongoInfra, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.configMongos !== undefined) { + MongosConfigSet.encode( + message.configMongos, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.configMongocfg !== undefined) { + MongoCfgConfigSet.encode( + message.configMongocfg, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); + } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Mongodb_MongoInfra { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongodb_MongoInfra } as Mongodb_MongoInfra; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.configMongos = MongosConfigSet.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.configMongocfg = MongoCfgConfigSet.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.resources = Resources.decode(reader, reader.uint32()); + break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodb_MongoInfra { + const message = { ...baseMongodb_MongoInfra } as Mongodb_MongoInfra; + message.configMongos = + object.configMongos !== undefined && object.configMongos !== null + ? MongosConfigSet.fromJSON(object.configMongos) + : undefined; + message.configMongocfg = + object.configMongocfg !== undefined && object.configMongocfg !== null + ? MongoCfgConfigSet.fromJSON(object.configMongocfg) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; + return message; + }, + + toJSON(message: Mongodb_MongoInfra): unknown { + const obj: any = {}; + message.configMongos !== undefined && + (obj.configMongos = message.configMongos + ? MongosConfigSet.toJSON(message.configMongos) + : undefined); + message.configMongocfg !== undefined && + (obj.configMongocfg = message.configMongocfg + ? MongoCfgConfigSet.toJSON(message.configMongocfg) + : undefined); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Mongodb_MongoInfra { + const message = { ...baseMongodb_MongoInfra } as Mongodb_MongoInfra; + message.configMongos = + object.configMongos !== undefined && object.configMongos !== null + ? MongosConfigSet.fromPartial(object.configMongos) + : undefined; + message.configMongocfg = + object.configMongocfg !== undefined && object.configMongocfg !== null + ? MongoCfgConfigSet.fromPartial(object.configMongocfg) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Mongodb_MongoInfra.$type, Mongodb_MongoInfra); + +const baseShard: object = { + $type: "yandex.cloud.mdb.mongodb.v1.Shard", + name: "", + clusterId: "", +}; + +export const Shard = { + $type: "yandex.cloud.mdb.mongodb.v1.Shard" as const, + + encode(message: Shard, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.clusterId !== "") { + writer.uint32(18).string(message.clusterId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Shard { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseShard } as Shard; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Shard { + const message = { ...baseShard } as Shard; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: Shard): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>(object: I): Shard { + const message = { ...baseShard } as Shard; + message.name = object.name ?? ""; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; messageTypeRegistry.set(Shard.$type, Shard); @@ -6868,6 +8583,12 @@ export const Host = { if (message.type !== 0) { writer.uint32(88).int32(message.type); } + if (message.hostParameters !== undefined) { + Host_HostParameters.encode( + message.hostParameters, + writer.uint32(98).fork() + ).ldelim(); + } return writer; }, @@ -6912,6 +8633,12 @@ export const Host = { case 11: message.type = reader.int32() as any; break; + case 12: + message.hostParameters = Host_HostParameters.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -6965,6 +8692,10 @@ export const Host = { object.type !== undefined && object.type !== null ? host_TypeFromJSON(object.type) : 0; + message.hostParameters = + object.hostParameters !== undefined && object.hostParameters !== null + ? Host_HostParameters.fromJSON(object.hostParameters) + : undefined; return message; }, @@ -6992,6 +8723,10 @@ export const Host = { (obj.assignPublicIp = message.assignPublicIp); message.shardName !== undefined && (obj.shardName = message.shardName); message.type !== undefined && (obj.type = host_TypeToJSON(message.type)); + message.hostParameters !== undefined && + (obj.hostParameters = message.hostParameters + ? Host_HostParameters.toJSON(message.hostParameters) + : undefined); return obj; }, @@ -7012,12 +8747,231 @@ export const Host = { message.assignPublicIp = object.assignPublicIp ?? false; message.shardName = object.shardName ?? ""; message.type = object.type ?? 0; + message.hostParameters = + object.hostParameters !== undefined && object.hostParameters !== null + ? Host_HostParameters.fromPartial(object.hostParameters) + : undefined; return message; }, }; messageTypeRegistry.set(Host.$type, Host); +const baseHost_HostParameters: object = { + $type: "yandex.cloud.mdb.mongodb.v1.Host.HostParameters", + hidden: false, + secondaryDelaySecs: 0, + priority: 0, +}; + +export const Host_HostParameters = { + $type: "yandex.cloud.mdb.mongodb.v1.Host.HostParameters" as const, + + encode( + message: Host_HostParameters, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.hidden === true) { + writer.uint32(8).bool(message.hidden); + } + if (message.secondaryDelaySecs !== 0) { + writer.uint32(16).int64(message.secondaryDelaySecs); + } + if (message.priority !== 0) { + writer.uint32(25).double(message.priority); + } + Object.entries(message.tags).forEach(([key, value]) => { + Host_HostParameters_TagsEntry.encode( + { + $type: "yandex.cloud.mdb.mongodb.v1.Host.HostParameters.TagsEntry", + key: key as any, + value, + }, + writer.uint32(34).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Host_HostParameters { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHost_HostParameters } as Host_HostParameters; + message.tags = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hidden = reader.bool(); + break; + case 2: + message.secondaryDelaySecs = longToNumber(reader.int64() as Long); + break; + case 3: + message.priority = reader.double(); + break; + case 4: + const entry4 = Host_HostParameters_TagsEntry.decode( + reader, + reader.uint32() + ); + if (entry4.value !== undefined) { + message.tags[entry4.key] = entry4.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Host_HostParameters { + const message = { ...baseHost_HostParameters } as Host_HostParameters; + message.hidden = + object.hidden !== undefined && object.hidden !== null + ? Boolean(object.hidden) + : false; + message.secondaryDelaySecs = + object.secondaryDelaySecs !== undefined && + object.secondaryDelaySecs !== null + ? Number(object.secondaryDelaySecs) + : 0; + message.priority = + object.priority !== undefined && object.priority !== null + ? Number(object.priority) + : 0; + message.tags = Object.entries(object.tags ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: Host_HostParameters): unknown { + const obj: any = {}; + message.hidden !== undefined && (obj.hidden = message.hidden); + message.secondaryDelaySecs !== undefined && + (obj.secondaryDelaySecs = Math.round(message.secondaryDelaySecs)); + message.priority !== undefined && (obj.priority = message.priority); + obj.tags = {}; + if (message.tags) { + Object.entries(message.tags).forEach(([k, v]) => { + obj.tags[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Host_HostParameters { + const message = { ...baseHost_HostParameters } as Host_HostParameters; + message.hidden = object.hidden ?? false; + message.secondaryDelaySecs = object.secondaryDelaySecs ?? 0; + message.priority = object.priority ?? 0; + message.tags = Object.entries(object.tags ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(Host_HostParameters.$type, Host_HostParameters); + +const baseHost_HostParameters_TagsEntry: object = { + $type: "yandex.cloud.mdb.mongodb.v1.Host.HostParameters.TagsEntry", + key: "", + value: "", +}; + +export const Host_HostParameters_TagsEntry = { + $type: "yandex.cloud.mdb.mongodb.v1.Host.HostParameters.TagsEntry" as const, + + encode( + message: Host_HostParameters_TagsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Host_HostParameters_TagsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseHost_HostParameters_TagsEntry, + } as Host_HostParameters_TagsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Host_HostParameters_TagsEntry { + const message = { + ...baseHost_HostParameters_TagsEntry, + } as Host_HostParameters_TagsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Host_HostParameters_TagsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Host_HostParameters_TagsEntry { + const message = { + ...baseHost_HostParameters_TagsEntry, + } as Host_HostParameters_TagsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + Host_HostParameters_TagsEntry.$type, + Host_HostParameters_TagsEntry +); + const baseService: object = { $type: "yandex.cloud.mdb.mongodb.v1.Service", type: 0, @@ -7331,6 +9285,121 @@ messageTypeRegistry.set( PerformanceDiagnosticsConfig ); +const baseDiskSizeAutoscaling: object = { + $type: "yandex.cloud.mdb.mongodb.v1.DiskSizeAutoscaling", +}; + +export const DiskSizeAutoscaling = { + $type: "yandex.cloud.mdb.mongodb.v1.DiskSizeAutoscaling" as const, + + encode( + message: DiskSizeAutoscaling, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.plannedUsageThreshold !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.plannedUsageThreshold!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.emergencyUsageThreshold !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.emergencyUsageThreshold!, + }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.diskSizeLimit !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.diskSizeLimit! }, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DiskSizeAutoscaling { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDiskSizeAutoscaling } as DiskSizeAutoscaling; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plannedUsageThreshold = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 2: + message.emergencyUsageThreshold = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 3: + message.diskSizeLimit = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DiskSizeAutoscaling { + const message = { ...baseDiskSizeAutoscaling } as DiskSizeAutoscaling; + message.plannedUsageThreshold = + object.plannedUsageThreshold !== undefined && + object.plannedUsageThreshold !== null + ? Number(object.plannedUsageThreshold) + : undefined; + message.emergencyUsageThreshold = + object.emergencyUsageThreshold !== undefined && + object.emergencyUsageThreshold !== null + ? Number(object.emergencyUsageThreshold) + : undefined; + message.diskSizeLimit = + object.diskSizeLimit !== undefined && object.diskSizeLimit !== null + ? Number(object.diskSizeLimit) + : undefined; + return message; + }, + + toJSON(message: DiskSizeAutoscaling): unknown { + const obj: any = {}; + message.plannedUsageThreshold !== undefined && + (obj.plannedUsageThreshold = message.plannedUsageThreshold); + message.emergencyUsageThreshold !== undefined && + (obj.emergencyUsageThreshold = message.emergencyUsageThreshold); + message.diskSizeLimit !== undefined && + (obj.diskSizeLimit = message.diskSizeLimit); + return obj; + }, + + fromPartial, I>>( + object: I + ): DiskSizeAutoscaling { + const message = { ...baseDiskSizeAutoscaling } as DiskSizeAutoscaling; + message.plannedUsageThreshold = object.plannedUsageThreshold ?? undefined; + message.emergencyUsageThreshold = + object.emergencyUsageThreshold ?? undefined; + message.diskSizeLimit = object.diskSizeLimit ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(DiskSizeAutoscaling.$type, DiskSizeAutoscaling); + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/generated/yandex/cloud/mdb/mongodb/v1/cluster_service.ts b/src/generated/yandex/cloud/mdb/mongodb/v1/cluster_service.ts index 03c392c8..57106190 100644 --- a/src/generated/yandex/cloud/mdb/mongodb/v1/cluster_service.ts +++ b/src/generated/yandex/cloud/mdb/mongodb/v1/cluster_service.ts @@ -20,6 +20,7 @@ import { Cluster_Environment, Resources, Host_Type, + DiskSizeAutoscaling, PerformanceDiagnosticsConfig, Access, Cluster, @@ -30,8 +31,8 @@ import { host_TypeFromJSON, host_TypeToJSON, } from "../../../../../yandex/cloud/mdb/mongodb/v1/cluster"; -import { FieldMask } from "../../../../../google/protobuf/field_mask"; import { MaintenanceWindow } from "../../../../../yandex/cloud/mdb/mongodb/v1/maintenance"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; import { Mongodconfig36, Mongocfgconfig36, @@ -77,13 +78,22 @@ import { Mongocfgconfig60Enterprise, Mongosconfig60Enterprise, } from "../../../../../yandex/cloud/mdb/mongodb/v1/config/mongodb6_0_enterprise"; +import { + MongodConfig, + MongoCfgConfig, + MongosConfig, +} from "../../../../../yandex/cloud/mdb/mongodb/v1/config/mongodb"; import { TimeOfDay } from "../../../../../google/type/timeofday"; import { Timestamp } from "../../../../../google/protobuf/timestamp"; import { DatabaseSpec } from "../../../../../yandex/cloud/mdb/mongodb/v1/database"; import { UserSpec } from "../../../../../yandex/cloud/mdb/mongodb/v1/user"; import { Operation } from "../../../../../yandex/cloud/operation/operation"; import { Backup } from "../../../../../yandex/cloud/mdb/mongodb/v1/backup"; -import { Int64Value } from "../../../../../google/protobuf/wrappers"; +import { + BoolValue, + Int64Value, + DoubleValue, +} from "../../../../../google/protobuf/wrappers"; export const protobufPackage = "yandex.cloud.mdb.mongodb.v1"; @@ -167,6 +177,8 @@ export interface CreateClusterRequest { securityGroupIds: string[]; /** Deletion Protection inhibits deletion of the cluster */ deletionProtection: boolean; + /** Maintenance window settings for the cluster. */ + maintenanceWindow?: MaintenanceWindow; } export interface CreateClusterRequest_LabelsEntry { @@ -210,6 +222,8 @@ export interface UpdateClusterRequest { securityGroupIds: string[]; /** Deletion Protection inhibits deletion of the cluster */ deletionProtection: boolean; + /** ID of the network to move the cluster to. */ + networkId: string; } export interface UpdateClusterRequest_LabelsEntry { @@ -334,6 +348,8 @@ export interface RestoreClusterRequest { securityGroupIds: string[]; /** Deletion Protection inhibits deletion of the cluster */ deletionProtection: boolean; + /** Maintenance window settings for the cluster. */ + maintenanceWindow?: MaintenanceWindow; } export interface RestoreClusterRequest_LabelsEntry { @@ -779,6 +795,57 @@ export interface DeleteClusterHostsMetadata { hostNames: string[]; } +export interface UpdateClusterHostsRequest { + $type: "yandex.cloud.mdb.mongodb.v1.UpdateClusterHostsRequest"; + /** + * ID of the MongoDB cluster to update hosts from. + * To get the MongoDB cluster ID, use a [ClusterService.List] request. + */ + clusterId: string; + /** New configurations to apply to hosts of a Managed Service for MongoDB cluster. */ + updateHostSpecs: UpdateHostSpec[]; +} + +export interface UpdateClusterHostsMetadata { + $type: "yandex.cloud.mdb.mongodb.v1.UpdateClusterHostsMetadata"; + /** ID of the MongoDB cluster to update host from. */ + clusterId: string; + /** Name of host that are being updated. */ + hostNames: string[]; +} + +export interface UpdateHostSpec { + $type: "yandex.cloud.mdb.mongodb.v1.UpdateHostSpec"; + /** Host to be updated. Specify the [host FQDN](https://yandex.cloud/en/docs/managed-mongodb/operations/connect/#fqdn). */ + hostName: string; + /** + * Determines if the host is a hidden replica set member. + * + * Such members cannot become primary in a replica set, and they are invisible to client applications. However, hidden members can participate in elections of the primary host. For more information, see the [MongoDB documentation](https://www.mongodb.com/docs/manual/core/replica-set-hidden-member/). + */ + hidden?: boolean; + /** The time, in seconds, by which the given replica set member lags behind the primary host. */ + secondaryDelaySecs?: number; + /** + * Priority of the host to be elected as the primary in the replica set. + * + * The minimum value is `0` if the Managed Service for MongoDB cluster contains three or more secondary hosts. Otherwise, the minimum value is `1`. + */ + priority?: number; + /** Determines whether the host should get a public IP address after the update. */ + assignPublicIp: boolean; + /** Field mask that specifies which fields of the MongoDB host should be updated. */ + updateMask?: FieldMask; + /** Host tag list that contains key-value pairs for the given replica set member. For more information about how to specify the tags and what values to choose, see the [MongoDB documentation](https://www.mongodb.com/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-.tags). */ + tags: { [key: string]: string }; +} + +export interface UpdateHostSpec_TagsEntry { + $type: "yandex.cloud.mdb.mongodb.v1.UpdateHostSpec.TagsEntry"; + key: string; + value: string; +} + export interface EnableClusterShardingRequest { $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest"; /** ID of the MongoDB cluster to enable sharding for. */ @@ -983,6 +1050,20 @@ export interface HostSpec { type: Host_Type; /** Name of the shard that the host belongs to. */ shardName: string; + /** Is host hidden in replSet */ + hidden?: boolean; + /** The number of seconds "behind" the primary that this replica set member should "lag" */ + secondaryDelaySecs?: number; + /** Priority of host for the election in replSet */ + priority?: number; + /** Host tags */ + tags: { [key: string]: string }; +} + +export interface HostSpec_TagsEntry { + $type: "yandex.cloud.mdb.mongodb.v1.HostSpec.TagsEntry"; + key: string; + value: string; } export interface Mongodbspec36 { @@ -1003,6 +1084,8 @@ export interface Mongodbspec36_Mongod { config?: Mongodconfig36; /** Resources allocated to each mongod host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec36_MongoCfg { @@ -1011,6 +1094,8 @@ export interface Mongodbspec36_MongoCfg { config?: Mongocfgconfig36; /** Resources allocated to each mongocfg host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec36_Mongos { @@ -1019,6 +1104,8 @@ export interface Mongodbspec36_Mongos { config?: Mongosconfig36; /** Resources allocated to each mongos host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec36_MongoInfra { @@ -1028,6 +1115,8 @@ export interface Mongodbspec36_MongoInfra { configMongocfg?: Mongocfgconfig36; /** Resources allocated to each mongoinfra (mongos+mongocfg) host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec40 { @@ -1048,6 +1137,8 @@ export interface Mongodbspec40_Mongod { config?: Mongodconfig40; /** Resources allocated to each mongod host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec40_MongoCfg { @@ -1056,6 +1147,8 @@ export interface Mongodbspec40_MongoCfg { config?: Mongocfgconfig40; /** Resources allocated to each mongocfg host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec40_Mongos { @@ -1064,6 +1157,8 @@ export interface Mongodbspec40_Mongos { config?: Mongosconfig40; /** Resources allocated to each mongos host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec40_MongoInfra { @@ -1073,6 +1168,8 @@ export interface Mongodbspec40_MongoInfra { configMongocfg?: Mongocfgconfig40; /** Resources allocated to each mongoinfra (mongos+mongocfg) host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec42 { @@ -1093,6 +1190,8 @@ export interface Mongodbspec42_Mongod { config?: Mongodconfig42; /** Resources allocated to each mongod host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec42_MongoCfg { @@ -1101,6 +1200,8 @@ export interface Mongodbspec42_MongoCfg { config?: Mongocfgconfig42; /** Resources allocated to each mongocfg host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec42_Mongos { @@ -1109,6 +1210,8 @@ export interface Mongodbspec42_Mongos { config?: Mongosconfig42; /** Resources allocated to each mongos host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec42_MongoInfra { @@ -1118,6 +1221,8 @@ export interface Mongodbspec42_MongoInfra { configMongocfg?: Mongocfgconfig42; /** Resources allocated to each mongoinfra (mongos+mongocfg) host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec44 { @@ -1138,6 +1243,8 @@ export interface Mongodbspec44_Mongod { config?: Mongodconfig44; /** Resources allocated to each mongod host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec44_MongoCfg { @@ -1146,6 +1253,8 @@ export interface Mongodbspec44_MongoCfg { config?: Mongocfgconfig44; /** Resources allocated to each mongocfg host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec44_Mongos { @@ -1154,6 +1263,8 @@ export interface Mongodbspec44_Mongos { config?: Mongosconfig44; /** Resources allocated to each mongos host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec44_MongoInfra { @@ -1163,6 +1274,8 @@ export interface Mongodbspec44_MongoInfra { configMongocfg?: Mongocfgconfig44; /** Resources allocated to each mongoinfra (mongos+mongocfg) host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec44Enterprise { @@ -1183,6 +1296,8 @@ export interface Mongodbspec44Enterprise_Mongod { config?: Mongodconfig44Enterprise; /** Resources allocated to each mongod host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec44Enterprise_MongoCfg { @@ -1191,6 +1306,8 @@ export interface Mongodbspec44Enterprise_MongoCfg { config?: Mongocfgconfig44Enterprise; /** Resources allocated to each mongocfg host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec44Enterprise_Mongos { @@ -1199,6 +1316,8 @@ export interface Mongodbspec44Enterprise_Mongos { config?: Mongosconfig44Enterprise; /** Resources allocated to each mongos host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec44Enterprise_MongoInfra { @@ -1208,6 +1327,8 @@ export interface Mongodbspec44Enterprise_MongoInfra { configMongocfg?: Mongocfgconfig44Enterprise; /** Resources allocated to each mongoinfra (mongos+mongocfg) host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec50 { @@ -1228,6 +1349,8 @@ export interface Mongodbspec50_Mongod { config?: Mongodconfig50; /** Resources allocated to each mongod host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec50_MongoCfg { @@ -1236,6 +1359,8 @@ export interface Mongodbspec50_MongoCfg { config?: Mongocfgconfig50; /** Resources allocated to each mongocfg host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec50_Mongos { @@ -1244,6 +1369,8 @@ export interface Mongodbspec50_Mongos { config?: Mongosconfig50; /** Resources allocated to each mongos host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec50_MongoInfra { @@ -1253,6 +1380,8 @@ export interface Mongodbspec50_MongoInfra { configMongocfg?: Mongocfgconfig50; /** Resources allocated to each mongoinfra (mongos+mongocfg) host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec50Enterprise { @@ -1273,6 +1402,8 @@ export interface Mongodbspec50Enterprise_Mongod { config?: Mongodconfig50Enterprise; /** Resources allocated to each mongod host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec50Enterprise_MongoCfg { @@ -1281,6 +1412,8 @@ export interface Mongodbspec50Enterprise_MongoCfg { config?: Mongocfgconfig50Enterprise; /** Resources allocated to each mongocfg host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec50Enterprise_Mongos { @@ -1289,6 +1422,8 @@ export interface Mongodbspec50Enterprise_Mongos { config?: Mongosconfig50Enterprise; /** Resources allocated to each mongos host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec50Enterprise_MongoInfra { @@ -1298,6 +1433,8 @@ export interface Mongodbspec50Enterprise_MongoInfra { configMongocfg?: Mongocfgconfig50Enterprise; /** Resources allocated to each mongoinfra (mongos+mongocfg) host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec60 { @@ -1318,6 +1455,8 @@ export interface Mongodbspec60_Mongod { config?: Mongodconfig60; /** Resources allocated to each mongod host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec60_MongoCfg { @@ -1326,6 +1465,8 @@ export interface Mongodbspec60_MongoCfg { config?: Mongocfgconfig60; /** Resources allocated to each mongocfg host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec60_Mongos { @@ -1334,6 +1475,8 @@ export interface Mongodbspec60_Mongos { config?: Mongosconfig60; /** Resources allocated to each mongos host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec60_MongoInfra { @@ -1343,6 +1486,8 @@ export interface Mongodbspec60_MongoInfra { configMongocfg?: Mongocfgconfig60; /** Resources allocated to each mongoinfra (mongos+mongocfg) host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec60Enterprise { @@ -1363,6 +1508,8 @@ export interface Mongodbspec60Enterprise_Mongod { config?: Mongodconfig60Enterprise; /** Resources allocated to each mongod host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec60Enterprise_MongoCfg { @@ -1371,6 +1518,8 @@ export interface Mongodbspec60Enterprise_MongoCfg { config?: Mongocfgconfig60Enterprise; /** Resources allocated to each mongocfg host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec60Enterprise_Mongos { @@ -1379,6 +1528,8 @@ export interface Mongodbspec60Enterprise_Mongos { config?: Mongosconfig60Enterprise; /** Resources allocated to each mongos host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Mongodbspec60Enterprise_MongoInfra { @@ -1388,6 +1539,60 @@ export interface Mongodbspec60Enterprise_MongoInfra { configMongocfg?: Mongocfgconfig60Enterprise; /** Resources allocated to each mongoinfra (mongos+mongocfg) host. */ resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; +} + +export interface MongodbSpec { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec"; + /** Configuration and resource allocation for mongod hosts. */ + mongod?: MongodbSpec_Mongod; + /** Configuration and resource allocation for mongocfg hosts. */ + mongocfg?: MongodbSpec_MongoCfg; + /** Configuration and resource allocation for mongos hosts. */ + mongos?: MongodbSpec_Mongos; + /** Configuration and resource allocation for mongoinfra (mongos+mongocfg) hosts. */ + mongoinfra?: MongodbSpec_MongoInfra; +} + +export interface MongodbSpec_Mongod { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec.Mongod"; + config?: MongodConfig; + /** Resources allocated to each mongod host. */ + resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; +} + +export interface MongodbSpec_MongoCfg { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec.MongoCfg"; + /** Configuration for mongocfg hosts. */ + config?: MongoCfgConfig; + /** Resources allocated to each mongocfg host. */ + resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; +} + +export interface MongodbSpec_Mongos { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec.Mongos"; + /** Configuration for mongos hosts. */ + config?: MongosConfig; + /** Resources allocated to each mongos host. */ + resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; +} + +export interface MongodbSpec_MongoInfra { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec.MongoInfra"; + /** Configuration for mongoinfra hosts. */ + configMongos?: MongosConfig; + configMongocfg?: MongoCfgConfig; + /** Resources allocated to each mongoinfra (mongos+mongocfg) host. */ + resources?: Resources; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface ConfigSpec { @@ -1432,6 +1637,8 @@ export interface ConfigSpec { performanceDiagnostics?: PerformanceDiagnosticsConfig; /** Access policy to DB */ access?: Access; + /** Configuration and resource allocation for a MongoDB 7.0 Enterprise cluster. */ + mongodb?: MongodbSpec; } const baseGetClusterRequest: object = { @@ -1603,7 +1810,15 @@ const baseListClustersResponse: object = { nextPageToken: "", }; -export const ListClustersResponse = { +type ListClustersResponseType = { + $type: "yandex.cloud.mdb.mongodb.v1.ListClustersResponse"; + encode(message: ListClustersResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): ListClustersResponse; + fromJSON(object: any): ListClustersResponse; + toJSON(message: ListClustersResponse): unknown; + fromPartial, I>>(object: I): ListClustersResponse; +} +export const ListClustersResponse: ListClustersResponseType = { $type: "yandex.cloud.mdb.mongodb.v1.ListClustersResponse" as const, encode( @@ -1744,6 +1959,12 @@ export const CreateClusterRequest = { if (message.deletionProtection === true) { writer.uint32(96).bool(message.deletionProtection); } + if (message.maintenanceWindow !== undefined) { + MaintenanceWindow.encode( + message.maintenanceWindow, + writer.uint32(106).fork() + ).ldelim(); + } return writer; }, @@ -1806,6 +2027,12 @@ export const CreateClusterRequest = { case 12: message.deletionProtection = reader.bool(); break; + case 13: + message.maintenanceWindow = MaintenanceWindow.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1863,6 +2090,11 @@ export const CreateClusterRequest = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : false; + message.maintenanceWindow = + object.maintenanceWindow !== undefined && + object.maintenanceWindow !== null + ? MaintenanceWindow.fromJSON(object.maintenanceWindow) + : undefined; return message; }, @@ -1913,6 +2145,10 @@ export const CreateClusterRequest = { } message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + message.maintenanceWindow !== undefined && + (obj.maintenanceWindow = message.maintenanceWindow + ? MaintenanceWindow.toJSON(message.maintenanceWindow) + : undefined); return obj; }, @@ -1945,6 +2181,11 @@ export const CreateClusterRequest = { message.networkId = object.networkId ?? ""; message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; message.deletionProtection = object.deletionProtection ?? false; + message.maintenanceWindow = + object.maintenanceWindow !== undefined && + object.maintenanceWindow !== null + ? MaintenanceWindow.fromPartial(object.maintenanceWindow) + : undefined; return message; }, }; @@ -2109,6 +2350,7 @@ const baseUpdateClusterRequest: object = { name: "", securityGroupIds: "", deletionProtection: false, + networkId: "", }; export const UpdateClusterRequest = { @@ -2155,6 +2397,9 @@ export const UpdateClusterRequest = { if (message.deletionProtection === true) { writer.uint32(72).bool(message.deletionProtection); } + if (message.networkId !== "") { + writer.uint32(82).string(message.networkId); + } return writer; }, @@ -2206,6 +2451,9 @@ export const UpdateClusterRequest = { case 9: message.deletionProtection = reader.bool(); break; + case 10: + message.networkId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -2255,6 +2503,10 @@ export const UpdateClusterRequest = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : false; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; return message; }, @@ -2289,6 +2541,7 @@ export const UpdateClusterRequest = { } message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + message.networkId !== undefined && (obj.networkId = message.networkId); return obj; }, @@ -2322,6 +2575,7 @@ export const UpdateClusterRequest = { : undefined; message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; message.deletionProtection = object.deletionProtection ?? false; + message.networkId = object.networkId ?? ""; return message; }, }; @@ -3224,6 +3478,12 @@ export const RestoreClusterRequest = { if (message.deletionProtection === true) { writer.uint32(96).bool(message.deletionProtection); } + if (message.maintenanceWindow !== undefined) { + MaintenanceWindow.encode( + message.maintenanceWindow, + writer.uint32(106).fork() + ).ldelim(); + } return writer; }, @@ -3286,6 +3546,12 @@ export const RestoreClusterRequest = { case 12: message.deletionProtection = reader.bool(); break; + case 13: + message.maintenanceWindow = MaintenanceWindow.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3348,6 +3614,11 @@ export const RestoreClusterRequest = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : false; + message.maintenanceWindow = + object.maintenanceWindow !== undefined && + object.maintenanceWindow !== null + ? MaintenanceWindow.fromJSON(object.maintenanceWindow) + : undefined; return message; }, @@ -3391,6 +3662,10 @@ export const RestoreClusterRequest = { } message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + message.maintenanceWindow !== undefined && + (obj.maintenanceWindow = message.maintenanceWindow + ? MaintenanceWindow.toJSON(message.maintenanceWindow) + : undefined); return obj; }, @@ -3427,6 +3702,11 @@ export const RestoreClusterRequest = { : undefined; message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; message.deletionProtection = object.deletionProtection ?? false; + message.maintenanceWindow = + object.maintenanceWindow !== undefined && + object.maintenanceWindow !== null + ? MaintenanceWindow.fromPartial(object.maintenanceWindow) + : undefined; return message; }, }; @@ -5475,41 +5755,23 @@ messageTypeRegistry.set( DeleteClusterHostsMetadata ); -const baseEnableClusterShardingRequest: object = { - $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest", +const baseUpdateClusterHostsRequest: object = { + $type: "yandex.cloud.mdb.mongodb.v1.UpdateClusterHostsRequest", clusterId: "", }; -export const EnableClusterShardingRequest = { - $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest" as const, +export const UpdateClusterHostsRequest = { + $type: "yandex.cloud.mdb.mongodb.v1.UpdateClusterHostsRequest" as const, encode( - message: EnableClusterShardingRequest, + message: UpdateClusterHostsRequest, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.clusterId !== "") { writer.uint32(10).string(message.clusterId); } - if (message.mongocfg !== undefined) { - EnableClusterShardingRequest_MongoCfg.encode( - message.mongocfg, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.mongos !== undefined) { - EnableClusterShardingRequest_Mongos.encode( - message.mongos, - writer.uint32(26).fork() - ).ldelim(); - } - for (const v of message.hostSpecs) { - HostSpec.encode(v!, writer.uint32(34).fork()).ldelim(); - } - if (message.mongoinfra !== undefined) { - EnableClusterShardingRequest_MongoInfra.encode( - message.mongoinfra, - writer.uint32(42).fork() - ).ldelim(); + for (const v of message.updateHostSpecs) { + UpdateHostSpec.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, @@ -5517,13 +5779,13 @@ export const EnableClusterShardingRequest = { decode( input: _m0.Reader | Uint8Array, length?: number - ): EnableClusterShardingRequest { + ): UpdateClusterHostsRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseEnableClusterShardingRequest, - } as EnableClusterShardingRequest; - message.hostSpecs = []; + ...baseUpdateClusterHostsRequest, + } as UpdateClusterHostsRequest; + message.updateHostSpecs = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5531,24 +5793,8 @@ export const EnableClusterShardingRequest = { message.clusterId = reader.string(); break; case 2: - message.mongocfg = EnableClusterShardingRequest_MongoCfg.decode( - reader, - reader.uint32() - ); - break; - case 3: - message.mongos = EnableClusterShardingRequest_Mongos.decode( - reader, - reader.uint32() - ); - break; - case 4: - message.hostSpecs.push(HostSpec.decode(reader, reader.uint32())); - break; - case 5: - message.mongoinfra = EnableClusterShardingRequest_MongoInfra.decode( - reader, - reader.uint32() + message.updateHostSpecs.push( + UpdateHostSpec.decode(reader, reader.uint32()) ); break; default: @@ -5559,101 +5805,69 @@ export const EnableClusterShardingRequest = { return message; }, - fromJSON(object: any): EnableClusterShardingRequest { + fromJSON(object: any): UpdateClusterHostsRequest { const message = { - ...baseEnableClusterShardingRequest, - } as EnableClusterShardingRequest; + ...baseUpdateClusterHostsRequest, + } as UpdateClusterHostsRequest; message.clusterId = object.clusterId !== undefined && object.clusterId !== null ? String(object.clusterId) : ""; - message.mongocfg = - object.mongocfg !== undefined && object.mongocfg !== null - ? EnableClusterShardingRequest_MongoCfg.fromJSON(object.mongocfg) - : undefined; - message.mongos = - object.mongos !== undefined && object.mongos !== null - ? EnableClusterShardingRequest_Mongos.fromJSON(object.mongos) - : undefined; - message.hostSpecs = (object.hostSpecs ?? []).map((e: any) => - HostSpec.fromJSON(e) + message.updateHostSpecs = (object.updateHostSpecs ?? []).map((e: any) => + UpdateHostSpec.fromJSON(e) ); - message.mongoinfra = - object.mongoinfra !== undefined && object.mongoinfra !== null - ? EnableClusterShardingRequest_MongoInfra.fromJSON(object.mongoinfra) - : undefined; return message; }, - toJSON(message: EnableClusterShardingRequest): unknown { + toJSON(message: UpdateClusterHostsRequest): unknown { const obj: any = {}; message.clusterId !== undefined && (obj.clusterId = message.clusterId); - message.mongocfg !== undefined && - (obj.mongocfg = message.mongocfg - ? EnableClusterShardingRequest_MongoCfg.toJSON(message.mongocfg) - : undefined); - message.mongos !== undefined && - (obj.mongos = message.mongos - ? EnableClusterShardingRequest_Mongos.toJSON(message.mongos) - : undefined); - if (message.hostSpecs) { - obj.hostSpecs = message.hostSpecs.map((e) => - e ? HostSpec.toJSON(e) : undefined + if (message.updateHostSpecs) { + obj.updateHostSpecs = message.updateHostSpecs.map((e) => + e ? UpdateHostSpec.toJSON(e) : undefined ); } else { - obj.hostSpecs = []; + obj.updateHostSpecs = []; } - message.mongoinfra !== undefined && - (obj.mongoinfra = message.mongoinfra - ? EnableClusterShardingRequest_MongoInfra.toJSON(message.mongoinfra) - : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): EnableClusterShardingRequest { + ): UpdateClusterHostsRequest { const message = { - ...baseEnableClusterShardingRequest, - } as EnableClusterShardingRequest; + ...baseUpdateClusterHostsRequest, + } as UpdateClusterHostsRequest; message.clusterId = object.clusterId ?? ""; - message.mongocfg = - object.mongocfg !== undefined && object.mongocfg !== null - ? EnableClusterShardingRequest_MongoCfg.fromPartial(object.mongocfg) - : undefined; - message.mongos = - object.mongos !== undefined && object.mongos !== null - ? EnableClusterShardingRequest_Mongos.fromPartial(object.mongos) - : undefined; - message.hostSpecs = - object.hostSpecs?.map((e) => HostSpec.fromPartial(e)) || []; - message.mongoinfra = - object.mongoinfra !== undefined && object.mongoinfra !== null - ? EnableClusterShardingRequest_MongoInfra.fromPartial(object.mongoinfra) - : undefined; + message.updateHostSpecs = + object.updateHostSpecs?.map((e) => UpdateHostSpec.fromPartial(e)) || []; return message; }, }; messageTypeRegistry.set( - EnableClusterShardingRequest.$type, - EnableClusterShardingRequest + UpdateClusterHostsRequest.$type, + UpdateClusterHostsRequest ); -const baseEnableClusterShardingRequest_MongoCfg: object = { - $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest.MongoCfg", +const baseUpdateClusterHostsMetadata: object = { + $type: "yandex.cloud.mdb.mongodb.v1.UpdateClusterHostsMetadata", + clusterId: "", + hostNames: "", }; -export const EnableClusterShardingRequest_MongoCfg = { - $type: - "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest.MongoCfg" as const, +export const UpdateClusterHostsMetadata = { + $type: "yandex.cloud.mdb.mongodb.v1.UpdateClusterHostsMetadata" as const, encode( - message: EnableClusterShardingRequest_MongoCfg, + message: UpdateClusterHostsMetadata, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - if (message.resources !== undefined) { - Resources.encode(message.resources, writer.uint32(10).fork()).ldelim(); + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + for (const v of message.hostNames) { + writer.uint32(18).string(v!); } return writer; }, @@ -5661,17 +5875,21 @@ export const EnableClusterShardingRequest_MongoCfg = { decode( input: _m0.Reader | Uint8Array, length?: number - ): EnableClusterShardingRequest_MongoCfg { + ): UpdateClusterHostsMetadata { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseEnableClusterShardingRequest_MongoCfg, - } as EnableClusterShardingRequest_MongoCfg; + ...baseUpdateClusterHostsMetadata, + } as UpdateClusterHostsMetadata; + message.hostNames = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.resources = Resources.decode(reader, reader.uint32()); + message.clusterId = reader.string(); + break; + case 2: + message.hostNames.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -5681,77 +5899,139 @@ export const EnableClusterShardingRequest_MongoCfg = { return message; }, - fromJSON(object: any): EnableClusterShardingRequest_MongoCfg { + fromJSON(object: any): UpdateClusterHostsMetadata { const message = { - ...baseEnableClusterShardingRequest_MongoCfg, - } as EnableClusterShardingRequest_MongoCfg; - message.resources = - object.resources !== undefined && object.resources !== null - ? Resources.fromJSON(object.resources) - : undefined; + ...baseUpdateClusterHostsMetadata, + } as UpdateClusterHostsMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); return message; }, - toJSON(message: EnableClusterShardingRequest_MongoCfg): unknown { + toJSON(message: UpdateClusterHostsMetadata): unknown { const obj: any = {}; - message.resources !== undefined && - (obj.resources = message.resources - ? Resources.toJSON(message.resources) - : undefined); + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.hostNames) { + obj.hostNames = message.hostNames.map((e) => e); + } else { + obj.hostNames = []; + } return obj; }, - fromPartial< - I extends Exact, I> - >(object: I): EnableClusterShardingRequest_MongoCfg { + fromPartial, I>>( + object: I + ): UpdateClusterHostsMetadata { const message = { - ...baseEnableClusterShardingRequest_MongoCfg, - } as EnableClusterShardingRequest_MongoCfg; - message.resources = - object.resources !== undefined && object.resources !== null - ? Resources.fromPartial(object.resources) - : undefined; + ...baseUpdateClusterHostsMetadata, + } as UpdateClusterHostsMetadata; + message.clusterId = object.clusterId ?? ""; + message.hostNames = object.hostNames?.map((e) => e) || []; return message; }, }; messageTypeRegistry.set( - EnableClusterShardingRequest_MongoCfg.$type, - EnableClusterShardingRequest_MongoCfg + UpdateClusterHostsMetadata.$type, + UpdateClusterHostsMetadata ); -const baseEnableClusterShardingRequest_Mongos: object = { - $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest.Mongos", +const baseUpdateHostSpec: object = { + $type: "yandex.cloud.mdb.mongodb.v1.UpdateHostSpec", + hostName: "", + assignPublicIp: false, }; -export const EnableClusterShardingRequest_Mongos = { - $type: - "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest.Mongos" as const, +export const UpdateHostSpec = { + $type: "yandex.cloud.mdb.mongodb.v1.UpdateHostSpec" as const, encode( - message: EnableClusterShardingRequest_Mongos, + message: UpdateHostSpec, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - if (message.resources !== undefined) { - Resources.encode(message.resources, writer.uint32(10).fork()).ldelim(); + if (message.hostName !== "") { + writer.uint32(10).string(message.hostName); + } + if (message.hidden !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.hidden! }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.secondaryDelaySecs !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.secondaryDelaySecs!, + }, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.priority !== undefined) { + DoubleValue.encode( + { $type: "google.protobuf.DoubleValue", value: message.priority! }, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.assignPublicIp === true) { + writer.uint32(40).bool(message.assignPublicIp); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(50).fork()).ldelim(); } + Object.entries(message.tags).forEach(([key, value]) => { + UpdateHostSpec_TagsEntry.encode( + { + $type: "yandex.cloud.mdb.mongodb.v1.UpdateHostSpec.TagsEntry", + key: key as any, + value, + }, + writer.uint32(58).fork() + ).ldelim(); + }); return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): EnableClusterShardingRequest_Mongos { + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateHostSpec { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseEnableClusterShardingRequest_Mongos, - } as EnableClusterShardingRequest_Mongos; + const message = { ...baseUpdateHostSpec } as UpdateHostSpec; + message.tags = {}; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.resources = Resources.decode(reader, reader.uint32()); + message.hostName = reader.string(); + break; + case 2: + message.hidden = BoolValue.decode(reader, reader.uint32()).value; + break; + case 3: + message.secondaryDelaySecs = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 4: + message.priority = DoubleValue.decode(reader, reader.uint32()).value; + break; + case 5: + message.assignPublicIp = reader.bool(); + break; + case 6: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 7: + const entry7 = UpdateHostSpec_TagsEntry.decode( + reader, + reader.uint32() + ); + if (entry7.value !== undefined) { + message.tags[entry7.key] = entry7.value; + } break; default: reader.skipType(tag & 7); @@ -5761,59 +6041,109 @@ export const EnableClusterShardingRequest_Mongos = { return message; }, - fromJSON(object: any): EnableClusterShardingRequest_Mongos { - const message = { - ...baseEnableClusterShardingRequest_Mongos, - } as EnableClusterShardingRequest_Mongos; - message.resources = - object.resources !== undefined && object.resources !== null - ? Resources.fromJSON(object.resources) + fromJSON(object: any): UpdateHostSpec { + const message = { ...baseUpdateHostSpec } as UpdateHostSpec; + message.hostName = + object.hostName !== undefined && object.hostName !== null + ? String(object.hostName) + : ""; + message.hidden = + object.hidden !== undefined && object.hidden !== null + ? Boolean(object.hidden) + : undefined; + message.secondaryDelaySecs = + object.secondaryDelaySecs !== undefined && + object.secondaryDelaySecs !== null + ? Number(object.secondaryDelaySecs) : undefined; + message.priority = + object.priority !== undefined && object.priority !== null + ? Number(object.priority) + : undefined; + message.assignPublicIp = + object.assignPublicIp !== undefined && object.assignPublicIp !== null + ? Boolean(object.assignPublicIp) + : false; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.tags = Object.entries(object.tags ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); return message; }, - toJSON(message: EnableClusterShardingRequest_Mongos): unknown { + toJSON(message: UpdateHostSpec): unknown { const obj: any = {}; - message.resources !== undefined && - (obj.resources = message.resources - ? Resources.toJSON(message.resources) + message.hostName !== undefined && (obj.hostName = message.hostName); + message.hidden !== undefined && (obj.hidden = message.hidden); + message.secondaryDelaySecs !== undefined && + (obj.secondaryDelaySecs = message.secondaryDelaySecs); + message.priority !== undefined && (obj.priority = message.priority); + message.assignPublicIp !== undefined && + (obj.assignPublicIp = message.assignPublicIp); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) : undefined); + obj.tags = {}; + if (message.tags) { + Object.entries(message.tags).forEach(([k, v]) => { + obj.tags[k] = v; + }); + } return obj; }, - fromPartial< - I extends Exact, I> - >(object: I): EnableClusterShardingRequest_Mongos { - const message = { - ...baseEnableClusterShardingRequest_Mongos, - } as EnableClusterShardingRequest_Mongos; - message.resources = - object.resources !== undefined && object.resources !== null - ? Resources.fromPartial(object.resources) + fromPartial, I>>( + object: I + ): UpdateHostSpec { + const message = { ...baseUpdateHostSpec } as UpdateHostSpec; + message.hostName = object.hostName ?? ""; + message.hidden = object.hidden ?? undefined; + message.secondaryDelaySecs = object.secondaryDelaySecs ?? undefined; + message.priority = object.priority ?? undefined; + message.assignPublicIp = object.assignPublicIp ?? false; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) : undefined; + message.tags = Object.entries(object.tags ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); return message; }, }; -messageTypeRegistry.set( - EnableClusterShardingRequest_Mongos.$type, - EnableClusterShardingRequest_Mongos -); +messageTypeRegistry.set(UpdateHostSpec.$type, UpdateHostSpec); -const baseEnableClusterShardingRequest_MongoInfra: object = { - $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest.MongoInfra", +const baseUpdateHostSpec_TagsEntry: object = { + $type: "yandex.cloud.mdb.mongodb.v1.UpdateHostSpec.TagsEntry", + key: "", + value: "", }; -export const EnableClusterShardingRequest_MongoInfra = { - $type: - "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest.MongoInfra" as const, +export const UpdateHostSpec_TagsEntry = { + $type: "yandex.cloud.mdb.mongodb.v1.UpdateHostSpec.TagsEntry" as const, encode( - message: EnableClusterShardingRequest_MongoInfra, + message: UpdateHostSpec_TagsEntry, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - if (message.resources !== undefined) { - Resources.encode(message.resources, writer.uint32(10).fork()).ldelim(); + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); } return writer; }, @@ -5821,17 +6151,20 @@ export const EnableClusterShardingRequest_MongoInfra = { decode( input: _m0.Reader | Uint8Array, length?: number - ): EnableClusterShardingRequest_MongoInfra { + ): UpdateHostSpec_TagsEntry { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseEnableClusterShardingRequest_MongoInfra, - } as EnableClusterShardingRequest_MongoInfra; + ...baseUpdateHostSpec_TagsEntry, + } as UpdateHostSpec_TagsEntry; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.resources = Resources.decode(reader, reader.uint32()); + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); break; default: reader.skipType(tag & 7); @@ -5841,137 +6174,222 @@ export const EnableClusterShardingRequest_MongoInfra = { return message; }, - fromJSON(object: any): EnableClusterShardingRequest_MongoInfra { + fromJSON(object: any): UpdateHostSpec_TagsEntry { const message = { - ...baseEnableClusterShardingRequest_MongoInfra, - } as EnableClusterShardingRequest_MongoInfra; - message.resources = - object.resources !== undefined && object.resources !== null - ? Resources.fromJSON(object.resources) - : undefined; + ...baseUpdateHostSpec_TagsEntry, + } as UpdateHostSpec_TagsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; return message; }, - toJSON(message: EnableClusterShardingRequest_MongoInfra): unknown { + toJSON(message: UpdateHostSpec_TagsEntry): unknown { const obj: any = {}; - message.resources !== undefined && - (obj.resources = message.resources - ? Resources.toJSON(message.resources) - : undefined); + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); return obj; }, - fromPartial< - I extends Exact, I> - >(object: I): EnableClusterShardingRequest_MongoInfra { + fromPartial, I>>( + object: I + ): UpdateHostSpec_TagsEntry { const message = { - ...baseEnableClusterShardingRequest_MongoInfra, - } as EnableClusterShardingRequest_MongoInfra; - message.resources = - object.resources !== undefined && object.resources !== null - ? Resources.fromPartial(object.resources) - : undefined; + ...baseUpdateHostSpec_TagsEntry, + } as UpdateHostSpec_TagsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; return message; }, }; messageTypeRegistry.set( - EnableClusterShardingRequest_MongoInfra.$type, - EnableClusterShardingRequest_MongoInfra + UpdateHostSpec_TagsEntry.$type, + UpdateHostSpec_TagsEntry ); -const baseEnableClusterShardingMetadata: object = { - $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingMetadata", +const baseEnableClusterShardingRequest: object = { + $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest", clusterId: "", }; -export const EnableClusterShardingMetadata = { - $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingMetadata" as const, +export const EnableClusterShardingRequest = { + $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest" as const, encode( - message: EnableClusterShardingMetadata, + message: EnableClusterShardingRequest, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.clusterId !== "") { writer.uint32(10).string(message.clusterId); } + if (message.mongocfg !== undefined) { + EnableClusterShardingRequest_MongoCfg.encode( + message.mongocfg, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.mongos !== undefined) { + EnableClusterShardingRequest_Mongos.encode( + message.mongos, + writer.uint32(26).fork() + ).ldelim(); + } + for (const v of message.hostSpecs) { + HostSpec.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.mongoinfra !== undefined) { + EnableClusterShardingRequest_MongoInfra.encode( + message.mongoinfra, + writer.uint32(42).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): EnableClusterShardingMetadata { + ): EnableClusterShardingRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseEnableClusterShardingMetadata, - } as EnableClusterShardingMetadata; + ...baseEnableClusterShardingRequest, + } as EnableClusterShardingRequest; + message.hostSpecs = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.clusterId = reader.string(); break; - default: - reader.skipType(tag & 7); + case 2: + message.mongocfg = EnableClusterShardingRequest_MongoCfg.decode( + reader, + reader.uint32() + ); break; - } - } - return message; - }, - - fromJSON(object: any): EnableClusterShardingMetadata { - const message = { - ...baseEnableClusterShardingMetadata, - } as EnableClusterShardingMetadata; + case 3: + message.mongos = EnableClusterShardingRequest_Mongos.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.hostSpecs.push(HostSpec.decode(reader, reader.uint32())); + break; + case 5: + message.mongoinfra = EnableClusterShardingRequest_MongoInfra.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnableClusterShardingRequest { + const message = { + ...baseEnableClusterShardingRequest, + } as EnableClusterShardingRequest; message.clusterId = object.clusterId !== undefined && object.clusterId !== null ? String(object.clusterId) : ""; + message.mongocfg = + object.mongocfg !== undefined && object.mongocfg !== null + ? EnableClusterShardingRequest_MongoCfg.fromJSON(object.mongocfg) + : undefined; + message.mongos = + object.mongos !== undefined && object.mongos !== null + ? EnableClusterShardingRequest_Mongos.fromJSON(object.mongos) + : undefined; + message.hostSpecs = (object.hostSpecs ?? []).map((e: any) => + HostSpec.fromJSON(e) + ); + message.mongoinfra = + object.mongoinfra !== undefined && object.mongoinfra !== null + ? EnableClusterShardingRequest_MongoInfra.fromJSON(object.mongoinfra) + : undefined; return message; }, - toJSON(message: EnableClusterShardingMetadata): unknown { + toJSON(message: EnableClusterShardingRequest): unknown { const obj: any = {}; message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.mongocfg !== undefined && + (obj.mongocfg = message.mongocfg + ? EnableClusterShardingRequest_MongoCfg.toJSON(message.mongocfg) + : undefined); + message.mongos !== undefined && + (obj.mongos = message.mongos + ? EnableClusterShardingRequest_Mongos.toJSON(message.mongos) + : undefined); + if (message.hostSpecs) { + obj.hostSpecs = message.hostSpecs.map((e) => + e ? HostSpec.toJSON(e) : undefined + ); + } else { + obj.hostSpecs = []; + } + message.mongoinfra !== undefined && + (obj.mongoinfra = message.mongoinfra + ? EnableClusterShardingRequest_MongoInfra.toJSON(message.mongoinfra) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): EnableClusterShardingMetadata { + ): EnableClusterShardingRequest { const message = { - ...baseEnableClusterShardingMetadata, - } as EnableClusterShardingMetadata; + ...baseEnableClusterShardingRequest, + } as EnableClusterShardingRequest; message.clusterId = object.clusterId ?? ""; + message.mongocfg = + object.mongocfg !== undefined && object.mongocfg !== null + ? EnableClusterShardingRequest_MongoCfg.fromPartial(object.mongocfg) + : undefined; + message.mongos = + object.mongos !== undefined && object.mongos !== null + ? EnableClusterShardingRequest_Mongos.fromPartial(object.mongos) + : undefined; + message.hostSpecs = + object.hostSpecs?.map((e) => HostSpec.fromPartial(e)) || []; + message.mongoinfra = + object.mongoinfra !== undefined && object.mongoinfra !== null + ? EnableClusterShardingRequest_MongoInfra.fromPartial(object.mongoinfra) + : undefined; return message; }, }; messageTypeRegistry.set( - EnableClusterShardingMetadata.$type, - EnableClusterShardingMetadata + EnableClusterShardingRequest.$type, + EnableClusterShardingRequest ); -const baseGetClusterShardRequest: object = { - $type: "yandex.cloud.mdb.mongodb.v1.GetClusterShardRequest", - clusterId: "", - shardName: "", +const baseEnableClusterShardingRequest_MongoCfg: object = { + $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest.MongoCfg", }; -export const GetClusterShardRequest = { - $type: "yandex.cloud.mdb.mongodb.v1.GetClusterShardRequest" as const, +export const EnableClusterShardingRequest_MongoCfg = { + $type: + "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest.MongoCfg" as const, encode( - message: GetClusterShardRequest, + message: EnableClusterShardingRequest_MongoCfg, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - if (message.clusterId !== "") { - writer.uint32(10).string(message.clusterId); - } - if (message.shardName !== "") { - writer.uint32(18).string(message.shardName); + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(10).fork()).ldelim(); } return writer; }, @@ -5979,18 +6397,17 @@ export const GetClusterShardRequest = { decode( input: _m0.Reader | Uint8Array, length?: number - ): GetClusterShardRequest { + ): EnableClusterShardingRequest_MongoCfg { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseGetClusterShardRequest } as GetClusterShardRequest; + const message = { + ...baseEnableClusterShardingRequest_MongoCfg, + } as EnableClusterShardingRequest_MongoCfg; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.clusterId = reader.string(); - break; - case 2: - message.shardName = reader.string(); + message.resources = Resources.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6000,60 +6417,59 @@ export const GetClusterShardRequest = { return message; }, - fromJSON(object: any): GetClusterShardRequest { - const message = { ...baseGetClusterShardRequest } as GetClusterShardRequest; - message.clusterId = - object.clusterId !== undefined && object.clusterId !== null - ? String(object.clusterId) - : ""; - message.shardName = - object.shardName !== undefined && object.shardName !== null - ? String(object.shardName) - : ""; + fromJSON(object: any): EnableClusterShardingRequest_MongoCfg { + const message = { + ...baseEnableClusterShardingRequest_MongoCfg, + } as EnableClusterShardingRequest_MongoCfg; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; return message; }, - toJSON(message: GetClusterShardRequest): unknown { + toJSON(message: EnableClusterShardingRequest_MongoCfg): unknown { const obj: any = {}; - message.clusterId !== undefined && (obj.clusterId = message.clusterId); - message.shardName !== undefined && (obj.shardName = message.shardName); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); return obj; }, - fromPartial, I>>( - object: I - ): GetClusterShardRequest { - const message = { ...baseGetClusterShardRequest } as GetClusterShardRequest; - message.clusterId = object.clusterId ?? ""; - message.shardName = object.shardName ?? ""; + fromPartial< + I extends Exact, I> + >(object: I): EnableClusterShardingRequest_MongoCfg { + const message = { + ...baseEnableClusterShardingRequest_MongoCfg, + } as EnableClusterShardingRequest_MongoCfg; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; return message; }, }; -messageTypeRegistry.set(GetClusterShardRequest.$type, GetClusterShardRequest); +messageTypeRegistry.set( + EnableClusterShardingRequest_MongoCfg.$type, + EnableClusterShardingRequest_MongoCfg +); -const baseListClusterShardsRequest: object = { - $type: "yandex.cloud.mdb.mongodb.v1.ListClusterShardsRequest", - clusterId: "", - pageSize: 0, - pageToken: "", +const baseEnableClusterShardingRequest_Mongos: object = { + $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest.Mongos", }; -export const ListClusterShardsRequest = { - $type: "yandex.cloud.mdb.mongodb.v1.ListClusterShardsRequest" as const, +export const EnableClusterShardingRequest_Mongos = { + $type: + "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest.Mongos" as const, encode( - message: ListClusterShardsRequest, + message: EnableClusterShardingRequest_Mongos, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - if (message.clusterId !== "") { - writer.uint32(10).string(message.clusterId); - } - if (message.pageSize !== 0) { - writer.uint32(16).int64(message.pageSize); - } - if (message.pageToken !== "") { - writer.uint32(26).string(message.pageToken); + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(10).fork()).ldelim(); } return writer; }, @@ -6061,23 +6477,17 @@ export const ListClusterShardsRequest = { decode( input: _m0.Reader | Uint8Array, length?: number - ): ListClusterShardsRequest { + ): EnableClusterShardingRequest_Mongos { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseListClusterShardsRequest, - } as ListClusterShardsRequest; + ...baseEnableClusterShardingRequest_Mongos, + } as EnableClusterShardingRequest_Mongos; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.clusterId = reader.string(); - break; - case 2: - message.pageSize = longToNumber(reader.int64() as Long); - break; - case 3: - message.pageToken = reader.string(); + message.resources = Resources.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6087,69 +6497,59 @@ export const ListClusterShardsRequest = { return message; }, - fromJSON(object: any): ListClusterShardsRequest { + fromJSON(object: any): EnableClusterShardingRequest_Mongos { const message = { - ...baseListClusterShardsRequest, - } as ListClusterShardsRequest; - message.clusterId = - object.clusterId !== undefined && object.clusterId !== null - ? String(object.clusterId) - : ""; - message.pageSize = - object.pageSize !== undefined && object.pageSize !== null - ? Number(object.pageSize) - : 0; - message.pageToken = - object.pageToken !== undefined && object.pageToken !== null - ? String(object.pageToken) - : ""; + ...baseEnableClusterShardingRequest_Mongos, + } as EnableClusterShardingRequest_Mongos; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; return message; }, - toJSON(message: ListClusterShardsRequest): unknown { + toJSON(message: EnableClusterShardingRequest_Mongos): unknown { const obj: any = {}; - message.clusterId !== undefined && (obj.clusterId = message.clusterId); - message.pageSize !== undefined && - (obj.pageSize = Math.round(message.pageSize)); - message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); return obj; }, - fromPartial, I>>( - object: I - ): ListClusterShardsRequest { + fromPartial< + I extends Exact, I> + >(object: I): EnableClusterShardingRequest_Mongos { const message = { - ...baseListClusterShardsRequest, - } as ListClusterShardsRequest; - message.clusterId = object.clusterId ?? ""; - message.pageSize = object.pageSize ?? 0; - message.pageToken = object.pageToken ?? ""; + ...baseEnableClusterShardingRequest_Mongos, + } as EnableClusterShardingRequest_Mongos; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; return message; }, }; messageTypeRegistry.set( - ListClusterShardsRequest.$type, - ListClusterShardsRequest + EnableClusterShardingRequest_Mongos.$type, + EnableClusterShardingRequest_Mongos ); -const baseListClusterShardsResponse: object = { - $type: "yandex.cloud.mdb.mongodb.v1.ListClusterShardsResponse", - nextPageToken: "", +const baseEnableClusterShardingRequest_MongoInfra: object = { + $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest.MongoInfra", }; -export const ListClusterShardsResponse = { - $type: "yandex.cloud.mdb.mongodb.v1.ListClusterShardsResponse" as const, +export const EnableClusterShardingRequest_MongoInfra = { + $type: + "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingRequest.MongoInfra" as const, encode( - message: ListClusterShardsResponse, + message: EnableClusterShardingRequest_MongoInfra, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - for (const v of message.shards) { - Shard.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.nextPageToken !== "") { - writer.uint32(18).string(message.nextPageToken); + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(10).fork()).ldelim(); } return writer; }, @@ -6157,21 +6557,17 @@ export const ListClusterShardsResponse = { decode( input: _m0.Reader | Uint8Array, length?: number - ): ListClusterShardsResponse { + ): EnableClusterShardingRequest_MongoInfra { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseListClusterShardsResponse, - } as ListClusterShardsResponse; - message.shards = []; + ...baseEnableClusterShardingRequest_MongoInfra, + } as EnableClusterShardingRequest_MongoInfra; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.shards.push(Shard.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); + message.resources = Resources.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6181,92 +6577,78 @@ export const ListClusterShardsResponse = { return message; }, - fromJSON(object: any): ListClusterShardsResponse { + fromJSON(object: any): EnableClusterShardingRequest_MongoInfra { const message = { - ...baseListClusterShardsResponse, - } as ListClusterShardsResponse; - message.shards = (object.shards ?? []).map((e: any) => Shard.fromJSON(e)); - message.nextPageToken = - object.nextPageToken !== undefined && object.nextPageToken !== null - ? String(object.nextPageToken) - : ""; + ...baseEnableClusterShardingRequest_MongoInfra, + } as EnableClusterShardingRequest_MongoInfra; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; return message; }, - toJSON(message: ListClusterShardsResponse): unknown { + toJSON(message: EnableClusterShardingRequest_MongoInfra): unknown { const obj: any = {}; - if (message.shards) { - obj.shards = message.shards.map((e) => (e ? Shard.toJSON(e) : undefined)); - } else { - obj.shards = []; - } - message.nextPageToken !== undefined && - (obj.nextPageToken = message.nextPageToken); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); return obj; }, - fromPartial, I>>( - object: I - ): ListClusterShardsResponse { + fromPartial< + I extends Exact, I> + >(object: I): EnableClusterShardingRequest_MongoInfra { const message = { - ...baseListClusterShardsResponse, - } as ListClusterShardsResponse; - message.shards = object.shards?.map((e) => Shard.fromPartial(e)) || []; - message.nextPageToken = object.nextPageToken ?? ""; + ...baseEnableClusterShardingRequest_MongoInfra, + } as EnableClusterShardingRequest_MongoInfra; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; return message; }, }; messageTypeRegistry.set( - ListClusterShardsResponse.$type, - ListClusterShardsResponse + EnableClusterShardingRequest_MongoInfra.$type, + EnableClusterShardingRequest_MongoInfra ); -const baseAddClusterShardRequest: object = { - $type: "yandex.cloud.mdb.mongodb.v1.AddClusterShardRequest", +const baseEnableClusterShardingMetadata: object = { + $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingMetadata", clusterId: "", - shardName: "", }; -export const AddClusterShardRequest = { - $type: "yandex.cloud.mdb.mongodb.v1.AddClusterShardRequest" as const, +export const EnableClusterShardingMetadata = { + $type: "yandex.cloud.mdb.mongodb.v1.EnableClusterShardingMetadata" as const, encode( - message: AddClusterShardRequest, + message: EnableClusterShardingMetadata, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.clusterId !== "") { writer.uint32(10).string(message.clusterId); } - if (message.shardName !== "") { - writer.uint32(18).string(message.shardName); - } - for (const v of message.hostSpecs) { - HostSpec.encode(v!, writer.uint32(26).fork()).ldelim(); - } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): AddClusterShardRequest { + ): EnableClusterShardingMetadata { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseAddClusterShardRequest } as AddClusterShardRequest; - message.hostSpecs = []; + const message = { + ...baseEnableClusterShardingMetadata, + } as EnableClusterShardingMetadata; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.clusterId = reader.string(); break; - case 2: - message.shardName = reader.string(); - break; - case 3: - message.hostSpecs.push(HostSpec.decode(reader, reader.uint32())); - break; default: reader.skipType(tag & 7); break; @@ -6275,61 +6657,50 @@ export const AddClusterShardRequest = { return message; }, - fromJSON(object: any): AddClusterShardRequest { - const message = { ...baseAddClusterShardRequest } as AddClusterShardRequest; + fromJSON(object: any): EnableClusterShardingMetadata { + const message = { + ...baseEnableClusterShardingMetadata, + } as EnableClusterShardingMetadata; message.clusterId = object.clusterId !== undefined && object.clusterId !== null ? String(object.clusterId) : ""; - message.shardName = - object.shardName !== undefined && object.shardName !== null - ? String(object.shardName) - : ""; - message.hostSpecs = (object.hostSpecs ?? []).map((e: any) => - HostSpec.fromJSON(e) - ); return message; }, - toJSON(message: AddClusterShardRequest): unknown { + toJSON(message: EnableClusterShardingMetadata): unknown { const obj: any = {}; message.clusterId !== undefined && (obj.clusterId = message.clusterId); - message.shardName !== undefined && (obj.shardName = message.shardName); - if (message.hostSpecs) { - obj.hostSpecs = message.hostSpecs.map((e) => - e ? HostSpec.toJSON(e) : undefined - ); - } else { - obj.hostSpecs = []; - } return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): AddClusterShardRequest { - const message = { ...baseAddClusterShardRequest } as AddClusterShardRequest; + ): EnableClusterShardingMetadata { + const message = { + ...baseEnableClusterShardingMetadata, + } as EnableClusterShardingMetadata; message.clusterId = object.clusterId ?? ""; - message.shardName = object.shardName ?? ""; - message.hostSpecs = - object.hostSpecs?.map((e) => HostSpec.fromPartial(e)) || []; return message; }, }; -messageTypeRegistry.set(AddClusterShardRequest.$type, AddClusterShardRequest); +messageTypeRegistry.set( + EnableClusterShardingMetadata.$type, + EnableClusterShardingMetadata +); -const baseAddClusterShardMetadata: object = { - $type: "yandex.cloud.mdb.mongodb.v1.AddClusterShardMetadata", +const baseGetClusterShardRequest: object = { + $type: "yandex.cloud.mdb.mongodb.v1.GetClusterShardRequest", clusterId: "", shardName: "", }; -export const AddClusterShardMetadata = { - $type: "yandex.cloud.mdb.mongodb.v1.AddClusterShardMetadata" as const, +export const GetClusterShardRequest = { + $type: "yandex.cloud.mdb.mongodb.v1.GetClusterShardRequest" as const, encode( - message: AddClusterShardMetadata, + message: GetClusterShardRequest, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.clusterId !== "") { @@ -6344,12 +6715,10 @@ export const AddClusterShardMetadata = { decode( input: _m0.Reader | Uint8Array, length?: number - ): AddClusterShardMetadata { + ): GetClusterShardRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseAddClusterShardMetadata, - } as AddClusterShardMetadata; + const message = { ...baseGetClusterShardRequest } as GetClusterShardRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6367,10 +6736,8 @@ export const AddClusterShardMetadata = { return message; }, - fromJSON(object: any): AddClusterShardMetadata { - const message = { - ...baseAddClusterShardMetadata, - } as AddClusterShardMetadata; + fromJSON(object: any): GetClusterShardRequest { + const message = { ...baseGetClusterShardRequest } as GetClusterShardRequest; message.clusterId = object.clusterId !== undefined && object.clusterId !== null ? String(object.clusterId) @@ -6382,45 +6749,47 @@ export const AddClusterShardMetadata = { return message; }, - toJSON(message: AddClusterShardMetadata): unknown { + toJSON(message: GetClusterShardRequest): unknown { const obj: any = {}; message.clusterId !== undefined && (obj.clusterId = message.clusterId); message.shardName !== undefined && (obj.shardName = message.shardName); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): AddClusterShardMetadata { - const message = { - ...baseAddClusterShardMetadata, - } as AddClusterShardMetadata; + ): GetClusterShardRequest { + const message = { ...baseGetClusterShardRequest } as GetClusterShardRequest; message.clusterId = object.clusterId ?? ""; message.shardName = object.shardName ?? ""; return message; }, }; -messageTypeRegistry.set(AddClusterShardMetadata.$type, AddClusterShardMetadata); +messageTypeRegistry.set(GetClusterShardRequest.$type, GetClusterShardRequest); -const baseDeleteClusterShardRequest: object = { - $type: "yandex.cloud.mdb.mongodb.v1.DeleteClusterShardRequest", +const baseListClusterShardsRequest: object = { + $type: "yandex.cloud.mdb.mongodb.v1.ListClusterShardsRequest", clusterId: "", - shardName: "", + pageSize: 0, + pageToken: "", }; -export const DeleteClusterShardRequest = { - $type: "yandex.cloud.mdb.mongodb.v1.DeleteClusterShardRequest" as const, +export const ListClusterShardsRequest = { + $type: "yandex.cloud.mdb.mongodb.v1.ListClusterShardsRequest" as const, encode( - message: DeleteClusterShardRequest, + message: ListClusterShardsRequest, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.clusterId !== "") { writer.uint32(10).string(message.clusterId); } - if (message.shardName !== "") { - writer.uint32(18).string(message.shardName); + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); } return writer; }, @@ -6428,12 +6797,12 @@ export const DeleteClusterShardRequest = { decode( input: _m0.Reader | Uint8Array, length?: number - ): DeleteClusterShardRequest { + ): ListClusterShardsRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseDeleteClusterShardRequest, - } as DeleteClusterShardRequest; + ...baseListClusterShardsRequest, + } as ListClusterShardsRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6441,7 +6810,10 @@ export const DeleteClusterShardRequest = { message.clusterId = reader.string(); break; case 2: - message.shardName = reader.string(); + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -6451,63 +6823,69 @@ export const DeleteClusterShardRequest = { return message; }, - fromJSON(object: any): DeleteClusterShardRequest { + fromJSON(object: any): ListClusterShardsRequest { const message = { - ...baseDeleteClusterShardRequest, - } as DeleteClusterShardRequest; + ...baseListClusterShardsRequest, + } as ListClusterShardsRequest; message.clusterId = object.clusterId !== undefined && object.clusterId !== null ? String(object.clusterId) : ""; - message.shardName = - object.shardName !== undefined && object.shardName !== null - ? String(object.shardName) + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) : ""; return message; }, - toJSON(message: DeleteClusterShardRequest): unknown { + toJSON(message: ListClusterShardsRequest): unknown { const obj: any = {}; message.clusterId !== undefined && (obj.clusterId = message.clusterId); - message.shardName !== undefined && (obj.shardName = message.shardName); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): DeleteClusterShardRequest { + ): ListClusterShardsRequest { const message = { - ...baseDeleteClusterShardRequest, - } as DeleteClusterShardRequest; + ...baseListClusterShardsRequest, + } as ListClusterShardsRequest; message.clusterId = object.clusterId ?? ""; - message.shardName = object.shardName ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; return message; }, }; messageTypeRegistry.set( - DeleteClusterShardRequest.$type, - DeleteClusterShardRequest + ListClusterShardsRequest.$type, + ListClusterShardsRequest ); -const baseDeleteClusterShardMetadata: object = { - $type: "yandex.cloud.mdb.mongodb.v1.DeleteClusterShardMetadata", - clusterId: "", - shardName: "", +const baseListClusterShardsResponse: object = { + $type: "yandex.cloud.mdb.mongodb.v1.ListClusterShardsResponse", + nextPageToken: "", }; -export const DeleteClusterShardMetadata = { - $type: "yandex.cloud.mdb.mongodb.v1.DeleteClusterShardMetadata" as const, +export const ListClusterShardsResponse = { + $type: "yandex.cloud.mdb.mongodb.v1.ListClusterShardsResponse" as const, encode( - message: DeleteClusterShardMetadata, + message: ListClusterShardsResponse, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - if (message.clusterId !== "") { - writer.uint32(10).string(message.clusterId); + for (const v of message.shards) { + Shard.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (message.shardName !== "") { - writer.uint32(18).string(message.shardName); + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); } return writer; }, @@ -6515,20 +6893,21 @@ export const DeleteClusterShardMetadata = { decode( input: _m0.Reader | Uint8Array, length?: number - ): DeleteClusterShardMetadata { + ): ListClusterShardsResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseDeleteClusterShardMetadata, - } as DeleteClusterShardMetadata; + ...baseListClusterShardsResponse, + } as ListClusterShardsResponse; + message.shards = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.clusterId = reader.string(); + message.shards.push(Shard.decode(reader, reader.uint32())); break; case 2: - message.shardName = reader.string(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -6538,72 +6917,80 @@ export const DeleteClusterShardMetadata = { return message; }, - fromJSON(object: any): DeleteClusterShardMetadata { + fromJSON(object: any): ListClusterShardsResponse { const message = { - ...baseDeleteClusterShardMetadata, - } as DeleteClusterShardMetadata; - message.clusterId = - object.clusterId !== undefined && object.clusterId !== null - ? String(object.clusterId) - : ""; - message.shardName = - object.shardName !== undefined && object.shardName !== null - ? String(object.shardName) + ...baseListClusterShardsResponse, + } as ListClusterShardsResponse; + message.shards = (object.shards ?? []).map((e: any) => Shard.fromJSON(e)); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) : ""; return message; }, - toJSON(message: DeleteClusterShardMetadata): unknown { + toJSON(message: ListClusterShardsResponse): unknown { const obj: any = {}; - message.clusterId !== undefined && (obj.clusterId = message.clusterId); - message.shardName !== undefined && (obj.shardName = message.shardName); + if (message.shards) { + obj.shards = message.shards.map((e) => (e ? Shard.toJSON(e) : undefined)); + } else { + obj.shards = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): DeleteClusterShardMetadata { + ): ListClusterShardsResponse { const message = { - ...baseDeleteClusterShardMetadata, - } as DeleteClusterShardMetadata; - message.clusterId = object.clusterId ?? ""; - message.shardName = object.shardName ?? ""; + ...baseListClusterShardsResponse, + } as ListClusterShardsResponse; + message.shards = object.shards?.map((e) => Shard.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; return message; }, }; messageTypeRegistry.set( - DeleteClusterShardMetadata.$type, - DeleteClusterShardMetadata + ListClusterShardsResponse.$type, + ListClusterShardsResponse ); -const baseResetupHostsRequest: object = { - $type: "yandex.cloud.mdb.mongodb.v1.ResetupHostsRequest", +const baseAddClusterShardRequest: object = { + $type: "yandex.cloud.mdb.mongodb.v1.AddClusterShardRequest", clusterId: "", - hostNames: "", + shardName: "", }; -export const ResetupHostsRequest = { - $type: "yandex.cloud.mdb.mongodb.v1.ResetupHostsRequest" as const, +export const AddClusterShardRequest = { + $type: "yandex.cloud.mdb.mongodb.v1.AddClusterShardRequest" as const, encode( - message: ResetupHostsRequest, + message: AddClusterShardRequest, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.clusterId !== "") { writer.uint32(10).string(message.clusterId); } - for (const v of message.hostNames) { - writer.uint32(18).string(v!); + if (message.shardName !== "") { + writer.uint32(18).string(message.shardName); + } + for (const v of message.hostSpecs) { + HostSpec.encode(v!, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResetupHostsRequest { + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AddClusterShardRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResetupHostsRequest } as ResetupHostsRequest; - message.hostNames = []; + const message = { ...baseAddClusterShardRequest } as AddClusterShardRequest; + message.hostSpecs = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6611,7 +6998,10 @@ export const ResetupHostsRequest = { message.clusterId = reader.string(); break; case 2: - message.hostNames.push(reader.string()); + message.shardName = reader.string(); + break; + case 3: + message.hostSpecs.push(HostSpec.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -6621,57 +7011,68 @@ export const ResetupHostsRequest = { return message; }, - fromJSON(object: any): ResetupHostsRequest { - const message = { ...baseResetupHostsRequest } as ResetupHostsRequest; + fromJSON(object: any): AddClusterShardRequest { + const message = { ...baseAddClusterShardRequest } as AddClusterShardRequest; message.clusterId = object.clusterId !== undefined && object.clusterId !== null ? String(object.clusterId) : ""; - message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + message.shardName = + object.shardName !== undefined && object.shardName !== null + ? String(object.shardName) + : ""; + message.hostSpecs = (object.hostSpecs ?? []).map((e: any) => + HostSpec.fromJSON(e) + ); return message; }, - toJSON(message: ResetupHostsRequest): unknown { + toJSON(message: AddClusterShardRequest): unknown { const obj: any = {}; message.clusterId !== undefined && (obj.clusterId = message.clusterId); - if (message.hostNames) { - obj.hostNames = message.hostNames.map((e) => e); + message.shardName !== undefined && (obj.shardName = message.shardName); + if (message.hostSpecs) { + obj.hostSpecs = message.hostSpecs.map((e) => + e ? HostSpec.toJSON(e) : undefined + ); } else { - obj.hostNames = []; + obj.hostSpecs = []; } return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): ResetupHostsRequest { - const message = { ...baseResetupHostsRequest } as ResetupHostsRequest; + ): AddClusterShardRequest { + const message = { ...baseAddClusterShardRequest } as AddClusterShardRequest; message.clusterId = object.clusterId ?? ""; - message.hostNames = object.hostNames?.map((e) => e) || []; + message.shardName = object.shardName ?? ""; + message.hostSpecs = + object.hostSpecs?.map((e) => HostSpec.fromPartial(e)) || []; return message; }, }; -messageTypeRegistry.set(ResetupHostsRequest.$type, ResetupHostsRequest); +messageTypeRegistry.set(AddClusterShardRequest.$type, AddClusterShardRequest); -const baseResetupHostsMetadata: object = { - $type: "yandex.cloud.mdb.mongodb.v1.ResetupHostsMetadata", +const baseAddClusterShardMetadata: object = { + $type: "yandex.cloud.mdb.mongodb.v1.AddClusterShardMetadata", clusterId: "", - hostNames: "", + shardName: "", }; -export const ResetupHostsMetadata = { - $type: "yandex.cloud.mdb.mongodb.v1.ResetupHostsMetadata" as const, +export const AddClusterShardMetadata = { + $type: "yandex.cloud.mdb.mongodb.v1.AddClusterShardMetadata" as const, encode( - message: ResetupHostsMetadata, + message: AddClusterShardMetadata, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.clusterId !== "") { writer.uint32(10).string(message.clusterId); } - for (const v of message.hostNames) { - writer.uint32(18).string(v!); + if (message.shardName !== "") { + writer.uint32(18).string(message.shardName); } return writer; }, @@ -6679,11 +7080,12 @@ export const ResetupHostsMetadata = { decode( input: _m0.Reader | Uint8Array, length?: number - ): ResetupHostsMetadata { + ): AddClusterShardMetadata { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseResetupHostsMetadata } as ResetupHostsMetadata; - message.hostNames = []; + const message = { + ...baseAddClusterShardMetadata, + } as AddClusterShardMetadata; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6691,7 +7093,7 @@ export const ResetupHostsMetadata = { message.clusterId = reader.string(); break; case 2: - message.hostNames.push(reader.string()); + message.shardName = reader.string(); break; default: reader.skipType(tag & 7); @@ -6701,66 +7103,73 @@ export const ResetupHostsMetadata = { return message; }, - fromJSON(object: any): ResetupHostsMetadata { - const message = { ...baseResetupHostsMetadata } as ResetupHostsMetadata; + fromJSON(object: any): AddClusterShardMetadata { + const message = { + ...baseAddClusterShardMetadata, + } as AddClusterShardMetadata; message.clusterId = object.clusterId !== undefined && object.clusterId !== null ? String(object.clusterId) : ""; - message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + message.shardName = + object.shardName !== undefined && object.shardName !== null + ? String(object.shardName) + : ""; return message; }, - toJSON(message: ResetupHostsMetadata): unknown { + toJSON(message: AddClusterShardMetadata): unknown { const obj: any = {}; message.clusterId !== undefined && (obj.clusterId = message.clusterId); - if (message.hostNames) { - obj.hostNames = message.hostNames.map((e) => e); - } else { - obj.hostNames = []; - } + message.shardName !== undefined && (obj.shardName = message.shardName); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): ResetupHostsMetadata { - const message = { ...baseResetupHostsMetadata } as ResetupHostsMetadata; + ): AddClusterShardMetadata { + const message = { + ...baseAddClusterShardMetadata, + } as AddClusterShardMetadata; message.clusterId = object.clusterId ?? ""; - message.hostNames = object.hostNames?.map((e) => e) || []; + message.shardName = object.shardName ?? ""; return message; }, }; -messageTypeRegistry.set(ResetupHostsMetadata.$type, ResetupHostsMetadata); +messageTypeRegistry.set(AddClusterShardMetadata.$type, AddClusterShardMetadata); -const baseRestartHostsRequest: object = { - $type: "yandex.cloud.mdb.mongodb.v1.RestartHostsRequest", +const baseDeleteClusterShardRequest: object = { + $type: "yandex.cloud.mdb.mongodb.v1.DeleteClusterShardRequest", clusterId: "", - hostNames: "", + shardName: "", }; -export const RestartHostsRequest = { - $type: "yandex.cloud.mdb.mongodb.v1.RestartHostsRequest" as const, +export const DeleteClusterShardRequest = { + $type: "yandex.cloud.mdb.mongodb.v1.DeleteClusterShardRequest" as const, encode( - message: RestartHostsRequest, + message: DeleteClusterShardRequest, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.clusterId !== "") { writer.uint32(10).string(message.clusterId); } - for (const v of message.hostNames) { - writer.uint32(18).string(v!); + if (message.shardName !== "") { + writer.uint32(18).string(message.shardName); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RestartHostsRequest { + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteClusterShardRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRestartHostsRequest } as RestartHostsRequest; - message.hostNames = []; + const message = { + ...baseDeleteClusterShardRequest, + } as DeleteClusterShardRequest; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6768,7 +7177,7 @@ export const RestartHostsRequest = { message.clusterId = reader.string(); break; case 2: - message.hostNames.push(reader.string()); + message.shardName = reader.string(); break; default: reader.skipType(tag & 7); @@ -6778,57 +7187,1043 @@ export const RestartHostsRequest = { return message; }, - fromJSON(object: any): RestartHostsRequest { - const message = { ...baseRestartHostsRequest } as RestartHostsRequest; + fromJSON(object: any): DeleteClusterShardRequest { + const message = { + ...baseDeleteClusterShardRequest, + } as DeleteClusterShardRequest; message.clusterId = object.clusterId !== undefined && object.clusterId !== null ? String(object.clusterId) : ""; - message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + message.shardName = + object.shardName !== undefined && object.shardName !== null + ? String(object.shardName) + : ""; return message; }, - toJSON(message: RestartHostsRequest): unknown { + toJSON(message: DeleteClusterShardRequest): unknown { const obj: any = {}; message.clusterId !== undefined && (obj.clusterId = message.clusterId); - if (message.hostNames) { - obj.hostNames = message.hostNames.map((e) => e); - } else { - obj.hostNames = []; - } + message.shardName !== undefined && (obj.shardName = message.shardName); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteClusterShardRequest { + const message = { + ...baseDeleteClusterShardRequest, + } as DeleteClusterShardRequest; + message.clusterId = object.clusterId ?? ""; + message.shardName = object.shardName ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteClusterShardRequest.$type, + DeleteClusterShardRequest +); + +const baseDeleteClusterShardMetadata: object = { + $type: "yandex.cloud.mdb.mongodb.v1.DeleteClusterShardMetadata", + clusterId: "", + shardName: "", +}; + +export const DeleteClusterShardMetadata = { + $type: "yandex.cloud.mdb.mongodb.v1.DeleteClusterShardMetadata" as const, + + encode( + message: DeleteClusterShardMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + if (message.shardName !== "") { + writer.uint32(18).string(message.shardName); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteClusterShardMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteClusterShardMetadata, + } as DeleteClusterShardMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.shardName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteClusterShardMetadata { + const message = { + ...baseDeleteClusterShardMetadata, + } as DeleteClusterShardMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.shardName = + object.shardName !== undefined && object.shardName !== null + ? String(object.shardName) + : ""; + return message; + }, + + toJSON(message: DeleteClusterShardMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + message.shardName !== undefined && (obj.shardName = message.shardName); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteClusterShardMetadata { + const message = { + ...baseDeleteClusterShardMetadata, + } as DeleteClusterShardMetadata; + message.clusterId = object.clusterId ?? ""; + message.shardName = object.shardName ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteClusterShardMetadata.$type, + DeleteClusterShardMetadata +); + +const baseResetupHostsRequest: object = { + $type: "yandex.cloud.mdb.mongodb.v1.ResetupHostsRequest", + clusterId: "", + hostNames: "", +}; + +export const ResetupHostsRequest = { + $type: "yandex.cloud.mdb.mongodb.v1.ResetupHostsRequest" as const, + + encode( + message: ResetupHostsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + for (const v of message.hostNames) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResetupHostsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResetupHostsRequest } as ResetupHostsRequest; + message.hostNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.hostNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResetupHostsRequest { + const message = { ...baseResetupHostsRequest } as ResetupHostsRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: ResetupHostsRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.hostNames) { + obj.hostNames = message.hostNames.map((e) => e); + } else { + obj.hostNames = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ResetupHostsRequest { + const message = { ...baseResetupHostsRequest } as ResetupHostsRequest; + message.clusterId = object.clusterId ?? ""; + message.hostNames = object.hostNames?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(ResetupHostsRequest.$type, ResetupHostsRequest); + +const baseResetupHostsMetadata: object = { + $type: "yandex.cloud.mdb.mongodb.v1.ResetupHostsMetadata", + clusterId: "", + hostNames: "", +}; + +export const ResetupHostsMetadata = { + $type: "yandex.cloud.mdb.mongodb.v1.ResetupHostsMetadata" as const, + + encode( + message: ResetupHostsMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + for (const v of message.hostNames) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ResetupHostsMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResetupHostsMetadata } as ResetupHostsMetadata; + message.hostNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.hostNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResetupHostsMetadata { + const message = { ...baseResetupHostsMetadata } as ResetupHostsMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: ResetupHostsMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.hostNames) { + obj.hostNames = message.hostNames.map((e) => e); + } else { + obj.hostNames = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ResetupHostsMetadata { + const message = { ...baseResetupHostsMetadata } as ResetupHostsMetadata; + message.clusterId = object.clusterId ?? ""; + message.hostNames = object.hostNames?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(ResetupHostsMetadata.$type, ResetupHostsMetadata); + +const baseRestartHostsRequest: object = { + $type: "yandex.cloud.mdb.mongodb.v1.RestartHostsRequest", + clusterId: "", + hostNames: "", +}; + +export const RestartHostsRequest = { + $type: "yandex.cloud.mdb.mongodb.v1.RestartHostsRequest" as const, + + encode( + message: RestartHostsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + for (const v of message.hostNames) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RestartHostsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRestartHostsRequest } as RestartHostsRequest; + message.hostNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.hostNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RestartHostsRequest { + const message = { ...baseRestartHostsRequest } as RestartHostsRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: RestartHostsRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.hostNames) { + obj.hostNames = message.hostNames.map((e) => e); + } else { + obj.hostNames = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): RestartHostsRequest { + const message = { ...baseRestartHostsRequest } as RestartHostsRequest; + message.clusterId = object.clusterId ?? ""; + message.hostNames = object.hostNames?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(RestartHostsRequest.$type, RestartHostsRequest); + +const baseRestartHostsMetadata: object = { + $type: "yandex.cloud.mdb.mongodb.v1.RestartHostsMetadata", + clusterId: "", + hostNames: "", +}; + +export const RestartHostsMetadata = { + $type: "yandex.cloud.mdb.mongodb.v1.RestartHostsMetadata" as const, + + encode( + message: RestartHostsMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + for (const v of message.hostNames) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RestartHostsMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRestartHostsMetadata } as RestartHostsMetadata; + message.hostNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.hostNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RestartHostsMetadata { + const message = { ...baseRestartHostsMetadata } as RestartHostsMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: RestartHostsMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.hostNames) { + obj.hostNames = message.hostNames.map((e) => e); + } else { + obj.hostNames = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): RestartHostsMetadata { + const message = { ...baseRestartHostsMetadata } as RestartHostsMetadata; + message.clusterId = object.clusterId ?? ""; + message.hostNames = object.hostNames?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(RestartHostsMetadata.$type, RestartHostsMetadata); + +const baseStepdownHostsRequest: object = { + $type: "yandex.cloud.mdb.mongodb.v1.StepdownHostsRequest", + clusterId: "", + hostNames: "", +}; + +export const StepdownHostsRequest = { + $type: "yandex.cloud.mdb.mongodb.v1.StepdownHostsRequest" as const, + + encode( + message: StepdownHostsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + for (const v of message.hostNames) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): StepdownHostsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStepdownHostsRequest } as StepdownHostsRequest; + message.hostNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.hostNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StepdownHostsRequest { + const message = { ...baseStepdownHostsRequest } as StepdownHostsRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: StepdownHostsRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.hostNames) { + obj.hostNames = message.hostNames.map((e) => e); + } else { + obj.hostNames = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): StepdownHostsRequest { + const message = { ...baseStepdownHostsRequest } as StepdownHostsRequest; + message.clusterId = object.clusterId ?? ""; + message.hostNames = object.hostNames?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(StepdownHostsRequest.$type, StepdownHostsRequest); + +const baseStepdownHostsMetadata: object = { + $type: "yandex.cloud.mdb.mongodb.v1.StepdownHostsMetadata", + clusterId: "", + hostNames: "", +}; + +export const StepdownHostsMetadata = { + $type: "yandex.cloud.mdb.mongodb.v1.StepdownHostsMetadata" as const, + + encode( + message: StepdownHostsMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + for (const v of message.hostNames) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): StepdownHostsMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStepdownHostsMetadata } as StepdownHostsMetadata; + message.hostNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + case 2: + message.hostNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StepdownHostsMetadata { + const message = { ...baseStepdownHostsMetadata } as StepdownHostsMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: StepdownHostsMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + if (message.hostNames) { + obj.hostNames = message.hostNames.map((e) => e); + } else { + obj.hostNames = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): StepdownHostsMetadata { + const message = { ...baseStepdownHostsMetadata } as StepdownHostsMetadata; + message.clusterId = object.clusterId ?? ""; + message.hostNames = object.hostNames?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(StepdownHostsMetadata.$type, StepdownHostsMetadata); + +const baseHostSpec: object = { + $type: "yandex.cloud.mdb.mongodb.v1.HostSpec", + zoneId: "", + subnetId: "", + assignPublicIp: false, + type: 0, + shardName: "", +}; + +export const HostSpec = { + $type: "yandex.cloud.mdb.mongodb.v1.HostSpec" as const, + + encode( + message: HostSpec, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.zoneId !== "") { + writer.uint32(10).string(message.zoneId); + } + if (message.subnetId !== "") { + writer.uint32(18).string(message.subnetId); + } + if (message.assignPublicIp === true) { + writer.uint32(24).bool(message.assignPublicIp); + } + if (message.type !== 0) { + writer.uint32(32).int32(message.type); + } + if (message.shardName !== "") { + writer.uint32(42).string(message.shardName); + } + if (message.hidden !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.hidden! }, + writer.uint32(50).fork() + ).ldelim(); + } + if (message.secondaryDelaySecs !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.secondaryDelaySecs!, + }, + writer.uint32(58).fork() + ).ldelim(); + } + if (message.priority !== undefined) { + DoubleValue.encode( + { $type: "google.protobuf.DoubleValue", value: message.priority! }, + writer.uint32(66).fork() + ).ldelim(); + } + Object.entries(message.tags).forEach(([key, value]) => { + HostSpec_TagsEntry.encode( + { + $type: "yandex.cloud.mdb.mongodb.v1.HostSpec.TagsEntry", + key: key as any, + value, + }, + writer.uint32(74).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HostSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHostSpec } as HostSpec; + message.tags = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.zoneId = reader.string(); + break; + case 2: + message.subnetId = reader.string(); + break; + case 3: + message.assignPublicIp = reader.bool(); + break; + case 4: + message.type = reader.int32() as any; + break; + case 5: + message.shardName = reader.string(); + break; + case 6: + message.hidden = BoolValue.decode(reader, reader.uint32()).value; + break; + case 7: + message.secondaryDelaySecs = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 8: + message.priority = DoubleValue.decode(reader, reader.uint32()).value; + break; + case 9: + const entry9 = HostSpec_TagsEntry.decode(reader, reader.uint32()); + if (entry9.value !== undefined) { + message.tags[entry9.key] = entry9.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HostSpec { + const message = { ...baseHostSpec } as HostSpec; + message.zoneId = + object.zoneId !== undefined && object.zoneId !== null + ? String(object.zoneId) + : ""; + message.subnetId = + object.subnetId !== undefined && object.subnetId !== null + ? String(object.subnetId) + : ""; + message.assignPublicIp = + object.assignPublicIp !== undefined && object.assignPublicIp !== null + ? Boolean(object.assignPublicIp) + : false; + message.type = + object.type !== undefined && object.type !== null + ? host_TypeFromJSON(object.type) + : 0; + message.shardName = + object.shardName !== undefined && object.shardName !== null + ? String(object.shardName) + : ""; + message.hidden = + object.hidden !== undefined && object.hidden !== null + ? Boolean(object.hidden) + : undefined; + message.secondaryDelaySecs = + object.secondaryDelaySecs !== undefined && + object.secondaryDelaySecs !== null + ? Number(object.secondaryDelaySecs) + : undefined; + message.priority = + object.priority !== undefined && object.priority !== null + ? Number(object.priority) + : undefined; + message.tags = Object.entries(object.tags ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: HostSpec): unknown { + const obj: any = {}; + message.zoneId !== undefined && (obj.zoneId = message.zoneId); + message.subnetId !== undefined && (obj.subnetId = message.subnetId); + message.assignPublicIp !== undefined && + (obj.assignPublicIp = message.assignPublicIp); + message.type !== undefined && (obj.type = host_TypeToJSON(message.type)); + message.shardName !== undefined && (obj.shardName = message.shardName); + message.hidden !== undefined && (obj.hidden = message.hidden); + message.secondaryDelaySecs !== undefined && + (obj.secondaryDelaySecs = message.secondaryDelaySecs); + message.priority !== undefined && (obj.priority = message.priority); + obj.tags = {}; + if (message.tags) { + Object.entries(message.tags).forEach(([k, v]) => { + obj.tags[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>(object: I): HostSpec { + const message = { ...baseHostSpec } as HostSpec; + message.zoneId = object.zoneId ?? ""; + message.subnetId = object.subnetId ?? ""; + message.assignPublicIp = object.assignPublicIp ?? false; + message.type = object.type ?? 0; + message.shardName = object.shardName ?? ""; + message.hidden = object.hidden ?? undefined; + message.secondaryDelaySecs = object.secondaryDelaySecs ?? undefined; + message.priority = object.priority ?? undefined; + message.tags = Object.entries(object.tags ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(HostSpec.$type, HostSpec); + +const baseHostSpec_TagsEntry: object = { + $type: "yandex.cloud.mdb.mongodb.v1.HostSpec.TagsEntry", + key: "", + value: "", +}; + +export const HostSpec_TagsEntry = { + $type: "yandex.cloud.mdb.mongodb.v1.HostSpec.TagsEntry" as const, + + encode( + message: HostSpec_TagsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HostSpec_TagsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHostSpec_TagsEntry } as HostSpec_TagsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HostSpec_TagsEntry { + const message = { ...baseHostSpec_TagsEntry } as HostSpec_TagsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: HostSpec_TagsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): HostSpec_TagsEntry { + const message = { ...baseHostSpec_TagsEntry } as HostSpec_TagsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(HostSpec_TagsEntry.$type, HostSpec_TagsEntry); + +const baseMongodbspec36: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6", +}; + +export const Mongodbspec36 = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6" as const, + + encode( + message: Mongodbspec36, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.mongod !== undefined) { + Mongodbspec36_Mongod.encode( + message.mongod, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.mongocfg !== undefined) { + Mongodbspec36_MongoCfg.encode( + message.mongocfg, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.mongos !== undefined) { + Mongodbspec36_Mongos.encode( + message.mongos, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.mongoinfra !== undefined) { + Mongodbspec36_MongoInfra.encode( + message.mongoinfra, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Mongodbspec36 { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongodbspec36 } as Mongodbspec36; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mongod = Mongodbspec36_Mongod.decode(reader, reader.uint32()); + break; + case 2: + message.mongocfg = Mongodbspec36_MongoCfg.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.mongos = Mongodbspec36_Mongos.decode(reader, reader.uint32()); + break; + case 4: + message.mongoinfra = Mongodbspec36_MongoInfra.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodbspec36 { + const message = { ...baseMongodbspec36 } as Mongodbspec36; + message.mongod = + object.mongod !== undefined && object.mongod !== null + ? Mongodbspec36_Mongod.fromJSON(object.mongod) + : undefined; + message.mongocfg = + object.mongocfg !== undefined && object.mongocfg !== null + ? Mongodbspec36_MongoCfg.fromJSON(object.mongocfg) + : undefined; + message.mongos = + object.mongos !== undefined && object.mongos !== null + ? Mongodbspec36_Mongos.fromJSON(object.mongos) + : undefined; + message.mongoinfra = + object.mongoinfra !== undefined && object.mongoinfra !== null + ? Mongodbspec36_MongoInfra.fromJSON(object.mongoinfra) + : undefined; + return message; + }, + + toJSON(message: Mongodbspec36): unknown { + const obj: any = {}; + message.mongod !== undefined && + (obj.mongod = message.mongod + ? Mongodbspec36_Mongod.toJSON(message.mongod) + : undefined); + message.mongocfg !== undefined && + (obj.mongocfg = message.mongocfg + ? Mongodbspec36_MongoCfg.toJSON(message.mongocfg) + : undefined); + message.mongos !== undefined && + (obj.mongos = message.mongos + ? Mongodbspec36_Mongos.toJSON(message.mongos) + : undefined); + message.mongoinfra !== undefined && + (obj.mongoinfra = message.mongoinfra + ? Mongodbspec36_MongoInfra.toJSON(message.mongoinfra) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): RestartHostsRequest { - const message = { ...baseRestartHostsRequest } as RestartHostsRequest; - message.clusterId = object.clusterId ?? ""; - message.hostNames = object.hostNames?.map((e) => e) || []; + ): Mongodbspec36 { + const message = { ...baseMongodbspec36 } as Mongodbspec36; + message.mongod = + object.mongod !== undefined && object.mongod !== null + ? Mongodbspec36_Mongod.fromPartial(object.mongod) + : undefined; + message.mongocfg = + object.mongocfg !== undefined && object.mongocfg !== null + ? Mongodbspec36_MongoCfg.fromPartial(object.mongocfg) + : undefined; + message.mongos = + object.mongos !== undefined && object.mongos !== null + ? Mongodbspec36_Mongos.fromPartial(object.mongos) + : undefined; + message.mongoinfra = + object.mongoinfra !== undefined && object.mongoinfra !== null + ? Mongodbspec36_MongoInfra.fromPartial(object.mongoinfra) + : undefined; return message; }, }; -messageTypeRegistry.set(RestartHostsRequest.$type, RestartHostsRequest); +messageTypeRegistry.set(Mongodbspec36.$type, Mongodbspec36); -const baseRestartHostsMetadata: object = { - $type: "yandex.cloud.mdb.mongodb.v1.RestartHostsMetadata", - clusterId: "", - hostNames: "", +const baseMongodbspec36_Mongod: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.Mongod", }; -export const RestartHostsMetadata = { - $type: "yandex.cloud.mdb.mongodb.v1.RestartHostsMetadata" as const, +export const Mongodbspec36_Mongod = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.Mongod" as const, encode( - message: RestartHostsMetadata, + message: Mongodbspec36_Mongod, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - if (message.clusterId !== "") { - writer.uint32(10).string(message.clusterId); + if (message.config !== undefined) { + Mongodconfig36.encode(message.config, writer.uint32(10).fork()).ldelim(); } - for (const v of message.hostNames) { - writer.uint32(18).string(v!); + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); + } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); } return writer; }, @@ -6836,19 +8231,24 @@ export const RestartHostsMetadata = { decode( input: _m0.Reader | Uint8Array, length?: number - ): RestartHostsMetadata { + ): Mongodbspec36_Mongod { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseRestartHostsMetadata } as RestartHostsMetadata; - message.hostNames = []; + const message = { ...baseMongodbspec36_Mongod } as Mongodbspec36_Mongod; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.clusterId = reader.string(); + message.config = Mongodconfig36.decode(reader, reader.uint32()); break; case 2: - message.hostNames.push(reader.string()); + message.resources = Resources.decode(reader, reader.uint32()); + break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); break; default: reader.skipType(tag & 7); @@ -6858,57 +8258,89 @@ export const RestartHostsMetadata = { return message; }, - fromJSON(object: any): RestartHostsMetadata { - const message = { ...baseRestartHostsMetadata } as RestartHostsMetadata; - message.clusterId = - object.clusterId !== undefined && object.clusterId !== null - ? String(object.clusterId) - : ""; - message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + fromJSON(object: any): Mongodbspec36_Mongod { + const message = { ...baseMongodbspec36_Mongod } as Mongodbspec36_Mongod; + message.config = + object.config !== undefined && object.config !== null + ? Mongodconfig36.fromJSON(object.config) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: RestartHostsMetadata): unknown { + toJSON(message: Mongodbspec36_Mongod): unknown { const obj: any = {}; - message.clusterId !== undefined && (obj.clusterId = message.clusterId); - if (message.hostNames) { - obj.hostNames = message.hostNames.map((e) => e); - } else { - obj.hostNames = []; - } + message.config !== undefined && + (obj.config = message.config + ? Mongodconfig36.toJSON(message.config) + : undefined); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): RestartHostsMetadata { - const message = { ...baseRestartHostsMetadata } as RestartHostsMetadata; - message.clusterId = object.clusterId ?? ""; - message.hostNames = object.hostNames?.map((e) => e) || []; + ): Mongodbspec36_Mongod { + const message = { ...baseMongodbspec36_Mongod } as Mongodbspec36_Mongod; + message.config = + object.config !== undefined && object.config !== null + ? Mongodconfig36.fromPartial(object.config) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(RestartHostsMetadata.$type, RestartHostsMetadata); +messageTypeRegistry.set(Mongodbspec36_Mongod.$type, Mongodbspec36_Mongod); -const baseStepdownHostsRequest: object = { - $type: "yandex.cloud.mdb.mongodb.v1.StepdownHostsRequest", - clusterId: "", - hostNames: "", +const baseMongodbspec36_MongoCfg: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.MongoCfg", }; -export const StepdownHostsRequest = { - $type: "yandex.cloud.mdb.mongodb.v1.StepdownHostsRequest" as const, +export const Mongodbspec36_MongoCfg = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.MongoCfg" as const, encode( - message: StepdownHostsRequest, + message: Mongodbspec36_MongoCfg, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - if (message.clusterId !== "") { - writer.uint32(10).string(message.clusterId); + if (message.config !== undefined) { + Mongocfgconfig36.encode( + message.config, + writer.uint32(10).fork() + ).ldelim(); } - for (const v of message.hostNames) { - writer.uint32(18).string(v!); + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); + } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); } return writer; }, @@ -6916,19 +8348,24 @@ export const StepdownHostsRequest = { decode( input: _m0.Reader | Uint8Array, length?: number - ): StepdownHostsRequest { + ): Mongodbspec36_MongoCfg { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseStepdownHostsRequest } as StepdownHostsRequest; - message.hostNames = []; + const message = { ...baseMongodbspec36_MongoCfg } as Mongodbspec36_MongoCfg; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.clusterId = reader.string(); + message.config = Mongocfgconfig36.decode(reader, reader.uint32()); break; case 2: - message.hostNames.push(reader.string()); + message.resources = Resources.decode(reader, reader.uint32()); + break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); break; default: reader.skipType(tag & 7); @@ -6938,57 +8375,86 @@ export const StepdownHostsRequest = { return message; }, - fromJSON(object: any): StepdownHostsRequest { - const message = { ...baseStepdownHostsRequest } as StepdownHostsRequest; - message.clusterId = - object.clusterId !== undefined && object.clusterId !== null - ? String(object.clusterId) - : ""; - message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + fromJSON(object: any): Mongodbspec36_MongoCfg { + const message = { ...baseMongodbspec36_MongoCfg } as Mongodbspec36_MongoCfg; + message.config = + object.config !== undefined && object.config !== null + ? Mongocfgconfig36.fromJSON(object.config) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: StepdownHostsRequest): unknown { + toJSON(message: Mongodbspec36_MongoCfg): unknown { const obj: any = {}; - message.clusterId !== undefined && (obj.clusterId = message.clusterId); - if (message.hostNames) { - obj.hostNames = message.hostNames.map((e) => e); - } else { - obj.hostNames = []; - } + message.config !== undefined && + (obj.config = message.config + ? Mongocfgconfig36.toJSON(message.config) + : undefined); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): StepdownHostsRequest { - const message = { ...baseStepdownHostsRequest } as StepdownHostsRequest; - message.clusterId = object.clusterId ?? ""; - message.hostNames = object.hostNames?.map((e) => e) || []; + ): Mongodbspec36_MongoCfg { + const message = { ...baseMongodbspec36_MongoCfg } as Mongodbspec36_MongoCfg; + message.config = + object.config !== undefined && object.config !== null + ? Mongocfgconfig36.fromPartial(object.config) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(StepdownHostsRequest.$type, StepdownHostsRequest); +messageTypeRegistry.set(Mongodbspec36_MongoCfg.$type, Mongodbspec36_MongoCfg); -const baseStepdownHostsMetadata: object = { - $type: "yandex.cloud.mdb.mongodb.v1.StepdownHostsMetadata", - clusterId: "", - hostNames: "", +const baseMongodbspec36_Mongos: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.Mongos", }; -export const StepdownHostsMetadata = { - $type: "yandex.cloud.mdb.mongodb.v1.StepdownHostsMetadata" as const, +export const Mongodbspec36_Mongos = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.Mongos" as const, encode( - message: StepdownHostsMetadata, + message: Mongodbspec36_Mongos, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - if (message.clusterId !== "") { - writer.uint32(10).string(message.clusterId); + if (message.config !== undefined) { + Mongosconfig36.encode(message.config, writer.uint32(10).fork()).ldelim(); } - for (const v of message.hostNames) { - writer.uint32(18).string(v!); + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); + } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); } return writer; }, @@ -6996,19 +8462,24 @@ export const StepdownHostsMetadata = { decode( input: _m0.Reader | Uint8Array, length?: number - ): StepdownHostsMetadata { + ): Mongodbspec36_Mongos { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseStepdownHostsMetadata } as StepdownHostsMetadata; - message.hostNames = []; + const message = { ...baseMongodbspec36_Mongos } as Mongodbspec36_Mongos; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.clusterId = reader.string(); + message.config = Mongosconfig36.decode(reader, reader.uint32()); break; case 2: - message.hostNames.push(reader.string()); + message.resources = Resources.decode(reader, reader.uint32()); + break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); break; default: reader.skipType(tag & 7); @@ -7018,94 +8489,128 @@ export const StepdownHostsMetadata = { return message; }, - fromJSON(object: any): StepdownHostsMetadata { - const message = { ...baseStepdownHostsMetadata } as StepdownHostsMetadata; - message.clusterId = - object.clusterId !== undefined && object.clusterId !== null - ? String(object.clusterId) - : ""; - message.hostNames = (object.hostNames ?? []).map((e: any) => String(e)); + fromJSON(object: any): Mongodbspec36_Mongos { + const message = { ...baseMongodbspec36_Mongos } as Mongodbspec36_Mongos; + message.config = + object.config !== undefined && object.config !== null + ? Mongosconfig36.fromJSON(object.config) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: StepdownHostsMetadata): unknown { + toJSON(message: Mongodbspec36_Mongos): unknown { const obj: any = {}; - message.clusterId !== undefined && (obj.clusterId = message.clusterId); - if (message.hostNames) { - obj.hostNames = message.hostNames.map((e) => e); - } else { - obj.hostNames = []; - } + message.config !== undefined && + (obj.config = message.config + ? Mongosconfig36.toJSON(message.config) + : undefined); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): StepdownHostsMetadata { - const message = { ...baseStepdownHostsMetadata } as StepdownHostsMetadata; - message.clusterId = object.clusterId ?? ""; - message.hostNames = object.hostNames?.map((e) => e) || []; + ): Mongodbspec36_Mongos { + const message = { ...baseMongodbspec36_Mongos } as Mongodbspec36_Mongos; + message.config = + object.config !== undefined && object.config !== null + ? Mongosconfig36.fromPartial(object.config) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(StepdownHostsMetadata.$type, StepdownHostsMetadata); +messageTypeRegistry.set(Mongodbspec36_Mongos.$type, Mongodbspec36_Mongos); -const baseHostSpec: object = { - $type: "yandex.cloud.mdb.mongodb.v1.HostSpec", - zoneId: "", - subnetId: "", - assignPublicIp: false, - type: 0, - shardName: "", +const baseMongodbspec36_MongoInfra: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.MongoInfra", }; -export const HostSpec = { - $type: "yandex.cloud.mdb.mongodb.v1.HostSpec" as const, +export const Mongodbspec36_MongoInfra = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.MongoInfra" as const, encode( - message: HostSpec, + message: Mongodbspec36_MongoInfra, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { - if (message.zoneId !== "") { - writer.uint32(10).string(message.zoneId); - } - if (message.subnetId !== "") { - writer.uint32(18).string(message.subnetId); + if (message.configMongos !== undefined) { + Mongosconfig36.encode( + message.configMongos, + writer.uint32(10).fork() + ).ldelim(); } - if (message.assignPublicIp === true) { - writer.uint32(24).bool(message.assignPublicIp); + if (message.configMongocfg !== undefined) { + Mongocfgconfig36.encode( + message.configMongocfg, + writer.uint32(18).fork() + ).ldelim(); } - if (message.type !== 0) { - writer.uint32(32).int32(message.type); + if (message.resources !== undefined) { + Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } - if (message.shardName !== "") { - writer.uint32(42).string(message.shardName); + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HostSpec { + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodbspec36_MongoInfra { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseHostSpec } as HostSpec; + const message = { + ...baseMongodbspec36_MongoInfra, + } as Mongodbspec36_MongoInfra; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.zoneId = reader.string(); + message.configMongos = Mongosconfig36.decode(reader, reader.uint32()); break; case 2: - message.subnetId = reader.string(); + message.configMongocfg = Mongocfgconfig36.decode( + reader, + reader.uint32() + ); break; case 3: - message.assignPublicIp = reader.bool(); + message.resources = Resources.decode(reader, reader.uint32()); break; case 4: - message.type = reader.int32() as any; - break; - case 5: - message.shardName = reader.string(); + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); break; default: reader.skipType(tag & 7); @@ -7115,86 +8620,114 @@ export const HostSpec = { return message; }, - fromJSON(object: any): HostSpec { - const message = { ...baseHostSpec } as HostSpec; - message.zoneId = - object.zoneId !== undefined && object.zoneId !== null - ? String(object.zoneId) - : ""; - message.subnetId = - object.subnetId !== undefined && object.subnetId !== null - ? String(object.subnetId) - : ""; - message.assignPublicIp = - object.assignPublicIp !== undefined && object.assignPublicIp !== null - ? Boolean(object.assignPublicIp) - : false; - message.type = - object.type !== undefined && object.type !== null - ? host_TypeFromJSON(object.type) - : 0; - message.shardName = - object.shardName !== undefined && object.shardName !== null - ? String(object.shardName) - : ""; + fromJSON(object: any): Mongodbspec36_MongoInfra { + const message = { + ...baseMongodbspec36_MongoInfra, + } as Mongodbspec36_MongoInfra; + message.configMongos = + object.configMongos !== undefined && object.configMongos !== null + ? Mongosconfig36.fromJSON(object.configMongos) + : undefined; + message.configMongocfg = + object.configMongocfg !== undefined && object.configMongocfg !== null + ? Mongocfgconfig36.fromJSON(object.configMongocfg) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromJSON(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: HostSpec): unknown { + toJSON(message: Mongodbspec36_MongoInfra): unknown { const obj: any = {}; - message.zoneId !== undefined && (obj.zoneId = message.zoneId); - message.subnetId !== undefined && (obj.subnetId = message.subnetId); - message.assignPublicIp !== undefined && - (obj.assignPublicIp = message.assignPublicIp); - message.type !== undefined && (obj.type = host_TypeToJSON(message.type)); - message.shardName !== undefined && (obj.shardName = message.shardName); + message.configMongos !== undefined && + (obj.configMongos = message.configMongos + ? Mongosconfig36.toJSON(message.configMongos) + : undefined); + message.configMongocfg !== undefined && + (obj.configMongocfg = message.configMongocfg + ? Mongocfgconfig36.toJSON(message.configMongocfg) + : undefined); + message.resources !== undefined && + (obj.resources = message.resources + ? Resources.toJSON(message.resources) + : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>(object: I): HostSpec { - const message = { ...baseHostSpec } as HostSpec; - message.zoneId = object.zoneId ?? ""; - message.subnetId = object.subnetId ?? ""; - message.assignPublicIp = object.assignPublicIp ?? false; - message.type = object.type ?? 0; - message.shardName = object.shardName ?? ""; + fromPartial, I>>( + object: I + ): Mongodbspec36_MongoInfra { + const message = { + ...baseMongodbspec36_MongoInfra, + } as Mongodbspec36_MongoInfra; + message.configMongos = + object.configMongos !== undefined && object.configMongos !== null + ? Mongosconfig36.fromPartial(object.configMongos) + : undefined; + message.configMongocfg = + object.configMongocfg !== undefined && object.configMongocfg !== null + ? Mongocfgconfig36.fromPartial(object.configMongocfg) + : undefined; + message.resources = + object.resources !== undefined && object.resources !== null + ? Resources.fromPartial(object.resources) + : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(HostSpec.$type, HostSpec); +messageTypeRegistry.set( + Mongodbspec36_MongoInfra.$type, + Mongodbspec36_MongoInfra +); -const baseMongodbspec36: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6", +const baseMongodbspec40: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0", }; -export const Mongodbspec36 = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6" as const, +export const Mongodbspec40 = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0" as const, encode( - message: Mongodbspec36, + message: Mongodbspec40, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.mongod !== undefined) { - Mongodbspec36_Mongod.encode( + Mongodbspec40_Mongod.encode( message.mongod, writer.uint32(10).fork() ).ldelim(); } if (message.mongocfg !== undefined) { - Mongodbspec36_MongoCfg.encode( + Mongodbspec40_MongoCfg.encode( message.mongocfg, writer.uint32(18).fork() ).ldelim(); } if (message.mongos !== undefined) { - Mongodbspec36_Mongos.encode( + Mongodbspec40_Mongos.encode( message.mongos, writer.uint32(26).fork() ).ldelim(); } if (message.mongoinfra !== undefined) { - Mongodbspec36_MongoInfra.encode( + Mongodbspec40_MongoInfra.encode( message.mongoinfra, writer.uint32(34).fork() ).ldelim(); @@ -7202,27 +8735,27 @@ export const Mongodbspec36 = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Mongodbspec36 { + decode(input: _m0.Reader | Uint8Array, length?: number): Mongodbspec40 { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec36 } as Mongodbspec36; + const message = { ...baseMongodbspec40 } as Mongodbspec40; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mongod = Mongodbspec36_Mongod.decode(reader, reader.uint32()); + message.mongod = Mongodbspec40_Mongod.decode(reader, reader.uint32()); break; case 2: - message.mongocfg = Mongodbspec36_MongoCfg.decode( + message.mongocfg = Mongodbspec40_MongoCfg.decode( reader, reader.uint32() ); break; case 3: - message.mongos = Mongodbspec36_Mongos.decode(reader, reader.uint32()); + message.mongos = Mongodbspec40_Mongos.decode(reader, reader.uint32()); break; case 4: - message.mongoinfra = Mongodbspec36_MongoInfra.decode( + message.mongoinfra = Mongodbspec40_MongoInfra.decode( reader, reader.uint32() ); @@ -7235,110 +8768,122 @@ export const Mongodbspec36 = { return message; }, - fromJSON(object: any): Mongodbspec36 { - const message = { ...baseMongodbspec36 } as Mongodbspec36; + fromJSON(object: any): Mongodbspec40 { + const message = { ...baseMongodbspec40 } as Mongodbspec40; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec36_Mongod.fromJSON(object.mongod) + ? Mongodbspec40_Mongod.fromJSON(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec36_MongoCfg.fromJSON(object.mongocfg) + ? Mongodbspec40_MongoCfg.fromJSON(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec36_Mongos.fromJSON(object.mongos) + ? Mongodbspec40_Mongos.fromJSON(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec36_MongoInfra.fromJSON(object.mongoinfra) + ? Mongodbspec40_MongoInfra.fromJSON(object.mongoinfra) : undefined; return message; }, - toJSON(message: Mongodbspec36): unknown { + toJSON(message: Mongodbspec40): unknown { const obj: any = {}; message.mongod !== undefined && (obj.mongod = message.mongod - ? Mongodbspec36_Mongod.toJSON(message.mongod) + ? Mongodbspec40_Mongod.toJSON(message.mongod) : undefined); message.mongocfg !== undefined && (obj.mongocfg = message.mongocfg - ? Mongodbspec36_MongoCfg.toJSON(message.mongocfg) + ? Mongodbspec40_MongoCfg.toJSON(message.mongocfg) : undefined); message.mongos !== undefined && (obj.mongos = message.mongos - ? Mongodbspec36_Mongos.toJSON(message.mongos) + ? Mongodbspec40_Mongos.toJSON(message.mongos) : undefined); message.mongoinfra !== undefined && (obj.mongoinfra = message.mongoinfra - ? Mongodbspec36_MongoInfra.toJSON(message.mongoinfra) + ? Mongodbspec40_MongoInfra.toJSON(message.mongoinfra) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec36 { - const message = { ...baseMongodbspec36 } as Mongodbspec36; + ): Mongodbspec40 { + const message = { ...baseMongodbspec40 } as Mongodbspec40; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec36_Mongod.fromPartial(object.mongod) + ? Mongodbspec40_Mongod.fromPartial(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec36_MongoCfg.fromPartial(object.mongocfg) + ? Mongodbspec40_MongoCfg.fromPartial(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec36_Mongos.fromPartial(object.mongos) + ? Mongodbspec40_Mongos.fromPartial(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec36_MongoInfra.fromPartial(object.mongoinfra) + ? Mongodbspec40_MongoInfra.fromPartial(object.mongoinfra) : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec36.$type, Mongodbspec36); +messageTypeRegistry.set(Mongodbspec40.$type, Mongodbspec40); -const baseMongodbspec36_Mongod: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.Mongod", +const baseMongodbspec40_Mongod: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.Mongod", }; -export const Mongodbspec36_Mongod = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.Mongod" as const, +export const Mongodbspec40_Mongod = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.Mongod" as const, encode( - message: Mongodbspec36_Mongod, + message: Mongodbspec40_Mongod, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongodconfig36.encode(message.config, writer.uint32(10).fork()).ldelim(); + Mongodconfig40.encode(message.config, writer.uint32(10).fork()).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec36_Mongod { + ): Mongodbspec40_Mongod { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec36_Mongod } as Mongodbspec36_Mongod; + const message = { ...baseMongodbspec40_Mongod } as Mongodbspec40_Mongod; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongodconfig36.decode(reader, reader.uint32()); + message.config = Mongodconfig40.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -7347,63 +8892,77 @@ export const Mongodbspec36_Mongod = { return message; }, - fromJSON(object: any): Mongodbspec36_Mongod { - const message = { ...baseMongodbspec36_Mongod } as Mongodbspec36_Mongod; + fromJSON(object: any): Mongodbspec40_Mongod { + const message = { ...baseMongodbspec40_Mongod } as Mongodbspec40_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig36.fromJSON(object.config) + ? Mongodconfig40.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec36_Mongod): unknown { + toJSON(message: Mongodbspec40_Mongod): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongodconfig36.toJSON(message.config) + ? Mongodconfig40.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec36_Mongod { - const message = { ...baseMongodbspec36_Mongod } as Mongodbspec36_Mongod; + ): Mongodbspec40_Mongod { + const message = { ...baseMongodbspec40_Mongod } as Mongodbspec40_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig36.fromPartial(object.config) + ? Mongodconfig40.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec36_Mongod.$type, Mongodbspec36_Mongod); +messageTypeRegistry.set(Mongodbspec40_Mongod.$type, Mongodbspec40_Mongod); -const baseMongodbspec36_MongoCfg: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.MongoCfg", +const baseMongodbspec40_MongoCfg: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.MongoCfg", }; -export const Mongodbspec36_MongoCfg = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.MongoCfg" as const, +export const Mongodbspec40_MongoCfg = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.MongoCfg" as const, encode( - message: Mongodbspec36_MongoCfg, + message: Mongodbspec40_MongoCfg, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongocfgconfig36.encode( + Mongocfgconfig40.encode( message.config, writer.uint32(10).fork() ).ldelim(); @@ -7411,25 +8970,37 @@ export const Mongodbspec36_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec36_MongoCfg { + ): Mongodbspec40_MongoCfg { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec36_MongoCfg } as Mongodbspec36_MongoCfg; + const message = { ...baseMongodbspec40_MongoCfg } as Mongodbspec40_MongoCfg; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongocfgconfig36.decode(reader, reader.uint32()); + message.config = Mongocfgconfig40.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -7438,86 +9009,112 @@ export const Mongodbspec36_MongoCfg = { return message; }, - fromJSON(object: any): Mongodbspec36_MongoCfg { - const message = { ...baseMongodbspec36_MongoCfg } as Mongodbspec36_MongoCfg; + fromJSON(object: any): Mongodbspec40_MongoCfg { + const message = { ...baseMongodbspec40_MongoCfg } as Mongodbspec40_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig36.fromJSON(object.config) + ? Mongocfgconfig40.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec36_MongoCfg): unknown { + toJSON(message: Mongodbspec40_MongoCfg): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongocfgconfig36.toJSON(message.config) + ? Mongocfgconfig40.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec36_MongoCfg { - const message = { ...baseMongodbspec36_MongoCfg } as Mongodbspec36_MongoCfg; + ): Mongodbspec40_MongoCfg { + const message = { ...baseMongodbspec40_MongoCfg } as Mongodbspec40_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig36.fromPartial(object.config) + ? Mongocfgconfig40.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec36_MongoCfg.$type, Mongodbspec36_MongoCfg); +messageTypeRegistry.set(Mongodbspec40_MongoCfg.$type, Mongodbspec40_MongoCfg); -const baseMongodbspec36_Mongos: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.Mongos", +const baseMongodbspec40_Mongos: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.Mongos", }; -export const Mongodbspec36_Mongos = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.Mongos" as const, +export const Mongodbspec40_Mongos = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.Mongos" as const, encode( - message: Mongodbspec36_Mongos, + message: Mongodbspec40_Mongos, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongosconfig36.encode(message.config, writer.uint32(10).fork()).ldelim(); + Mongosconfig40.encode(message.config, writer.uint32(10).fork()).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec36_Mongos { + ): Mongodbspec40_Mongos { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec36_Mongos } as Mongodbspec36_Mongos; + const message = { ...baseMongodbspec40_Mongos } as Mongodbspec40_Mongos; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongosconfig36.decode(reader, reader.uint32()); + message.config = Mongosconfig40.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -7526,69 +9123,83 @@ export const Mongodbspec36_Mongos = { return message; }, - fromJSON(object: any): Mongodbspec36_Mongos { - const message = { ...baseMongodbspec36_Mongos } as Mongodbspec36_Mongos; + fromJSON(object: any): Mongodbspec40_Mongos { + const message = { ...baseMongodbspec40_Mongos } as Mongodbspec40_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig36.fromJSON(object.config) + ? Mongosconfig40.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec36_Mongos): unknown { + toJSON(message: Mongodbspec40_Mongos): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongosconfig36.toJSON(message.config) + ? Mongosconfig40.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec36_Mongos { - const message = { ...baseMongodbspec36_Mongos } as Mongodbspec36_Mongos; + ): Mongodbspec40_Mongos { + const message = { ...baseMongodbspec40_Mongos } as Mongodbspec40_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig36.fromPartial(object.config) + ? Mongosconfig40.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec36_Mongos.$type, Mongodbspec36_Mongos); +messageTypeRegistry.set(Mongodbspec40_Mongos.$type, Mongodbspec40_Mongos); -const baseMongodbspec36_MongoInfra: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.MongoInfra", +const baseMongodbspec40_MongoInfra: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.MongoInfra", }; -export const Mongodbspec36_MongoInfra = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec3_6.MongoInfra" as const, +export const Mongodbspec40_MongoInfra = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.MongoInfra" as const, encode( - message: Mongodbspec36_MongoInfra, + message: Mongodbspec40_MongoInfra, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.configMongos !== undefined) { - Mongosconfig36.encode( + Mongosconfig40.encode( message.configMongos, writer.uint32(10).fork() ).ldelim(); } if (message.configMongocfg !== undefined) { - Mongocfgconfig36.encode( + Mongocfgconfig40.encode( message.configMongocfg, writer.uint32(18).fork() ).ldelim(); @@ -7596,26 +9207,32 @@ export const Mongodbspec36_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec36_MongoInfra { + ): Mongodbspec40_MongoInfra { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseMongodbspec36_MongoInfra, - } as Mongodbspec36_MongoInfra; + ...baseMongodbspec40_MongoInfra, + } as Mongodbspec40_MongoInfra; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.configMongos = Mongosconfig36.decode(reader, reader.uint32()); + message.configMongos = Mongosconfig40.decode(reader, reader.uint32()); break; case 2: - message.configMongocfg = Mongocfgconfig36.decode( + message.configMongocfg = Mongocfgconfig40.decode( reader, reader.uint32() ); @@ -7623,6 +9240,12 @@ export const Mongodbspec36_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -7631,100 +9254,114 @@ export const Mongodbspec36_MongoInfra = { return message; }, - fromJSON(object: any): Mongodbspec36_MongoInfra { + fromJSON(object: any): Mongodbspec40_MongoInfra { const message = { - ...baseMongodbspec36_MongoInfra, - } as Mongodbspec36_MongoInfra; + ...baseMongodbspec40_MongoInfra, + } as Mongodbspec40_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig36.fromJSON(object.configMongos) + ? Mongosconfig40.fromJSON(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig36.fromJSON(object.configMongocfg) + ? Mongocfgconfig40.fromJSON(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec36_MongoInfra): unknown { + toJSON(message: Mongodbspec40_MongoInfra): unknown { const obj: any = {}; message.configMongos !== undefined && (obj.configMongos = message.configMongos - ? Mongosconfig36.toJSON(message.configMongos) + ? Mongosconfig40.toJSON(message.configMongos) : undefined); message.configMongocfg !== undefined && (obj.configMongocfg = message.configMongocfg - ? Mongocfgconfig36.toJSON(message.configMongocfg) + ? Mongocfgconfig40.toJSON(message.configMongocfg) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec36_MongoInfra { + ): Mongodbspec40_MongoInfra { const message = { - ...baseMongodbspec36_MongoInfra, - } as Mongodbspec36_MongoInfra; + ...baseMongodbspec40_MongoInfra, + } as Mongodbspec40_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig36.fromPartial(object.configMongos) + ? Mongosconfig40.fromPartial(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig36.fromPartial(object.configMongocfg) + ? Mongocfgconfig40.fromPartial(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; messageTypeRegistry.set( - Mongodbspec36_MongoInfra.$type, - Mongodbspec36_MongoInfra + Mongodbspec40_MongoInfra.$type, + Mongodbspec40_MongoInfra ); -const baseMongodbspec40: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0", +const baseMongodbspec42: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2", }; -export const Mongodbspec40 = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0" as const, +export const Mongodbspec42 = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2" as const, encode( - message: Mongodbspec40, + message: Mongodbspec42, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.mongod !== undefined) { - Mongodbspec40_Mongod.encode( + Mongodbspec42_Mongod.encode( message.mongod, writer.uint32(10).fork() ).ldelim(); } if (message.mongocfg !== undefined) { - Mongodbspec40_MongoCfg.encode( + Mongodbspec42_MongoCfg.encode( message.mongocfg, writer.uint32(18).fork() ).ldelim(); } if (message.mongos !== undefined) { - Mongodbspec40_Mongos.encode( + Mongodbspec42_Mongos.encode( message.mongos, writer.uint32(26).fork() ).ldelim(); } if (message.mongoinfra !== undefined) { - Mongodbspec40_MongoInfra.encode( + Mongodbspec42_MongoInfra.encode( message.mongoinfra, writer.uint32(34).fork() ).ldelim(); @@ -7732,27 +9369,27 @@ export const Mongodbspec40 = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Mongodbspec40 { + decode(input: _m0.Reader | Uint8Array, length?: number): Mongodbspec42 { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec40 } as Mongodbspec40; + const message = { ...baseMongodbspec42 } as Mongodbspec42; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mongod = Mongodbspec40_Mongod.decode(reader, reader.uint32()); + message.mongod = Mongodbspec42_Mongod.decode(reader, reader.uint32()); break; case 2: - message.mongocfg = Mongodbspec40_MongoCfg.decode( + message.mongocfg = Mongodbspec42_MongoCfg.decode( reader, reader.uint32() ); break; case 3: - message.mongos = Mongodbspec40_Mongos.decode(reader, reader.uint32()); + message.mongos = Mongodbspec42_Mongos.decode(reader, reader.uint32()); break; case 4: - message.mongoinfra = Mongodbspec40_MongoInfra.decode( + message.mongoinfra = Mongodbspec42_MongoInfra.decode( reader, reader.uint32() ); @@ -7765,110 +9402,122 @@ export const Mongodbspec40 = { return message; }, - fromJSON(object: any): Mongodbspec40 { - const message = { ...baseMongodbspec40 } as Mongodbspec40; + fromJSON(object: any): Mongodbspec42 { + const message = { ...baseMongodbspec42 } as Mongodbspec42; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec40_Mongod.fromJSON(object.mongod) + ? Mongodbspec42_Mongod.fromJSON(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec40_MongoCfg.fromJSON(object.mongocfg) + ? Mongodbspec42_MongoCfg.fromJSON(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec40_Mongos.fromJSON(object.mongos) + ? Mongodbspec42_Mongos.fromJSON(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec40_MongoInfra.fromJSON(object.mongoinfra) + ? Mongodbspec42_MongoInfra.fromJSON(object.mongoinfra) : undefined; return message; }, - toJSON(message: Mongodbspec40): unknown { + toJSON(message: Mongodbspec42): unknown { const obj: any = {}; message.mongod !== undefined && (obj.mongod = message.mongod - ? Mongodbspec40_Mongod.toJSON(message.mongod) + ? Mongodbspec42_Mongod.toJSON(message.mongod) : undefined); message.mongocfg !== undefined && (obj.mongocfg = message.mongocfg - ? Mongodbspec40_MongoCfg.toJSON(message.mongocfg) + ? Mongodbspec42_MongoCfg.toJSON(message.mongocfg) : undefined); message.mongos !== undefined && (obj.mongos = message.mongos - ? Mongodbspec40_Mongos.toJSON(message.mongos) + ? Mongodbspec42_Mongos.toJSON(message.mongos) : undefined); message.mongoinfra !== undefined && (obj.mongoinfra = message.mongoinfra - ? Mongodbspec40_MongoInfra.toJSON(message.mongoinfra) + ? Mongodbspec42_MongoInfra.toJSON(message.mongoinfra) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec40 { - const message = { ...baseMongodbspec40 } as Mongodbspec40; + ): Mongodbspec42 { + const message = { ...baseMongodbspec42 } as Mongodbspec42; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec40_Mongod.fromPartial(object.mongod) + ? Mongodbspec42_Mongod.fromPartial(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec40_MongoCfg.fromPartial(object.mongocfg) + ? Mongodbspec42_MongoCfg.fromPartial(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec40_Mongos.fromPartial(object.mongos) + ? Mongodbspec42_Mongos.fromPartial(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec40_MongoInfra.fromPartial(object.mongoinfra) + ? Mongodbspec42_MongoInfra.fromPartial(object.mongoinfra) : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec40.$type, Mongodbspec40); +messageTypeRegistry.set(Mongodbspec42.$type, Mongodbspec42); -const baseMongodbspec40_Mongod: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.Mongod", +const baseMongodbspec42_Mongod: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.Mongod", }; -export const Mongodbspec40_Mongod = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.Mongod" as const, +export const Mongodbspec42_Mongod = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.Mongod" as const, encode( - message: Mongodbspec40_Mongod, + message: Mongodbspec42_Mongod, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongodconfig40.encode(message.config, writer.uint32(10).fork()).ldelim(); + Mongodconfig42.encode(message.config, writer.uint32(10).fork()).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec40_Mongod { + ): Mongodbspec42_Mongod { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec40_Mongod } as Mongodbspec40_Mongod; + const message = { ...baseMongodbspec42_Mongod } as Mongodbspec42_Mongod; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongodconfig40.decode(reader, reader.uint32()); + message.config = Mongodconfig42.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -7877,63 +9526,77 @@ export const Mongodbspec40_Mongod = { return message; }, - fromJSON(object: any): Mongodbspec40_Mongod { - const message = { ...baseMongodbspec40_Mongod } as Mongodbspec40_Mongod; + fromJSON(object: any): Mongodbspec42_Mongod { + const message = { ...baseMongodbspec42_Mongod } as Mongodbspec42_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig40.fromJSON(object.config) + ? Mongodconfig42.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec40_Mongod): unknown { + toJSON(message: Mongodbspec42_Mongod): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongodconfig40.toJSON(message.config) + ? Mongodconfig42.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec40_Mongod { - const message = { ...baseMongodbspec40_Mongod } as Mongodbspec40_Mongod; + ): Mongodbspec42_Mongod { + const message = { ...baseMongodbspec42_Mongod } as Mongodbspec42_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig40.fromPartial(object.config) + ? Mongodconfig42.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec40_Mongod.$type, Mongodbspec40_Mongod); +messageTypeRegistry.set(Mongodbspec42_Mongod.$type, Mongodbspec42_Mongod); -const baseMongodbspec40_MongoCfg: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.MongoCfg", +const baseMongodbspec42_MongoCfg: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.MongoCfg", }; -export const Mongodbspec40_MongoCfg = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.MongoCfg" as const, +export const Mongodbspec42_MongoCfg = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.MongoCfg" as const, encode( - message: Mongodbspec40_MongoCfg, + message: Mongodbspec42_MongoCfg, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongocfgconfig40.encode( + Mongocfgconfig42.encode( message.config, writer.uint32(10).fork() ).ldelim(); @@ -7941,25 +9604,37 @@ export const Mongodbspec40_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec40_MongoCfg { + ): Mongodbspec42_MongoCfg { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec40_MongoCfg } as Mongodbspec40_MongoCfg; + const message = { ...baseMongodbspec42_MongoCfg } as Mongodbspec42_MongoCfg; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongocfgconfig40.decode(reader, reader.uint32()); + message.config = Mongocfgconfig42.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -7968,86 +9643,112 @@ export const Mongodbspec40_MongoCfg = { return message; }, - fromJSON(object: any): Mongodbspec40_MongoCfg { - const message = { ...baseMongodbspec40_MongoCfg } as Mongodbspec40_MongoCfg; + fromJSON(object: any): Mongodbspec42_MongoCfg { + const message = { ...baseMongodbspec42_MongoCfg } as Mongodbspec42_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig40.fromJSON(object.config) + ? Mongocfgconfig42.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec40_MongoCfg): unknown { + toJSON(message: Mongodbspec42_MongoCfg): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongocfgconfig40.toJSON(message.config) + ? Mongocfgconfig42.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec40_MongoCfg { - const message = { ...baseMongodbspec40_MongoCfg } as Mongodbspec40_MongoCfg; + ): Mongodbspec42_MongoCfg { + const message = { ...baseMongodbspec42_MongoCfg } as Mongodbspec42_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig40.fromPartial(object.config) + ? Mongocfgconfig42.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec40_MongoCfg.$type, Mongodbspec40_MongoCfg); +messageTypeRegistry.set(Mongodbspec42_MongoCfg.$type, Mongodbspec42_MongoCfg); -const baseMongodbspec40_Mongos: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.Mongos", +const baseMongodbspec42_Mongos: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.Mongos", }; -export const Mongodbspec40_Mongos = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.Mongos" as const, +export const Mongodbspec42_Mongos = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.Mongos" as const, encode( - message: Mongodbspec40_Mongos, + message: Mongodbspec42_Mongos, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongosconfig40.encode(message.config, writer.uint32(10).fork()).ldelim(); + Mongosconfig42.encode(message.config, writer.uint32(10).fork()).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec40_Mongos { + ): Mongodbspec42_Mongos { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec40_Mongos } as Mongodbspec40_Mongos; + const message = { ...baseMongodbspec42_Mongos } as Mongodbspec42_Mongos; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongosconfig40.decode(reader, reader.uint32()); + message.config = Mongosconfig42.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -8056,69 +9757,83 @@ export const Mongodbspec40_Mongos = { return message; }, - fromJSON(object: any): Mongodbspec40_Mongos { - const message = { ...baseMongodbspec40_Mongos } as Mongodbspec40_Mongos; + fromJSON(object: any): Mongodbspec42_Mongos { + const message = { ...baseMongodbspec42_Mongos } as Mongodbspec42_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig40.fromJSON(object.config) + ? Mongosconfig42.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec40_Mongos): unknown { + toJSON(message: Mongodbspec42_Mongos): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongosconfig40.toJSON(message.config) + ? Mongosconfig42.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec40_Mongos { - const message = { ...baseMongodbspec40_Mongos } as Mongodbspec40_Mongos; + ): Mongodbspec42_Mongos { + const message = { ...baseMongodbspec42_Mongos } as Mongodbspec42_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig40.fromPartial(object.config) + ? Mongosconfig42.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec40_Mongos.$type, Mongodbspec40_Mongos); +messageTypeRegistry.set(Mongodbspec42_Mongos.$type, Mongodbspec42_Mongos); -const baseMongodbspec40_MongoInfra: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.MongoInfra", +const baseMongodbspec42_MongoInfra: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.MongoInfra", }; -export const Mongodbspec40_MongoInfra = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_0.MongoInfra" as const, +export const Mongodbspec42_MongoInfra = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.MongoInfra" as const, encode( - message: Mongodbspec40_MongoInfra, + message: Mongodbspec42_MongoInfra, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.configMongos !== undefined) { - Mongosconfig40.encode( + Mongosconfig42.encode( message.configMongos, writer.uint32(10).fork() ).ldelim(); } if (message.configMongocfg !== undefined) { - Mongocfgconfig40.encode( + Mongocfgconfig42.encode( message.configMongocfg, writer.uint32(18).fork() ).ldelim(); @@ -8126,26 +9841,32 @@ export const Mongodbspec40_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec40_MongoInfra { + ): Mongodbspec42_MongoInfra { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseMongodbspec40_MongoInfra, - } as Mongodbspec40_MongoInfra; + ...baseMongodbspec42_MongoInfra, + } as Mongodbspec42_MongoInfra; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.configMongos = Mongosconfig40.decode(reader, reader.uint32()); + message.configMongos = Mongosconfig42.decode(reader, reader.uint32()); break; case 2: - message.configMongocfg = Mongocfgconfig40.decode( + message.configMongocfg = Mongocfgconfig42.decode( reader, reader.uint32() ); @@ -8153,6 +9874,12 @@ export const Mongodbspec40_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -8161,100 +9888,114 @@ export const Mongodbspec40_MongoInfra = { return message; }, - fromJSON(object: any): Mongodbspec40_MongoInfra { + fromJSON(object: any): Mongodbspec42_MongoInfra { const message = { - ...baseMongodbspec40_MongoInfra, - } as Mongodbspec40_MongoInfra; + ...baseMongodbspec42_MongoInfra, + } as Mongodbspec42_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig40.fromJSON(object.configMongos) + ? Mongosconfig42.fromJSON(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig40.fromJSON(object.configMongocfg) + ? Mongocfgconfig42.fromJSON(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec40_MongoInfra): unknown { + toJSON(message: Mongodbspec42_MongoInfra): unknown { const obj: any = {}; message.configMongos !== undefined && (obj.configMongos = message.configMongos - ? Mongosconfig40.toJSON(message.configMongos) + ? Mongosconfig42.toJSON(message.configMongos) : undefined); message.configMongocfg !== undefined && (obj.configMongocfg = message.configMongocfg - ? Mongocfgconfig40.toJSON(message.configMongocfg) + ? Mongocfgconfig42.toJSON(message.configMongocfg) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec40_MongoInfra { + ): Mongodbspec42_MongoInfra { const message = { - ...baseMongodbspec40_MongoInfra, - } as Mongodbspec40_MongoInfra; + ...baseMongodbspec42_MongoInfra, + } as Mongodbspec42_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig40.fromPartial(object.configMongos) + ? Mongosconfig42.fromPartial(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig40.fromPartial(object.configMongocfg) + ? Mongocfgconfig42.fromPartial(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; messageTypeRegistry.set( - Mongodbspec40_MongoInfra.$type, - Mongodbspec40_MongoInfra + Mongodbspec42_MongoInfra.$type, + Mongodbspec42_MongoInfra ); -const baseMongodbspec42: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2", +const baseMongodbspec44: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4", }; -export const Mongodbspec42 = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2" as const, +export const Mongodbspec44 = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4" as const, encode( - message: Mongodbspec42, + message: Mongodbspec44, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.mongod !== undefined) { - Mongodbspec42_Mongod.encode( + Mongodbspec44_Mongod.encode( message.mongod, writer.uint32(10).fork() ).ldelim(); } if (message.mongocfg !== undefined) { - Mongodbspec42_MongoCfg.encode( + Mongodbspec44_MongoCfg.encode( message.mongocfg, writer.uint32(18).fork() ).ldelim(); } if (message.mongos !== undefined) { - Mongodbspec42_Mongos.encode( + Mongodbspec44_Mongos.encode( message.mongos, writer.uint32(26).fork() ).ldelim(); } if (message.mongoinfra !== undefined) { - Mongodbspec42_MongoInfra.encode( + Mongodbspec44_MongoInfra.encode( message.mongoinfra, writer.uint32(34).fork() ).ldelim(); @@ -8262,27 +10003,27 @@ export const Mongodbspec42 = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Mongodbspec42 { + decode(input: _m0.Reader | Uint8Array, length?: number): Mongodbspec44 { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec42 } as Mongodbspec42; + const message = { ...baseMongodbspec44 } as Mongodbspec44; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mongod = Mongodbspec42_Mongod.decode(reader, reader.uint32()); + message.mongod = Mongodbspec44_Mongod.decode(reader, reader.uint32()); break; case 2: - message.mongocfg = Mongodbspec42_MongoCfg.decode( + message.mongocfg = Mongodbspec44_MongoCfg.decode( reader, reader.uint32() ); break; case 3: - message.mongos = Mongodbspec42_Mongos.decode(reader, reader.uint32()); + message.mongos = Mongodbspec44_Mongos.decode(reader, reader.uint32()); break; case 4: - message.mongoinfra = Mongodbspec42_MongoInfra.decode( + message.mongoinfra = Mongodbspec44_MongoInfra.decode( reader, reader.uint32() ); @@ -8295,110 +10036,122 @@ export const Mongodbspec42 = { return message; }, - fromJSON(object: any): Mongodbspec42 { - const message = { ...baseMongodbspec42 } as Mongodbspec42; + fromJSON(object: any): Mongodbspec44 { + const message = { ...baseMongodbspec44 } as Mongodbspec44; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec42_Mongod.fromJSON(object.mongod) + ? Mongodbspec44_Mongod.fromJSON(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec42_MongoCfg.fromJSON(object.mongocfg) + ? Mongodbspec44_MongoCfg.fromJSON(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec42_Mongos.fromJSON(object.mongos) + ? Mongodbspec44_Mongos.fromJSON(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec42_MongoInfra.fromJSON(object.mongoinfra) + ? Mongodbspec44_MongoInfra.fromJSON(object.mongoinfra) : undefined; return message; }, - toJSON(message: Mongodbspec42): unknown { + toJSON(message: Mongodbspec44): unknown { const obj: any = {}; message.mongod !== undefined && (obj.mongod = message.mongod - ? Mongodbspec42_Mongod.toJSON(message.mongod) + ? Mongodbspec44_Mongod.toJSON(message.mongod) : undefined); message.mongocfg !== undefined && (obj.mongocfg = message.mongocfg - ? Mongodbspec42_MongoCfg.toJSON(message.mongocfg) + ? Mongodbspec44_MongoCfg.toJSON(message.mongocfg) : undefined); message.mongos !== undefined && (obj.mongos = message.mongos - ? Mongodbspec42_Mongos.toJSON(message.mongos) + ? Mongodbspec44_Mongos.toJSON(message.mongos) : undefined); message.mongoinfra !== undefined && (obj.mongoinfra = message.mongoinfra - ? Mongodbspec42_MongoInfra.toJSON(message.mongoinfra) + ? Mongodbspec44_MongoInfra.toJSON(message.mongoinfra) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec42 { - const message = { ...baseMongodbspec42 } as Mongodbspec42; + ): Mongodbspec44 { + const message = { ...baseMongodbspec44 } as Mongodbspec44; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec42_Mongod.fromPartial(object.mongod) + ? Mongodbspec44_Mongod.fromPartial(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec42_MongoCfg.fromPartial(object.mongocfg) + ? Mongodbspec44_MongoCfg.fromPartial(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec42_Mongos.fromPartial(object.mongos) + ? Mongodbspec44_Mongos.fromPartial(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec42_MongoInfra.fromPartial(object.mongoinfra) + ? Mongodbspec44_MongoInfra.fromPartial(object.mongoinfra) : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec42.$type, Mongodbspec42); +messageTypeRegistry.set(Mongodbspec44.$type, Mongodbspec44); -const baseMongodbspec42_Mongod: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.Mongod", +const baseMongodbspec44_Mongod: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.Mongod", }; -export const Mongodbspec42_Mongod = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.Mongod" as const, +export const Mongodbspec44_Mongod = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.Mongod" as const, encode( - message: Mongodbspec42_Mongod, + message: Mongodbspec44_Mongod, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongodconfig42.encode(message.config, writer.uint32(10).fork()).ldelim(); + Mongodconfig44.encode(message.config, writer.uint32(10).fork()).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec42_Mongod { + ): Mongodbspec44_Mongod { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec42_Mongod } as Mongodbspec42_Mongod; + const message = { ...baseMongodbspec44_Mongod } as Mongodbspec44_Mongod; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongodconfig42.decode(reader, reader.uint32()); + message.config = Mongodconfig44.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -8407,63 +10160,77 @@ export const Mongodbspec42_Mongod = { return message; }, - fromJSON(object: any): Mongodbspec42_Mongod { - const message = { ...baseMongodbspec42_Mongod } as Mongodbspec42_Mongod; + fromJSON(object: any): Mongodbspec44_Mongod { + const message = { ...baseMongodbspec44_Mongod } as Mongodbspec44_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig42.fromJSON(object.config) + ? Mongodconfig44.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec42_Mongod): unknown { + toJSON(message: Mongodbspec44_Mongod): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongodconfig42.toJSON(message.config) + ? Mongodconfig44.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec42_Mongod { - const message = { ...baseMongodbspec42_Mongod } as Mongodbspec42_Mongod; + ): Mongodbspec44_Mongod { + const message = { ...baseMongodbspec44_Mongod } as Mongodbspec44_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig42.fromPartial(object.config) + ? Mongodconfig44.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec42_Mongod.$type, Mongodbspec42_Mongod); +messageTypeRegistry.set(Mongodbspec44_Mongod.$type, Mongodbspec44_Mongod); -const baseMongodbspec42_MongoCfg: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.MongoCfg", +const baseMongodbspec44_MongoCfg: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.MongoCfg", }; -export const Mongodbspec42_MongoCfg = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.MongoCfg" as const, +export const Mongodbspec44_MongoCfg = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.MongoCfg" as const, encode( - message: Mongodbspec42_MongoCfg, + message: Mongodbspec44_MongoCfg, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongocfgconfig42.encode( + Mongocfgconfig44.encode( message.config, writer.uint32(10).fork() ).ldelim(); @@ -8471,25 +10238,37 @@ export const Mongodbspec42_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec42_MongoCfg { + ): Mongodbspec44_MongoCfg { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec42_MongoCfg } as Mongodbspec42_MongoCfg; + const message = { ...baseMongodbspec44_MongoCfg } as Mongodbspec44_MongoCfg; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongocfgconfig42.decode(reader, reader.uint32()); + message.config = Mongocfgconfig44.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -8498,86 +10277,112 @@ export const Mongodbspec42_MongoCfg = { return message; }, - fromJSON(object: any): Mongodbspec42_MongoCfg { - const message = { ...baseMongodbspec42_MongoCfg } as Mongodbspec42_MongoCfg; + fromJSON(object: any): Mongodbspec44_MongoCfg { + const message = { ...baseMongodbspec44_MongoCfg } as Mongodbspec44_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig42.fromJSON(object.config) + ? Mongocfgconfig44.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec42_MongoCfg): unknown { + toJSON(message: Mongodbspec44_MongoCfg): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongocfgconfig42.toJSON(message.config) + ? Mongocfgconfig44.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec42_MongoCfg { - const message = { ...baseMongodbspec42_MongoCfg } as Mongodbspec42_MongoCfg; + ): Mongodbspec44_MongoCfg { + const message = { ...baseMongodbspec44_MongoCfg } as Mongodbspec44_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig42.fromPartial(object.config) + ? Mongocfgconfig44.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec42_MongoCfg.$type, Mongodbspec42_MongoCfg); +messageTypeRegistry.set(Mongodbspec44_MongoCfg.$type, Mongodbspec44_MongoCfg); -const baseMongodbspec42_Mongos: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.Mongos", +const baseMongodbspec44_Mongos: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.Mongos", }; -export const Mongodbspec42_Mongos = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.Mongos" as const, +export const Mongodbspec44_Mongos = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.Mongos" as const, encode( - message: Mongodbspec42_Mongos, + message: Mongodbspec44_Mongos, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongosconfig42.encode(message.config, writer.uint32(10).fork()).ldelim(); + Mongosconfig44.encode(message.config, writer.uint32(10).fork()).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec42_Mongos { + ): Mongodbspec44_Mongos { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec42_Mongos } as Mongodbspec42_Mongos; + const message = { ...baseMongodbspec44_Mongos } as Mongodbspec44_Mongos; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongosconfig42.decode(reader, reader.uint32()); + message.config = Mongosconfig44.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -8586,69 +10391,83 @@ export const Mongodbspec42_Mongos = { return message; }, - fromJSON(object: any): Mongodbspec42_Mongos { - const message = { ...baseMongodbspec42_Mongos } as Mongodbspec42_Mongos; + fromJSON(object: any): Mongodbspec44_Mongos { + const message = { ...baseMongodbspec44_Mongos } as Mongodbspec44_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig42.fromJSON(object.config) + ? Mongosconfig44.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec42_Mongos): unknown { + toJSON(message: Mongodbspec44_Mongos): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongosconfig42.toJSON(message.config) + ? Mongosconfig44.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec42_Mongos { - const message = { ...baseMongodbspec42_Mongos } as Mongodbspec42_Mongos; + ): Mongodbspec44_Mongos { + const message = { ...baseMongodbspec44_Mongos } as Mongodbspec44_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig42.fromPartial(object.config) + ? Mongosconfig44.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec42_Mongos.$type, Mongodbspec42_Mongos); +messageTypeRegistry.set(Mongodbspec44_Mongos.$type, Mongodbspec44_Mongos); -const baseMongodbspec42_MongoInfra: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.MongoInfra", +const baseMongodbspec44_MongoInfra: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.MongoInfra", }; -export const Mongodbspec42_MongoInfra = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_2.MongoInfra" as const, +export const Mongodbspec44_MongoInfra = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.MongoInfra" as const, encode( - message: Mongodbspec42_MongoInfra, + message: Mongodbspec44_MongoInfra, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.configMongos !== undefined) { - Mongosconfig42.encode( + Mongosconfig44.encode( message.configMongos, writer.uint32(10).fork() ).ldelim(); } if (message.configMongocfg !== undefined) { - Mongocfgconfig42.encode( + Mongocfgconfig44.encode( message.configMongocfg, writer.uint32(18).fork() ).ldelim(); @@ -8656,26 +10475,32 @@ export const Mongodbspec42_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec42_MongoInfra { + ): Mongodbspec44_MongoInfra { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseMongodbspec42_MongoInfra, - } as Mongodbspec42_MongoInfra; + ...baseMongodbspec44_MongoInfra, + } as Mongodbspec44_MongoInfra; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.configMongos = Mongosconfig42.decode(reader, reader.uint32()); + message.configMongos = Mongosconfig44.decode(reader, reader.uint32()); break; case 2: - message.configMongocfg = Mongocfgconfig42.decode( + message.configMongocfg = Mongocfgconfig44.decode( reader, reader.uint32() ); @@ -8683,6 +10508,12 @@ export const Mongodbspec42_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -8691,100 +10522,114 @@ export const Mongodbspec42_MongoInfra = { return message; }, - fromJSON(object: any): Mongodbspec42_MongoInfra { + fromJSON(object: any): Mongodbspec44_MongoInfra { const message = { - ...baseMongodbspec42_MongoInfra, - } as Mongodbspec42_MongoInfra; + ...baseMongodbspec44_MongoInfra, + } as Mongodbspec44_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig42.fromJSON(object.configMongos) + ? Mongosconfig44.fromJSON(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig42.fromJSON(object.configMongocfg) + ? Mongocfgconfig44.fromJSON(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec42_MongoInfra): unknown { + toJSON(message: Mongodbspec44_MongoInfra): unknown { const obj: any = {}; message.configMongos !== undefined && (obj.configMongos = message.configMongos - ? Mongosconfig42.toJSON(message.configMongos) + ? Mongosconfig44.toJSON(message.configMongos) : undefined); message.configMongocfg !== undefined && (obj.configMongocfg = message.configMongocfg - ? Mongocfgconfig42.toJSON(message.configMongocfg) + ? Mongocfgconfig44.toJSON(message.configMongocfg) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec42_MongoInfra { + ): Mongodbspec44_MongoInfra { const message = { - ...baseMongodbspec42_MongoInfra, - } as Mongodbspec42_MongoInfra; + ...baseMongodbspec44_MongoInfra, + } as Mongodbspec44_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig42.fromPartial(object.configMongos) + ? Mongosconfig44.fromPartial(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig42.fromPartial(object.configMongocfg) + ? Mongocfgconfig44.fromPartial(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; messageTypeRegistry.set( - Mongodbspec42_MongoInfra.$type, - Mongodbspec42_MongoInfra + Mongodbspec44_MongoInfra.$type, + Mongodbspec44_MongoInfra ); -const baseMongodbspec44: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4", +const baseMongodbspec44Enterprise: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise", }; -export const Mongodbspec44 = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4" as const, +export const Mongodbspec44Enterprise = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise" as const, encode( - message: Mongodbspec44, + message: Mongodbspec44Enterprise, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.mongod !== undefined) { - Mongodbspec44_Mongod.encode( + Mongodbspec44Enterprise_Mongod.encode( message.mongod, writer.uint32(10).fork() ).ldelim(); } if (message.mongocfg !== undefined) { - Mongodbspec44_MongoCfg.encode( + Mongodbspec44Enterprise_MongoCfg.encode( message.mongocfg, writer.uint32(18).fork() ).ldelim(); } if (message.mongos !== undefined) { - Mongodbspec44_Mongos.encode( + Mongodbspec44Enterprise_Mongos.encode( message.mongos, writer.uint32(26).fork() ).ldelim(); } if (message.mongoinfra !== undefined) { - Mongodbspec44_MongoInfra.encode( + Mongodbspec44Enterprise_MongoInfra.encode( message.mongoinfra, writer.uint32(34).fork() ).ldelim(); @@ -8792,27 +10637,38 @@ export const Mongodbspec44 = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Mongodbspec44 { + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodbspec44Enterprise { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec44 } as Mongodbspec44; + const message = { + ...baseMongodbspec44Enterprise, + } as Mongodbspec44Enterprise; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mongod = Mongodbspec44_Mongod.decode(reader, reader.uint32()); + message.mongod = Mongodbspec44Enterprise_Mongod.decode( + reader, + reader.uint32() + ); break; case 2: - message.mongocfg = Mongodbspec44_MongoCfg.decode( + message.mongocfg = Mongodbspec44Enterprise_MongoCfg.decode( reader, reader.uint32() ); break; case 3: - message.mongos = Mongodbspec44_Mongos.decode(reader, reader.uint32()); + message.mongos = Mongodbspec44Enterprise_Mongos.decode( + reader, + reader.uint32() + ); break; case 4: - message.mongoinfra = Mongodbspec44_MongoInfra.decode( + message.mongoinfra = Mongodbspec44Enterprise_MongoInfra.decode( reader, reader.uint32() ); @@ -8825,110 +10681,135 @@ export const Mongodbspec44 = { return message; }, - fromJSON(object: any): Mongodbspec44 { - const message = { ...baseMongodbspec44 } as Mongodbspec44; + fromJSON(object: any): Mongodbspec44Enterprise { + const message = { + ...baseMongodbspec44Enterprise, + } as Mongodbspec44Enterprise; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec44_Mongod.fromJSON(object.mongod) + ? Mongodbspec44Enterprise_Mongod.fromJSON(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec44_MongoCfg.fromJSON(object.mongocfg) + ? Mongodbspec44Enterprise_MongoCfg.fromJSON(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec44_Mongos.fromJSON(object.mongos) + ? Mongodbspec44Enterprise_Mongos.fromJSON(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec44_MongoInfra.fromJSON(object.mongoinfra) + ? Mongodbspec44Enterprise_MongoInfra.fromJSON(object.mongoinfra) : undefined; return message; }, - toJSON(message: Mongodbspec44): unknown { + toJSON(message: Mongodbspec44Enterprise): unknown { const obj: any = {}; message.mongod !== undefined && (obj.mongod = message.mongod - ? Mongodbspec44_Mongod.toJSON(message.mongod) + ? Mongodbspec44Enterprise_Mongod.toJSON(message.mongod) : undefined); message.mongocfg !== undefined && (obj.mongocfg = message.mongocfg - ? Mongodbspec44_MongoCfg.toJSON(message.mongocfg) + ? Mongodbspec44Enterprise_MongoCfg.toJSON(message.mongocfg) : undefined); message.mongos !== undefined && (obj.mongos = message.mongos - ? Mongodbspec44_Mongos.toJSON(message.mongos) + ? Mongodbspec44Enterprise_Mongos.toJSON(message.mongos) : undefined); message.mongoinfra !== undefined && (obj.mongoinfra = message.mongoinfra - ? Mongodbspec44_MongoInfra.toJSON(message.mongoinfra) + ? Mongodbspec44Enterprise_MongoInfra.toJSON(message.mongoinfra) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec44 { - const message = { ...baseMongodbspec44 } as Mongodbspec44; + ): Mongodbspec44Enterprise { + const message = { + ...baseMongodbspec44Enterprise, + } as Mongodbspec44Enterprise; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec44_Mongod.fromPartial(object.mongod) + ? Mongodbspec44Enterprise_Mongod.fromPartial(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec44_MongoCfg.fromPartial(object.mongocfg) + ? Mongodbspec44Enterprise_MongoCfg.fromPartial(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec44_Mongos.fromPartial(object.mongos) + ? Mongodbspec44Enterprise_Mongos.fromPartial(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec44_MongoInfra.fromPartial(object.mongoinfra) + ? Mongodbspec44Enterprise_MongoInfra.fromPartial(object.mongoinfra) : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec44.$type, Mongodbspec44); +messageTypeRegistry.set(Mongodbspec44Enterprise.$type, Mongodbspec44Enterprise); -const baseMongodbspec44_Mongod: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.Mongod", +const baseMongodbspec44Enterprise_Mongod: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.Mongod", }; -export const Mongodbspec44_Mongod = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.Mongod" as const, +export const Mongodbspec44Enterprise_Mongod = { + $type: + "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.Mongod" as const, encode( - message: Mongodbspec44_Mongod, + message: Mongodbspec44Enterprise_Mongod, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongodconfig44.encode(message.config, writer.uint32(10).fork()).ldelim(); + Mongodconfig44Enterprise.encode( + message.config, + writer.uint32(10).fork() + ).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec44_Mongod { + ): Mongodbspec44Enterprise_Mongod { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec44_Mongod } as Mongodbspec44_Mongod; + const message = { + ...baseMongodbspec44Enterprise_Mongod, + } as Mongodbspec44Enterprise_Mongod; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongodconfig44.decode(reader, reader.uint32()); + message.config = Mongodconfig44Enterprise.decode( + reader, + reader.uint32() + ); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -8937,63 +10818,85 @@ export const Mongodbspec44_Mongod = { return message; }, - fromJSON(object: any): Mongodbspec44_Mongod { - const message = { ...baseMongodbspec44_Mongod } as Mongodbspec44_Mongod; + fromJSON(object: any): Mongodbspec44Enterprise_Mongod { + const message = { + ...baseMongodbspec44Enterprise_Mongod, + } as Mongodbspec44Enterprise_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig44.fromJSON(object.config) + ? Mongodconfig44Enterprise.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec44_Mongod): unknown { + toJSON(message: Mongodbspec44Enterprise_Mongod): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongodconfig44.toJSON(message.config) + ? Mongodconfig44Enterprise.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec44_Mongod { - const message = { ...baseMongodbspec44_Mongod } as Mongodbspec44_Mongod; + ): Mongodbspec44Enterprise_Mongod { + const message = { + ...baseMongodbspec44Enterprise_Mongod, + } as Mongodbspec44Enterprise_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig44.fromPartial(object.config) + ? Mongodconfig44Enterprise.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec44_Mongod.$type, Mongodbspec44_Mongod); +messageTypeRegistry.set( + Mongodbspec44Enterprise_Mongod.$type, + Mongodbspec44Enterprise_Mongod +); -const baseMongodbspec44_MongoCfg: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.MongoCfg", +const baseMongodbspec44Enterprise_MongoCfg: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.MongoCfg", }; -export const Mongodbspec44_MongoCfg = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.MongoCfg" as const, +export const Mongodbspec44Enterprise_MongoCfg = { + $type: + "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.MongoCfg" as const, encode( - message: Mongodbspec44_MongoCfg, + message: Mongodbspec44Enterprise_MongoCfg, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongocfgconfig44.encode( + Mongocfgconfig44Enterprise.encode( message.config, writer.uint32(10).fork() ).ldelim(); @@ -9001,25 +10904,42 @@ export const Mongodbspec44_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec44_MongoCfg { + ): Mongodbspec44Enterprise_MongoCfg { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec44_MongoCfg } as Mongodbspec44_MongoCfg; + const message = { + ...baseMongodbspec44Enterprise_MongoCfg, + } as Mongodbspec44Enterprise_MongoCfg; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongocfgconfig44.decode(reader, reader.uint32()); + message.config = Mongocfgconfig44Enterprise.decode( + reader, + reader.uint32() + ); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -9028,86 +10948,128 @@ export const Mongodbspec44_MongoCfg = { return message; }, - fromJSON(object: any): Mongodbspec44_MongoCfg { - const message = { ...baseMongodbspec44_MongoCfg } as Mongodbspec44_MongoCfg; + fromJSON(object: any): Mongodbspec44Enterprise_MongoCfg { + const message = { + ...baseMongodbspec44Enterprise_MongoCfg, + } as Mongodbspec44Enterprise_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig44.fromJSON(object.config) + ? Mongocfgconfig44Enterprise.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec44_MongoCfg): unknown { + toJSON(message: Mongodbspec44Enterprise_MongoCfg): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongocfgconfig44.toJSON(message.config) + ? Mongocfgconfig44Enterprise.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( - object: I - ): Mongodbspec44_MongoCfg { - const message = { ...baseMongodbspec44_MongoCfg } as Mongodbspec44_MongoCfg; + fromPartial< + I extends Exact, I> + >(object: I): Mongodbspec44Enterprise_MongoCfg { + const message = { + ...baseMongodbspec44Enterprise_MongoCfg, + } as Mongodbspec44Enterprise_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig44.fromPartial(object.config) + ? Mongocfgconfig44Enterprise.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec44_MongoCfg.$type, Mongodbspec44_MongoCfg); +messageTypeRegistry.set( + Mongodbspec44Enterprise_MongoCfg.$type, + Mongodbspec44Enterprise_MongoCfg +); -const baseMongodbspec44_Mongos: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.Mongos", +const baseMongodbspec44Enterprise_Mongos: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.Mongos", }; -export const Mongodbspec44_Mongos = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.Mongos" as const, +export const Mongodbspec44Enterprise_Mongos = { + $type: + "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.Mongos" as const, encode( - message: Mongodbspec44_Mongos, + message: Mongodbspec44Enterprise_Mongos, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongosconfig44.encode(message.config, writer.uint32(10).fork()).ldelim(); + Mongosconfig44Enterprise.encode( + message.config, + writer.uint32(10).fork() + ).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec44_Mongos { + ): Mongodbspec44Enterprise_Mongos { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec44_Mongos } as Mongodbspec44_Mongos; + const message = { + ...baseMongodbspec44Enterprise_Mongos, + } as Mongodbspec44Enterprise_Mongos; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongosconfig44.decode(reader, reader.uint32()); + message.config = Mongosconfig44Enterprise.decode( + reader, + reader.uint32() + ); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -9116,69 +11078,91 @@ export const Mongodbspec44_Mongos = { return message; }, - fromJSON(object: any): Mongodbspec44_Mongos { - const message = { ...baseMongodbspec44_Mongos } as Mongodbspec44_Mongos; + fromJSON(object: any): Mongodbspec44Enterprise_Mongos { + const message = { + ...baseMongodbspec44Enterprise_Mongos, + } as Mongodbspec44Enterprise_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig44.fromJSON(object.config) + ? Mongosconfig44Enterprise.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec44_Mongos): unknown { + toJSON(message: Mongodbspec44Enterprise_Mongos): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongosconfig44.toJSON(message.config) + ? Mongosconfig44Enterprise.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec44_Mongos { - const message = { ...baseMongodbspec44_Mongos } as Mongodbspec44_Mongos; + ): Mongodbspec44Enterprise_Mongos { + const message = { + ...baseMongodbspec44Enterprise_Mongos, + } as Mongodbspec44Enterprise_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig44.fromPartial(object.config) + ? Mongosconfig44Enterprise.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec44_Mongos.$type, Mongodbspec44_Mongos); +messageTypeRegistry.set( + Mongodbspec44Enterprise_Mongos.$type, + Mongodbspec44Enterprise_Mongos +); -const baseMongodbspec44_MongoInfra: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.MongoInfra", +const baseMongodbspec44Enterprise_MongoInfra: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.MongoInfra", }; -export const Mongodbspec44_MongoInfra = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4.MongoInfra" as const, +export const Mongodbspec44Enterprise_MongoInfra = { + $type: + "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.MongoInfra" as const, encode( - message: Mongodbspec44_MongoInfra, + message: Mongodbspec44Enterprise_MongoInfra, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.configMongos !== undefined) { - Mongosconfig44.encode( + Mongosconfig44Enterprise.encode( message.configMongos, writer.uint32(10).fork() ).ldelim(); } if (message.configMongocfg !== undefined) { - Mongocfgconfig44.encode( + Mongocfgconfig44Enterprise.encode( message.configMongocfg, writer.uint32(18).fork() ).ldelim(); @@ -9186,26 +11170,35 @@ export const Mongodbspec44_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec44_MongoInfra { + ): Mongodbspec44Enterprise_MongoInfra { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseMongodbspec44_MongoInfra, - } as Mongodbspec44_MongoInfra; + ...baseMongodbspec44Enterprise_MongoInfra, + } as Mongodbspec44Enterprise_MongoInfra; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.configMongos = Mongosconfig44.decode(reader, reader.uint32()); + message.configMongos = Mongosconfig44Enterprise.decode( + reader, + reader.uint32() + ); break; case 2: - message.configMongocfg = Mongocfgconfig44.decode( + message.configMongocfg = Mongocfgconfig44Enterprise.decode( reader, reader.uint32() ); @@ -9213,6 +11206,12 @@ export const Mongodbspec44_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -9221,100 +11220,114 @@ export const Mongodbspec44_MongoInfra = { return message; }, - fromJSON(object: any): Mongodbspec44_MongoInfra { + fromJSON(object: any): Mongodbspec44Enterprise_MongoInfra { const message = { - ...baseMongodbspec44_MongoInfra, - } as Mongodbspec44_MongoInfra; + ...baseMongodbspec44Enterprise_MongoInfra, + } as Mongodbspec44Enterprise_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig44.fromJSON(object.configMongos) + ? Mongosconfig44Enterprise.fromJSON(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig44.fromJSON(object.configMongocfg) + ? Mongocfgconfig44Enterprise.fromJSON(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec44_MongoInfra): unknown { + toJSON(message: Mongodbspec44Enterprise_MongoInfra): unknown { const obj: any = {}; message.configMongos !== undefined && (obj.configMongos = message.configMongos - ? Mongosconfig44.toJSON(message.configMongos) + ? Mongosconfig44Enterprise.toJSON(message.configMongos) : undefined); message.configMongocfg !== undefined && (obj.configMongocfg = message.configMongocfg - ? Mongocfgconfig44.toJSON(message.configMongocfg) + ? Mongocfgconfig44Enterprise.toJSON(message.configMongocfg) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( - object: I - ): Mongodbspec44_MongoInfra { + fromPartial< + I extends Exact, I> + >(object: I): Mongodbspec44Enterprise_MongoInfra { const message = { - ...baseMongodbspec44_MongoInfra, - } as Mongodbspec44_MongoInfra; + ...baseMongodbspec44Enterprise_MongoInfra, + } as Mongodbspec44Enterprise_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig44.fromPartial(object.configMongos) + ? Mongosconfig44Enterprise.fromPartial(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig44.fromPartial(object.configMongocfg) + ? Mongocfgconfig44Enterprise.fromPartial(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; messageTypeRegistry.set( - Mongodbspec44_MongoInfra.$type, - Mongodbspec44_MongoInfra + Mongodbspec44Enterprise_MongoInfra.$type, + Mongodbspec44Enterprise_MongoInfra ); -const baseMongodbspec44Enterprise: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise", +const baseMongodbspec50: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0", }; -export const Mongodbspec44Enterprise = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise" as const, +export const Mongodbspec50 = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0" as const, encode( - message: Mongodbspec44Enterprise, + message: Mongodbspec50, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.mongod !== undefined) { - Mongodbspec44Enterprise_Mongod.encode( + Mongodbspec50_Mongod.encode( message.mongod, writer.uint32(10).fork() ).ldelim(); } if (message.mongocfg !== undefined) { - Mongodbspec44Enterprise_MongoCfg.encode( + Mongodbspec50_MongoCfg.encode( message.mongocfg, writer.uint32(18).fork() ).ldelim(); } if (message.mongos !== undefined) { - Mongodbspec44Enterprise_Mongos.encode( + Mongodbspec50_Mongos.encode( message.mongos, writer.uint32(26).fork() ).ldelim(); } if (message.mongoinfra !== undefined) { - Mongodbspec44Enterprise_MongoInfra.encode( + Mongodbspec50_MongoInfra.encode( message.mongoinfra, writer.uint32(34).fork() ).ldelim(); @@ -9322,38 +11335,27 @@ export const Mongodbspec44Enterprise = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): Mongodbspec44Enterprise { + decode(input: _m0.Reader | Uint8Array, length?: number): Mongodbspec50 { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec44Enterprise, - } as Mongodbspec44Enterprise; + const message = { ...baseMongodbspec50 } as Mongodbspec50; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mongod = Mongodbspec44Enterprise_Mongod.decode( - reader, - reader.uint32() - ); + message.mongod = Mongodbspec50_Mongod.decode(reader, reader.uint32()); break; case 2: - message.mongocfg = Mongodbspec44Enterprise_MongoCfg.decode( + message.mongocfg = Mongodbspec50_MongoCfg.decode( reader, reader.uint32() ); break; case 3: - message.mongos = Mongodbspec44Enterprise_Mongos.decode( - reader, - reader.uint32() - ); + message.mongos = Mongodbspec50_Mongos.decode(reader, reader.uint32()); break; case 4: - message.mongoinfra = Mongodbspec44Enterprise_MongoInfra.decode( + message.mongoinfra = Mongodbspec50_MongoInfra.decode( reader, reader.uint32() ); @@ -9366,123 +11368,122 @@ export const Mongodbspec44Enterprise = { return message; }, - fromJSON(object: any): Mongodbspec44Enterprise { - const message = { - ...baseMongodbspec44Enterprise, - } as Mongodbspec44Enterprise; + fromJSON(object: any): Mongodbspec50 { + const message = { ...baseMongodbspec50 } as Mongodbspec50; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec44Enterprise_Mongod.fromJSON(object.mongod) + ? Mongodbspec50_Mongod.fromJSON(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec44Enterprise_MongoCfg.fromJSON(object.mongocfg) + ? Mongodbspec50_MongoCfg.fromJSON(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec44Enterprise_Mongos.fromJSON(object.mongos) + ? Mongodbspec50_Mongos.fromJSON(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec44Enterprise_MongoInfra.fromJSON(object.mongoinfra) + ? Mongodbspec50_MongoInfra.fromJSON(object.mongoinfra) : undefined; return message; }, - toJSON(message: Mongodbspec44Enterprise): unknown { + toJSON(message: Mongodbspec50): unknown { const obj: any = {}; message.mongod !== undefined && (obj.mongod = message.mongod - ? Mongodbspec44Enterprise_Mongod.toJSON(message.mongod) + ? Mongodbspec50_Mongod.toJSON(message.mongod) : undefined); message.mongocfg !== undefined && (obj.mongocfg = message.mongocfg - ? Mongodbspec44Enterprise_MongoCfg.toJSON(message.mongocfg) + ? Mongodbspec50_MongoCfg.toJSON(message.mongocfg) : undefined); message.mongos !== undefined && (obj.mongos = message.mongos - ? Mongodbspec44Enterprise_Mongos.toJSON(message.mongos) + ? Mongodbspec50_Mongos.toJSON(message.mongos) : undefined); message.mongoinfra !== undefined && (obj.mongoinfra = message.mongoinfra - ? Mongodbspec44Enterprise_MongoInfra.toJSON(message.mongoinfra) + ? Mongodbspec50_MongoInfra.toJSON(message.mongoinfra) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec44Enterprise { - const message = { - ...baseMongodbspec44Enterprise, - } as Mongodbspec44Enterprise; + ): Mongodbspec50 { + const message = { ...baseMongodbspec50 } as Mongodbspec50; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec44Enterprise_Mongod.fromPartial(object.mongod) + ? Mongodbspec50_Mongod.fromPartial(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec44Enterprise_MongoCfg.fromPartial(object.mongocfg) + ? Mongodbspec50_MongoCfg.fromPartial(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec44Enterprise_Mongos.fromPartial(object.mongos) + ? Mongodbspec50_Mongos.fromPartial(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec44Enterprise_MongoInfra.fromPartial(object.mongoinfra) + ? Mongodbspec50_MongoInfra.fromPartial(object.mongoinfra) : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec44Enterprise.$type, Mongodbspec44Enterprise); +messageTypeRegistry.set(Mongodbspec50.$type, Mongodbspec50); -const baseMongodbspec44Enterprise_Mongod: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.Mongod", +const baseMongodbspec50_Mongod: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.Mongod", }; -export const Mongodbspec44Enterprise_Mongod = { - $type: - "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.Mongod" as const, +export const Mongodbspec50_Mongod = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.Mongod" as const, encode( - message: Mongodbspec44Enterprise_Mongod, + message: Mongodbspec50_Mongod, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongodconfig44Enterprise.encode( - message.config, - writer.uint32(10).fork() - ).ldelim(); + Mongodconfig50.encode(message.config, writer.uint32(10).fork()).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec44Enterprise_Mongod { + ): Mongodbspec50_Mongod { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec44Enterprise_Mongod, - } as Mongodbspec44Enterprise_Mongod; + const message = { ...baseMongodbspec50_Mongod } as Mongodbspec50_Mongod; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongodconfig44Enterprise.decode( - reader, - reader.uint32() - ); + message.config = Mongodconfig50.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -9491,71 +11492,77 @@ export const Mongodbspec44Enterprise_Mongod = { return message; }, - fromJSON(object: any): Mongodbspec44Enterprise_Mongod { - const message = { - ...baseMongodbspec44Enterprise_Mongod, - } as Mongodbspec44Enterprise_Mongod; + fromJSON(object: any): Mongodbspec50_Mongod { + const message = { ...baseMongodbspec50_Mongod } as Mongodbspec50_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig44Enterprise.fromJSON(object.config) + ? Mongodconfig50.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec44Enterprise_Mongod): unknown { + toJSON(message: Mongodbspec50_Mongod): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongodconfig44Enterprise.toJSON(message.config) + ? Mongodconfig50.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec44Enterprise_Mongod { - const message = { - ...baseMongodbspec44Enterprise_Mongod, - } as Mongodbspec44Enterprise_Mongod; + ): Mongodbspec50_Mongod { + const message = { ...baseMongodbspec50_Mongod } as Mongodbspec50_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig44Enterprise.fromPartial(object.config) + ? Mongodconfig50.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set( - Mongodbspec44Enterprise_Mongod.$type, - Mongodbspec44Enterprise_Mongod -); +messageTypeRegistry.set(Mongodbspec50_Mongod.$type, Mongodbspec50_Mongod); -const baseMongodbspec44Enterprise_MongoCfg: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.MongoCfg", +const baseMongodbspec50_MongoCfg: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.MongoCfg", }; -export const Mongodbspec44Enterprise_MongoCfg = { - $type: - "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.MongoCfg" as const, +export const Mongodbspec50_MongoCfg = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.MongoCfg" as const, encode( - message: Mongodbspec44Enterprise_MongoCfg, + message: Mongodbspec50_MongoCfg, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongocfgconfig44Enterprise.encode( + Mongocfgconfig50.encode( message.config, writer.uint32(10).fork() ).ldelim(); @@ -9563,30 +11570,37 @@ export const Mongodbspec44Enterprise_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec44Enterprise_MongoCfg { + ): Mongodbspec50_MongoCfg { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec44Enterprise_MongoCfg, - } as Mongodbspec44Enterprise_MongoCfg; + const message = { ...baseMongodbspec50_MongoCfg } as Mongodbspec50_MongoCfg; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongocfgconfig44Enterprise.decode( - reader, - reader.uint32() - ); + message.config = Mongocfgconfig50.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -9595,102 +11609,112 @@ export const Mongodbspec44Enterprise_MongoCfg = { return message; }, - fromJSON(object: any): Mongodbspec44Enterprise_MongoCfg { - const message = { - ...baseMongodbspec44Enterprise_MongoCfg, - } as Mongodbspec44Enterprise_MongoCfg; + fromJSON(object: any): Mongodbspec50_MongoCfg { + const message = { ...baseMongodbspec50_MongoCfg } as Mongodbspec50_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig44Enterprise.fromJSON(object.config) + ? Mongocfgconfig50.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec44Enterprise_MongoCfg): unknown { + toJSON(message: Mongodbspec50_MongoCfg): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongocfgconfig44Enterprise.toJSON(message.config) + ? Mongocfgconfig50.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial< - I extends Exact, I> - >(object: I): Mongodbspec44Enterprise_MongoCfg { - const message = { - ...baseMongodbspec44Enterprise_MongoCfg, - } as Mongodbspec44Enterprise_MongoCfg; + fromPartial, I>>( + object: I + ): Mongodbspec50_MongoCfg { + const message = { ...baseMongodbspec50_MongoCfg } as Mongodbspec50_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig44Enterprise.fromPartial(object.config) + ? Mongocfgconfig50.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set( - Mongodbspec44Enterprise_MongoCfg.$type, - Mongodbspec44Enterprise_MongoCfg -); +messageTypeRegistry.set(Mongodbspec50_MongoCfg.$type, Mongodbspec50_MongoCfg); -const baseMongodbspec44Enterprise_Mongos: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.Mongos", +const baseMongodbspec50_Mongos: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.Mongos", }; -export const Mongodbspec44Enterprise_Mongos = { - $type: - "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.Mongos" as const, +export const Mongodbspec50_Mongos = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.Mongos" as const, encode( - message: Mongodbspec44Enterprise_Mongos, + message: Mongodbspec50_Mongos, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongosconfig44Enterprise.encode( - message.config, - writer.uint32(10).fork() - ).ldelim(); + Mongosconfig50.encode(message.config, writer.uint32(10).fork()).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec44Enterprise_Mongos { + ): Mongodbspec50_Mongos { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec44Enterprise_Mongos, - } as Mongodbspec44Enterprise_Mongos; + const message = { ...baseMongodbspec50_Mongos } as Mongodbspec50_Mongos; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongosconfig44Enterprise.decode( - reader, - reader.uint32() - ); + message.config = Mongosconfig50.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -9699,77 +11723,83 @@ export const Mongodbspec44Enterprise_Mongos = { return message; }, - fromJSON(object: any): Mongodbspec44Enterprise_Mongos { - const message = { - ...baseMongodbspec44Enterprise_Mongos, - } as Mongodbspec44Enterprise_Mongos; + fromJSON(object: any): Mongodbspec50_Mongos { + const message = { ...baseMongodbspec50_Mongos } as Mongodbspec50_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig44Enterprise.fromJSON(object.config) + ? Mongosconfig50.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec44Enterprise_Mongos): unknown { + toJSON(message: Mongodbspec50_Mongos): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongosconfig44Enterprise.toJSON(message.config) + ? Mongosconfig50.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec44Enterprise_Mongos { - const message = { - ...baseMongodbspec44Enterprise_Mongos, - } as Mongodbspec44Enterprise_Mongos; + ): Mongodbspec50_Mongos { + const message = { ...baseMongodbspec50_Mongos } as Mongodbspec50_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig44Enterprise.fromPartial(object.config) + ? Mongosconfig50.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set( - Mongodbspec44Enterprise_Mongos.$type, - Mongodbspec44Enterprise_Mongos -); +messageTypeRegistry.set(Mongodbspec50_Mongos.$type, Mongodbspec50_Mongos); -const baseMongodbspec44Enterprise_MongoInfra: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.MongoInfra", +const baseMongodbspec50_MongoInfra: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.MongoInfra", }; -export const Mongodbspec44Enterprise_MongoInfra = { - $type: - "yandex.cloud.mdb.mongodb.v1.MongodbSpec4_4_enterprise.MongoInfra" as const, +export const Mongodbspec50_MongoInfra = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.MongoInfra" as const, encode( - message: Mongodbspec44Enterprise_MongoInfra, + message: Mongodbspec50_MongoInfra, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.configMongos !== undefined) { - Mongosconfig44Enterprise.encode( + Mongosconfig50.encode( message.configMongos, writer.uint32(10).fork() ).ldelim(); } if (message.configMongocfg !== undefined) { - Mongocfgconfig44Enterprise.encode( + Mongocfgconfig50.encode( message.configMongocfg, writer.uint32(18).fork() ).ldelim(); @@ -9777,29 +11807,32 @@ export const Mongodbspec44Enterprise_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec44Enterprise_MongoInfra { + ): Mongodbspec50_MongoInfra { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseMongodbspec44Enterprise_MongoInfra, - } as Mongodbspec44Enterprise_MongoInfra; + ...baseMongodbspec50_MongoInfra, + } as Mongodbspec50_MongoInfra; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.configMongos = Mongosconfig44Enterprise.decode( - reader, - reader.uint32() - ); + message.configMongos = Mongosconfig50.decode(reader, reader.uint32()); break; case 2: - message.configMongocfg = Mongocfgconfig44Enterprise.decode( + message.configMongocfg = Mongocfgconfig50.decode( reader, reader.uint32() ); @@ -9807,6 +11840,12 @@ export const Mongodbspec44Enterprise_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -9815,100 +11854,114 @@ export const Mongodbspec44Enterprise_MongoInfra = { return message; }, - fromJSON(object: any): Mongodbspec44Enterprise_MongoInfra { + fromJSON(object: any): Mongodbspec50_MongoInfra { const message = { - ...baseMongodbspec44Enterprise_MongoInfra, - } as Mongodbspec44Enterprise_MongoInfra; + ...baseMongodbspec50_MongoInfra, + } as Mongodbspec50_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig44Enterprise.fromJSON(object.configMongos) + ? Mongosconfig50.fromJSON(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig44Enterprise.fromJSON(object.configMongocfg) + ? Mongocfgconfig50.fromJSON(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec44Enterprise_MongoInfra): unknown { + toJSON(message: Mongodbspec50_MongoInfra): unknown { const obj: any = {}; message.configMongos !== undefined && (obj.configMongos = message.configMongos - ? Mongosconfig44Enterprise.toJSON(message.configMongos) + ? Mongosconfig50.toJSON(message.configMongos) : undefined); message.configMongocfg !== undefined && (obj.configMongocfg = message.configMongocfg - ? Mongocfgconfig44Enterprise.toJSON(message.configMongocfg) + ? Mongocfgconfig50.toJSON(message.configMongocfg) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial< - I extends Exact, I> - >(object: I): Mongodbspec44Enterprise_MongoInfra { + fromPartial, I>>( + object: I + ): Mongodbspec50_MongoInfra { const message = { - ...baseMongodbspec44Enterprise_MongoInfra, - } as Mongodbspec44Enterprise_MongoInfra; + ...baseMongodbspec50_MongoInfra, + } as Mongodbspec50_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig44Enterprise.fromPartial(object.configMongos) + ? Mongosconfig50.fromPartial(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig44Enterprise.fromPartial(object.configMongocfg) + ? Mongocfgconfig50.fromPartial(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; messageTypeRegistry.set( - Mongodbspec44Enterprise_MongoInfra.$type, - Mongodbspec44Enterprise_MongoInfra + Mongodbspec50_MongoInfra.$type, + Mongodbspec50_MongoInfra ); -const baseMongodbspec50: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0", +const baseMongodbspec50Enterprise: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise", }; -export const Mongodbspec50 = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0" as const, +export const Mongodbspec50Enterprise = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise" as const, encode( - message: Mongodbspec50, + message: Mongodbspec50Enterprise, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.mongod !== undefined) { - Mongodbspec50_Mongod.encode( + Mongodbspec50Enterprise_Mongod.encode( message.mongod, writer.uint32(10).fork() ).ldelim(); } if (message.mongocfg !== undefined) { - Mongodbspec50_MongoCfg.encode( + Mongodbspec50Enterprise_MongoCfg.encode( message.mongocfg, writer.uint32(18).fork() ).ldelim(); } if (message.mongos !== undefined) { - Mongodbspec50_Mongos.encode( + Mongodbspec50Enterprise_Mongos.encode( message.mongos, writer.uint32(26).fork() ).ldelim(); } if (message.mongoinfra !== undefined) { - Mongodbspec50_MongoInfra.encode( + Mongodbspec50Enterprise_MongoInfra.encode( message.mongoinfra, writer.uint32(34).fork() ).ldelim(); @@ -9916,27 +11969,38 @@ export const Mongodbspec50 = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Mongodbspec50 { + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodbspec50Enterprise { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec50 } as Mongodbspec50; + const message = { + ...baseMongodbspec50Enterprise, + } as Mongodbspec50Enterprise; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mongod = Mongodbspec50_Mongod.decode(reader, reader.uint32()); + message.mongod = Mongodbspec50Enterprise_Mongod.decode( + reader, + reader.uint32() + ); break; case 2: - message.mongocfg = Mongodbspec50_MongoCfg.decode( + message.mongocfg = Mongodbspec50Enterprise_MongoCfg.decode( reader, reader.uint32() ); break; case 3: - message.mongos = Mongodbspec50_Mongos.decode(reader, reader.uint32()); + message.mongos = Mongodbspec50Enterprise_Mongos.decode( + reader, + reader.uint32() + ); break; case 4: - message.mongoinfra = Mongodbspec50_MongoInfra.decode( + message.mongoinfra = Mongodbspec50Enterprise_MongoInfra.decode( reader, reader.uint32() ); @@ -9949,110 +12013,135 @@ export const Mongodbspec50 = { return message; }, - fromJSON(object: any): Mongodbspec50 { - const message = { ...baseMongodbspec50 } as Mongodbspec50; + fromJSON(object: any): Mongodbspec50Enterprise { + const message = { + ...baseMongodbspec50Enterprise, + } as Mongodbspec50Enterprise; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec50_Mongod.fromJSON(object.mongod) + ? Mongodbspec50Enterprise_Mongod.fromJSON(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec50_MongoCfg.fromJSON(object.mongocfg) + ? Mongodbspec50Enterprise_MongoCfg.fromJSON(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec50_Mongos.fromJSON(object.mongos) + ? Mongodbspec50Enterprise_Mongos.fromJSON(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec50_MongoInfra.fromJSON(object.mongoinfra) + ? Mongodbspec50Enterprise_MongoInfra.fromJSON(object.mongoinfra) : undefined; return message; }, - toJSON(message: Mongodbspec50): unknown { + toJSON(message: Mongodbspec50Enterprise): unknown { const obj: any = {}; message.mongod !== undefined && (obj.mongod = message.mongod - ? Mongodbspec50_Mongod.toJSON(message.mongod) + ? Mongodbspec50Enterprise_Mongod.toJSON(message.mongod) : undefined); message.mongocfg !== undefined && (obj.mongocfg = message.mongocfg - ? Mongodbspec50_MongoCfg.toJSON(message.mongocfg) + ? Mongodbspec50Enterprise_MongoCfg.toJSON(message.mongocfg) : undefined); message.mongos !== undefined && (obj.mongos = message.mongos - ? Mongodbspec50_Mongos.toJSON(message.mongos) + ? Mongodbspec50Enterprise_Mongos.toJSON(message.mongos) : undefined); message.mongoinfra !== undefined && (obj.mongoinfra = message.mongoinfra - ? Mongodbspec50_MongoInfra.toJSON(message.mongoinfra) + ? Mongodbspec50Enterprise_MongoInfra.toJSON(message.mongoinfra) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec50 { - const message = { ...baseMongodbspec50 } as Mongodbspec50; + ): Mongodbspec50Enterprise { + const message = { + ...baseMongodbspec50Enterprise, + } as Mongodbspec50Enterprise; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec50_Mongod.fromPartial(object.mongod) + ? Mongodbspec50Enterprise_Mongod.fromPartial(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec50_MongoCfg.fromPartial(object.mongocfg) + ? Mongodbspec50Enterprise_MongoCfg.fromPartial(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec50_Mongos.fromPartial(object.mongos) + ? Mongodbspec50Enterprise_Mongos.fromPartial(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec50_MongoInfra.fromPartial(object.mongoinfra) + ? Mongodbspec50Enterprise_MongoInfra.fromPartial(object.mongoinfra) : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec50.$type, Mongodbspec50); +messageTypeRegistry.set(Mongodbspec50Enterprise.$type, Mongodbspec50Enterprise); -const baseMongodbspec50_Mongod: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.Mongod", +const baseMongodbspec50Enterprise_Mongod: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.Mongod", }; -export const Mongodbspec50_Mongod = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.Mongod" as const, +export const Mongodbspec50Enterprise_Mongod = { + $type: + "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.Mongod" as const, encode( - message: Mongodbspec50_Mongod, + message: Mongodbspec50Enterprise_Mongod, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongodconfig50.encode(message.config, writer.uint32(10).fork()).ldelim(); + Mongodconfig50Enterprise.encode( + message.config, + writer.uint32(10).fork() + ).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec50_Mongod { + ): Mongodbspec50Enterprise_Mongod { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec50_Mongod } as Mongodbspec50_Mongod; + const message = { + ...baseMongodbspec50Enterprise_Mongod, + } as Mongodbspec50Enterprise_Mongod; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongodconfig50.decode(reader, reader.uint32()); + message.config = Mongodconfig50Enterprise.decode( + reader, + reader.uint32() + ); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -10061,63 +12150,85 @@ export const Mongodbspec50_Mongod = { return message; }, - fromJSON(object: any): Mongodbspec50_Mongod { - const message = { ...baseMongodbspec50_Mongod } as Mongodbspec50_Mongod; + fromJSON(object: any): Mongodbspec50Enterprise_Mongod { + const message = { + ...baseMongodbspec50Enterprise_Mongod, + } as Mongodbspec50Enterprise_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig50.fromJSON(object.config) + ? Mongodconfig50Enterprise.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec50_Mongod): unknown { + toJSON(message: Mongodbspec50Enterprise_Mongod): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongodconfig50.toJSON(message.config) + ? Mongodconfig50Enterprise.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec50_Mongod { - const message = { ...baseMongodbspec50_Mongod } as Mongodbspec50_Mongod; + ): Mongodbspec50Enterprise_Mongod { + const message = { + ...baseMongodbspec50Enterprise_Mongod, + } as Mongodbspec50Enterprise_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig50.fromPartial(object.config) + ? Mongodconfig50Enterprise.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec50_Mongod.$type, Mongodbspec50_Mongod); +messageTypeRegistry.set( + Mongodbspec50Enterprise_Mongod.$type, + Mongodbspec50Enterprise_Mongod +); -const baseMongodbspec50_MongoCfg: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.MongoCfg", +const baseMongodbspec50Enterprise_MongoCfg: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.MongoCfg", }; -export const Mongodbspec50_MongoCfg = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.MongoCfg" as const, +export const Mongodbspec50Enterprise_MongoCfg = { + $type: + "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.MongoCfg" as const, encode( - message: Mongodbspec50_MongoCfg, + message: Mongodbspec50Enterprise_MongoCfg, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongocfgconfig50.encode( + Mongocfgconfig50Enterprise.encode( message.config, writer.uint32(10).fork() ).ldelim(); @@ -10125,25 +12236,42 @@ export const Mongodbspec50_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec50_MongoCfg { + ): Mongodbspec50Enterprise_MongoCfg { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec50_MongoCfg } as Mongodbspec50_MongoCfg; + const message = { + ...baseMongodbspec50Enterprise_MongoCfg, + } as Mongodbspec50Enterprise_MongoCfg; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongocfgconfig50.decode(reader, reader.uint32()); + message.config = Mongocfgconfig50Enterprise.decode( + reader, + reader.uint32() + ); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -10152,86 +12280,128 @@ export const Mongodbspec50_MongoCfg = { return message; }, - fromJSON(object: any): Mongodbspec50_MongoCfg { - const message = { ...baseMongodbspec50_MongoCfg } as Mongodbspec50_MongoCfg; + fromJSON(object: any): Mongodbspec50Enterprise_MongoCfg { + const message = { + ...baseMongodbspec50Enterprise_MongoCfg, + } as Mongodbspec50Enterprise_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig50.fromJSON(object.config) + ? Mongocfgconfig50Enterprise.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec50_MongoCfg): unknown { + toJSON(message: Mongodbspec50Enterprise_MongoCfg): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongocfgconfig50.toJSON(message.config) + ? Mongocfgconfig50Enterprise.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( - object: I - ): Mongodbspec50_MongoCfg { - const message = { ...baseMongodbspec50_MongoCfg } as Mongodbspec50_MongoCfg; + fromPartial< + I extends Exact, I> + >(object: I): Mongodbspec50Enterprise_MongoCfg { + const message = { + ...baseMongodbspec50Enterprise_MongoCfg, + } as Mongodbspec50Enterprise_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig50.fromPartial(object.config) + ? Mongocfgconfig50Enterprise.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec50_MongoCfg.$type, Mongodbspec50_MongoCfg); +messageTypeRegistry.set( + Mongodbspec50Enterprise_MongoCfg.$type, + Mongodbspec50Enterprise_MongoCfg +); -const baseMongodbspec50_Mongos: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.Mongos", +const baseMongodbspec50Enterprise_Mongos: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.Mongos", }; -export const Mongodbspec50_Mongos = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.Mongos" as const, +export const Mongodbspec50Enterprise_Mongos = { + $type: + "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.Mongos" as const, encode( - message: Mongodbspec50_Mongos, + message: Mongodbspec50Enterprise_Mongos, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongosconfig50.encode(message.config, writer.uint32(10).fork()).ldelim(); + Mongosconfig50Enterprise.encode( + message.config, + writer.uint32(10).fork() + ).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec50_Mongos { + ): Mongodbspec50Enterprise_Mongos { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec50_Mongos } as Mongodbspec50_Mongos; + const message = { + ...baseMongodbspec50Enterprise_Mongos, + } as Mongodbspec50Enterprise_Mongos; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongosconfig50.decode(reader, reader.uint32()); + message.config = Mongosconfig50Enterprise.decode( + reader, + reader.uint32() + ); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -10240,69 +12410,91 @@ export const Mongodbspec50_Mongos = { return message; }, - fromJSON(object: any): Mongodbspec50_Mongos { - const message = { ...baseMongodbspec50_Mongos } as Mongodbspec50_Mongos; + fromJSON(object: any): Mongodbspec50Enterprise_Mongos { + const message = { + ...baseMongodbspec50Enterprise_Mongos, + } as Mongodbspec50Enterprise_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig50.fromJSON(object.config) + ? Mongosconfig50Enterprise.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec50_Mongos): unknown { + toJSON(message: Mongodbspec50Enterprise_Mongos): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongosconfig50.toJSON(message.config) + ? Mongosconfig50Enterprise.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec50_Mongos { - const message = { ...baseMongodbspec50_Mongos } as Mongodbspec50_Mongos; + ): Mongodbspec50Enterprise_Mongos { + const message = { + ...baseMongodbspec50Enterprise_Mongos, + } as Mongodbspec50Enterprise_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig50.fromPartial(object.config) + ? Mongosconfig50Enterprise.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec50_Mongos.$type, Mongodbspec50_Mongos); +messageTypeRegistry.set( + Mongodbspec50Enterprise_Mongos.$type, + Mongodbspec50Enterprise_Mongos +); -const baseMongodbspec50_MongoInfra: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.MongoInfra", +const baseMongodbspec50Enterprise_MongoInfra: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.MongoInfra", }; -export const Mongodbspec50_MongoInfra = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0.MongoInfra" as const, +export const Mongodbspec50Enterprise_MongoInfra = { + $type: + "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.MongoInfra" as const, encode( - message: Mongodbspec50_MongoInfra, + message: Mongodbspec50Enterprise_MongoInfra, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.configMongos !== undefined) { - Mongosconfig50.encode( + Mongosconfig50Enterprise.encode( message.configMongos, writer.uint32(10).fork() ).ldelim(); } if (message.configMongocfg !== undefined) { - Mongocfgconfig50.encode( + Mongocfgconfig50Enterprise.encode( message.configMongocfg, writer.uint32(18).fork() ).ldelim(); @@ -10310,26 +12502,35 @@ export const Mongodbspec50_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec50_MongoInfra { + ): Mongodbspec50Enterprise_MongoInfra { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec50_MongoInfra, - } as Mongodbspec50_MongoInfra; + const message = { + ...baseMongodbspec50Enterprise_MongoInfra, + } as Mongodbspec50Enterprise_MongoInfra; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.configMongos = Mongosconfig50.decode(reader, reader.uint32()); + message.configMongos = Mongosconfig50Enterprise.decode( + reader, + reader.uint32() + ); break; case 2: - message.configMongocfg = Mongocfgconfig50.decode( + message.configMongocfg = Mongocfgconfig50Enterprise.decode( reader, reader.uint32() ); @@ -10337,6 +12538,12 @@ export const Mongodbspec50_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -10345,100 +12552,114 @@ export const Mongodbspec50_MongoInfra = { return message; }, - fromJSON(object: any): Mongodbspec50_MongoInfra { + fromJSON(object: any): Mongodbspec50Enterprise_MongoInfra { const message = { - ...baseMongodbspec50_MongoInfra, - } as Mongodbspec50_MongoInfra; + ...baseMongodbspec50Enterprise_MongoInfra, + } as Mongodbspec50Enterprise_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig50.fromJSON(object.configMongos) + ? Mongosconfig50Enterprise.fromJSON(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig50.fromJSON(object.configMongocfg) + ? Mongocfgconfig50Enterprise.fromJSON(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec50_MongoInfra): unknown { + toJSON(message: Mongodbspec50Enterprise_MongoInfra): unknown { const obj: any = {}; message.configMongos !== undefined && (obj.configMongos = message.configMongos - ? Mongosconfig50.toJSON(message.configMongos) + ? Mongosconfig50Enterprise.toJSON(message.configMongos) : undefined); message.configMongocfg !== undefined && (obj.configMongocfg = message.configMongocfg - ? Mongocfgconfig50.toJSON(message.configMongocfg) + ? Mongocfgconfig50Enterprise.toJSON(message.configMongocfg) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( - object: I - ): Mongodbspec50_MongoInfra { + fromPartial< + I extends Exact, I> + >(object: I): Mongodbspec50Enterprise_MongoInfra { const message = { - ...baseMongodbspec50_MongoInfra, - } as Mongodbspec50_MongoInfra; + ...baseMongodbspec50Enterprise_MongoInfra, + } as Mongodbspec50Enterprise_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig50.fromPartial(object.configMongos) + ? Mongosconfig50Enterprise.fromPartial(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig50.fromPartial(object.configMongocfg) + ? Mongocfgconfig50Enterprise.fromPartial(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; messageTypeRegistry.set( - Mongodbspec50_MongoInfra.$type, - Mongodbspec50_MongoInfra + Mongodbspec50Enterprise_MongoInfra.$type, + Mongodbspec50Enterprise_MongoInfra ); -const baseMongodbspec50Enterprise: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise", +const baseMongodbspec60: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0", }; -export const Mongodbspec50Enterprise = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise" as const, +export const Mongodbspec60 = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0" as const, encode( - message: Mongodbspec50Enterprise, + message: Mongodbspec60, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.mongod !== undefined) { - Mongodbspec50Enterprise_Mongod.encode( + Mongodbspec60_Mongod.encode( message.mongod, writer.uint32(10).fork() ).ldelim(); } if (message.mongocfg !== undefined) { - Mongodbspec50Enterprise_MongoCfg.encode( + Mongodbspec60_MongoCfg.encode( message.mongocfg, writer.uint32(18).fork() ).ldelim(); } if (message.mongos !== undefined) { - Mongodbspec50Enterprise_Mongos.encode( + Mongodbspec60_Mongos.encode( message.mongos, writer.uint32(26).fork() ).ldelim(); } if (message.mongoinfra !== undefined) { - Mongodbspec50Enterprise_MongoInfra.encode( + Mongodbspec60_MongoInfra.encode( message.mongoinfra, writer.uint32(34).fork() ).ldelim(); @@ -10446,38 +12667,27 @@ export const Mongodbspec50Enterprise = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): Mongodbspec50Enterprise { + decode(input: _m0.Reader | Uint8Array, length?: number): Mongodbspec60 { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec50Enterprise, - } as Mongodbspec50Enterprise; + const message = { ...baseMongodbspec60 } as Mongodbspec60; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mongod = Mongodbspec50Enterprise_Mongod.decode( - reader, - reader.uint32() - ); + message.mongod = Mongodbspec60_Mongod.decode(reader, reader.uint32()); break; case 2: - message.mongocfg = Mongodbspec50Enterprise_MongoCfg.decode( + message.mongocfg = Mongodbspec60_MongoCfg.decode( reader, reader.uint32() ); break; case 3: - message.mongos = Mongodbspec50Enterprise_Mongos.decode( - reader, - reader.uint32() - ); + message.mongos = Mongodbspec60_Mongos.decode(reader, reader.uint32()); break; case 4: - message.mongoinfra = Mongodbspec50Enterprise_MongoInfra.decode( + message.mongoinfra = Mongodbspec60_MongoInfra.decode( reader, reader.uint32() ); @@ -10490,123 +12700,122 @@ export const Mongodbspec50Enterprise = { return message; }, - fromJSON(object: any): Mongodbspec50Enterprise { - const message = { - ...baseMongodbspec50Enterprise, - } as Mongodbspec50Enterprise; + fromJSON(object: any): Mongodbspec60 { + const message = { ...baseMongodbspec60 } as Mongodbspec60; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec50Enterprise_Mongod.fromJSON(object.mongod) + ? Mongodbspec60_Mongod.fromJSON(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec50Enterprise_MongoCfg.fromJSON(object.mongocfg) + ? Mongodbspec60_MongoCfg.fromJSON(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec50Enterprise_Mongos.fromJSON(object.mongos) + ? Mongodbspec60_Mongos.fromJSON(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec50Enterprise_MongoInfra.fromJSON(object.mongoinfra) + ? Mongodbspec60_MongoInfra.fromJSON(object.mongoinfra) : undefined; return message; }, - toJSON(message: Mongodbspec50Enterprise): unknown { + toJSON(message: Mongodbspec60): unknown { const obj: any = {}; message.mongod !== undefined && (obj.mongod = message.mongod - ? Mongodbspec50Enterprise_Mongod.toJSON(message.mongod) + ? Mongodbspec60_Mongod.toJSON(message.mongod) : undefined); message.mongocfg !== undefined && (obj.mongocfg = message.mongocfg - ? Mongodbspec50Enterprise_MongoCfg.toJSON(message.mongocfg) + ? Mongodbspec60_MongoCfg.toJSON(message.mongocfg) : undefined); message.mongos !== undefined && (obj.mongos = message.mongos - ? Mongodbspec50Enterprise_Mongos.toJSON(message.mongos) + ? Mongodbspec60_Mongos.toJSON(message.mongos) : undefined); message.mongoinfra !== undefined && (obj.mongoinfra = message.mongoinfra - ? Mongodbspec50Enterprise_MongoInfra.toJSON(message.mongoinfra) + ? Mongodbspec60_MongoInfra.toJSON(message.mongoinfra) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec50Enterprise { - const message = { - ...baseMongodbspec50Enterprise, - } as Mongodbspec50Enterprise; + ): Mongodbspec60 { + const message = { ...baseMongodbspec60 } as Mongodbspec60; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec50Enterprise_Mongod.fromPartial(object.mongod) + ? Mongodbspec60_Mongod.fromPartial(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec50Enterprise_MongoCfg.fromPartial(object.mongocfg) + ? Mongodbspec60_MongoCfg.fromPartial(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec50Enterprise_Mongos.fromPartial(object.mongos) + ? Mongodbspec60_Mongos.fromPartial(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec50Enterprise_MongoInfra.fromPartial(object.mongoinfra) + ? Mongodbspec60_MongoInfra.fromPartial(object.mongoinfra) : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec50Enterprise.$type, Mongodbspec50Enterprise); +messageTypeRegistry.set(Mongodbspec60.$type, Mongodbspec60); -const baseMongodbspec50Enterprise_Mongod: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.Mongod", +const baseMongodbspec60_Mongod: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.Mongod", }; -export const Mongodbspec50Enterprise_Mongod = { - $type: - "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.Mongod" as const, +export const Mongodbspec60_Mongod = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.Mongod" as const, encode( - message: Mongodbspec50Enterprise_Mongod, + message: Mongodbspec60_Mongod, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongodconfig50Enterprise.encode( - message.config, - writer.uint32(10).fork() - ).ldelim(); + Mongodconfig60.encode(message.config, writer.uint32(10).fork()).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec50Enterprise_Mongod { + ): Mongodbspec60_Mongod { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec50Enterprise_Mongod, - } as Mongodbspec50Enterprise_Mongod; + const message = { ...baseMongodbspec60_Mongod } as Mongodbspec60_Mongod; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongodconfig50Enterprise.decode( - reader, - reader.uint32() - ); + message.config = Mongodconfig60.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -10615,71 +12824,77 @@ export const Mongodbspec50Enterprise_Mongod = { return message; }, - fromJSON(object: any): Mongodbspec50Enterprise_Mongod { - const message = { - ...baseMongodbspec50Enterprise_Mongod, - } as Mongodbspec50Enterprise_Mongod; + fromJSON(object: any): Mongodbspec60_Mongod { + const message = { ...baseMongodbspec60_Mongod } as Mongodbspec60_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig50Enterprise.fromJSON(object.config) + ? Mongodconfig60.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec50Enterprise_Mongod): unknown { + toJSON(message: Mongodbspec60_Mongod): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongodconfig50Enterprise.toJSON(message.config) + ? Mongodconfig60.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec50Enterprise_Mongod { - const message = { - ...baseMongodbspec50Enterprise_Mongod, - } as Mongodbspec50Enterprise_Mongod; + ): Mongodbspec60_Mongod { + const message = { ...baseMongodbspec60_Mongod } as Mongodbspec60_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig50Enterprise.fromPartial(object.config) + ? Mongodconfig60.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set( - Mongodbspec50Enterprise_Mongod.$type, - Mongodbspec50Enterprise_Mongod -); +messageTypeRegistry.set(Mongodbspec60_Mongod.$type, Mongodbspec60_Mongod); -const baseMongodbspec50Enterprise_MongoCfg: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.MongoCfg", +const baseMongodbspec60_MongoCfg: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.MongoCfg", }; -export const Mongodbspec50Enterprise_MongoCfg = { - $type: - "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.MongoCfg" as const, +export const Mongodbspec60_MongoCfg = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.MongoCfg" as const, encode( - message: Mongodbspec50Enterprise_MongoCfg, + message: Mongodbspec60_MongoCfg, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongocfgconfig50Enterprise.encode( + Mongocfgconfig60.encode( message.config, writer.uint32(10).fork() ).ldelim(); @@ -10687,30 +12902,37 @@ export const Mongodbspec50Enterprise_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec50Enterprise_MongoCfg { + ): Mongodbspec60_MongoCfg { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec50Enterprise_MongoCfg, - } as Mongodbspec50Enterprise_MongoCfg; + const message = { ...baseMongodbspec60_MongoCfg } as Mongodbspec60_MongoCfg; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongocfgconfig50Enterprise.decode( - reader, - reader.uint32() - ); + message.config = Mongocfgconfig60.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -10719,102 +12941,112 @@ export const Mongodbspec50Enterprise_MongoCfg = { return message; }, - fromJSON(object: any): Mongodbspec50Enterprise_MongoCfg { - const message = { - ...baseMongodbspec50Enterprise_MongoCfg, - } as Mongodbspec50Enterprise_MongoCfg; + fromJSON(object: any): Mongodbspec60_MongoCfg { + const message = { ...baseMongodbspec60_MongoCfg } as Mongodbspec60_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig50Enterprise.fromJSON(object.config) + ? Mongocfgconfig60.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec50Enterprise_MongoCfg): unknown { + toJSON(message: Mongodbspec60_MongoCfg): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongocfgconfig50Enterprise.toJSON(message.config) + ? Mongocfgconfig60.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial< - I extends Exact, I> - >(object: I): Mongodbspec50Enterprise_MongoCfg { - const message = { - ...baseMongodbspec50Enterprise_MongoCfg, - } as Mongodbspec50Enterprise_MongoCfg; + fromPartial, I>>( + object: I + ): Mongodbspec60_MongoCfg { + const message = { ...baseMongodbspec60_MongoCfg } as Mongodbspec60_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig50Enterprise.fromPartial(object.config) + ? Mongocfgconfig60.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set( - Mongodbspec50Enterprise_MongoCfg.$type, - Mongodbspec50Enterprise_MongoCfg -); +messageTypeRegistry.set(Mongodbspec60_MongoCfg.$type, Mongodbspec60_MongoCfg); -const baseMongodbspec50Enterprise_Mongos: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.Mongos", +const baseMongodbspec60_Mongos: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.Mongos", }; -export const Mongodbspec50Enterprise_Mongos = { - $type: - "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.Mongos" as const, +export const Mongodbspec60_Mongos = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.Mongos" as const, encode( - message: Mongodbspec50Enterprise_Mongos, + message: Mongodbspec60_Mongos, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongosconfig50Enterprise.encode( - message.config, - writer.uint32(10).fork() - ).ldelim(); + Mongosconfig60.encode(message.config, writer.uint32(10).fork()).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec50Enterprise_Mongos { + ): Mongodbspec60_Mongos { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec50Enterprise_Mongos, - } as Mongodbspec50Enterprise_Mongos; + const message = { ...baseMongodbspec60_Mongos } as Mongodbspec60_Mongos; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongosconfig50Enterprise.decode( - reader, - reader.uint32() - ); + message.config = Mongosconfig60.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -10823,77 +13055,83 @@ export const Mongodbspec50Enterprise_Mongos = { return message; }, - fromJSON(object: any): Mongodbspec50Enterprise_Mongos { - const message = { - ...baseMongodbspec50Enterprise_Mongos, - } as Mongodbspec50Enterprise_Mongos; + fromJSON(object: any): Mongodbspec60_Mongos { + const message = { ...baseMongodbspec60_Mongos } as Mongodbspec60_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig50Enterprise.fromJSON(object.config) + ? Mongosconfig60.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec50Enterprise_Mongos): unknown { + toJSON(message: Mongodbspec60_Mongos): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongosconfig50Enterprise.toJSON(message.config) + ? Mongosconfig60.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec50Enterprise_Mongos { - const message = { - ...baseMongodbspec50Enterprise_Mongos, - } as Mongodbspec50Enterprise_Mongos; + ): Mongodbspec60_Mongos { + const message = { ...baseMongodbspec60_Mongos } as Mongodbspec60_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig50Enterprise.fromPartial(object.config) + ? Mongosconfig60.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set( - Mongodbspec50Enterprise_Mongos.$type, - Mongodbspec50Enterprise_Mongos -); +messageTypeRegistry.set(Mongodbspec60_Mongos.$type, Mongodbspec60_Mongos); -const baseMongodbspec50Enterprise_MongoInfra: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.MongoInfra", +const baseMongodbspec60_MongoInfra: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.MongoInfra", }; -export const Mongodbspec50Enterprise_MongoInfra = { - $type: - "yandex.cloud.mdb.mongodb.v1.MongodbSpec5_0_enterprise.MongoInfra" as const, +export const Mongodbspec60_MongoInfra = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.MongoInfra" as const, encode( - message: Mongodbspec50Enterprise_MongoInfra, + message: Mongodbspec60_MongoInfra, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.configMongos !== undefined) { - Mongosconfig50Enterprise.encode( + Mongosconfig60.encode( message.configMongos, writer.uint32(10).fork() ).ldelim(); } if (message.configMongocfg !== undefined) { - Mongocfgconfig50Enterprise.encode( + Mongocfgconfig60.encode( message.configMongocfg, writer.uint32(18).fork() ).ldelim(); @@ -10901,29 +13139,32 @@ export const Mongodbspec50Enterprise_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec50Enterprise_MongoInfra { + ): Mongodbspec60_MongoInfra { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseMongodbspec50Enterprise_MongoInfra, - } as Mongodbspec50Enterprise_MongoInfra; + ...baseMongodbspec60_MongoInfra, + } as Mongodbspec60_MongoInfra; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.configMongos = Mongosconfig50Enterprise.decode( - reader, - reader.uint32() - ); + message.configMongos = Mongosconfig60.decode(reader, reader.uint32()); break; case 2: - message.configMongocfg = Mongocfgconfig50Enterprise.decode( + message.configMongocfg = Mongocfgconfig60.decode( reader, reader.uint32() ); @@ -10931,6 +13172,12 @@ export const Mongodbspec50Enterprise_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -10939,100 +13186,114 @@ export const Mongodbspec50Enterprise_MongoInfra = { return message; }, - fromJSON(object: any): Mongodbspec50Enterprise_MongoInfra { + fromJSON(object: any): Mongodbspec60_MongoInfra { const message = { - ...baseMongodbspec50Enterprise_MongoInfra, - } as Mongodbspec50Enterprise_MongoInfra; + ...baseMongodbspec60_MongoInfra, + } as Mongodbspec60_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig50Enterprise.fromJSON(object.configMongos) + ? Mongosconfig60.fromJSON(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig50Enterprise.fromJSON(object.configMongocfg) + ? Mongocfgconfig60.fromJSON(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec50Enterprise_MongoInfra): unknown { + toJSON(message: Mongodbspec60_MongoInfra): unknown { const obj: any = {}; message.configMongos !== undefined && (obj.configMongos = message.configMongos - ? Mongosconfig50Enterprise.toJSON(message.configMongos) + ? Mongosconfig60.toJSON(message.configMongos) : undefined); message.configMongocfg !== undefined && (obj.configMongocfg = message.configMongocfg - ? Mongocfgconfig50Enterprise.toJSON(message.configMongocfg) + ? Mongocfgconfig60.toJSON(message.configMongocfg) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial< - I extends Exact, I> - >(object: I): Mongodbspec50Enterprise_MongoInfra { + fromPartial, I>>( + object: I + ): Mongodbspec60_MongoInfra { const message = { - ...baseMongodbspec50Enterprise_MongoInfra, - } as Mongodbspec50Enterprise_MongoInfra; + ...baseMongodbspec60_MongoInfra, + } as Mongodbspec60_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig50Enterprise.fromPartial(object.configMongos) + ? Mongosconfig60.fromPartial(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig50Enterprise.fromPartial(object.configMongocfg) + ? Mongocfgconfig60.fromPartial(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; messageTypeRegistry.set( - Mongodbspec50Enterprise_MongoInfra.$type, - Mongodbspec50Enterprise_MongoInfra + Mongodbspec60_MongoInfra.$type, + Mongodbspec60_MongoInfra ); -const baseMongodbspec60: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0", +const baseMongodbspec60Enterprise: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise", }; -export const Mongodbspec60 = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0" as const, +export const Mongodbspec60Enterprise = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise" as const, encode( - message: Mongodbspec60, + message: Mongodbspec60Enterprise, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.mongod !== undefined) { - Mongodbspec60_Mongod.encode( + Mongodbspec60Enterprise_Mongod.encode( message.mongod, writer.uint32(10).fork() ).ldelim(); } if (message.mongocfg !== undefined) { - Mongodbspec60_MongoCfg.encode( + Mongodbspec60Enterprise_MongoCfg.encode( message.mongocfg, writer.uint32(18).fork() ).ldelim(); } if (message.mongos !== undefined) { - Mongodbspec60_Mongos.encode( + Mongodbspec60Enterprise_Mongos.encode( message.mongos, writer.uint32(26).fork() ).ldelim(); } if (message.mongoinfra !== undefined) { - Mongodbspec60_MongoInfra.encode( + Mongodbspec60Enterprise_MongoInfra.encode( message.mongoinfra, writer.uint32(34).fork() ).ldelim(); @@ -11040,27 +13301,38 @@ export const Mongodbspec60 = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Mongodbspec60 { + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodbspec60Enterprise { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec60 } as Mongodbspec60; + const message = { + ...baseMongodbspec60Enterprise, + } as Mongodbspec60Enterprise; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mongod = Mongodbspec60_Mongod.decode(reader, reader.uint32()); + message.mongod = Mongodbspec60Enterprise_Mongod.decode( + reader, + reader.uint32() + ); break; case 2: - message.mongocfg = Mongodbspec60_MongoCfg.decode( + message.mongocfg = Mongodbspec60Enterprise_MongoCfg.decode( reader, reader.uint32() ); break; case 3: - message.mongos = Mongodbspec60_Mongos.decode(reader, reader.uint32()); + message.mongos = Mongodbspec60Enterprise_Mongos.decode( + reader, + reader.uint32() + ); break; case 4: - message.mongoinfra = Mongodbspec60_MongoInfra.decode( + message.mongoinfra = Mongodbspec60Enterprise_MongoInfra.decode( reader, reader.uint32() ); @@ -11073,110 +13345,135 @@ export const Mongodbspec60 = { return message; }, - fromJSON(object: any): Mongodbspec60 { - const message = { ...baseMongodbspec60 } as Mongodbspec60; + fromJSON(object: any): Mongodbspec60Enterprise { + const message = { + ...baseMongodbspec60Enterprise, + } as Mongodbspec60Enterprise; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec60_Mongod.fromJSON(object.mongod) + ? Mongodbspec60Enterprise_Mongod.fromJSON(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec60_MongoCfg.fromJSON(object.mongocfg) + ? Mongodbspec60Enterprise_MongoCfg.fromJSON(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec60_Mongos.fromJSON(object.mongos) + ? Mongodbspec60Enterprise_Mongos.fromJSON(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec60_MongoInfra.fromJSON(object.mongoinfra) + ? Mongodbspec60Enterprise_MongoInfra.fromJSON(object.mongoinfra) : undefined; return message; }, - toJSON(message: Mongodbspec60): unknown { + toJSON(message: Mongodbspec60Enterprise): unknown { const obj: any = {}; message.mongod !== undefined && (obj.mongod = message.mongod - ? Mongodbspec60_Mongod.toJSON(message.mongod) + ? Mongodbspec60Enterprise_Mongod.toJSON(message.mongod) : undefined); message.mongocfg !== undefined && (obj.mongocfg = message.mongocfg - ? Mongodbspec60_MongoCfg.toJSON(message.mongocfg) + ? Mongodbspec60Enterprise_MongoCfg.toJSON(message.mongocfg) : undefined); message.mongos !== undefined && (obj.mongos = message.mongos - ? Mongodbspec60_Mongos.toJSON(message.mongos) + ? Mongodbspec60Enterprise_Mongos.toJSON(message.mongos) : undefined); message.mongoinfra !== undefined && (obj.mongoinfra = message.mongoinfra - ? Mongodbspec60_MongoInfra.toJSON(message.mongoinfra) + ? Mongodbspec60Enterprise_MongoInfra.toJSON(message.mongoinfra) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec60 { - const message = { ...baseMongodbspec60 } as Mongodbspec60; + ): Mongodbspec60Enterprise { + const message = { + ...baseMongodbspec60Enterprise, + } as Mongodbspec60Enterprise; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec60_Mongod.fromPartial(object.mongod) + ? Mongodbspec60Enterprise_Mongod.fromPartial(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec60_MongoCfg.fromPartial(object.mongocfg) + ? Mongodbspec60Enterprise_MongoCfg.fromPartial(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec60_Mongos.fromPartial(object.mongos) + ? Mongodbspec60Enterprise_Mongos.fromPartial(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec60_MongoInfra.fromPartial(object.mongoinfra) + ? Mongodbspec60Enterprise_MongoInfra.fromPartial(object.mongoinfra) : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec60.$type, Mongodbspec60); +messageTypeRegistry.set(Mongodbspec60Enterprise.$type, Mongodbspec60Enterprise); -const baseMongodbspec60_Mongod: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.Mongod", +const baseMongodbspec60Enterprise_Mongod: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.Mongod", }; -export const Mongodbspec60_Mongod = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.Mongod" as const, +export const Mongodbspec60Enterprise_Mongod = { + $type: + "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.Mongod" as const, encode( - message: Mongodbspec60_Mongod, + message: Mongodbspec60Enterprise_Mongod, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongodconfig60.encode(message.config, writer.uint32(10).fork()).ldelim(); + Mongodconfig60Enterprise.encode( + message.config, + writer.uint32(10).fork() + ).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec60_Mongod { + ): Mongodbspec60Enterprise_Mongod { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec60_Mongod } as Mongodbspec60_Mongod; + const message = { + ...baseMongodbspec60Enterprise_Mongod, + } as Mongodbspec60Enterprise_Mongod; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongodconfig60.decode(reader, reader.uint32()); + message.config = Mongodconfig60Enterprise.decode( + reader, + reader.uint32() + ); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -11185,63 +13482,85 @@ export const Mongodbspec60_Mongod = { return message; }, - fromJSON(object: any): Mongodbspec60_Mongod { - const message = { ...baseMongodbspec60_Mongod } as Mongodbspec60_Mongod; + fromJSON(object: any): Mongodbspec60Enterprise_Mongod { + const message = { + ...baseMongodbspec60Enterprise_Mongod, + } as Mongodbspec60Enterprise_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig60.fromJSON(object.config) + ? Mongodconfig60Enterprise.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec60_Mongod): unknown { + toJSON(message: Mongodbspec60Enterprise_Mongod): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongodconfig60.toJSON(message.config) + ? Mongodconfig60Enterprise.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec60_Mongod { - const message = { ...baseMongodbspec60_Mongod } as Mongodbspec60_Mongod; + ): Mongodbspec60Enterprise_Mongod { + const message = { + ...baseMongodbspec60Enterprise_Mongod, + } as Mongodbspec60Enterprise_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig60.fromPartial(object.config) + ? Mongodconfig60Enterprise.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec60_Mongod.$type, Mongodbspec60_Mongod); +messageTypeRegistry.set( + Mongodbspec60Enterprise_Mongod.$type, + Mongodbspec60Enterprise_Mongod +); -const baseMongodbspec60_MongoCfg: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.MongoCfg", +const baseMongodbspec60Enterprise_MongoCfg: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.MongoCfg", }; -export const Mongodbspec60_MongoCfg = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.MongoCfg" as const, +export const Mongodbspec60Enterprise_MongoCfg = { + $type: + "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.MongoCfg" as const, encode( - message: Mongodbspec60_MongoCfg, + message: Mongodbspec60Enterprise_MongoCfg, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongocfgconfig60.encode( + Mongocfgconfig60Enterprise.encode( message.config, writer.uint32(10).fork() ).ldelim(); @@ -11249,25 +13568,42 @@ export const Mongodbspec60_MongoCfg = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec60_MongoCfg { + ): Mongodbspec60Enterprise_MongoCfg { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec60_MongoCfg } as Mongodbspec60_MongoCfg; + const message = { + ...baseMongodbspec60Enterprise_MongoCfg, + } as Mongodbspec60Enterprise_MongoCfg; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongocfgconfig60.decode(reader, reader.uint32()); + message.config = Mongocfgconfig60Enterprise.decode( + reader, + reader.uint32() + ); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -11276,86 +13612,128 @@ export const Mongodbspec60_MongoCfg = { return message; }, - fromJSON(object: any): Mongodbspec60_MongoCfg { - const message = { ...baseMongodbspec60_MongoCfg } as Mongodbspec60_MongoCfg; + fromJSON(object: any): Mongodbspec60Enterprise_MongoCfg { + const message = { + ...baseMongodbspec60Enterprise_MongoCfg, + } as Mongodbspec60Enterprise_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig60.fromJSON(object.config) + ? Mongocfgconfig60Enterprise.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec60_MongoCfg): unknown { + toJSON(message: Mongodbspec60Enterprise_MongoCfg): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongocfgconfig60.toJSON(message.config) + ? Mongocfgconfig60Enterprise.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( - object: I - ): Mongodbspec60_MongoCfg { - const message = { ...baseMongodbspec60_MongoCfg } as Mongodbspec60_MongoCfg; + fromPartial< + I extends Exact, I> + >(object: I): Mongodbspec60Enterprise_MongoCfg { + const message = { + ...baseMongodbspec60Enterprise_MongoCfg, + } as Mongodbspec60Enterprise_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig60.fromPartial(object.config) + ? Mongocfgconfig60Enterprise.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec60_MongoCfg.$type, Mongodbspec60_MongoCfg); +messageTypeRegistry.set( + Mongodbspec60Enterprise_MongoCfg.$type, + Mongodbspec60Enterprise_MongoCfg +); -const baseMongodbspec60_Mongos: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.Mongos", +const baseMongodbspec60Enterprise_Mongos: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.Mongos", }; -export const Mongodbspec60_Mongos = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.Mongos" as const, +export const Mongodbspec60Enterprise_Mongos = { + $type: + "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.Mongos" as const, encode( - message: Mongodbspec60_Mongos, + message: Mongodbspec60Enterprise_Mongos, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongosconfig60.encode(message.config, writer.uint32(10).fork()).ldelim(); + Mongosconfig60Enterprise.encode( + message.config, + writer.uint32(10).fork() + ).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec60_Mongos { + ): Mongodbspec60Enterprise_Mongos { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { ...baseMongodbspec60_Mongos } as Mongodbspec60_Mongos; + const message = { + ...baseMongodbspec60Enterprise_Mongos, + } as Mongodbspec60Enterprise_Mongos; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongosconfig60.decode(reader, reader.uint32()); + message.config = Mongosconfig60Enterprise.decode( + reader, + reader.uint32() + ); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -11364,69 +13742,91 @@ export const Mongodbspec60_Mongos = { return message; }, - fromJSON(object: any): Mongodbspec60_Mongos { - const message = { ...baseMongodbspec60_Mongos } as Mongodbspec60_Mongos; + fromJSON(object: any): Mongodbspec60Enterprise_Mongos { + const message = { + ...baseMongodbspec60Enterprise_Mongos, + } as Mongodbspec60Enterprise_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig60.fromJSON(object.config) + ? Mongosconfig60Enterprise.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec60_Mongos): unknown { + toJSON(message: Mongodbspec60Enterprise_Mongos): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongosconfig60.toJSON(message.config) + ? Mongosconfig60Enterprise.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec60_Mongos { - const message = { ...baseMongodbspec60_Mongos } as Mongodbspec60_Mongos; + ): Mongodbspec60Enterprise_Mongos { + const message = { + ...baseMongodbspec60Enterprise_Mongos, + } as Mongodbspec60Enterprise_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig60.fromPartial(object.config) + ? Mongosconfig60Enterprise.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec60_Mongos.$type, Mongodbspec60_Mongos); +messageTypeRegistry.set( + Mongodbspec60Enterprise_Mongos.$type, + Mongodbspec60Enterprise_Mongos +); -const baseMongodbspec60_MongoInfra: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.MongoInfra", +const baseMongodbspec60Enterprise_MongoInfra: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.MongoInfra", }; -export const Mongodbspec60_MongoInfra = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0.MongoInfra" as const, +export const Mongodbspec60Enterprise_MongoInfra = { + $type: + "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.MongoInfra" as const, encode( - message: Mongodbspec60_MongoInfra, + message: Mongodbspec60Enterprise_MongoInfra, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.configMongos !== undefined) { - Mongosconfig60.encode( + Mongosconfig60Enterprise.encode( message.configMongos, writer.uint32(10).fork() ).ldelim(); } if (message.configMongocfg !== undefined) { - Mongocfgconfig60.encode( + Mongocfgconfig60Enterprise.encode( message.configMongocfg, writer.uint32(18).fork() ).ldelim(); @@ -11434,26 +13834,35 @@ export const Mongodbspec60_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec60_MongoInfra { + ): Mongodbspec60Enterprise_MongoInfra { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = { - ...baseMongodbspec60_MongoInfra, - } as Mongodbspec60_MongoInfra; + ...baseMongodbspec60Enterprise_MongoInfra, + } as Mongodbspec60Enterprise_MongoInfra; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.configMongos = Mongosconfig60.decode(reader, reader.uint32()); + message.configMongos = Mongosconfig60Enterprise.decode( + reader, + reader.uint32() + ); break; case 2: - message.configMongocfg = Mongocfgconfig60.decode( + message.configMongocfg = Mongocfgconfig60Enterprise.decode( reader, reader.uint32() ); @@ -11461,6 +13870,12 @@ export const Mongodbspec60_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -11469,139 +13884,142 @@ export const Mongodbspec60_MongoInfra = { return message; }, - fromJSON(object: any): Mongodbspec60_MongoInfra { + fromJSON(object: any): Mongodbspec60Enterprise_MongoInfra { const message = { - ...baseMongodbspec60_MongoInfra, - } as Mongodbspec60_MongoInfra; + ...baseMongodbspec60Enterprise_MongoInfra, + } as Mongodbspec60Enterprise_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig60.fromJSON(object.configMongos) + ? Mongosconfig60Enterprise.fromJSON(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig60.fromJSON(object.configMongocfg) + ? Mongocfgconfig60Enterprise.fromJSON(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec60_MongoInfra): unknown { + toJSON(message: Mongodbspec60Enterprise_MongoInfra): unknown { const obj: any = {}; message.configMongos !== undefined && (obj.configMongos = message.configMongos - ? Mongosconfig60.toJSON(message.configMongos) + ? Mongosconfig60Enterprise.toJSON(message.configMongos) : undefined); message.configMongocfg !== undefined && (obj.configMongocfg = message.configMongocfg - ? Mongocfgconfig60.toJSON(message.configMongocfg) + ? Mongocfgconfig60Enterprise.toJSON(message.configMongocfg) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( - object: I - ): Mongodbspec60_MongoInfra { + fromPartial< + I extends Exact, I> + >(object: I): Mongodbspec60Enterprise_MongoInfra { const message = { - ...baseMongodbspec60_MongoInfra, - } as Mongodbspec60_MongoInfra; + ...baseMongodbspec60Enterprise_MongoInfra, + } as Mongodbspec60Enterprise_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig60.fromPartial(object.configMongos) + ? Mongosconfig60Enterprise.fromPartial(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig60.fromPartial(object.configMongocfg) + ? Mongocfgconfig60Enterprise.fromPartial(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; messageTypeRegistry.set( - Mongodbspec60_MongoInfra.$type, - Mongodbspec60_MongoInfra + Mongodbspec60Enterprise_MongoInfra.$type, + Mongodbspec60Enterprise_MongoInfra ); -const baseMongodbspec60Enterprise: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise", +const baseMongodbSpec: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec", }; -export const Mongodbspec60Enterprise = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise" as const, +export const MongodbSpec = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec" as const, encode( - message: Mongodbspec60Enterprise, + message: MongodbSpec, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.mongod !== undefined) { - Mongodbspec60Enterprise_Mongod.encode( + MongodbSpec_Mongod.encode( message.mongod, writer.uint32(10).fork() ).ldelim(); } if (message.mongocfg !== undefined) { - Mongodbspec60Enterprise_MongoCfg.encode( + MongodbSpec_MongoCfg.encode( message.mongocfg, writer.uint32(18).fork() ).ldelim(); } if (message.mongos !== undefined) { - Mongodbspec60Enterprise_Mongos.encode( + MongodbSpec_Mongos.encode( message.mongos, writer.uint32(26).fork() ).ldelim(); } if (message.mongoinfra !== undefined) { - Mongodbspec60Enterprise_MongoInfra.encode( + MongodbSpec_MongoInfra.encode( message.mongoinfra, writer.uint32(34).fork() ).ldelim(); } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): Mongodbspec60Enterprise { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MongodbSpec { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec60Enterprise, - } as Mongodbspec60Enterprise; + const message = { ...baseMongodbSpec } as MongodbSpec; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mongod = Mongodbspec60Enterprise_Mongod.decode( - reader, - reader.uint32() - ); + message.mongod = MongodbSpec_Mongod.decode(reader, reader.uint32()); break; case 2: - message.mongocfg = Mongodbspec60Enterprise_MongoCfg.decode( + message.mongocfg = MongodbSpec_MongoCfg.decode( reader, reader.uint32() ); break; case 3: - message.mongos = Mongodbspec60Enterprise_Mongos.decode( - reader, - reader.uint32() - ); + message.mongos = MongodbSpec_Mongos.decode(reader, reader.uint32()); break; case 4: - message.mongoinfra = Mongodbspec60Enterprise_MongoInfra.decode( + message.mongoinfra = MongodbSpec_MongoInfra.decode( reader, reader.uint32() ); @@ -11614,123 +14032,119 @@ export const Mongodbspec60Enterprise = { return message; }, - fromJSON(object: any): Mongodbspec60Enterprise { - const message = { - ...baseMongodbspec60Enterprise, - } as Mongodbspec60Enterprise; + fromJSON(object: any): MongodbSpec { + const message = { ...baseMongodbSpec } as MongodbSpec; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec60Enterprise_Mongod.fromJSON(object.mongod) + ? MongodbSpec_Mongod.fromJSON(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec60Enterprise_MongoCfg.fromJSON(object.mongocfg) + ? MongodbSpec_MongoCfg.fromJSON(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec60Enterprise_Mongos.fromJSON(object.mongos) + ? MongodbSpec_Mongos.fromJSON(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec60Enterprise_MongoInfra.fromJSON(object.mongoinfra) + ? MongodbSpec_MongoInfra.fromJSON(object.mongoinfra) : undefined; return message; }, - toJSON(message: Mongodbspec60Enterprise): unknown { + toJSON(message: MongodbSpec): unknown { const obj: any = {}; message.mongod !== undefined && (obj.mongod = message.mongod - ? Mongodbspec60Enterprise_Mongod.toJSON(message.mongod) + ? MongodbSpec_Mongod.toJSON(message.mongod) : undefined); message.mongocfg !== undefined && (obj.mongocfg = message.mongocfg - ? Mongodbspec60Enterprise_MongoCfg.toJSON(message.mongocfg) + ? MongodbSpec_MongoCfg.toJSON(message.mongocfg) : undefined); message.mongos !== undefined && (obj.mongos = message.mongos - ? Mongodbspec60Enterprise_Mongos.toJSON(message.mongos) + ? MongodbSpec_Mongos.toJSON(message.mongos) : undefined); message.mongoinfra !== undefined && (obj.mongoinfra = message.mongoinfra - ? Mongodbspec60Enterprise_MongoInfra.toJSON(message.mongoinfra) + ? MongodbSpec_MongoInfra.toJSON(message.mongoinfra) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec60Enterprise { - const message = { - ...baseMongodbspec60Enterprise, - } as Mongodbspec60Enterprise; + ): MongodbSpec { + const message = { ...baseMongodbSpec } as MongodbSpec; message.mongod = object.mongod !== undefined && object.mongod !== null - ? Mongodbspec60Enterprise_Mongod.fromPartial(object.mongod) + ? MongodbSpec_Mongod.fromPartial(object.mongod) : undefined; message.mongocfg = object.mongocfg !== undefined && object.mongocfg !== null - ? Mongodbspec60Enterprise_MongoCfg.fromPartial(object.mongocfg) + ? MongodbSpec_MongoCfg.fromPartial(object.mongocfg) : undefined; message.mongos = object.mongos !== undefined && object.mongos !== null - ? Mongodbspec60Enterprise_Mongos.fromPartial(object.mongos) + ? MongodbSpec_Mongos.fromPartial(object.mongos) : undefined; message.mongoinfra = object.mongoinfra !== undefined && object.mongoinfra !== null - ? Mongodbspec60Enterprise_MongoInfra.fromPartial(object.mongoinfra) + ? MongodbSpec_MongoInfra.fromPartial(object.mongoinfra) : undefined; return message; }, }; -messageTypeRegistry.set(Mongodbspec60Enterprise.$type, Mongodbspec60Enterprise); +messageTypeRegistry.set(MongodbSpec.$type, MongodbSpec); -const baseMongodbspec60Enterprise_Mongod: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.Mongod", +const baseMongodbSpec_Mongod: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec.Mongod", }; -export const Mongodbspec60Enterprise_Mongod = { - $type: - "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.Mongod" as const, +export const MongodbSpec_Mongod = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec.Mongod" as const, encode( - message: Mongodbspec60Enterprise_Mongod, + message: MongodbSpec_Mongod, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongodconfig60Enterprise.encode( - message.config, - writer.uint32(10).fork() - ).ldelim(); + MongodConfig.encode(message.config, writer.uint32(10).fork()).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): Mongodbspec60Enterprise_Mongod { + decode(input: _m0.Reader | Uint8Array, length?: number): MongodbSpec_Mongod { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec60Enterprise_Mongod, - } as Mongodbspec60Enterprise_Mongod; + const message = { ...baseMongodbSpec_Mongod } as MongodbSpec_Mongod; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongodconfig60Enterprise.decode( - reader, - reader.uint32() - ); + message.config = MongodConfig.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -11739,102 +14153,112 @@ export const Mongodbspec60Enterprise_Mongod = { return message; }, - fromJSON(object: any): Mongodbspec60Enterprise_Mongod { - const message = { - ...baseMongodbspec60Enterprise_Mongod, - } as Mongodbspec60Enterprise_Mongod; + fromJSON(object: any): MongodbSpec_Mongod { + const message = { ...baseMongodbSpec_Mongod } as MongodbSpec_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig60Enterprise.fromJSON(object.config) + ? MongodConfig.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec60Enterprise_Mongod): unknown { + toJSON(message: MongodbSpec_Mongod): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongodconfig60Enterprise.toJSON(message.config) + ? MongodConfig.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec60Enterprise_Mongod { - const message = { - ...baseMongodbspec60Enterprise_Mongod, - } as Mongodbspec60Enterprise_Mongod; + ): MongodbSpec_Mongod { + const message = { ...baseMongodbSpec_Mongod } as MongodbSpec_Mongod; message.config = object.config !== undefined && object.config !== null - ? Mongodconfig60Enterprise.fromPartial(object.config) + ? MongodConfig.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set( - Mongodbspec60Enterprise_Mongod.$type, - Mongodbspec60Enterprise_Mongod -); +messageTypeRegistry.set(MongodbSpec_Mongod.$type, MongodbSpec_Mongod); -const baseMongodbspec60Enterprise_MongoCfg: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.MongoCfg", +const baseMongodbSpec_MongoCfg: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec.MongoCfg", }; -export const Mongodbspec60Enterprise_MongoCfg = { - $type: - "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.MongoCfg" as const, +export const MongodbSpec_MongoCfg = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec.MongoCfg" as const, encode( - message: Mongodbspec60Enterprise_MongoCfg, + message: MongodbSpec_MongoCfg, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongocfgconfig60Enterprise.encode( - message.config, - writer.uint32(10).fork() - ).ldelim(); + MongoCfgConfig.encode(message.config, writer.uint32(10).fork()).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec60Enterprise_MongoCfg { + ): MongodbSpec_MongoCfg { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec60Enterprise_MongoCfg, - } as Mongodbspec60Enterprise_MongoCfg; + const message = { ...baseMongodbSpec_MongoCfg } as MongodbSpec_MongoCfg; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongocfgconfig60Enterprise.decode( - reader, - reader.uint32() - ); + message.config = MongoCfgConfig.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -11843,102 +14267,109 @@ export const Mongodbspec60Enterprise_MongoCfg = { return message; }, - fromJSON(object: any): Mongodbspec60Enterprise_MongoCfg { - const message = { - ...baseMongodbspec60Enterprise_MongoCfg, - } as Mongodbspec60Enterprise_MongoCfg; + fromJSON(object: any): MongodbSpec_MongoCfg { + const message = { ...baseMongodbSpec_MongoCfg } as MongodbSpec_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig60Enterprise.fromJSON(object.config) + ? MongoCfgConfig.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec60Enterprise_MongoCfg): unknown { + toJSON(message: MongodbSpec_MongoCfg): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongocfgconfig60Enterprise.toJSON(message.config) + ? MongoCfgConfig.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial< - I extends Exact, I> - >(object: I): Mongodbspec60Enterprise_MongoCfg { - const message = { - ...baseMongodbspec60Enterprise_MongoCfg, - } as Mongodbspec60Enterprise_MongoCfg; + fromPartial, I>>( + object: I + ): MongodbSpec_MongoCfg { + const message = { ...baseMongodbSpec_MongoCfg } as MongodbSpec_MongoCfg; message.config = object.config !== undefined && object.config !== null - ? Mongocfgconfig60Enterprise.fromPartial(object.config) + ? MongoCfgConfig.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set( - Mongodbspec60Enterprise_MongoCfg.$type, - Mongodbspec60Enterprise_MongoCfg -); +messageTypeRegistry.set(MongodbSpec_MongoCfg.$type, MongodbSpec_MongoCfg); -const baseMongodbspec60Enterprise_Mongos: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.Mongos", +const baseMongodbSpec_Mongos: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec.Mongos", }; -export const Mongodbspec60Enterprise_Mongos = { - $type: - "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.Mongos" as const, +export const MongodbSpec_Mongos = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec.Mongos" as const, encode( - message: Mongodbspec60Enterprise_Mongos, + message: MongodbSpec_Mongos, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.config !== undefined) { - Mongosconfig60Enterprise.encode( - message.config, - writer.uint32(10).fork() - ).ldelim(); + MongosConfig.encode(message.config, writer.uint32(10).fork()).ldelim(); } if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(18).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): Mongodbspec60Enterprise_Mongos { + decode(input: _m0.Reader | Uint8Array, length?: number): MongodbSpec_Mongos { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec60Enterprise_Mongos, - } as Mongodbspec60Enterprise_Mongos; + const message = { ...baseMongodbSpec_Mongos } as MongodbSpec_Mongos; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.config = Mongosconfig60Enterprise.decode( - reader, - reader.uint32() - ); + message.config = MongosConfig.decode(reader, reader.uint32()); break; case 2: message.resources = Resources.decode(reader, reader.uint32()); break; + case 3: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -11947,77 +14378,83 @@ export const Mongodbspec60Enterprise_Mongos = { return message; }, - fromJSON(object: any): Mongodbspec60Enterprise_Mongos { - const message = { - ...baseMongodbspec60Enterprise_Mongos, - } as Mongodbspec60Enterprise_Mongos; + fromJSON(object: any): MongodbSpec_Mongos { + const message = { ...baseMongodbSpec_Mongos } as MongodbSpec_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig60Enterprise.fromJSON(object.config) + ? MongosConfig.fromJSON(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec60Enterprise_Mongos): unknown { + toJSON(message: MongodbSpec_Mongos): unknown { const obj: any = {}; message.config !== undefined && (obj.config = message.config - ? Mongosconfig60Enterprise.toJSON(message.config) + ? MongosConfig.toJSON(message.config) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I - ): Mongodbspec60Enterprise_Mongos { - const message = { - ...baseMongodbspec60Enterprise_Mongos, - } as Mongodbspec60Enterprise_Mongos; + ): MongodbSpec_Mongos { + const message = { ...baseMongodbSpec_Mongos } as MongodbSpec_Mongos; message.config = object.config !== undefined && object.config !== null - ? Mongosconfig60Enterprise.fromPartial(object.config) + ? MongosConfig.fromPartial(object.config) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set( - Mongodbspec60Enterprise_Mongos.$type, - Mongodbspec60Enterprise_Mongos -); +messageTypeRegistry.set(MongodbSpec_Mongos.$type, MongodbSpec_Mongos); -const baseMongodbspec60Enterprise_MongoInfra: object = { - $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.MongoInfra", +const baseMongodbSpec_MongoInfra: object = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec.MongoInfra", }; -export const Mongodbspec60Enterprise_MongoInfra = { - $type: - "yandex.cloud.mdb.mongodb.v1.MongodbSpec6_0_enterprise.MongoInfra" as const, +export const MongodbSpec_MongoInfra = { + $type: "yandex.cloud.mdb.mongodb.v1.MongodbSpec.MongoInfra" as const, encode( - message: Mongodbspec60Enterprise_MongoInfra, + message: MongodbSpec_MongoInfra, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.configMongos !== undefined) { - Mongosconfig60Enterprise.encode( + MongosConfig.encode( message.configMongos, writer.uint32(10).fork() ).ldelim(); } if (message.configMongocfg !== undefined) { - Mongocfgconfig60Enterprise.encode( + MongoCfgConfig.encode( message.configMongocfg, writer.uint32(18).fork() ).ldelim(); @@ -12025,29 +14462,30 @@ export const Mongodbspec60Enterprise_MongoInfra = { if (message.resources !== undefined) { Resources.encode(message.resources, writer.uint32(26).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number - ): Mongodbspec60Enterprise_MongoInfra { + ): MongodbSpec_MongoInfra { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = { - ...baseMongodbspec60Enterprise_MongoInfra, - } as Mongodbspec60Enterprise_MongoInfra; + const message = { ...baseMongodbSpec_MongoInfra } as MongodbSpec_MongoInfra; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.configMongos = Mongosconfig60Enterprise.decode( - reader, - reader.uint32() - ); + message.configMongos = MongosConfig.decode(reader, reader.uint32()); break; case 2: - message.configMongocfg = Mongocfgconfig60Enterprise.decode( + message.configMongocfg = MongoCfgConfig.decode( reader, reader.uint32() ); @@ -12055,6 +14493,12 @@ export const Mongodbspec60Enterprise_MongoInfra = { case 3: message.resources = Resources.decode(reader, reader.uint32()); break; + case 4: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -12063,68 +14507,75 @@ export const Mongodbspec60Enterprise_MongoInfra = { return message; }, - fromJSON(object: any): Mongodbspec60Enterprise_MongoInfra { - const message = { - ...baseMongodbspec60Enterprise_MongoInfra, - } as Mongodbspec60Enterprise_MongoInfra; + fromJSON(object: any): MongodbSpec_MongoInfra { + const message = { ...baseMongodbSpec_MongoInfra } as MongodbSpec_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig60Enterprise.fromJSON(object.configMongos) + ? MongosConfig.fromJSON(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig60Enterprise.fromJSON(object.configMongocfg) + ? MongoCfgConfig.fromJSON(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromJSON(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, - toJSON(message: Mongodbspec60Enterprise_MongoInfra): unknown { + toJSON(message: MongodbSpec_MongoInfra): unknown { const obj: any = {}; message.configMongos !== undefined && (obj.configMongos = message.configMongos - ? Mongosconfig60Enterprise.toJSON(message.configMongos) + ? MongosConfig.toJSON(message.configMongos) : undefined); message.configMongocfg !== undefined && (obj.configMongocfg = message.configMongocfg - ? Mongocfgconfig60Enterprise.toJSON(message.configMongocfg) + ? MongoCfgConfig.toJSON(message.configMongocfg) : undefined); message.resources !== undefined && (obj.resources = message.resources ? Resources.toJSON(message.resources) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, - fromPartial< - I extends Exact, I> - >(object: I): Mongodbspec60Enterprise_MongoInfra { - const message = { - ...baseMongodbspec60Enterprise_MongoInfra, - } as Mongodbspec60Enterprise_MongoInfra; + fromPartial, I>>( + object: I + ): MongodbSpec_MongoInfra { + const message = { ...baseMongodbSpec_MongoInfra } as MongodbSpec_MongoInfra; message.configMongos = object.configMongos !== undefined && object.configMongos !== null - ? Mongosconfig60Enterprise.fromPartial(object.configMongos) + ? MongosConfig.fromPartial(object.configMongos) : undefined; message.configMongocfg = object.configMongocfg !== undefined && object.configMongocfg !== null - ? Mongocfgconfig60Enterprise.fromPartial(object.configMongocfg) + ? MongoCfgConfig.fromPartial(object.configMongocfg) : undefined; message.resources = object.resources !== undefined && object.resources !== null ? Resources.fromPartial(object.resources) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; -messageTypeRegistry.set( - Mongodbspec60Enterprise_MongoInfra.$type, - Mongodbspec60Enterprise_MongoInfra -); +messageTypeRegistry.set(MongodbSpec_MongoInfra.$type, MongodbSpec_MongoInfra); const baseConfigSpec: object = { $type: "yandex.cloud.mdb.mongodb.v1.ConfigSpec", @@ -12223,6 +14674,9 @@ export const ConfigSpec = { if (message.access !== undefined) { Access.encode(message.access, writer.uint32(50).fork()).ldelim(); } + if (message.mongodb !== undefined) { + MongodbSpec.encode(message.mongodb, writer.uint32(162).fork()).ldelim(); + } return writer; }, @@ -12293,6 +14747,9 @@ export const ConfigSpec = { case 6: message.access = Access.decode(reader, reader.uint32()); break; + case 20: + message.mongodb = MongodbSpec.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -12370,6 +14827,10 @@ export const ConfigSpec = { object.access !== undefined && object.access !== null ? Access.fromJSON(object.access) : undefined; + message.mongodb = + object.mongodb !== undefined && object.mongodb !== null + ? MongodbSpec.fromJSON(object.mongodb) + : undefined; return message; }, @@ -12426,6 +14887,10 @@ export const ConfigSpec = { : undefined); message.access !== undefined && (obj.access = message.access ? Access.toJSON(message.access) : undefined); + message.mongodb !== undefined && + (obj.mongodb = message.mongodb + ? MongodbSpec.toJSON(message.mongodb) + : undefined); return obj; }, @@ -12492,6 +14957,10 @@ export const ConfigSpec = { object.access !== undefined && object.access !== null ? Access.fromPartial(object.access) : undefined; + message.mongodb = + object.mongodb !== undefined && object.mongodb !== null + ? MongodbSpec.fromPartial(object.mongodb) + : undefined; return message; }, }; @@ -12736,6 +15205,19 @@ export const ClusterServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Updates the specified parameters for the host. */ + updateHosts: { + path: "/yandex.cloud.mdb.mongodb.v1.ClusterService/UpdateHosts", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateClusterHostsRequest) => + Buffer.from(UpdateClusterHostsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateClusterHostsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, /** * Enables sharding for the cluster: * creates 3 mongoinfra (or 3 mongocfg and 2 mongos) hosts @@ -12901,6 +15383,8 @@ export interface ClusterServiceServer extends UntypedServiceImplementation { addHosts: handleUnaryCall; /** Deletes the specified hosts for a cluster. */ deleteHosts: handleUnaryCall; + /** Updates the specified parameters for the host. */ + updateHosts: handleUnaryCall; /** * Enables sharding for the cluster: * creates 3 mongoinfra (or 3 mongocfg and 2 mongos) hosts @@ -13264,6 +15748,22 @@ export interface ClusterServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Updates the specified parameters for the host. */ + updateHosts( + request: UpdateClusterHostsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateHosts( + request: UpdateClusterHostsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateHosts( + request: UpdateClusterHostsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; /** * Enables sharding for the cluster: * creates 3 mongoinfra (or 3 mongocfg and 2 mongos) hosts diff --git a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb.ts b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb.ts new file mode 100644 index 00000000..1fb3da60 --- /dev/null +++ b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb.ts @@ -0,0 +1,3279 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + DoubleValue, + BoolValue, + Int64Value, +} from "../../../../../../google/protobuf/wrappers"; + +export const protobufPackage = "yandex.cloud.mdb.mongodb.v1.config"; + +/** + * Configuration of a mongod daemon. Supported options are a limited subset of all + * options described in [MongoDB documentation](https://docs.mongodb.com/v7.0/reference/configuration-options/). + */ +export interface MongodConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig"; + /** `storage` section of mongod configuration. */ + storage?: MongodConfig_Storage; + /** `operationProfiling` section of mongod configuration. */ + operationProfiling?: MongodConfig_OperationProfiling; + /** `net` section of mongod configuration. */ + net?: MongodConfig_Network; + /** `security` section of mongod configuration. */ + security?: MongodConfig_Security; + /** `AuditLog` section of mongod configuration. */ + auditLog?: MongodConfig_AuditLog; + /** `SetParameter` section of mongod configuration. */ + setParameter?: MongodConfig_SetParameter; +} + +export interface MongodConfig_Storage { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage"; + /** Configuration of the WiredTiger storage engine. */ + wiredTiger?: MongodConfig_Storage_WiredTiger; + /** Configuration of the MongoDB [journal](https://docs.mongodb.com/v7.0/reference/glossary/#std-term-journal). */ + journal?: MongodConfig_Storage_Journal; +} + +/** Configuration of WiredTiger storage engine. */ +export interface MongodConfig_Storage_WiredTiger { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.WiredTiger"; + /** Engine configuration for WiredTiger. */ + engineConfig?: MongodConfig_Storage_WiredTiger_EngineConfig; + /** Collection configuration for WiredTiger. */ + collectionConfig?: MongodConfig_Storage_WiredTiger_CollectionConfig; + /** Index configuration for WiredTiger */ + indexConfig?: MongodConfig_Storage_WiredTiger_IndexConfig; +} + +export interface MongodConfig_Storage_WiredTiger_EngineConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.WiredTiger.EngineConfig"; + /** The maximum size of the internal cache that WiredTiger will use for all data. */ + cacheSizeGb?: number; +} + +export interface MongodConfig_Storage_WiredTiger_CollectionConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.WiredTiger.CollectionConfig"; + /** Default type of compression to use for collection data. */ + blockCompressor: MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor; +} + +export enum MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** NONE - No compression. */ + NONE = 1, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v7.0/reference/glossary/#std-term-snappy) compression. */ + SNAPPY = 2, + /** ZLIB - The [zlib](https://docs.mongodb.com/v7.0/reference/glossary/#std-term-zlib) compression. */ + ZLIB = 3, + /** ZSTD - The [zstd](https://docs.mongodb.com/v7.0/reference/glossary/#std-term-zstd) compression. */ + ZSTD = 4, + UNRECOGNIZED = -1, +} + +export function mongodConfig_Storage_WiredTiger_CollectionConfig_CompressorFromJSON( + object: any +): MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "NONE": + return MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor.NONE; + case 2: + case "SNAPPY": + return MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor.SNAPPY; + case 3: + case "ZLIB": + return MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor.ZLIB; + case 4: + case "ZSTD": + return MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor.ZSTD; + case -1: + case "UNRECOGNIZED": + default: + return MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor.UNRECOGNIZED; + } +} + +export function mongodConfig_Storage_WiredTiger_CollectionConfig_CompressorToJSON( + object: MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor +): string { + switch (object) { + case MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor.NONE: + return "NONE"; + case MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor.SNAPPY: + return "SNAPPY"; + case MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor.ZLIB: + return "ZLIB"; + case MongodConfig_Storage_WiredTiger_CollectionConfig_Compressor.ZSTD: + return "ZSTD"; + default: + return "UNKNOWN"; + } +} + +export interface MongodConfig_Storage_WiredTiger_IndexConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.WiredTiger.IndexConfig"; + /** Enables or disables [prefix compression](https://www.mongodb.com/docs/manual/reference/glossary/#std-term-prefix-compression) */ + prefixCompression?: boolean; +} + +export interface MongodConfig_Storage_Journal { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.Journal"; + /** + * Commit interval between journal operations, in milliseconds. + * Default: 100. + */ + commitInterval?: number; +} + +export interface MongodConfig_OperationProfiling { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.OperationProfiling"; + /** Mode which specifies operations that should be profiled. */ + mode: MongodConfig_OperationProfiling_Mode; + /** + * The slow operation time threshold, in milliseconds. Operations that run + * for longer than this threshold are considered slow, and are processed by the profiler + * running in the SLOW_OP mode. + */ + slowOpThreshold?: number; + /** + * The fraction of slow operations that should be profiled or logged. + * operationProfiling.slowOpSampleRate accepts values between 0 and 1, inclusive. + */ + slowOpSampleRate?: number; +} + +export enum MongodConfig_OperationProfiling_Mode { + MODE_UNSPECIFIED = 0, + /** OFF - The profiler is off and does not collect any data. */ + OFF = 1, + /** SLOW_OP - The profiler collects data for operations that take longer than the value of [slow_op_threshold]. */ + SLOW_OP = 2, + /** ALL - The profiler collects data for all operations. */ + ALL = 3, + UNRECOGNIZED = -1, +} + +export function mongodConfig_OperationProfiling_ModeFromJSON( + object: any +): MongodConfig_OperationProfiling_Mode { + switch (object) { + case 0: + case "MODE_UNSPECIFIED": + return MongodConfig_OperationProfiling_Mode.MODE_UNSPECIFIED; + case 1: + case "OFF": + return MongodConfig_OperationProfiling_Mode.OFF; + case 2: + case "SLOW_OP": + return MongodConfig_OperationProfiling_Mode.SLOW_OP; + case 3: + case "ALL": + return MongodConfig_OperationProfiling_Mode.ALL; + case -1: + case "UNRECOGNIZED": + default: + return MongodConfig_OperationProfiling_Mode.UNRECOGNIZED; + } +} + +export function mongodConfig_OperationProfiling_ModeToJSON( + object: MongodConfig_OperationProfiling_Mode +): string { + switch (object) { + case MongodConfig_OperationProfiling_Mode.MODE_UNSPECIFIED: + return "MODE_UNSPECIFIED"; + case MongodConfig_OperationProfiling_Mode.OFF: + return "OFF"; + case MongodConfig_OperationProfiling_Mode.SLOW_OP: + return "SLOW_OP"; + case MongodConfig_OperationProfiling_Mode.ALL: + return "ALL"; + default: + return "UNKNOWN"; + } +} + +export interface MongodConfig_Network { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Network"; + /** The maximum number of simultaneous connections that mongod will accept. */ + maxIncomingConnections?: number; + /** Compression settings */ + compression?: MongodConfig_Network_Compression; +} + +export interface MongodConfig_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: MongodConfig_Network_Compression_Compressor[]; +} + +export enum MongodConfig_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongodConfig_Network_Compression_CompressorFromJSON( + object: any +): MongodConfig_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return MongodConfig_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return MongodConfig_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return MongodConfig_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return MongodConfig_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return MongodConfig_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return MongodConfig_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongodConfig_Network_Compression_CompressorToJSON( + object: MongodConfig_Network_Compression_Compressor +): string { + switch (object) { + case MongodConfig_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case MongodConfig_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case MongodConfig_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case MongodConfig_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case MongodConfig_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } +} + +export interface MongodConfig_Security { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Security"; + /** If encryption at rest should be enabled or not */ + enableEncryption?: boolean; + /** `kmip` section of mongod security config */ + kmip?: MongodConfig_Security_KMIP; +} + +export interface MongodConfig_Security_KMIP { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Security.KMIP"; + /** KMIP server name */ + serverName: string; + /** KMIP server port */ + port?: number; + /** KMIP Server CA */ + serverCa: string; + /** KMIP client certificate + private key (unencrypted) */ + clientCertificate: string; + /** KMIP Key identifier (if any) */ + keyIdentifier: string; +} + +export interface MongodConfig_AuditLog { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.AuditLog"; + /** Audit filter */ + filter: string; + /** Allows runtime configuration of audit filter and auditAuthorizationSuccess */ + runtimeConfiguration?: boolean; +} + +export interface MongodConfig_SetParameter { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.SetParameter"; + /** Enables the auditing of authorization successes */ + auditAuthorizationSuccess?: boolean; + /** + * Enables or disables the mechanism that controls the rate at which the primary applies its writes with the + * goal of keeping the secondary members [majority committed](https://www.mongodb.com/docs/v7.0/reference/command/replSetGetStatus/#replSetGetStatus.optimes.lastCommittedOpTime) + * lag under a configurable maximum value. + */ + enableFlowControl?: boolean; + /** The minimum time window in seconds for which the storage engine keeps the snapshot history. */ + minSnapshotHistoryWindowInSeconds?: number; +} + +export interface MongoCfgConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig"; + /** `storage` section of mongocfg configuration. */ + storage?: MongoCfgConfig_Storage; + /** `operationProfiling` section of mongocfg configuration. */ + operationProfiling?: MongoCfgConfig_OperationProfiling; + /** `net` section of mongocfg configuration. */ + net?: MongoCfgConfig_Network; +} + +export interface MongoCfgConfig_Storage { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.Storage"; + /** Configuration of the WiredTiger storage engine. */ + wiredTiger?: MongoCfgConfig_Storage_WiredTiger; +} + +/** Configuration of WiredTiger storage engine. */ +export interface MongoCfgConfig_Storage_WiredTiger { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.Storage.WiredTiger"; + /** Engine configuration for WiredTiger. */ + engineConfig?: MongoCfgConfig_Storage_WiredTiger_EngineConfig; +} + +export interface MongoCfgConfig_Storage_WiredTiger_EngineConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.Storage.WiredTiger.EngineConfig"; + /** The maximum size of the internal cache that WiredTiger will use for all data. */ + cacheSizeGb?: number; +} + +export interface MongoCfgConfig_OperationProfiling { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.OperationProfiling"; + /** Mode which specifies operations that should be profiled. */ + mode: MongoCfgConfig_OperationProfiling_Mode; + /** + * The slow operation time threshold, in milliseconds. Operations that run + * for longer than this threshold are considered slow, and are processed by the profiler + * running in the SLOW_OP mode. For details see [MongoDB documentation](https://www.mongodb.com/docs/v7.0/reference/configuration-options/#mongodb-setting-operationProfiling.slowOpThresholdMs). + */ + slowOpThreshold?: number; +} + +export enum MongoCfgConfig_OperationProfiling_Mode { + MODE_UNSPECIFIED = 0, + /** OFF - The profiler is off and does not collect any data. */ + OFF = 1, + /** SLOW_OP - The profiler collects data for operations that take longer than the value of [slow_op_threshold]. */ + SLOW_OP = 2, + /** ALL - The profiler collects data for all operations. */ + ALL = 3, + UNRECOGNIZED = -1, +} + +export function mongoCfgConfig_OperationProfiling_ModeFromJSON( + object: any +): MongoCfgConfig_OperationProfiling_Mode { + switch (object) { + case 0: + case "MODE_UNSPECIFIED": + return MongoCfgConfig_OperationProfiling_Mode.MODE_UNSPECIFIED; + case 1: + case "OFF": + return MongoCfgConfig_OperationProfiling_Mode.OFF; + case 2: + case "SLOW_OP": + return MongoCfgConfig_OperationProfiling_Mode.SLOW_OP; + case 3: + case "ALL": + return MongoCfgConfig_OperationProfiling_Mode.ALL; + case -1: + case "UNRECOGNIZED": + default: + return MongoCfgConfig_OperationProfiling_Mode.UNRECOGNIZED; + } +} + +export function mongoCfgConfig_OperationProfiling_ModeToJSON( + object: MongoCfgConfig_OperationProfiling_Mode +): string { + switch (object) { + case MongoCfgConfig_OperationProfiling_Mode.MODE_UNSPECIFIED: + return "MODE_UNSPECIFIED"; + case MongoCfgConfig_OperationProfiling_Mode.OFF: + return "OFF"; + case MongoCfgConfig_OperationProfiling_Mode.SLOW_OP: + return "SLOW_OP"; + case MongoCfgConfig_OperationProfiling_Mode.ALL: + return "ALL"; + default: + return "UNKNOWN"; + } +} + +export interface MongoCfgConfig_Network { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.Network"; + /** The maximum number of simultaneous connections that mongocfg will accept. */ + maxIncomingConnections?: number; +} + +export interface MongosConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig"; + /** Network settings for mongos. */ + net?: MongosConfig_Network; +} + +export interface MongosConfig_Network { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig.Network"; + /** The maximum number of simultaneous connections that mongos will accept. */ + maxIncomingConnections?: number; + /** Compression settings */ + compression?: MongosConfig_Network_Compression; +} + +export interface MongosConfig_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: MongosConfig_Network_Compression_Compressor[]; +} + +export enum MongosConfig_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongosConfig_Network_Compression_CompressorFromJSON( + object: any +): MongosConfig_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return MongosConfig_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return MongosConfig_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return MongosConfig_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return MongosConfig_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return MongosConfig_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return MongosConfig_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongosConfig_Network_Compression_CompressorToJSON( + object: MongosConfig_Network_Compression_Compressor +): string { + switch (object) { + case MongosConfig_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case MongosConfig_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case MongosConfig_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case MongosConfig_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case MongosConfig_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } +} + +export interface MongodConfigSet { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfigSet"; + /** + * Effective mongod settings for a MongoDB cluster (a combination of settings defined + * in [user_config] and [default_config]). + */ + effectiveConfig?: MongodConfig; + /** User-defined mongod settings for a MongoDB cluster. */ + userConfig?: MongodConfig; + /** Default mongod configuration for a MongoDB cluster. */ + defaultConfig?: MongodConfig; +} + +export interface MongoCfgConfigSet { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfigSet"; + /** + * Effective mongocfg settings for a MongoDB cluster (a combination of settings defined + * in [user_config] and [default_config]). + */ + effectiveConfig?: MongoCfgConfig; + /** User-defined mongocfg settings for a MongoDB cluster. */ + userConfig?: MongoCfgConfig; + /** Default mongocfg configuration for a MongoDB cluster. */ + defaultConfig?: MongoCfgConfig; +} + +export interface MongosConfigSet { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfigSet"; + /** + * Effective mongos settings for a MongoDB cluster (a combination of settings defined + * in [user_config] and [default_config]). + */ + effectiveConfig?: MongosConfig; + /** User-defined mongos settings for a MongoDB cluster. */ + userConfig?: MongosConfig; + /** Default mongos configuration for a MongoDB cluster. */ + defaultConfig?: MongosConfig; +} + +const baseMongodConfig: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig", +}; + +export const MongodConfig = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig" as const, + + encode( + message: MongodConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.storage !== undefined) { + MongodConfig_Storage.encode( + message.storage, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.operationProfiling !== undefined) { + MongodConfig_OperationProfiling.encode( + message.operationProfiling, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.net !== undefined) { + MongodConfig_Network.encode( + message.net, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.security !== undefined) { + MongodConfig_Security.encode( + message.security, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.auditLog !== undefined) { + MongodConfig_AuditLog.encode( + message.auditLog, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.setParameter !== undefined) { + MongodConfig_SetParameter.encode( + message.setParameter, + writer.uint32(50).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MongodConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongodConfig } as MongodConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.storage = MongodConfig_Storage.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.operationProfiling = MongodConfig_OperationProfiling.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.net = MongodConfig_Network.decode(reader, reader.uint32()); + break; + case 4: + message.security = MongodConfig_Security.decode( + reader, + reader.uint32() + ); + break; + case 5: + message.auditLog = MongodConfig_AuditLog.decode( + reader, + reader.uint32() + ); + break; + case 6: + message.setParameter = MongodConfig_SetParameter.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig { + const message = { ...baseMongodConfig } as MongodConfig; + message.storage = + object.storage !== undefined && object.storage !== null + ? MongodConfig_Storage.fromJSON(object.storage) + : undefined; + message.operationProfiling = + object.operationProfiling !== undefined && + object.operationProfiling !== null + ? MongodConfig_OperationProfiling.fromJSON(object.operationProfiling) + : undefined; + message.net = + object.net !== undefined && object.net !== null + ? MongodConfig_Network.fromJSON(object.net) + : undefined; + message.security = + object.security !== undefined && object.security !== null + ? MongodConfig_Security.fromJSON(object.security) + : undefined; + message.auditLog = + object.auditLog !== undefined && object.auditLog !== null + ? MongodConfig_AuditLog.fromJSON(object.auditLog) + : undefined; + message.setParameter = + object.setParameter !== undefined && object.setParameter !== null + ? MongodConfig_SetParameter.fromJSON(object.setParameter) + : undefined; + return message; + }, + + toJSON(message: MongodConfig): unknown { + const obj: any = {}; + message.storage !== undefined && + (obj.storage = message.storage + ? MongodConfig_Storage.toJSON(message.storage) + : undefined); + message.operationProfiling !== undefined && + (obj.operationProfiling = message.operationProfiling + ? MongodConfig_OperationProfiling.toJSON(message.operationProfiling) + : undefined); + message.net !== undefined && + (obj.net = message.net + ? MongodConfig_Network.toJSON(message.net) + : undefined); + message.security !== undefined && + (obj.security = message.security + ? MongodConfig_Security.toJSON(message.security) + : undefined); + message.auditLog !== undefined && + (obj.auditLog = message.auditLog + ? MongodConfig_AuditLog.toJSON(message.auditLog) + : undefined); + message.setParameter !== undefined && + (obj.setParameter = message.setParameter + ? MongodConfig_SetParameter.toJSON(message.setParameter) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongodConfig { + const message = { ...baseMongodConfig } as MongodConfig; + message.storage = + object.storage !== undefined && object.storage !== null + ? MongodConfig_Storage.fromPartial(object.storage) + : undefined; + message.operationProfiling = + object.operationProfiling !== undefined && + object.operationProfiling !== null + ? MongodConfig_OperationProfiling.fromPartial(object.operationProfiling) + : undefined; + message.net = + object.net !== undefined && object.net !== null + ? MongodConfig_Network.fromPartial(object.net) + : undefined; + message.security = + object.security !== undefined && object.security !== null + ? MongodConfig_Security.fromPartial(object.security) + : undefined; + message.auditLog = + object.auditLog !== undefined && object.auditLog !== null + ? MongodConfig_AuditLog.fromPartial(object.auditLog) + : undefined; + message.setParameter = + object.setParameter !== undefined && object.setParameter !== null + ? MongodConfig_SetParameter.fromPartial(object.setParameter) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MongodConfig.$type, MongodConfig); + +const baseMongodConfig_Storage: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage", +}; + +export const MongodConfig_Storage = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage" as const, + + encode( + message: MongodConfig_Storage, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.wiredTiger !== undefined) { + MongodConfig_Storage_WiredTiger.encode( + message.wiredTiger, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.journal !== undefined) { + MongodConfig_Storage_Journal.encode( + message.journal, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongodConfig_Storage { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongodConfig_Storage } as MongodConfig_Storage; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wiredTiger = MongodConfig_Storage_WiredTiger.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.journal = MongodConfig_Storage_Journal.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig_Storage { + const message = { ...baseMongodConfig_Storage } as MongodConfig_Storage; + message.wiredTiger = + object.wiredTiger !== undefined && object.wiredTiger !== null + ? MongodConfig_Storage_WiredTiger.fromJSON(object.wiredTiger) + : undefined; + message.journal = + object.journal !== undefined && object.journal !== null + ? MongodConfig_Storage_Journal.fromJSON(object.journal) + : undefined; + return message; + }, + + toJSON(message: MongodConfig_Storage): unknown { + const obj: any = {}; + message.wiredTiger !== undefined && + (obj.wiredTiger = message.wiredTiger + ? MongodConfig_Storage_WiredTiger.toJSON(message.wiredTiger) + : undefined); + message.journal !== undefined && + (obj.journal = message.journal + ? MongodConfig_Storage_Journal.toJSON(message.journal) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongodConfig_Storage { + const message = { ...baseMongodConfig_Storage } as MongodConfig_Storage; + message.wiredTiger = + object.wiredTiger !== undefined && object.wiredTiger !== null + ? MongodConfig_Storage_WiredTiger.fromPartial(object.wiredTiger) + : undefined; + message.journal = + object.journal !== undefined && object.journal !== null + ? MongodConfig_Storage_Journal.fromPartial(object.journal) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MongodConfig_Storage.$type, MongodConfig_Storage); + +const baseMongodConfig_Storage_WiredTiger: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.WiredTiger", +}; + +export const MongodConfig_Storage_WiredTiger = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.WiredTiger" as const, + + encode( + message: MongodConfig_Storage_WiredTiger, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.engineConfig !== undefined) { + MongodConfig_Storage_WiredTiger_EngineConfig.encode( + message.engineConfig, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.collectionConfig !== undefined) { + MongodConfig_Storage_WiredTiger_CollectionConfig.encode( + message.collectionConfig, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.indexConfig !== undefined) { + MongodConfig_Storage_WiredTiger_IndexConfig.encode( + message.indexConfig, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongodConfig_Storage_WiredTiger { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodConfig_Storage_WiredTiger, + } as MongodConfig_Storage_WiredTiger; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.engineConfig = + MongodConfig_Storage_WiredTiger_EngineConfig.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.collectionConfig = + MongodConfig_Storage_WiredTiger_CollectionConfig.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.indexConfig = + MongodConfig_Storage_WiredTiger_IndexConfig.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig_Storage_WiredTiger { + const message = { + ...baseMongodConfig_Storage_WiredTiger, + } as MongodConfig_Storage_WiredTiger; + message.engineConfig = + object.engineConfig !== undefined && object.engineConfig !== null + ? MongodConfig_Storage_WiredTiger_EngineConfig.fromJSON( + object.engineConfig + ) + : undefined; + message.collectionConfig = + object.collectionConfig !== undefined && object.collectionConfig !== null + ? MongodConfig_Storage_WiredTiger_CollectionConfig.fromJSON( + object.collectionConfig + ) + : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? MongodConfig_Storage_WiredTiger_IndexConfig.fromJSON( + object.indexConfig + ) + : undefined; + return message; + }, + + toJSON(message: MongodConfig_Storage_WiredTiger): unknown { + const obj: any = {}; + message.engineConfig !== undefined && + (obj.engineConfig = message.engineConfig + ? MongodConfig_Storage_WiredTiger_EngineConfig.toJSON( + message.engineConfig + ) + : undefined); + message.collectionConfig !== undefined && + (obj.collectionConfig = message.collectionConfig + ? MongodConfig_Storage_WiredTiger_CollectionConfig.toJSON( + message.collectionConfig + ) + : undefined); + message.indexConfig !== undefined && + (obj.indexConfig = message.indexConfig + ? MongodConfig_Storage_WiredTiger_IndexConfig.toJSON( + message.indexConfig + ) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongodConfig_Storage_WiredTiger { + const message = { + ...baseMongodConfig_Storage_WiredTiger, + } as MongodConfig_Storage_WiredTiger; + message.engineConfig = + object.engineConfig !== undefined && object.engineConfig !== null + ? MongodConfig_Storage_WiredTiger_EngineConfig.fromPartial( + object.engineConfig + ) + : undefined; + message.collectionConfig = + object.collectionConfig !== undefined && object.collectionConfig !== null + ? MongodConfig_Storage_WiredTiger_CollectionConfig.fromPartial( + object.collectionConfig + ) + : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? MongodConfig_Storage_WiredTiger_IndexConfig.fromPartial( + object.indexConfig + ) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + MongodConfig_Storage_WiredTiger.$type, + MongodConfig_Storage_WiredTiger +); + +const baseMongodConfig_Storage_WiredTiger_EngineConfig: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.WiredTiger.EngineConfig", +}; + +export const MongodConfig_Storage_WiredTiger_EngineConfig = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.WiredTiger.EngineConfig" as const, + + encode( + message: MongodConfig_Storage_WiredTiger_EngineConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.cacheSizeGb !== undefined) { + DoubleValue.encode( + { $type: "google.protobuf.DoubleValue", value: message.cacheSizeGb! }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongodConfig_Storage_WiredTiger_EngineConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodConfig_Storage_WiredTiger_EngineConfig, + } as MongodConfig_Storage_WiredTiger_EngineConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cacheSizeGb = DoubleValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig_Storage_WiredTiger_EngineConfig { + const message = { + ...baseMongodConfig_Storage_WiredTiger_EngineConfig, + } as MongodConfig_Storage_WiredTiger_EngineConfig; + message.cacheSizeGb = + object.cacheSizeGb !== undefined && object.cacheSizeGb !== null + ? Number(object.cacheSizeGb) + : undefined; + return message; + }, + + toJSON(message: MongodConfig_Storage_WiredTiger_EngineConfig): unknown { + const obj: any = {}; + message.cacheSizeGb !== undefined && + (obj.cacheSizeGb = message.cacheSizeGb); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): MongodConfig_Storage_WiredTiger_EngineConfig { + const message = { + ...baseMongodConfig_Storage_WiredTiger_EngineConfig, + } as MongodConfig_Storage_WiredTiger_EngineConfig; + message.cacheSizeGb = object.cacheSizeGb ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + MongodConfig_Storage_WiredTiger_EngineConfig.$type, + MongodConfig_Storage_WiredTiger_EngineConfig +); + +const baseMongodConfig_Storage_WiredTiger_CollectionConfig: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.WiredTiger.CollectionConfig", + blockCompressor: 0, +}; + +export const MongodConfig_Storage_WiredTiger_CollectionConfig = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.WiredTiger.CollectionConfig" as const, + + encode( + message: MongodConfig_Storage_WiredTiger_CollectionConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.blockCompressor !== 0) { + writer.uint32(8).int32(message.blockCompressor); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongodConfig_Storage_WiredTiger_CollectionConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodConfig_Storage_WiredTiger_CollectionConfig, + } as MongodConfig_Storage_WiredTiger_CollectionConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockCompressor = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig_Storage_WiredTiger_CollectionConfig { + const message = { + ...baseMongodConfig_Storage_WiredTiger_CollectionConfig, + } as MongodConfig_Storage_WiredTiger_CollectionConfig; + message.blockCompressor = + object.blockCompressor !== undefined && object.blockCompressor !== null + ? mongodConfig_Storage_WiredTiger_CollectionConfig_CompressorFromJSON( + object.blockCompressor + ) + : 0; + return message; + }, + + toJSON(message: MongodConfig_Storage_WiredTiger_CollectionConfig): unknown { + const obj: any = {}; + message.blockCompressor !== undefined && + (obj.blockCompressor = + mongodConfig_Storage_WiredTiger_CollectionConfig_CompressorToJSON( + message.blockCompressor + )); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): MongodConfig_Storage_WiredTiger_CollectionConfig { + const message = { + ...baseMongodConfig_Storage_WiredTiger_CollectionConfig, + } as MongodConfig_Storage_WiredTiger_CollectionConfig; + message.blockCompressor = object.blockCompressor ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + MongodConfig_Storage_WiredTiger_CollectionConfig.$type, + MongodConfig_Storage_WiredTiger_CollectionConfig +); + +const baseMongodConfig_Storage_WiredTiger_IndexConfig: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.WiredTiger.IndexConfig", +}; + +export const MongodConfig_Storage_WiredTiger_IndexConfig = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.WiredTiger.IndexConfig" as const, + + encode( + message: MongodConfig_Storage_WiredTiger_IndexConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.prefixCompression !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.prefixCompression!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongodConfig_Storage_WiredTiger_IndexConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodConfig_Storage_WiredTiger_IndexConfig, + } as MongodConfig_Storage_WiredTiger_IndexConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prefixCompression = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodConfig_Storage_WiredTiger_IndexConfig, + } as MongodConfig_Storage_WiredTiger_IndexConfig; + message.prefixCompression = + object.prefixCompression !== undefined && + object.prefixCompression !== null + ? Boolean(object.prefixCompression) + : undefined; + return message; + }, + + toJSON(message: MongodConfig_Storage_WiredTiger_IndexConfig): unknown { + const obj: any = {}; + message.prefixCompression !== undefined && + (obj.prefixCompression = message.prefixCompression); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): MongodConfig_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodConfig_Storage_WiredTiger_IndexConfig, + } as MongodConfig_Storage_WiredTiger_IndexConfig; + message.prefixCompression = object.prefixCompression ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + MongodConfig_Storage_WiredTiger_IndexConfig.$type, + MongodConfig_Storage_WiredTiger_IndexConfig +); + +const baseMongodConfig_Storage_Journal: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.Journal", +}; + +export const MongodConfig_Storage_Journal = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Storage.Journal" as const, + + encode( + message: MongodConfig_Storage_Journal, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.commitInterval !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.commitInterval! }, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongodConfig_Storage_Journal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodConfig_Storage_Journal, + } as MongodConfig_Storage_Journal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.commitInterval = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig_Storage_Journal { + const message = { + ...baseMongodConfig_Storage_Journal, + } as MongodConfig_Storage_Journal; + message.commitInterval = + object.commitInterval !== undefined && object.commitInterval !== null + ? Number(object.commitInterval) + : undefined; + return message; + }, + + toJSON(message: MongodConfig_Storage_Journal): unknown { + const obj: any = {}; + message.commitInterval !== undefined && + (obj.commitInterval = message.commitInterval); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongodConfig_Storage_Journal { + const message = { + ...baseMongodConfig_Storage_Journal, + } as MongodConfig_Storage_Journal; + message.commitInterval = object.commitInterval ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + MongodConfig_Storage_Journal.$type, + MongodConfig_Storage_Journal +); + +const baseMongodConfig_OperationProfiling: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.OperationProfiling", + mode: 0, +}; + +export const MongodConfig_OperationProfiling = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.OperationProfiling" as const, + + encode( + message: MongodConfig_OperationProfiling, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.mode !== 0) { + writer.uint32(8).int32(message.mode); + } + if (message.slowOpThreshold !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.slowOpThreshold!, + }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.slowOpSampleRate !== undefined) { + DoubleValue.encode( + { + $type: "google.protobuf.DoubleValue", + value: message.slowOpSampleRate!, + }, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongodConfig_OperationProfiling { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodConfig_OperationProfiling, + } as MongodConfig_OperationProfiling; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any; + break; + case 2: + message.slowOpThreshold = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 3: + message.slowOpSampleRate = DoubleValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig_OperationProfiling { + const message = { + ...baseMongodConfig_OperationProfiling, + } as MongodConfig_OperationProfiling; + message.mode = + object.mode !== undefined && object.mode !== null + ? mongodConfig_OperationProfiling_ModeFromJSON(object.mode) + : 0; + message.slowOpThreshold = + object.slowOpThreshold !== undefined && object.slowOpThreshold !== null + ? Number(object.slowOpThreshold) + : undefined; + message.slowOpSampleRate = + object.slowOpSampleRate !== undefined && object.slowOpSampleRate !== null + ? Number(object.slowOpSampleRate) + : undefined; + return message; + }, + + toJSON(message: MongodConfig_OperationProfiling): unknown { + const obj: any = {}; + message.mode !== undefined && + (obj.mode = mongodConfig_OperationProfiling_ModeToJSON(message.mode)); + message.slowOpThreshold !== undefined && + (obj.slowOpThreshold = message.slowOpThreshold); + message.slowOpSampleRate !== undefined && + (obj.slowOpSampleRate = message.slowOpSampleRate); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongodConfig_OperationProfiling { + const message = { + ...baseMongodConfig_OperationProfiling, + } as MongodConfig_OperationProfiling; + message.mode = object.mode ?? 0; + message.slowOpThreshold = object.slowOpThreshold ?? undefined; + message.slowOpSampleRate = object.slowOpSampleRate ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + MongodConfig_OperationProfiling.$type, + MongodConfig_OperationProfiling +); + +const baseMongodConfig_Network: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Network", +}; + +export const MongodConfig_Network = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Network" as const, + + encode( + message: MongodConfig_Network, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.maxIncomingConnections !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.maxIncomingConnections!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.compression !== undefined) { + MongodConfig_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongodConfig_Network { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongodConfig_Network } as MongodConfig_Network; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxIncomingConnections = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 2: + message.compression = MongodConfig_Network_Compression.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig_Network { + const message = { ...baseMongodConfig_Network } as MongodConfig_Network; + message.maxIncomingConnections = + object.maxIncomingConnections !== undefined && + object.maxIncomingConnections !== null + ? Number(object.maxIncomingConnections) + : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? MongodConfig_Network_Compression.fromJSON(object.compression) + : undefined; + return message; + }, + + toJSON(message: MongodConfig_Network): unknown { + const obj: any = {}; + message.maxIncomingConnections !== undefined && + (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? MongodConfig_Network_Compression.toJSON(message.compression) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongodConfig_Network { + const message = { ...baseMongodConfig_Network } as MongodConfig_Network; + message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? MongodConfig_Network_Compression.fromPartial(object.compression) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MongodConfig_Network.$type, MongodConfig_Network); + +const baseMongodConfig_Network_Compression: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Network.Compression", + compressors: 0, +}; + +export const MongodConfig_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Network.Compression" as const, + + encode( + message: MongodConfig_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongodConfig_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodConfig_Network_Compression, + } as MongodConfig_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig_Network_Compression { + const message = { + ...baseMongodConfig_Network_Compression, + } as MongodConfig_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongodConfig_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: MongodConfig_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongodConfig_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): MongodConfig_Network_Compression { + const message = { + ...baseMongodConfig_Network_Compression, + } as MongodConfig_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + MongodConfig_Network_Compression.$type, + MongodConfig_Network_Compression +); + +const baseMongodConfig_Security: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Security", +}; + +export const MongodConfig_Security = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Security" as const, + + encode( + message: MongodConfig_Security, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enableEncryption !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.enableEncryption!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.kmip !== undefined) { + MongodConfig_Security_KMIP.encode( + message.kmip, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongodConfig_Security { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongodConfig_Security } as MongodConfig_Security; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enableEncryption = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 2: + message.kmip = MongodConfig_Security_KMIP.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig_Security { + const message = { ...baseMongodConfig_Security } as MongodConfig_Security; + message.enableEncryption = + object.enableEncryption !== undefined && object.enableEncryption !== null + ? Boolean(object.enableEncryption) + : undefined; + message.kmip = + object.kmip !== undefined && object.kmip !== null + ? MongodConfig_Security_KMIP.fromJSON(object.kmip) + : undefined; + return message; + }, + + toJSON(message: MongodConfig_Security): unknown { + const obj: any = {}; + message.enableEncryption !== undefined && + (obj.enableEncryption = message.enableEncryption); + message.kmip !== undefined && + (obj.kmip = message.kmip + ? MongodConfig_Security_KMIP.toJSON(message.kmip) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongodConfig_Security { + const message = { ...baseMongodConfig_Security } as MongodConfig_Security; + message.enableEncryption = object.enableEncryption ?? undefined; + message.kmip = + object.kmip !== undefined && object.kmip !== null + ? MongodConfig_Security_KMIP.fromPartial(object.kmip) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MongodConfig_Security.$type, MongodConfig_Security); + +const baseMongodConfig_Security_KMIP: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Security.KMIP", + serverName: "", + serverCa: "", + clientCertificate: "", + keyIdentifier: "", +}; + +export const MongodConfig_Security_KMIP = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.Security.KMIP" as const, + + encode( + message: MongodConfig_Security_KMIP, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.serverName !== "") { + writer.uint32(10).string(message.serverName); + } + if (message.port !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.port! }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.serverCa !== "") { + writer.uint32(26).string(message.serverCa); + } + if (message.clientCertificate !== "") { + writer.uint32(34).string(message.clientCertificate); + } + if (message.keyIdentifier !== "") { + writer.uint32(42).string(message.keyIdentifier); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongodConfig_Security_KMIP { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodConfig_Security_KMIP, + } as MongodConfig_Security_KMIP; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serverName = reader.string(); + break; + case 2: + message.port = Int64Value.decode(reader, reader.uint32()).value; + break; + case 3: + message.serverCa = reader.string(); + break; + case 4: + message.clientCertificate = reader.string(); + break; + case 5: + message.keyIdentifier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig_Security_KMIP { + const message = { + ...baseMongodConfig_Security_KMIP, + } as MongodConfig_Security_KMIP; + message.serverName = + object.serverName !== undefined && object.serverName !== null + ? String(object.serverName) + : ""; + message.port = + object.port !== undefined && object.port !== null + ? Number(object.port) + : undefined; + message.serverCa = + object.serverCa !== undefined && object.serverCa !== null + ? String(object.serverCa) + : ""; + message.clientCertificate = + object.clientCertificate !== undefined && + object.clientCertificate !== null + ? String(object.clientCertificate) + : ""; + message.keyIdentifier = + object.keyIdentifier !== undefined && object.keyIdentifier !== null + ? String(object.keyIdentifier) + : ""; + return message; + }, + + toJSON(message: MongodConfig_Security_KMIP): unknown { + const obj: any = {}; + message.serverName !== undefined && (obj.serverName = message.serverName); + message.port !== undefined && (obj.port = message.port); + message.serverCa !== undefined && (obj.serverCa = message.serverCa); + message.clientCertificate !== undefined && + (obj.clientCertificate = message.clientCertificate); + message.keyIdentifier !== undefined && + (obj.keyIdentifier = message.keyIdentifier); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongodConfig_Security_KMIP { + const message = { + ...baseMongodConfig_Security_KMIP, + } as MongodConfig_Security_KMIP; + message.serverName = object.serverName ?? ""; + message.port = object.port ?? undefined; + message.serverCa = object.serverCa ?? ""; + message.clientCertificate = object.clientCertificate ?? ""; + message.keyIdentifier = object.keyIdentifier ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + MongodConfig_Security_KMIP.$type, + MongodConfig_Security_KMIP +); + +const baseMongodConfig_AuditLog: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.AuditLog", + filter: "", +}; + +export const MongodConfig_AuditLog = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.AuditLog" as const, + + encode( + message: MongodConfig_AuditLog, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.filter !== "") { + writer.uint32(10).string(message.filter); + } + if (message.runtimeConfiguration !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.runtimeConfiguration!, + }, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongodConfig_AuditLog { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongodConfig_AuditLog } as MongodConfig_AuditLog; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.filter = reader.string(); + break; + case 2: + message.runtimeConfiguration = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig_AuditLog { + const message = { ...baseMongodConfig_AuditLog } as MongodConfig_AuditLog; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + message.runtimeConfiguration = + object.runtimeConfiguration !== undefined && + object.runtimeConfiguration !== null + ? Boolean(object.runtimeConfiguration) + : undefined; + return message; + }, + + toJSON(message: MongodConfig_AuditLog): unknown { + const obj: any = {}; + message.filter !== undefined && (obj.filter = message.filter); + message.runtimeConfiguration !== undefined && + (obj.runtimeConfiguration = message.runtimeConfiguration); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongodConfig_AuditLog { + const message = { ...baseMongodConfig_AuditLog } as MongodConfig_AuditLog; + message.filter = object.filter ?? ""; + message.runtimeConfiguration = object.runtimeConfiguration ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(MongodConfig_AuditLog.$type, MongodConfig_AuditLog); + +const baseMongodConfig_SetParameter: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.SetParameter", +}; + +export const MongodConfig_SetParameter = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig.SetParameter" as const, + + encode( + message: MongodConfig_SetParameter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.auditAuthorizationSuccess !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.auditAuthorizationSuccess!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.enableFlowControl !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.enableFlowControl!, + }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.minSnapshotHistoryWindowInSeconds !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.minSnapshotHistoryWindowInSeconds!, + }, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongodConfig_SetParameter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodConfig_SetParameter, + } as MongodConfig_SetParameter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.auditAuthorizationSuccess = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 2: + message.enableFlowControl = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 3: + message.minSnapshotHistoryWindowInSeconds = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfig_SetParameter { + const message = { + ...baseMongodConfig_SetParameter, + } as MongodConfig_SetParameter; + message.auditAuthorizationSuccess = + object.auditAuthorizationSuccess !== undefined && + object.auditAuthorizationSuccess !== null + ? Boolean(object.auditAuthorizationSuccess) + : undefined; + message.enableFlowControl = + object.enableFlowControl !== undefined && + object.enableFlowControl !== null + ? Boolean(object.enableFlowControl) + : undefined; + message.minSnapshotHistoryWindowInSeconds = + object.minSnapshotHistoryWindowInSeconds !== undefined && + object.minSnapshotHistoryWindowInSeconds !== null + ? Number(object.minSnapshotHistoryWindowInSeconds) + : undefined; + return message; + }, + + toJSON(message: MongodConfig_SetParameter): unknown { + const obj: any = {}; + message.auditAuthorizationSuccess !== undefined && + (obj.auditAuthorizationSuccess = message.auditAuthorizationSuccess); + message.enableFlowControl !== undefined && + (obj.enableFlowControl = message.enableFlowControl); + message.minSnapshotHistoryWindowInSeconds !== undefined && + (obj.minSnapshotHistoryWindowInSeconds = + message.minSnapshotHistoryWindowInSeconds); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongodConfig_SetParameter { + const message = { + ...baseMongodConfig_SetParameter, + } as MongodConfig_SetParameter; + message.auditAuthorizationSuccess = + object.auditAuthorizationSuccess ?? undefined; + message.enableFlowControl = object.enableFlowControl ?? undefined; + message.minSnapshotHistoryWindowInSeconds = + object.minSnapshotHistoryWindowInSeconds ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + MongodConfig_SetParameter.$type, + MongodConfig_SetParameter +); + +const baseMongoCfgConfig: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig", +}; + +export const MongoCfgConfig = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig" as const, + + encode( + message: MongoCfgConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.storage !== undefined) { + MongoCfgConfig_Storage.encode( + message.storage, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.operationProfiling !== undefined) { + MongoCfgConfig_OperationProfiling.encode( + message.operationProfiling, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.net !== undefined) { + MongoCfgConfig_Network.encode( + message.net, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MongoCfgConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongoCfgConfig } as MongoCfgConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.storage = MongoCfgConfig_Storage.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.operationProfiling = MongoCfgConfig_OperationProfiling.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.net = MongoCfgConfig_Network.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongoCfgConfig { + const message = { ...baseMongoCfgConfig } as MongoCfgConfig; + message.storage = + object.storage !== undefined && object.storage !== null + ? MongoCfgConfig_Storage.fromJSON(object.storage) + : undefined; + message.operationProfiling = + object.operationProfiling !== undefined && + object.operationProfiling !== null + ? MongoCfgConfig_OperationProfiling.fromJSON(object.operationProfiling) + : undefined; + message.net = + object.net !== undefined && object.net !== null + ? MongoCfgConfig_Network.fromJSON(object.net) + : undefined; + return message; + }, + + toJSON(message: MongoCfgConfig): unknown { + const obj: any = {}; + message.storage !== undefined && + (obj.storage = message.storage + ? MongoCfgConfig_Storage.toJSON(message.storage) + : undefined); + message.operationProfiling !== undefined && + (obj.operationProfiling = message.operationProfiling + ? MongoCfgConfig_OperationProfiling.toJSON(message.operationProfiling) + : undefined); + message.net !== undefined && + (obj.net = message.net + ? MongoCfgConfig_Network.toJSON(message.net) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongoCfgConfig { + const message = { ...baseMongoCfgConfig } as MongoCfgConfig; + message.storage = + object.storage !== undefined && object.storage !== null + ? MongoCfgConfig_Storage.fromPartial(object.storage) + : undefined; + message.operationProfiling = + object.operationProfiling !== undefined && + object.operationProfiling !== null + ? MongoCfgConfig_OperationProfiling.fromPartial( + object.operationProfiling + ) + : undefined; + message.net = + object.net !== undefined && object.net !== null + ? MongoCfgConfig_Network.fromPartial(object.net) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MongoCfgConfig.$type, MongoCfgConfig); + +const baseMongoCfgConfig_Storage: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.Storage", +}; + +export const MongoCfgConfig_Storage = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.Storage" as const, + + encode( + message: MongoCfgConfig_Storage, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.wiredTiger !== undefined) { + MongoCfgConfig_Storage_WiredTiger.encode( + message.wiredTiger, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongoCfgConfig_Storage { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongoCfgConfig_Storage } as MongoCfgConfig_Storage; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wiredTiger = MongoCfgConfig_Storage_WiredTiger.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongoCfgConfig_Storage { + const message = { ...baseMongoCfgConfig_Storage } as MongoCfgConfig_Storage; + message.wiredTiger = + object.wiredTiger !== undefined && object.wiredTiger !== null + ? MongoCfgConfig_Storage_WiredTiger.fromJSON(object.wiredTiger) + : undefined; + return message; + }, + + toJSON(message: MongoCfgConfig_Storage): unknown { + const obj: any = {}; + message.wiredTiger !== undefined && + (obj.wiredTiger = message.wiredTiger + ? MongoCfgConfig_Storage_WiredTiger.toJSON(message.wiredTiger) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongoCfgConfig_Storage { + const message = { ...baseMongoCfgConfig_Storage } as MongoCfgConfig_Storage; + message.wiredTiger = + object.wiredTiger !== undefined && object.wiredTiger !== null + ? MongoCfgConfig_Storage_WiredTiger.fromPartial(object.wiredTiger) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MongoCfgConfig_Storage.$type, MongoCfgConfig_Storage); + +const baseMongoCfgConfig_Storage_WiredTiger: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.Storage.WiredTiger", +}; + +export const MongoCfgConfig_Storage_WiredTiger = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.Storage.WiredTiger" as const, + + encode( + message: MongoCfgConfig_Storage_WiredTiger, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.engineConfig !== undefined) { + MongoCfgConfig_Storage_WiredTiger_EngineConfig.encode( + message.engineConfig, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongoCfgConfig_Storage_WiredTiger { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongoCfgConfig_Storage_WiredTiger, + } as MongoCfgConfig_Storage_WiredTiger; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.engineConfig = + MongoCfgConfig_Storage_WiredTiger_EngineConfig.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongoCfgConfig_Storage_WiredTiger { + const message = { + ...baseMongoCfgConfig_Storage_WiredTiger, + } as MongoCfgConfig_Storage_WiredTiger; + message.engineConfig = + object.engineConfig !== undefined && object.engineConfig !== null + ? MongoCfgConfig_Storage_WiredTiger_EngineConfig.fromJSON( + object.engineConfig + ) + : undefined; + return message; + }, + + toJSON(message: MongoCfgConfig_Storage_WiredTiger): unknown { + const obj: any = {}; + message.engineConfig !== undefined && + (obj.engineConfig = message.engineConfig + ? MongoCfgConfig_Storage_WiredTiger_EngineConfig.toJSON( + message.engineConfig + ) + : undefined); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): MongoCfgConfig_Storage_WiredTiger { + const message = { + ...baseMongoCfgConfig_Storage_WiredTiger, + } as MongoCfgConfig_Storage_WiredTiger; + message.engineConfig = + object.engineConfig !== undefined && object.engineConfig !== null + ? MongoCfgConfig_Storage_WiredTiger_EngineConfig.fromPartial( + object.engineConfig + ) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + MongoCfgConfig_Storage_WiredTiger.$type, + MongoCfgConfig_Storage_WiredTiger +); + +const baseMongoCfgConfig_Storage_WiredTiger_EngineConfig: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.Storage.WiredTiger.EngineConfig", +}; + +export const MongoCfgConfig_Storage_WiredTiger_EngineConfig = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.Storage.WiredTiger.EngineConfig" as const, + + encode( + message: MongoCfgConfig_Storage_WiredTiger_EngineConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.cacheSizeGb !== undefined) { + DoubleValue.encode( + { $type: "google.protobuf.DoubleValue", value: message.cacheSizeGb! }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongoCfgConfig_Storage_WiredTiger_EngineConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongoCfgConfig_Storage_WiredTiger_EngineConfig, + } as MongoCfgConfig_Storage_WiredTiger_EngineConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cacheSizeGb = DoubleValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongoCfgConfig_Storage_WiredTiger_EngineConfig { + const message = { + ...baseMongoCfgConfig_Storage_WiredTiger_EngineConfig, + } as MongoCfgConfig_Storage_WiredTiger_EngineConfig; + message.cacheSizeGb = + object.cacheSizeGb !== undefined && object.cacheSizeGb !== null + ? Number(object.cacheSizeGb) + : undefined; + return message; + }, + + toJSON(message: MongoCfgConfig_Storage_WiredTiger_EngineConfig): unknown { + const obj: any = {}; + message.cacheSizeGb !== undefined && + (obj.cacheSizeGb = message.cacheSizeGb); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): MongoCfgConfig_Storage_WiredTiger_EngineConfig { + const message = { + ...baseMongoCfgConfig_Storage_WiredTiger_EngineConfig, + } as MongoCfgConfig_Storage_WiredTiger_EngineConfig; + message.cacheSizeGb = object.cacheSizeGb ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + MongoCfgConfig_Storage_WiredTiger_EngineConfig.$type, + MongoCfgConfig_Storage_WiredTiger_EngineConfig +); + +const baseMongoCfgConfig_OperationProfiling: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.OperationProfiling", + mode: 0, +}; + +export const MongoCfgConfig_OperationProfiling = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.OperationProfiling" as const, + + encode( + message: MongoCfgConfig_OperationProfiling, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.mode !== 0) { + writer.uint32(8).int32(message.mode); + } + if (message.slowOpThreshold !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.slowOpThreshold!, + }, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongoCfgConfig_OperationProfiling { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongoCfgConfig_OperationProfiling, + } as MongoCfgConfig_OperationProfiling; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any; + break; + case 2: + message.slowOpThreshold = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongoCfgConfig_OperationProfiling { + const message = { + ...baseMongoCfgConfig_OperationProfiling, + } as MongoCfgConfig_OperationProfiling; + message.mode = + object.mode !== undefined && object.mode !== null + ? mongoCfgConfig_OperationProfiling_ModeFromJSON(object.mode) + : 0; + message.slowOpThreshold = + object.slowOpThreshold !== undefined && object.slowOpThreshold !== null + ? Number(object.slowOpThreshold) + : undefined; + return message; + }, + + toJSON(message: MongoCfgConfig_OperationProfiling): unknown { + const obj: any = {}; + message.mode !== undefined && + (obj.mode = mongoCfgConfig_OperationProfiling_ModeToJSON(message.mode)); + message.slowOpThreshold !== undefined && + (obj.slowOpThreshold = message.slowOpThreshold); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): MongoCfgConfig_OperationProfiling { + const message = { + ...baseMongoCfgConfig_OperationProfiling, + } as MongoCfgConfig_OperationProfiling; + message.mode = object.mode ?? 0; + message.slowOpThreshold = object.slowOpThreshold ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + MongoCfgConfig_OperationProfiling.$type, + MongoCfgConfig_OperationProfiling +); + +const baseMongoCfgConfig_Network: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.Network", +}; + +export const MongoCfgConfig_Network = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig.Network" as const, + + encode( + message: MongoCfgConfig_Network, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.maxIncomingConnections !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.maxIncomingConnections!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongoCfgConfig_Network { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongoCfgConfig_Network } as MongoCfgConfig_Network; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxIncomingConnections = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongoCfgConfig_Network { + const message = { ...baseMongoCfgConfig_Network } as MongoCfgConfig_Network; + message.maxIncomingConnections = + object.maxIncomingConnections !== undefined && + object.maxIncomingConnections !== null + ? Number(object.maxIncomingConnections) + : undefined; + return message; + }, + + toJSON(message: MongoCfgConfig_Network): unknown { + const obj: any = {}; + message.maxIncomingConnections !== undefined && + (obj.maxIncomingConnections = message.maxIncomingConnections); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongoCfgConfig_Network { + const message = { ...baseMongoCfgConfig_Network } as MongoCfgConfig_Network; + message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(MongoCfgConfig_Network.$type, MongoCfgConfig_Network); + +const baseMongosConfig: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig", +}; + +export const MongosConfig = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig" as const, + + encode( + message: MongosConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.net !== undefined) { + MongosConfig_Network.encode( + message.net, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MongosConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongosConfig } as MongosConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.net = MongosConfig_Network.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongosConfig { + const message = { ...baseMongosConfig } as MongosConfig; + message.net = + object.net !== undefined && object.net !== null + ? MongosConfig_Network.fromJSON(object.net) + : undefined; + return message; + }, + + toJSON(message: MongosConfig): unknown { + const obj: any = {}; + message.net !== undefined && + (obj.net = message.net + ? MongosConfig_Network.toJSON(message.net) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongosConfig { + const message = { ...baseMongosConfig } as MongosConfig; + message.net = + object.net !== undefined && object.net !== null + ? MongosConfig_Network.fromPartial(object.net) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MongosConfig.$type, MongosConfig); + +const baseMongosConfig_Network: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig.Network", +}; + +export const MongosConfig_Network = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig.Network" as const, + + encode( + message: MongosConfig_Network, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.maxIncomingConnections !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.maxIncomingConnections!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.compression !== undefined) { + MongosConfig_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongosConfig_Network { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongosConfig_Network } as MongosConfig_Network; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxIncomingConnections = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 2: + message.compression = MongosConfig_Network_Compression.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongosConfig_Network { + const message = { ...baseMongosConfig_Network } as MongosConfig_Network; + message.maxIncomingConnections = + object.maxIncomingConnections !== undefined && + object.maxIncomingConnections !== null + ? Number(object.maxIncomingConnections) + : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? MongosConfig_Network_Compression.fromJSON(object.compression) + : undefined; + return message; + }, + + toJSON(message: MongosConfig_Network): unknown { + const obj: any = {}; + message.maxIncomingConnections !== undefined && + (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? MongosConfig_Network_Compression.toJSON(message.compression) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongosConfig_Network { + const message = { ...baseMongosConfig_Network } as MongosConfig_Network; + message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? MongosConfig_Network_Compression.fromPartial(object.compression) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MongosConfig_Network.$type, MongosConfig_Network); + +const baseMongosConfig_Network_Compression: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig.Network.Compression", + compressors: 0, +}; + +export const MongosConfig_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig.Network.Compression" as const, + + encode( + message: MongosConfig_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MongosConfig_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongosConfig_Network_Compression, + } as MongosConfig_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongosConfig_Network_Compression { + const message = { + ...baseMongosConfig_Network_Compression, + } as MongosConfig_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongosConfig_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: MongosConfig_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongosConfig_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): MongosConfig_Network_Compression { + const message = { + ...baseMongosConfig_Network_Compression, + } as MongosConfig_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + MongosConfig_Network_Compression.$type, + MongosConfig_Network_Compression +); + +const baseMongodConfigSet: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfigSet", +}; + +export const MongodConfigSet = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfigSet" as const, + + encode( + message: MongodConfigSet, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.effectiveConfig !== undefined) { + MongodConfig.encode( + message.effectiveConfig, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.userConfig !== undefined) { + MongodConfig.encode( + message.userConfig, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.defaultConfig !== undefined) { + MongodConfig.encode( + message.defaultConfig, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MongodConfigSet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongodConfigSet } as MongodConfigSet; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.effectiveConfig = MongodConfig.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.userConfig = MongodConfig.decode(reader, reader.uint32()); + break; + case 3: + message.defaultConfig = MongodConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongodConfigSet { + const message = { ...baseMongodConfigSet } as MongodConfigSet; + message.effectiveConfig = + object.effectiveConfig !== undefined && object.effectiveConfig !== null + ? MongodConfig.fromJSON(object.effectiveConfig) + : undefined; + message.userConfig = + object.userConfig !== undefined && object.userConfig !== null + ? MongodConfig.fromJSON(object.userConfig) + : undefined; + message.defaultConfig = + object.defaultConfig !== undefined && object.defaultConfig !== null + ? MongodConfig.fromJSON(object.defaultConfig) + : undefined; + return message; + }, + + toJSON(message: MongodConfigSet): unknown { + const obj: any = {}; + message.effectiveConfig !== undefined && + (obj.effectiveConfig = message.effectiveConfig + ? MongodConfig.toJSON(message.effectiveConfig) + : undefined); + message.userConfig !== undefined && + (obj.userConfig = message.userConfig + ? MongodConfig.toJSON(message.userConfig) + : undefined); + message.defaultConfig !== undefined && + (obj.defaultConfig = message.defaultConfig + ? MongodConfig.toJSON(message.defaultConfig) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongodConfigSet { + const message = { ...baseMongodConfigSet } as MongodConfigSet; + message.effectiveConfig = + object.effectiveConfig !== undefined && object.effectiveConfig !== null + ? MongodConfig.fromPartial(object.effectiveConfig) + : undefined; + message.userConfig = + object.userConfig !== undefined && object.userConfig !== null + ? MongodConfig.fromPartial(object.userConfig) + : undefined; + message.defaultConfig = + object.defaultConfig !== undefined && object.defaultConfig !== null + ? MongodConfig.fromPartial(object.defaultConfig) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MongodConfigSet.$type, MongodConfigSet); + +const baseMongoCfgConfigSet: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfigSet", +}; + +export const MongoCfgConfigSet = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfigSet" as const, + + encode( + message: MongoCfgConfigSet, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.effectiveConfig !== undefined) { + MongoCfgConfig.encode( + message.effectiveConfig, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.userConfig !== undefined) { + MongoCfgConfig.encode( + message.userConfig, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.defaultConfig !== undefined) { + MongoCfgConfig.encode( + message.defaultConfig, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MongoCfgConfigSet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongoCfgConfigSet } as MongoCfgConfigSet; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.effectiveConfig = MongoCfgConfig.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.userConfig = MongoCfgConfig.decode(reader, reader.uint32()); + break; + case 3: + message.defaultConfig = MongoCfgConfig.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongoCfgConfigSet { + const message = { ...baseMongoCfgConfigSet } as MongoCfgConfigSet; + message.effectiveConfig = + object.effectiveConfig !== undefined && object.effectiveConfig !== null + ? MongoCfgConfig.fromJSON(object.effectiveConfig) + : undefined; + message.userConfig = + object.userConfig !== undefined && object.userConfig !== null + ? MongoCfgConfig.fromJSON(object.userConfig) + : undefined; + message.defaultConfig = + object.defaultConfig !== undefined && object.defaultConfig !== null + ? MongoCfgConfig.fromJSON(object.defaultConfig) + : undefined; + return message; + }, + + toJSON(message: MongoCfgConfigSet): unknown { + const obj: any = {}; + message.effectiveConfig !== undefined && + (obj.effectiveConfig = message.effectiveConfig + ? MongoCfgConfig.toJSON(message.effectiveConfig) + : undefined); + message.userConfig !== undefined && + (obj.userConfig = message.userConfig + ? MongoCfgConfig.toJSON(message.userConfig) + : undefined); + message.defaultConfig !== undefined && + (obj.defaultConfig = message.defaultConfig + ? MongoCfgConfig.toJSON(message.defaultConfig) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongoCfgConfigSet { + const message = { ...baseMongoCfgConfigSet } as MongoCfgConfigSet; + message.effectiveConfig = + object.effectiveConfig !== undefined && object.effectiveConfig !== null + ? MongoCfgConfig.fromPartial(object.effectiveConfig) + : undefined; + message.userConfig = + object.userConfig !== undefined && object.userConfig !== null + ? MongoCfgConfig.fromPartial(object.userConfig) + : undefined; + message.defaultConfig = + object.defaultConfig !== undefined && object.defaultConfig !== null + ? MongoCfgConfig.fromPartial(object.defaultConfig) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MongoCfgConfigSet.$type, MongoCfgConfigSet); + +const baseMongosConfigSet: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfigSet", +}; + +export const MongosConfigSet = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfigSet" as const, + + encode( + message: MongosConfigSet, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.effectiveConfig !== undefined) { + MongosConfig.encode( + message.effectiveConfig, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.userConfig !== undefined) { + MongosConfig.encode( + message.userConfig, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.defaultConfig !== undefined) { + MongosConfig.encode( + message.defaultConfig, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MongosConfigSet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMongosConfigSet } as MongosConfigSet; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.effectiveConfig = MongosConfig.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.userConfig = MongosConfig.decode(reader, reader.uint32()); + break; + case 3: + message.defaultConfig = MongosConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MongosConfigSet { + const message = { ...baseMongosConfigSet } as MongosConfigSet; + message.effectiveConfig = + object.effectiveConfig !== undefined && object.effectiveConfig !== null + ? MongosConfig.fromJSON(object.effectiveConfig) + : undefined; + message.userConfig = + object.userConfig !== undefined && object.userConfig !== null + ? MongosConfig.fromJSON(object.userConfig) + : undefined; + message.defaultConfig = + object.defaultConfig !== undefined && object.defaultConfig !== null + ? MongosConfig.fromJSON(object.defaultConfig) + : undefined; + return message; + }, + + toJSON(message: MongosConfigSet): unknown { + const obj: any = {}; + message.effectiveConfig !== undefined && + (obj.effectiveConfig = message.effectiveConfig + ? MongosConfig.toJSON(message.effectiveConfig) + : undefined); + message.userConfig !== undefined && + (obj.userConfig = message.userConfig + ? MongosConfig.toJSON(message.userConfig) + : undefined); + message.defaultConfig !== undefined && + (obj.defaultConfig = message.defaultConfig + ? MongosConfig.toJSON(message.defaultConfig) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MongosConfigSet { + const message = { ...baseMongosConfigSet } as MongosConfigSet; + message.effectiveConfig = + object.effectiveConfig !== undefined && object.effectiveConfig !== null + ? MongosConfig.fromPartial(object.effectiveConfig) + : undefined; + message.userConfig = + object.userConfig !== undefined && object.userConfig !== null + ? MongosConfig.fromPartial(object.userConfig) + : undefined; + message.defaultConfig = + object.defaultConfig !== undefined && object.defaultConfig !== null + ? MongosConfig.fromPartial(object.defaultConfig) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MongosConfigSet.$type, MongosConfigSet); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb4_2.ts b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb4_2.ts index 1c89e132..5099eaad 100644 --- a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb4_2.ts +++ b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb4_2.ts @@ -4,6 +4,7 @@ import Long from "long"; import _m0 from "protobufjs/minimal"; import { DoubleValue, + BoolValue, Int64Value, } from "../../../../../../google/protobuf/wrappers"; @@ -21,6 +22,8 @@ export interface Mongodconfig42 { operationProfiling?: Mongodconfig42_OperationProfiling; /** `net` section of mongod configuration. */ net?: Mongodconfig42_Network; + /** `replication` section of mongod configuration. */ + setParameter?: Mongodconfig42_SetParameter; } export interface Mongodconfig42_Storage { @@ -38,6 +41,8 @@ export interface Mongodconfig42_Storage_WiredTiger { engineConfig?: Mongodconfig42_Storage_WiredTiger_EngineConfig; /** Collection configuration for WiredTiger. */ collectionConfig?: Mongodconfig42_Storage_WiredTiger_CollectionConfig; + /** Index configuration for WiredTiger */ + indexConfig?: Mongodconfig42_Storage_WiredTiger_IndexConfig; } export interface Mongodconfig42_Storage_WiredTiger_EngineConfig { @@ -110,6 +115,12 @@ export function mongodconfig42_Storage_WiredTiger_CollectionConfig_CompressorToJ } } +export interface Mongodconfig42_Storage_WiredTiger_IndexConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_2.Storage.WiredTiger.IndexConfig"; + /** Enables or disables [prefix compression](https://www.mongodb.com/docs/manual/reference/glossary/#std-term-prefix-compression) */ + prefixCompression?: boolean; +} + export interface Mongodconfig42_Storage_Journal { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_2.Storage.Journal"; /** @@ -129,6 +140,11 @@ export interface Mongodconfig42_OperationProfiling { * running in the SLOW_OP mode. */ slowOpThreshold?: number; + /** + * The fraction of slow operations that should be profiled or logged. + * operationProfiling.slowOpSampleRate accepts values between 0 and 1, inclusive. + */ + slowOpSampleRate?: number; } export enum Mongodconfig42_OperationProfiling_Mode { @@ -186,6 +202,88 @@ export interface Mongodconfig42_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_2.Network"; /** The maximum number of simultaneous connections that mongod will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongodconfig42_Network_Compression; +} + +export interface Mongodconfig42_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_2.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongodconfig42_Network_Compression_Compressor[]; +} + +export enum Mongodconfig42_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongodconfig42_Network_Compression_CompressorFromJSON( + object: any +): Mongodconfig42_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongodconfig42_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongodconfig42_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongodconfig42_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongodconfig42_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongodconfig42_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongodconfig42_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongodconfig42_Network_Compression_CompressorToJSON( + object: Mongodconfig42_Network_Compression_Compressor +): string { + switch (object) { + case Mongodconfig42_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongodconfig42_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongodconfig42_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongodconfig42_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongodconfig42_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } +} + +export interface Mongodconfig42_SetParameter { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_2.SetParameter"; + /** + * Enables or disables the mechanism that controls the rate at which the primary applies its writes with the + * goal of keeping the secondary members [majority committed](https://www.mongodb.com/docs/v4.2/reference/command/replSetGetStatus/#replSetGetStatus.optimes.lastCommittedOpTime) + * lag under a configurable maximum value. + */ + enableFlowControl?: boolean; } export interface Mongocfgconfig42 { @@ -296,6 +394,78 @@ export interface Mongosconfig42_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig4_2.Network"; /** The maximum number of simultaneous connections that mongos will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongosconfig42_Network_Compression; +} + +export interface Mongosconfig42_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig4_2.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongosconfig42_Network_Compression_Compressor[]; +} + +export enum Mongosconfig42_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongosconfig42_Network_Compression_CompressorFromJSON( + object: any +): Mongosconfig42_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongosconfig42_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongosconfig42_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongosconfig42_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongosconfig42_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongosconfig42_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongosconfig42_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongosconfig42_Network_Compression_CompressorToJSON( + object: Mongosconfig42_Network_Compression_Compressor +): string { + switch (object) { + case Mongosconfig42_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongosconfig42_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongosconfig42_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongosconfig42_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongosconfig42_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } } export interface Mongodconfigset42 { @@ -366,6 +536,12 @@ export const Mongodconfig42 = { writer.uint32(26).fork() ).ldelim(); } + if (message.setParameter !== undefined) { + Mongodconfig42_SetParameter.encode( + message.setParameter, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -391,6 +567,12 @@ export const Mongodconfig42 = { case 3: message.net = Mongodconfig42_Network.decode(reader, reader.uint32()); break; + case 4: + message.setParameter = Mongodconfig42_SetParameter.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -414,6 +596,10 @@ export const Mongodconfig42 = { object.net !== undefined && object.net !== null ? Mongodconfig42_Network.fromJSON(object.net) : undefined; + message.setParameter = + object.setParameter !== undefined && object.setParameter !== null + ? Mongodconfig42_SetParameter.fromJSON(object.setParameter) + : undefined; return message; }, @@ -431,6 +617,10 @@ export const Mongodconfig42 = { (obj.net = message.net ? Mongodconfig42_Network.toJSON(message.net) : undefined); + message.setParameter !== undefined && + (obj.setParameter = message.setParameter + ? Mongodconfig42_SetParameter.toJSON(message.setParameter) + : undefined); return obj; }, @@ -453,6 +643,10 @@ export const Mongodconfig42 = { object.net !== undefined && object.net !== null ? Mongodconfig42_Network.fromPartial(object.net) : undefined; + message.setParameter = + object.setParameter !== undefined && object.setParameter !== null + ? Mongodconfig42_SetParameter.fromPartial(object.setParameter) + : undefined; return message; }, }; @@ -584,6 +778,12 @@ export const Mongodconfig42_Storage_WiredTiger = { writer.uint32(18).fork() ).ldelim(); } + if (message.indexConfig !== undefined) { + Mongodconfig42_Storage_WiredTiger_IndexConfig.encode( + message.indexConfig, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -613,6 +813,13 @@ export const Mongodconfig42_Storage_WiredTiger = { reader.uint32() ); break; + case 3: + message.indexConfig = + Mongodconfig42_Storage_WiredTiger_IndexConfig.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -637,6 +844,12 @@ export const Mongodconfig42_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig42_Storage_WiredTiger_IndexConfig.fromJSON( + object.indexConfig + ) + : undefined; return message; }, @@ -654,6 +867,12 @@ export const Mongodconfig42_Storage_WiredTiger = { message.collectionConfig ) : undefined); + message.indexConfig !== undefined && + (obj.indexConfig = message.indexConfig + ? Mongodconfig42_Storage_WiredTiger_IndexConfig.toJSON( + message.indexConfig + ) + : undefined); return obj; }, @@ -675,6 +894,12 @@ export const Mongodconfig42_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig42_Storage_WiredTiger_IndexConfig.fromPartial( + object.indexConfig + ) + : undefined; return message; }, }; @@ -854,6 +1079,95 @@ messageTypeRegistry.set( Mongodconfig42_Storage_WiredTiger_CollectionConfig ); +const baseMongodconfig42_Storage_WiredTiger_IndexConfig: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_2.Storage.WiredTiger.IndexConfig", +}; + +export const Mongodconfig42_Storage_WiredTiger_IndexConfig = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_2.Storage.WiredTiger.IndexConfig" as const, + + encode( + message: Mongodconfig42_Storage_WiredTiger_IndexConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.prefixCompression !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.prefixCompression!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig42_Storage_WiredTiger_IndexConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig42_Storage_WiredTiger_IndexConfig, + } as Mongodconfig42_Storage_WiredTiger_IndexConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prefixCompression = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig42_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig42_Storage_WiredTiger_IndexConfig, + } as Mongodconfig42_Storage_WiredTiger_IndexConfig; + message.prefixCompression = + object.prefixCompression !== undefined && + object.prefixCompression !== null + ? Boolean(object.prefixCompression) + : undefined; + return message; + }, + + toJSON(message: Mongodconfig42_Storage_WiredTiger_IndexConfig): unknown { + const obj: any = {}; + message.prefixCompression !== undefined && + (obj.prefixCompression = message.prefixCompression); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): Mongodconfig42_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig42_Storage_WiredTiger_IndexConfig, + } as Mongodconfig42_Storage_WiredTiger_IndexConfig; + message.prefixCompression = object.prefixCompression ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig42_Storage_WiredTiger_IndexConfig.$type, + Mongodconfig42_Storage_WiredTiger_IndexConfig +); + const baseMongodconfig42_Storage_Journal: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_2.Storage.Journal", }; @@ -961,6 +1275,15 @@ export const Mongodconfig42_OperationProfiling = { writer.uint32(18).fork() ).ldelim(); } + if (message.slowOpSampleRate !== undefined) { + DoubleValue.encode( + { + $type: "google.protobuf.DoubleValue", + value: message.slowOpSampleRate!, + }, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -985,6 +1308,12 @@ export const Mongodconfig42_OperationProfiling = { reader.uint32() ).value; break; + case 3: + message.slowOpSampleRate = DoubleValue.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -1005,6 +1334,10 @@ export const Mongodconfig42_OperationProfiling = { object.slowOpThreshold !== undefined && object.slowOpThreshold !== null ? Number(object.slowOpThreshold) : undefined; + message.slowOpSampleRate = + object.slowOpSampleRate !== undefined && object.slowOpSampleRate !== null + ? Number(object.slowOpSampleRate) + : undefined; return message; }, @@ -1014,6 +1347,8 @@ export const Mongodconfig42_OperationProfiling = { (obj.mode = mongodconfig42_OperationProfiling_ModeToJSON(message.mode)); message.slowOpThreshold !== undefined && (obj.slowOpThreshold = message.slowOpThreshold); + message.slowOpSampleRate !== undefined && + (obj.slowOpSampleRate = message.slowOpSampleRate); return obj; }, @@ -1025,6 +1360,7 @@ export const Mongodconfig42_OperationProfiling = { } as Mongodconfig42_OperationProfiling; message.mode = object.mode ?? 0; message.slowOpThreshold = object.slowOpThreshold ?? undefined; + message.slowOpSampleRate = object.slowOpSampleRate ?? undefined; return message; }, }; @@ -1054,6 +1390,12 @@ export const Mongodconfig42_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongodconfig42_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -1073,6 +1415,12 @@ export const Mongodconfig42_Network = { reader.uint32() ).value; break; + case 2: + message.compression = Mongodconfig42_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1088,6 +1436,10 @@ export const Mongodconfig42_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig42_Network_Compression.fromJSON(object.compression) + : undefined; return message; }, @@ -1095,6 +1447,10 @@ export const Mongodconfig42_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongodconfig42_Network_Compression.toJSON(message.compression) + : undefined); return obj; }, @@ -1103,12 +1459,192 @@ export const Mongodconfig42_Network = { ): Mongodconfig42_Network { const message = { ...baseMongodconfig42_Network } as Mongodconfig42_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig42_Network_Compression.fromPartial(object.compression) + : undefined; return message; }, }; messageTypeRegistry.set(Mongodconfig42_Network.$type, Mongodconfig42_Network); +const baseMongodconfig42_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_2.Network.Compression", + compressors: 0, +}; + +export const Mongodconfig42_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_2.Network.Compression" as const, + + encode( + message: Mongodconfig42_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig42_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig42_Network_Compression, + } as Mongodconfig42_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig42_Network_Compression { + const message = { + ...baseMongodconfig42_Network_Compression, + } as Mongodconfig42_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongodconfig42_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongodconfig42_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongodconfig42_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): Mongodconfig42_Network_Compression { + const message = { + ...baseMongodconfig42_Network_Compression, + } as Mongodconfig42_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig42_Network_Compression.$type, + Mongodconfig42_Network_Compression +); + +const baseMongodconfig42_SetParameter: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_2.SetParameter", +}; + +export const Mongodconfig42_SetParameter = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_2.SetParameter" as const, + + encode( + message: Mongodconfig42_SetParameter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enableFlowControl !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.enableFlowControl!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig42_SetParameter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig42_SetParameter, + } as Mongodconfig42_SetParameter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enableFlowControl = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig42_SetParameter { + const message = { + ...baseMongodconfig42_SetParameter, + } as Mongodconfig42_SetParameter; + message.enableFlowControl = + object.enableFlowControl !== undefined && + object.enableFlowControl !== null + ? Boolean(object.enableFlowControl) + : undefined; + return message; + }, + + toJSON(message: Mongodconfig42_SetParameter): unknown { + const obj: any = {}; + message.enableFlowControl !== undefined && + (obj.enableFlowControl = message.enableFlowControl); + return obj; + }, + + fromPartial, I>>( + object: I + ): Mongodconfig42_SetParameter { + const message = { + ...baseMongodconfig42_SetParameter, + } as Mongodconfig42_SetParameter; + message.enableFlowControl = object.enableFlowControl ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig42_SetParameter.$type, + Mongodconfig42_SetParameter +); + const baseMongocfgconfig42: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig4_2", }; @@ -1773,6 +2309,12 @@ export const Mongosconfig42_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongosconfig42_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -1792,6 +2334,12 @@ export const Mongosconfig42_Network = { reader.uint32() ).value; break; + case 2: + message.compression = Mongosconfig42_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1807,6 +2355,10 @@ export const Mongosconfig42_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig42_Network_Compression.fromJSON(object.compression) + : undefined; return message; }, @@ -1814,6 +2366,10 @@ export const Mongosconfig42_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongosconfig42_Network_Compression.toJSON(message.compression) + : undefined); return obj; }, @@ -1822,12 +2378,107 @@ export const Mongosconfig42_Network = { ): Mongosconfig42_Network { const message = { ...baseMongosconfig42_Network } as Mongosconfig42_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig42_Network_Compression.fromPartial(object.compression) + : undefined; return message; }, }; messageTypeRegistry.set(Mongosconfig42_Network.$type, Mongosconfig42_Network); +const baseMongosconfig42_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig4_2.Network.Compression", + compressors: 0, +}; + +export const Mongosconfig42_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig4_2.Network.Compression" as const, + + encode( + message: Mongosconfig42_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongosconfig42_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongosconfig42_Network_Compression, + } as Mongosconfig42_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongosconfig42_Network_Compression { + const message = { + ...baseMongosconfig42_Network_Compression, + } as Mongosconfig42_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongosconfig42_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongosconfig42_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongosconfig42_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): Mongosconfig42_Network_Compression { + const message = { + ...baseMongosconfig42_Network_Compression, + } as Mongosconfig42_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongosconfig42_Network_Compression.$type, + Mongosconfig42_Network_Compression +); + const baseMongodconfigset42: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfigSet4_2", }; diff --git a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb4_4.ts b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb4_4.ts index 77e1ff4b..1db15e10 100644 --- a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb4_4.ts +++ b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb4_4.ts @@ -4,6 +4,7 @@ import Long from "long"; import _m0 from "protobufjs/minimal"; import { DoubleValue, + BoolValue, Int64Value, } from "../../../../../../google/protobuf/wrappers"; @@ -21,6 +22,8 @@ export interface Mongodconfig44 { operationProfiling?: Mongodconfig44_OperationProfiling; /** `net` section of mongod configuration. */ net?: Mongodconfig44_Network; + /** `replication` section of mongod configuration. */ + setParameter?: Mongodconfig44_SetParameter; } export interface Mongodconfig44_Storage { @@ -38,6 +41,8 @@ export interface Mongodconfig44_Storage_WiredTiger { engineConfig?: Mongodconfig44_Storage_WiredTiger_EngineConfig; /** Collection configuration for WiredTiger. */ collectionConfig?: Mongodconfig44_Storage_WiredTiger_CollectionConfig; + /** Index configuration for WiredTiger */ + indexConfig?: Mongodconfig44_Storage_WiredTiger_IndexConfig; } export interface Mongodconfig44_Storage_WiredTiger_EngineConfig { @@ -110,6 +115,12 @@ export function mongodconfig44_Storage_WiredTiger_CollectionConfig_CompressorToJ } } +export interface Mongodconfig44_Storage_WiredTiger_IndexConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4.Storage.WiredTiger.IndexConfig"; + /** Enables or disables [prefix compression](https://www.mongodb.com/docs/manual/reference/glossary/#std-term-prefix-compression) */ + prefixCompression?: boolean; +} + export interface Mongodconfig44_Storage_Journal { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4.Storage.Journal"; /** @@ -129,6 +140,11 @@ export interface Mongodconfig44_OperationProfiling { * running in the SLOW_OP mode. */ slowOpThreshold?: number; + /** + * The fraction of slow operations that should be profiled or logged. + * operationProfiling.slowOpSampleRate accepts values between 0 and 1, inclusive. + */ + slowOpSampleRate?: number; } export enum Mongodconfig44_OperationProfiling_Mode { @@ -186,6 +202,88 @@ export interface Mongodconfig44_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4.Network"; /** The maximum number of simultaneous connections that mongod will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongodconfig44_Network_Compression; +} + +export interface Mongodconfig44_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongodconfig44_Network_Compression_Compressor[]; +} + +export enum Mongodconfig44_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongodconfig44_Network_Compression_CompressorFromJSON( + object: any +): Mongodconfig44_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongodconfig44_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongodconfig44_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongodconfig44_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongodconfig44_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongodconfig44_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongodconfig44_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongodconfig44_Network_Compression_CompressorToJSON( + object: Mongodconfig44_Network_Compression_Compressor +): string { + switch (object) { + case Mongodconfig44_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongodconfig44_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongodconfig44_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongodconfig44_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongodconfig44_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } +} + +export interface Mongodconfig44_SetParameter { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4.SetParameter"; + /** + * Enables or disables the mechanism that controls the rate at which the primary applies its writes with the + * goal of keeping the secondary members [majority committed](https://www.mongodb.com/docs/v4.2/reference/command/replSetGetStatus/#replSetGetStatus.optimes.lastCommittedOpTime) + * lag under a configurable maximum value. + */ + enableFlowControl?: boolean; } export interface Mongocfgconfig44 { @@ -296,6 +394,78 @@ export interface Mongosconfig44_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig4_4.Network"; /** The maximum number of simultaneous connections that mongos will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongosconfig44_Network_Compression; +} + +export interface Mongosconfig44_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig4_4.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongosconfig44_Network_Compression_Compressor[]; +} + +export enum Mongosconfig44_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongosconfig44_Network_Compression_CompressorFromJSON( + object: any +): Mongosconfig44_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongosconfig44_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongosconfig44_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongosconfig44_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongosconfig44_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongosconfig44_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongosconfig44_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongosconfig44_Network_Compression_CompressorToJSON( + object: Mongosconfig44_Network_Compression_Compressor +): string { + switch (object) { + case Mongosconfig44_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongosconfig44_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongosconfig44_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongosconfig44_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongosconfig44_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } } export interface Mongodconfigset44 { @@ -366,6 +536,12 @@ export const Mongodconfig44 = { writer.uint32(26).fork() ).ldelim(); } + if (message.setParameter !== undefined) { + Mongodconfig44_SetParameter.encode( + message.setParameter, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -391,6 +567,12 @@ export const Mongodconfig44 = { case 3: message.net = Mongodconfig44_Network.decode(reader, reader.uint32()); break; + case 4: + message.setParameter = Mongodconfig44_SetParameter.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -414,6 +596,10 @@ export const Mongodconfig44 = { object.net !== undefined && object.net !== null ? Mongodconfig44_Network.fromJSON(object.net) : undefined; + message.setParameter = + object.setParameter !== undefined && object.setParameter !== null + ? Mongodconfig44_SetParameter.fromJSON(object.setParameter) + : undefined; return message; }, @@ -431,6 +617,10 @@ export const Mongodconfig44 = { (obj.net = message.net ? Mongodconfig44_Network.toJSON(message.net) : undefined); + message.setParameter !== undefined && + (obj.setParameter = message.setParameter + ? Mongodconfig44_SetParameter.toJSON(message.setParameter) + : undefined); return obj; }, @@ -453,6 +643,10 @@ export const Mongodconfig44 = { object.net !== undefined && object.net !== null ? Mongodconfig44_Network.fromPartial(object.net) : undefined; + message.setParameter = + object.setParameter !== undefined && object.setParameter !== null + ? Mongodconfig44_SetParameter.fromPartial(object.setParameter) + : undefined; return message; }, }; @@ -584,6 +778,12 @@ export const Mongodconfig44_Storage_WiredTiger = { writer.uint32(18).fork() ).ldelim(); } + if (message.indexConfig !== undefined) { + Mongodconfig44_Storage_WiredTiger_IndexConfig.encode( + message.indexConfig, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -613,6 +813,13 @@ export const Mongodconfig44_Storage_WiredTiger = { reader.uint32() ); break; + case 3: + message.indexConfig = + Mongodconfig44_Storage_WiredTiger_IndexConfig.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -637,6 +844,12 @@ export const Mongodconfig44_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig44_Storage_WiredTiger_IndexConfig.fromJSON( + object.indexConfig + ) + : undefined; return message; }, @@ -654,6 +867,12 @@ export const Mongodconfig44_Storage_WiredTiger = { message.collectionConfig ) : undefined); + message.indexConfig !== undefined && + (obj.indexConfig = message.indexConfig + ? Mongodconfig44_Storage_WiredTiger_IndexConfig.toJSON( + message.indexConfig + ) + : undefined); return obj; }, @@ -675,6 +894,12 @@ export const Mongodconfig44_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig44_Storage_WiredTiger_IndexConfig.fromPartial( + object.indexConfig + ) + : undefined; return message; }, }; @@ -854,6 +1079,95 @@ messageTypeRegistry.set( Mongodconfig44_Storage_WiredTiger_CollectionConfig ); +const baseMongodconfig44_Storage_WiredTiger_IndexConfig: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4.Storage.WiredTiger.IndexConfig", +}; + +export const Mongodconfig44_Storage_WiredTiger_IndexConfig = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4.Storage.WiredTiger.IndexConfig" as const, + + encode( + message: Mongodconfig44_Storage_WiredTiger_IndexConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.prefixCompression !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.prefixCompression!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig44_Storage_WiredTiger_IndexConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig44_Storage_WiredTiger_IndexConfig, + } as Mongodconfig44_Storage_WiredTiger_IndexConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prefixCompression = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig44_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig44_Storage_WiredTiger_IndexConfig, + } as Mongodconfig44_Storage_WiredTiger_IndexConfig; + message.prefixCompression = + object.prefixCompression !== undefined && + object.prefixCompression !== null + ? Boolean(object.prefixCompression) + : undefined; + return message; + }, + + toJSON(message: Mongodconfig44_Storage_WiredTiger_IndexConfig): unknown { + const obj: any = {}; + message.prefixCompression !== undefined && + (obj.prefixCompression = message.prefixCompression); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): Mongodconfig44_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig44_Storage_WiredTiger_IndexConfig, + } as Mongodconfig44_Storage_WiredTiger_IndexConfig; + message.prefixCompression = object.prefixCompression ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig44_Storage_WiredTiger_IndexConfig.$type, + Mongodconfig44_Storage_WiredTiger_IndexConfig +); + const baseMongodconfig44_Storage_Journal: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4.Storage.Journal", }; @@ -961,6 +1275,15 @@ export const Mongodconfig44_OperationProfiling = { writer.uint32(18).fork() ).ldelim(); } + if (message.slowOpSampleRate !== undefined) { + DoubleValue.encode( + { + $type: "google.protobuf.DoubleValue", + value: message.slowOpSampleRate!, + }, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -985,6 +1308,12 @@ export const Mongodconfig44_OperationProfiling = { reader.uint32() ).value; break; + case 3: + message.slowOpSampleRate = DoubleValue.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -1005,6 +1334,10 @@ export const Mongodconfig44_OperationProfiling = { object.slowOpThreshold !== undefined && object.slowOpThreshold !== null ? Number(object.slowOpThreshold) : undefined; + message.slowOpSampleRate = + object.slowOpSampleRate !== undefined && object.slowOpSampleRate !== null + ? Number(object.slowOpSampleRate) + : undefined; return message; }, @@ -1014,6 +1347,8 @@ export const Mongodconfig44_OperationProfiling = { (obj.mode = mongodconfig44_OperationProfiling_ModeToJSON(message.mode)); message.slowOpThreshold !== undefined && (obj.slowOpThreshold = message.slowOpThreshold); + message.slowOpSampleRate !== undefined && + (obj.slowOpSampleRate = message.slowOpSampleRate); return obj; }, @@ -1025,6 +1360,7 @@ export const Mongodconfig44_OperationProfiling = { } as Mongodconfig44_OperationProfiling; message.mode = object.mode ?? 0; message.slowOpThreshold = object.slowOpThreshold ?? undefined; + message.slowOpSampleRate = object.slowOpSampleRate ?? undefined; return message; }, }; @@ -1054,6 +1390,12 @@ export const Mongodconfig44_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongodconfig44_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -1073,6 +1415,12 @@ export const Mongodconfig44_Network = { reader.uint32() ).value; break; + case 2: + message.compression = Mongodconfig44_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1088,6 +1436,10 @@ export const Mongodconfig44_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig44_Network_Compression.fromJSON(object.compression) + : undefined; return message; }, @@ -1095,6 +1447,10 @@ export const Mongodconfig44_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongodconfig44_Network_Compression.toJSON(message.compression) + : undefined); return obj; }, @@ -1103,12 +1459,192 @@ export const Mongodconfig44_Network = { ): Mongodconfig44_Network { const message = { ...baseMongodconfig44_Network } as Mongodconfig44_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig44_Network_Compression.fromPartial(object.compression) + : undefined; return message; }, }; messageTypeRegistry.set(Mongodconfig44_Network.$type, Mongodconfig44_Network); +const baseMongodconfig44_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4.Network.Compression", + compressors: 0, +}; + +export const Mongodconfig44_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4.Network.Compression" as const, + + encode( + message: Mongodconfig44_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig44_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig44_Network_Compression, + } as Mongodconfig44_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig44_Network_Compression { + const message = { + ...baseMongodconfig44_Network_Compression, + } as Mongodconfig44_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongodconfig44_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongodconfig44_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongodconfig44_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): Mongodconfig44_Network_Compression { + const message = { + ...baseMongodconfig44_Network_Compression, + } as Mongodconfig44_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig44_Network_Compression.$type, + Mongodconfig44_Network_Compression +); + +const baseMongodconfig44_SetParameter: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4.SetParameter", +}; + +export const Mongodconfig44_SetParameter = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4.SetParameter" as const, + + encode( + message: Mongodconfig44_SetParameter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enableFlowControl !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.enableFlowControl!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig44_SetParameter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig44_SetParameter, + } as Mongodconfig44_SetParameter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enableFlowControl = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig44_SetParameter { + const message = { + ...baseMongodconfig44_SetParameter, + } as Mongodconfig44_SetParameter; + message.enableFlowControl = + object.enableFlowControl !== undefined && + object.enableFlowControl !== null + ? Boolean(object.enableFlowControl) + : undefined; + return message; + }, + + toJSON(message: Mongodconfig44_SetParameter): unknown { + const obj: any = {}; + message.enableFlowControl !== undefined && + (obj.enableFlowControl = message.enableFlowControl); + return obj; + }, + + fromPartial, I>>( + object: I + ): Mongodconfig44_SetParameter { + const message = { + ...baseMongodconfig44_SetParameter, + } as Mongodconfig44_SetParameter; + message.enableFlowControl = object.enableFlowControl ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig44_SetParameter.$type, + Mongodconfig44_SetParameter +); + const baseMongocfgconfig44: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig4_4", }; @@ -1773,6 +2309,12 @@ export const Mongosconfig44_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongosconfig44_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -1792,6 +2334,12 @@ export const Mongosconfig44_Network = { reader.uint32() ).value; break; + case 2: + message.compression = Mongosconfig44_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1807,6 +2355,10 @@ export const Mongosconfig44_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig44_Network_Compression.fromJSON(object.compression) + : undefined; return message; }, @@ -1814,6 +2366,10 @@ export const Mongosconfig44_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongosconfig44_Network_Compression.toJSON(message.compression) + : undefined); return obj; }, @@ -1822,12 +2378,107 @@ export const Mongosconfig44_Network = { ): Mongosconfig44_Network { const message = { ...baseMongosconfig44_Network } as Mongosconfig44_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig44_Network_Compression.fromPartial(object.compression) + : undefined; return message; }, }; messageTypeRegistry.set(Mongosconfig44_Network.$type, Mongosconfig44_Network); +const baseMongosconfig44_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig4_4.Network.Compression", + compressors: 0, +}; + +export const Mongosconfig44_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig4_4.Network.Compression" as const, + + encode( + message: Mongosconfig44_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongosconfig44_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongosconfig44_Network_Compression, + } as Mongosconfig44_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongosconfig44_Network_Compression { + const message = { + ...baseMongosconfig44_Network_Compression, + } as Mongosconfig44_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongosconfig44_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongosconfig44_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongosconfig44_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): Mongosconfig44_Network_Compression { + const message = { + ...baseMongosconfig44_Network_Compression, + } as Mongosconfig44_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongosconfig44_Network_Compression.$type, + Mongosconfig44_Network_Compression +); + const baseMongodconfigset44: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfigSet4_4", }; diff --git a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb4_4_enterprise.ts b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb4_4_enterprise.ts index f20d7aa5..420c39da 100644 --- a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb4_4_enterprise.ts +++ b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb4_4_enterprise.ts @@ -4,8 +4,8 @@ import Long from "long"; import _m0 from "protobufjs/minimal"; import { DoubleValue, - Int64Value, BoolValue, + Int64Value, } from "../../../../../../google/protobuf/wrappers"; export const protobufPackage = "yandex.cloud.mdb.mongodb.v1.config"; @@ -45,6 +45,8 @@ export interface Mongodconfig44Enterprise_Storage_WiredTiger { engineConfig?: Mongodconfig44Enterprise_Storage_WiredTiger_EngineConfig; /** Collection configuration for WiredTiger. */ collectionConfig?: Mongodconfig44Enterprise_Storage_WiredTiger_CollectionConfig; + /** Index configuration for WiredTiger */ + indexConfig?: Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig; } export interface Mongodconfig44Enterprise_Storage_WiredTiger_EngineConfig { @@ -117,6 +119,12 @@ export function mongodconfig44Enterprise_Storage_WiredTiger_CollectionConfig_Com } } +export interface Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4_enterprise.Storage.WiredTiger.IndexConfig"; + /** Enables or disables [prefix compression](https://www.mongodb.com/docs/manual/reference/glossary/#std-term-prefix-compression) */ + prefixCompression?: boolean; +} + export interface Mongodconfig44Enterprise_Storage_Journal { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4_enterprise.Storage.Journal"; /** @@ -136,6 +144,11 @@ export interface Mongodconfig44Enterprise_OperationProfiling { * running in the SLOW_OP mode. */ slowOpThreshold?: number; + /** + * The fraction of slow operations that should be profiled or logged. + * operationProfiling.slowOpSampleRate accepts values between 0 and 1, inclusive. + */ + slowOpSampleRate?: number; } export enum Mongodconfig44Enterprise_OperationProfiling_Mode { @@ -193,6 +206,78 @@ export interface Mongodconfig44Enterprise_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4_enterprise.Network"; /** The maximum number of simultaneous connections that mongod will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongodconfig44Enterprise_Network_Compression; +} + +export interface Mongodconfig44Enterprise_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4_enterprise.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongodconfig44Enterprise_Network_Compression_Compressor[]; +} + +export enum Mongodconfig44Enterprise_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongodconfig44Enterprise_Network_Compression_CompressorFromJSON( + object: any +): Mongodconfig44Enterprise_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongodconfig44Enterprise_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongodconfig44Enterprise_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongodconfig44Enterprise_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongodconfig44Enterprise_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongodconfig44Enterprise_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongodconfig44Enterprise_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongodconfig44Enterprise_Network_Compression_CompressorToJSON( + object: Mongodconfig44Enterprise_Network_Compression_Compressor +): string { + switch (object) { + case Mongodconfig44Enterprise_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongodconfig44Enterprise_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongodconfig44Enterprise_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongodconfig44Enterprise_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongodconfig44Enterprise_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } } export interface Mongodconfig44Enterprise_Security { @@ -227,6 +312,12 @@ export interface Mongodconfig44Enterprise_SetParameter { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4_enterprise.SetParameter"; /** Enables the auditing of authorization successes */ auditAuthorizationSuccess?: boolean; + /** + * Enables or disables the mechanism that controls the rate at which the primary applies its writes with the + * goal of keeping the secondary members [majority committed](https://www.mongodb.com/docs/v4.2/reference/command/replSetGetStatus/#replSetGetStatus.optimes.lastCommittedOpTime) + * lag under a configurable maximum value. + */ + enableFlowControl?: boolean; } export interface Mongocfgconfig44Enterprise { @@ -337,6 +428,78 @@ export interface Mongosconfig44Enterprise_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig4_4_enterprise.Network"; /** The maximum number of simultaneous connections that mongos will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongosconfig44Enterprise_Network_Compression; +} + +export interface Mongosconfig44Enterprise_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig4_4_enterprise.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongosconfig44Enterprise_Network_Compression_Compressor[]; +} + +export enum Mongosconfig44Enterprise_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongosconfig44Enterprise_Network_Compression_CompressorFromJSON( + object: any +): Mongosconfig44Enterprise_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongosconfig44Enterprise_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongosconfig44Enterprise_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongosconfig44Enterprise_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongosconfig44Enterprise_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongosconfig44Enterprise_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongosconfig44Enterprise_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongosconfig44Enterprise_Network_Compression_CompressorToJSON( + object: Mongosconfig44Enterprise_Network_Compression_Compressor +): string { + switch (object) { + case Mongosconfig44Enterprise_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongosconfig44Enterprise_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongosconfig44Enterprise_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongosconfig44Enterprise_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongosconfig44Enterprise_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } } export interface Mongodconfigset44Enterprise { @@ -734,6 +897,12 @@ export const Mongodconfig44Enterprise_Storage_WiredTiger = { writer.uint32(18).fork() ).ldelim(); } + if (message.indexConfig !== undefined) { + Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig.encode( + message.indexConfig, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -763,6 +932,13 @@ export const Mongodconfig44Enterprise_Storage_WiredTiger = { reader.uint32() ); break; + case 3: + message.indexConfig = + Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -787,6 +963,12 @@ export const Mongodconfig44Enterprise_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig.fromJSON( + object.indexConfig + ) + : undefined; return message; }, @@ -804,6 +986,12 @@ export const Mongodconfig44Enterprise_Storage_WiredTiger = { message.collectionConfig ) : undefined); + message.indexConfig !== undefined && + (obj.indexConfig = message.indexConfig + ? Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig.toJSON( + message.indexConfig + ) + : undefined); return obj; }, @@ -825,6 +1013,12 @@ export const Mongodconfig44Enterprise_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig.fromPartial( + object.indexConfig + ) + : undefined; return message; }, }; @@ -1013,6 +1207,99 @@ messageTypeRegistry.set( Mongodconfig44Enterprise_Storage_WiredTiger_CollectionConfig ); +const baseMongodconfig44Enterprise_Storage_WiredTiger_IndexConfig: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4_enterprise.Storage.WiredTiger.IndexConfig", +}; + +export const Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4_enterprise.Storage.WiredTiger.IndexConfig" as const, + + encode( + message: Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.prefixCompression !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.prefixCompression!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig44Enterprise_Storage_WiredTiger_IndexConfig, + } as Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prefixCompression = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON( + object: any + ): Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig44Enterprise_Storage_WiredTiger_IndexConfig, + } as Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig; + message.prefixCompression = + object.prefixCompression !== undefined && + object.prefixCompression !== null + ? Boolean(object.prefixCompression) + : undefined; + return message; + }, + + toJSON( + message: Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig + ): unknown { + const obj: any = {}; + message.prefixCompression !== undefined && + (obj.prefixCompression = message.prefixCompression); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig44Enterprise_Storage_WiredTiger_IndexConfig, + } as Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig; + message.prefixCompression = object.prefixCompression ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig.$type, + Mongodconfig44Enterprise_Storage_WiredTiger_IndexConfig +); + const baseMongodconfig44Enterprise_Storage_Journal: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4_enterprise.Storage.Journal", @@ -1121,6 +1408,15 @@ export const Mongodconfig44Enterprise_OperationProfiling = { writer.uint32(18).fork() ).ldelim(); } + if (message.slowOpSampleRate !== undefined) { + DoubleValue.encode( + { + $type: "google.protobuf.DoubleValue", + value: message.slowOpSampleRate!, + }, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -1145,6 +1441,12 @@ export const Mongodconfig44Enterprise_OperationProfiling = { reader.uint32() ).value; break; + case 3: + message.slowOpSampleRate = DoubleValue.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -1165,6 +1467,10 @@ export const Mongodconfig44Enterprise_OperationProfiling = { object.slowOpThreshold !== undefined && object.slowOpThreshold !== null ? Number(object.slowOpThreshold) : undefined; + message.slowOpSampleRate = + object.slowOpSampleRate !== undefined && object.slowOpSampleRate !== null + ? Number(object.slowOpSampleRate) + : undefined; return message; }, @@ -1176,6 +1482,8 @@ export const Mongodconfig44Enterprise_OperationProfiling = { )); message.slowOpThreshold !== undefined && (obj.slowOpThreshold = message.slowOpThreshold); + message.slowOpSampleRate !== undefined && + (obj.slowOpSampleRate = message.slowOpSampleRate); return obj; }, @@ -1187,6 +1495,7 @@ export const Mongodconfig44Enterprise_OperationProfiling = { } as Mongodconfig44Enterprise_OperationProfiling; message.mode = object.mode ?? 0; message.slowOpThreshold = object.slowOpThreshold ?? undefined; + message.slowOpSampleRate = object.slowOpSampleRate ?? undefined; return message; }, }; @@ -1218,6 +1527,12 @@ export const Mongodconfig44Enterprise_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongodconfig44Enterprise_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -1239,6 +1554,13 @@ export const Mongodconfig44Enterprise_Network = { reader.uint32() ).value; break; + case 2: + message.compression = + Mongodconfig44Enterprise_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1256,6 +1578,12 @@ export const Mongodconfig44Enterprise_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig44Enterprise_Network_Compression.fromJSON( + object.compression + ) + : undefined; return message; }, @@ -1263,6 +1591,12 @@ export const Mongodconfig44Enterprise_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongodconfig44Enterprise_Network_Compression.toJSON( + message.compression + ) + : undefined); return obj; }, @@ -1273,6 +1607,12 @@ export const Mongodconfig44Enterprise_Network = { ...baseMongodconfig44Enterprise_Network, } as Mongodconfig44Enterprise_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig44Enterprise_Network_Compression.fromPartial( + object.compression + ) + : undefined; return message; }, }; @@ -1282,6 +1622,100 @@ messageTypeRegistry.set( Mongodconfig44Enterprise_Network ); +const baseMongodconfig44Enterprise_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4_enterprise.Network.Compression", + compressors: 0, +}; + +export const Mongodconfig44Enterprise_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4_enterprise.Network.Compression" as const, + + encode( + message: Mongodconfig44Enterprise_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig44Enterprise_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig44Enterprise_Network_Compression, + } as Mongodconfig44Enterprise_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig44Enterprise_Network_Compression { + const message = { + ...baseMongodconfig44Enterprise_Network_Compression, + } as Mongodconfig44Enterprise_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongodconfig44Enterprise_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongodconfig44Enterprise_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongodconfig44Enterprise_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): Mongodconfig44Enterprise_Network_Compression { + const message = { + ...baseMongodconfig44Enterprise_Network_Compression, + } as Mongodconfig44Enterprise_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig44Enterprise_Network_Compression.$type, + Mongodconfig44Enterprise_Network_Compression +); + const baseMongodconfig44Enterprise_Security: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig4_4_enterprise.Security", @@ -1622,6 +2056,15 @@ export const Mongodconfig44Enterprise_SetParameter = { writer.uint32(10).fork() ).ldelim(); } + if (message.enableFlowControl !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.enableFlowControl!, + }, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -1643,6 +2086,12 @@ export const Mongodconfig44Enterprise_SetParameter = { reader.uint32() ).value; break; + case 2: + message.enableFlowControl = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -1660,6 +2109,11 @@ export const Mongodconfig44Enterprise_SetParameter = { object.auditAuthorizationSuccess !== null ? Boolean(object.auditAuthorizationSuccess) : undefined; + message.enableFlowControl = + object.enableFlowControl !== undefined && + object.enableFlowControl !== null + ? Boolean(object.enableFlowControl) + : undefined; return message; }, @@ -1667,6 +2121,8 @@ export const Mongodconfig44Enterprise_SetParameter = { const obj: any = {}; message.auditAuthorizationSuccess !== undefined && (obj.auditAuthorizationSuccess = message.auditAuthorizationSuccess); + message.enableFlowControl !== undefined && + (obj.enableFlowControl = message.enableFlowControl); return obj; }, @@ -1678,6 +2134,7 @@ export const Mongodconfig44Enterprise_SetParameter = { } as Mongodconfig44Enterprise_SetParameter; message.auditAuthorizationSuccess = object.auditAuthorizationSuccess ?? undefined; + message.enableFlowControl = object.enableFlowControl ?? undefined; return message; }, }; @@ -2410,6 +2867,12 @@ export const Mongosconfig44Enterprise_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongosconfig44Enterprise_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -2431,6 +2894,13 @@ export const Mongosconfig44Enterprise_Network = { reader.uint32() ).value; break; + case 2: + message.compression = + Mongosconfig44Enterprise_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2448,6 +2918,12 @@ export const Mongosconfig44Enterprise_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig44Enterprise_Network_Compression.fromJSON( + object.compression + ) + : undefined; return message; }, @@ -2455,6 +2931,12 @@ export const Mongosconfig44Enterprise_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongosconfig44Enterprise_Network_Compression.toJSON( + message.compression + ) + : undefined); return obj; }, @@ -2465,6 +2947,12 @@ export const Mongosconfig44Enterprise_Network = { ...baseMongosconfig44Enterprise_Network, } as Mongosconfig44Enterprise_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig44Enterprise_Network_Compression.fromPartial( + object.compression + ) + : undefined; return message; }, }; @@ -2474,6 +2962,100 @@ messageTypeRegistry.set( Mongosconfig44Enterprise_Network ); +const baseMongosconfig44Enterprise_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig4_4_enterprise.Network.Compression", + compressors: 0, +}; + +export const Mongosconfig44Enterprise_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig4_4_enterprise.Network.Compression" as const, + + encode( + message: Mongosconfig44Enterprise_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongosconfig44Enterprise_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongosconfig44Enterprise_Network_Compression, + } as Mongosconfig44Enterprise_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongosconfig44Enterprise_Network_Compression { + const message = { + ...baseMongosconfig44Enterprise_Network_Compression, + } as Mongosconfig44Enterprise_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongosconfig44Enterprise_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongosconfig44Enterprise_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongosconfig44Enterprise_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): Mongosconfig44Enterprise_Network_Compression { + const message = { + ...baseMongosconfig44Enterprise_Network_Compression, + } as Mongosconfig44Enterprise_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongosconfig44Enterprise_Network_Compression.$type, + Mongosconfig44Enterprise_Network_Compression +); + const baseMongodconfigset44Enterprise: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfigSet4_4_enterprise", }; diff --git a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb5_0.ts b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb5_0.ts index 5f25e071..f7320f5b 100644 --- a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb5_0.ts +++ b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb5_0.ts @@ -4,6 +4,7 @@ import Long from "long"; import _m0 from "protobufjs/minimal"; import { DoubleValue, + BoolValue, Int64Value, } from "../../../../../../google/protobuf/wrappers"; @@ -21,6 +22,8 @@ export interface Mongodconfig50 { operationProfiling?: Mongodconfig50_OperationProfiling; /** `net` section of mongod configuration. */ net?: Mongodconfig50_Network; + /** `SetParameter` section of mongod configuration. */ + setParameter?: Mongodconfig50_SetParameter; } export interface Mongodconfig50_Storage { @@ -38,6 +41,8 @@ export interface Mongodconfig50_Storage_WiredTiger { engineConfig?: Mongodconfig50_Storage_WiredTiger_EngineConfig; /** Collection configuration for WiredTiger. */ collectionConfig?: Mongodconfig50_Storage_WiredTiger_CollectionConfig; + /** Index configuration for WiredTiger */ + indexConfig?: Mongodconfig50_Storage_WiredTiger_IndexConfig; } export interface Mongodconfig50_Storage_WiredTiger_EngineConfig { @@ -110,6 +115,12 @@ export function mongodconfig50_Storage_WiredTiger_CollectionConfig_CompressorToJ } } +export interface Mongodconfig50_Storage_WiredTiger_IndexConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0.Storage.WiredTiger.IndexConfig"; + /** Enables or disables [prefix compression](https://www.mongodb.com/docs/manual/reference/glossary/#std-term-prefix-compression) */ + prefixCompression?: boolean; +} + export interface Mongodconfig50_Storage_Journal { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0.Storage.Journal"; /** @@ -129,6 +140,11 @@ export interface Mongodconfig50_OperationProfiling { * running in the SLOW_OP mode. */ slowOpThreshold?: number; + /** + * The fraction of slow operations that should be profiled or logged. + * operationProfiling.slowOpSampleRate accepts values between 0 and 1, inclusive. + */ + slowOpSampleRate?: number; } export enum Mongodconfig50_OperationProfiling_Mode { @@ -186,6 +202,90 @@ export interface Mongodconfig50_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0.Network"; /** The maximum number of simultaneous connections that mongod will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongodconfig50_Network_Compression; +} + +export interface Mongodconfig50_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongodconfig50_Network_Compression_Compressor[]; +} + +export enum Mongodconfig50_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongodconfig50_Network_Compression_CompressorFromJSON( + object: any +): Mongodconfig50_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongodconfig50_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongodconfig50_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongodconfig50_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongodconfig50_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongodconfig50_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongodconfig50_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongodconfig50_Network_Compression_CompressorToJSON( + object: Mongodconfig50_Network_Compression_Compressor +): string { + switch (object) { + case Mongodconfig50_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongodconfig50_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongodconfig50_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongodconfig50_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongodconfig50_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } +} + +export interface Mongodconfig50_SetParameter { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0.SetParameter"; + /** + * Enables or disables the mechanism that controls the rate at which the primary applies its writes with the + * goal of keeping the secondary members [majority committed](https://www.mongodb.com/docs/v4.2/reference/command/replSetGetStatus/#replSetGetStatus.optimes.lastCommittedOpTime) + * lag under a configurable maximum value. + */ + enableFlowControl?: boolean; + /** The minimum time window in seconds for which the storage engine keeps the snapshot history. */ + minSnapshotHistoryWindowInSeconds?: number; } export interface Mongocfgconfig50 { @@ -296,6 +396,78 @@ export interface Mongosconfig50_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig5_0.Network"; /** The maximum number of simultaneous connections that mongos will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongosconfig50_Network_Compression; +} + +export interface Mongosconfig50_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig5_0.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongosconfig50_Network_Compression_Compressor[]; +} + +export enum Mongosconfig50_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongosconfig50_Network_Compression_CompressorFromJSON( + object: any +): Mongosconfig50_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongosconfig50_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongosconfig50_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongosconfig50_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongosconfig50_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongosconfig50_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongosconfig50_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongosconfig50_Network_Compression_CompressorToJSON( + object: Mongosconfig50_Network_Compression_Compressor +): string { + switch (object) { + case Mongosconfig50_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongosconfig50_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongosconfig50_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongosconfig50_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongosconfig50_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } } export interface Mongodconfigset50 { @@ -366,6 +538,12 @@ export const Mongodconfig50 = { writer.uint32(26).fork() ).ldelim(); } + if (message.setParameter !== undefined) { + Mongodconfig50_SetParameter.encode( + message.setParameter, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -391,6 +569,12 @@ export const Mongodconfig50 = { case 3: message.net = Mongodconfig50_Network.decode(reader, reader.uint32()); break; + case 4: + message.setParameter = Mongodconfig50_SetParameter.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -414,6 +598,10 @@ export const Mongodconfig50 = { object.net !== undefined && object.net !== null ? Mongodconfig50_Network.fromJSON(object.net) : undefined; + message.setParameter = + object.setParameter !== undefined && object.setParameter !== null + ? Mongodconfig50_SetParameter.fromJSON(object.setParameter) + : undefined; return message; }, @@ -431,6 +619,10 @@ export const Mongodconfig50 = { (obj.net = message.net ? Mongodconfig50_Network.toJSON(message.net) : undefined); + message.setParameter !== undefined && + (obj.setParameter = message.setParameter + ? Mongodconfig50_SetParameter.toJSON(message.setParameter) + : undefined); return obj; }, @@ -453,6 +645,10 @@ export const Mongodconfig50 = { object.net !== undefined && object.net !== null ? Mongodconfig50_Network.fromPartial(object.net) : undefined; + message.setParameter = + object.setParameter !== undefined && object.setParameter !== null + ? Mongodconfig50_SetParameter.fromPartial(object.setParameter) + : undefined; return message; }, }; @@ -584,6 +780,12 @@ export const Mongodconfig50_Storage_WiredTiger = { writer.uint32(18).fork() ).ldelim(); } + if (message.indexConfig !== undefined) { + Mongodconfig50_Storage_WiredTiger_IndexConfig.encode( + message.indexConfig, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -613,6 +815,13 @@ export const Mongodconfig50_Storage_WiredTiger = { reader.uint32() ); break; + case 3: + message.indexConfig = + Mongodconfig50_Storage_WiredTiger_IndexConfig.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -637,6 +846,12 @@ export const Mongodconfig50_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig50_Storage_WiredTiger_IndexConfig.fromJSON( + object.indexConfig + ) + : undefined; return message; }, @@ -654,6 +869,12 @@ export const Mongodconfig50_Storage_WiredTiger = { message.collectionConfig ) : undefined); + message.indexConfig !== undefined && + (obj.indexConfig = message.indexConfig + ? Mongodconfig50_Storage_WiredTiger_IndexConfig.toJSON( + message.indexConfig + ) + : undefined); return obj; }, @@ -675,6 +896,12 @@ export const Mongodconfig50_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig50_Storage_WiredTiger_IndexConfig.fromPartial( + object.indexConfig + ) + : undefined; return message; }, }; @@ -854,6 +1081,95 @@ messageTypeRegistry.set( Mongodconfig50_Storage_WiredTiger_CollectionConfig ); +const baseMongodconfig50_Storage_WiredTiger_IndexConfig: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0.Storage.WiredTiger.IndexConfig", +}; + +export const Mongodconfig50_Storage_WiredTiger_IndexConfig = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0.Storage.WiredTiger.IndexConfig" as const, + + encode( + message: Mongodconfig50_Storage_WiredTiger_IndexConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.prefixCompression !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.prefixCompression!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig50_Storage_WiredTiger_IndexConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig50_Storage_WiredTiger_IndexConfig, + } as Mongodconfig50_Storage_WiredTiger_IndexConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prefixCompression = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig50_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig50_Storage_WiredTiger_IndexConfig, + } as Mongodconfig50_Storage_WiredTiger_IndexConfig; + message.prefixCompression = + object.prefixCompression !== undefined && + object.prefixCompression !== null + ? Boolean(object.prefixCompression) + : undefined; + return message; + }, + + toJSON(message: Mongodconfig50_Storage_WiredTiger_IndexConfig): unknown { + const obj: any = {}; + message.prefixCompression !== undefined && + (obj.prefixCompression = message.prefixCompression); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): Mongodconfig50_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig50_Storage_WiredTiger_IndexConfig, + } as Mongodconfig50_Storage_WiredTiger_IndexConfig; + message.prefixCompression = object.prefixCompression ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig50_Storage_WiredTiger_IndexConfig.$type, + Mongodconfig50_Storage_WiredTiger_IndexConfig +); + const baseMongodconfig50_Storage_Journal: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0.Storage.Journal", }; @@ -961,6 +1277,15 @@ export const Mongodconfig50_OperationProfiling = { writer.uint32(18).fork() ).ldelim(); } + if (message.slowOpSampleRate !== undefined) { + DoubleValue.encode( + { + $type: "google.protobuf.DoubleValue", + value: message.slowOpSampleRate!, + }, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -985,6 +1310,12 @@ export const Mongodconfig50_OperationProfiling = { reader.uint32() ).value; break; + case 3: + message.slowOpSampleRate = DoubleValue.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -1005,6 +1336,10 @@ export const Mongodconfig50_OperationProfiling = { object.slowOpThreshold !== undefined && object.slowOpThreshold !== null ? Number(object.slowOpThreshold) : undefined; + message.slowOpSampleRate = + object.slowOpSampleRate !== undefined && object.slowOpSampleRate !== null + ? Number(object.slowOpSampleRate) + : undefined; return message; }, @@ -1014,6 +1349,8 @@ export const Mongodconfig50_OperationProfiling = { (obj.mode = mongodconfig50_OperationProfiling_ModeToJSON(message.mode)); message.slowOpThreshold !== undefined && (obj.slowOpThreshold = message.slowOpThreshold); + message.slowOpSampleRate !== undefined && + (obj.slowOpSampleRate = message.slowOpSampleRate); return obj; }, @@ -1025,6 +1362,7 @@ export const Mongodconfig50_OperationProfiling = { } as Mongodconfig50_OperationProfiling; message.mode = object.mode ?? 0; message.slowOpThreshold = object.slowOpThreshold ?? undefined; + message.slowOpSampleRate = object.slowOpSampleRate ?? undefined; return message; }, }; @@ -1054,6 +1392,12 @@ export const Mongodconfig50_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongodconfig50_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -1073,6 +1417,12 @@ export const Mongodconfig50_Network = { reader.uint32() ).value; break; + case 2: + message.compression = Mongodconfig50_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1088,6 +1438,10 @@ export const Mongodconfig50_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig50_Network_Compression.fromJSON(object.compression) + : undefined; return message; }, @@ -1095,6 +1449,10 @@ export const Mongodconfig50_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongodconfig50_Network_Compression.toJSON(message.compression) + : undefined); return obj; }, @@ -1103,12 +1461,217 @@ export const Mongodconfig50_Network = { ): Mongodconfig50_Network { const message = { ...baseMongodconfig50_Network } as Mongodconfig50_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig50_Network_Compression.fromPartial(object.compression) + : undefined; return message; }, }; messageTypeRegistry.set(Mongodconfig50_Network.$type, Mongodconfig50_Network); +const baseMongodconfig50_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0.Network.Compression", + compressors: 0, +}; + +export const Mongodconfig50_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0.Network.Compression" as const, + + encode( + message: Mongodconfig50_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig50_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig50_Network_Compression, + } as Mongodconfig50_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig50_Network_Compression { + const message = { + ...baseMongodconfig50_Network_Compression, + } as Mongodconfig50_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongodconfig50_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongodconfig50_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongodconfig50_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): Mongodconfig50_Network_Compression { + const message = { + ...baseMongodconfig50_Network_Compression, + } as Mongodconfig50_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig50_Network_Compression.$type, + Mongodconfig50_Network_Compression +); + +const baseMongodconfig50_SetParameter: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0.SetParameter", +}; + +export const Mongodconfig50_SetParameter = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0.SetParameter" as const, + + encode( + message: Mongodconfig50_SetParameter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enableFlowControl !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.enableFlowControl!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.minSnapshotHistoryWindowInSeconds !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.minSnapshotHistoryWindowInSeconds!, + }, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig50_SetParameter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig50_SetParameter, + } as Mongodconfig50_SetParameter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enableFlowControl = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 2: + message.minSnapshotHistoryWindowInSeconds = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig50_SetParameter { + const message = { + ...baseMongodconfig50_SetParameter, + } as Mongodconfig50_SetParameter; + message.enableFlowControl = + object.enableFlowControl !== undefined && + object.enableFlowControl !== null + ? Boolean(object.enableFlowControl) + : undefined; + message.minSnapshotHistoryWindowInSeconds = + object.minSnapshotHistoryWindowInSeconds !== undefined && + object.minSnapshotHistoryWindowInSeconds !== null + ? Number(object.minSnapshotHistoryWindowInSeconds) + : undefined; + return message; + }, + + toJSON(message: Mongodconfig50_SetParameter): unknown { + const obj: any = {}; + message.enableFlowControl !== undefined && + (obj.enableFlowControl = message.enableFlowControl); + message.minSnapshotHistoryWindowInSeconds !== undefined && + (obj.minSnapshotHistoryWindowInSeconds = + message.minSnapshotHistoryWindowInSeconds); + return obj; + }, + + fromPartial, I>>( + object: I + ): Mongodconfig50_SetParameter { + const message = { + ...baseMongodconfig50_SetParameter, + } as Mongodconfig50_SetParameter; + message.enableFlowControl = object.enableFlowControl ?? undefined; + message.minSnapshotHistoryWindowInSeconds = + object.minSnapshotHistoryWindowInSeconds ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig50_SetParameter.$type, + Mongodconfig50_SetParameter +); + const baseMongocfgconfig50: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig5_0", }; @@ -1773,6 +2336,12 @@ export const Mongosconfig50_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongosconfig50_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -1792,6 +2361,12 @@ export const Mongosconfig50_Network = { reader.uint32() ).value; break; + case 2: + message.compression = Mongosconfig50_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1807,6 +2382,10 @@ export const Mongosconfig50_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig50_Network_Compression.fromJSON(object.compression) + : undefined; return message; }, @@ -1814,6 +2393,10 @@ export const Mongosconfig50_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongosconfig50_Network_Compression.toJSON(message.compression) + : undefined); return obj; }, @@ -1822,12 +2405,107 @@ export const Mongosconfig50_Network = { ): Mongosconfig50_Network { const message = { ...baseMongosconfig50_Network } as Mongosconfig50_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig50_Network_Compression.fromPartial(object.compression) + : undefined; return message; }, }; messageTypeRegistry.set(Mongosconfig50_Network.$type, Mongosconfig50_Network); +const baseMongosconfig50_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig5_0.Network.Compression", + compressors: 0, +}; + +export const Mongosconfig50_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig5_0.Network.Compression" as const, + + encode( + message: Mongosconfig50_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongosconfig50_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongosconfig50_Network_Compression, + } as Mongosconfig50_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongosconfig50_Network_Compression { + const message = { + ...baseMongosconfig50_Network_Compression, + } as Mongosconfig50_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongosconfig50_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongosconfig50_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongosconfig50_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): Mongosconfig50_Network_Compression { + const message = { + ...baseMongosconfig50_Network_Compression, + } as Mongosconfig50_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongosconfig50_Network_Compression.$type, + Mongosconfig50_Network_Compression +); + const baseMongodconfigset50: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfigSet5_0", }; diff --git a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb5_0_enterprise.ts b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb5_0_enterprise.ts index 7a850308..81881834 100644 --- a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb5_0_enterprise.ts +++ b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb5_0_enterprise.ts @@ -4,8 +4,8 @@ import Long from "long"; import _m0 from "protobufjs/minimal"; import { DoubleValue, - Int64Value, BoolValue, + Int64Value, } from "../../../../../../google/protobuf/wrappers"; export const protobufPackage = "yandex.cloud.mdb.mongodb.v1.config"; @@ -45,6 +45,8 @@ export interface Mongodconfig50Enterprise_Storage_WiredTiger { engineConfig?: Mongodconfig50Enterprise_Storage_WiredTiger_EngineConfig; /** Collection configuration for WiredTiger. */ collectionConfig?: Mongodconfig50Enterprise_Storage_WiredTiger_CollectionConfig; + /** Index configuration for WiredTiger */ + indexConfig?: Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig; } export interface Mongodconfig50Enterprise_Storage_WiredTiger_EngineConfig { @@ -117,6 +119,12 @@ export function mongodconfig50Enterprise_Storage_WiredTiger_CollectionConfig_Com } } +export interface Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0_enterprise.Storage.WiredTiger.IndexConfig"; + /** Enables or disables [prefix compression](https://www.mongodb.com/docs/manual/reference/glossary/#std-term-prefix-compression) */ + prefixCompression?: boolean; +} + export interface Mongodconfig50Enterprise_Storage_Journal { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0_enterprise.Storage.Journal"; /** @@ -136,6 +144,11 @@ export interface Mongodconfig50Enterprise_OperationProfiling { * running in the SLOW_OP mode. */ slowOpThreshold?: number; + /** + * The fraction of slow operations that should be profiled or logged. + * operationProfiling.slowOpSampleRate accepts values between 0 and 1, inclusive. + */ + slowOpSampleRate?: number; } export enum Mongodconfig50Enterprise_OperationProfiling_Mode { @@ -193,6 +206,78 @@ export interface Mongodconfig50Enterprise_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0_enterprise.Network"; /** The maximum number of simultaneous connections that mongod will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongodconfig50Enterprise_Network_Compression; +} + +export interface Mongodconfig50Enterprise_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0_enterprise.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongodconfig50Enterprise_Network_Compression_Compressor[]; +} + +export enum Mongodconfig50Enterprise_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongodconfig50Enterprise_Network_Compression_CompressorFromJSON( + object: any +): Mongodconfig50Enterprise_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongodconfig50Enterprise_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongodconfig50Enterprise_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongodconfig50Enterprise_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongodconfig50Enterprise_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongodconfig50Enterprise_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongodconfig50Enterprise_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongodconfig50Enterprise_Network_Compression_CompressorToJSON( + object: Mongodconfig50Enterprise_Network_Compression_Compressor +): string { + switch (object) { + case Mongodconfig50Enterprise_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongodconfig50Enterprise_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongodconfig50Enterprise_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongodconfig50Enterprise_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongodconfig50Enterprise_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } } export interface Mongodconfig50Enterprise_Security { @@ -229,6 +314,14 @@ export interface Mongodconfig50Enterprise_SetParameter { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0_enterprise.SetParameter"; /** Enables the auditing of authorization successes */ auditAuthorizationSuccess?: boolean; + /** + * Enables or disables the mechanism that controls the rate at which the primary applies its writes with the + * goal of keeping the secondary members [majority committed](https://www.mongodb.com/docs/v4.2/reference/command/replSetGetStatus/#replSetGetStatus.optimes.lastCommittedOpTime) + * lag under a configurable maximum value. + */ + enableFlowControl?: boolean; + /** The minimum time window in seconds for which the storage engine keeps the snapshot history. */ + minSnapshotHistoryWindowInSeconds?: number; } export interface Mongocfgconfig50Enterprise { @@ -339,6 +432,78 @@ export interface Mongosconfig50Enterprise_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig5_0_enterprise.Network"; /** The maximum number of simultaneous connections that mongos will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongosconfig50Enterprise_Network_Compression; +} + +export interface Mongosconfig50Enterprise_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig5_0_enterprise.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongosconfig50Enterprise_Network_Compression_Compressor[]; +} + +export enum Mongosconfig50Enterprise_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongosconfig50Enterprise_Network_Compression_CompressorFromJSON( + object: any +): Mongosconfig50Enterprise_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongosconfig50Enterprise_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongosconfig50Enterprise_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongosconfig50Enterprise_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongosconfig50Enterprise_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongosconfig50Enterprise_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongosconfig50Enterprise_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongosconfig50Enterprise_Network_Compression_CompressorToJSON( + object: Mongosconfig50Enterprise_Network_Compression_Compressor +): string { + switch (object) { + case Mongosconfig50Enterprise_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongosconfig50Enterprise_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongosconfig50Enterprise_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongosconfig50Enterprise_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongosconfig50Enterprise_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } } export interface Mongodconfigset50Enterprise { @@ -736,6 +901,12 @@ export const Mongodconfig50Enterprise_Storage_WiredTiger = { writer.uint32(18).fork() ).ldelim(); } + if (message.indexConfig !== undefined) { + Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig.encode( + message.indexConfig, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -765,6 +936,13 @@ export const Mongodconfig50Enterprise_Storage_WiredTiger = { reader.uint32() ); break; + case 3: + message.indexConfig = + Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -789,6 +967,12 @@ export const Mongodconfig50Enterprise_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig.fromJSON( + object.indexConfig + ) + : undefined; return message; }, @@ -806,6 +990,12 @@ export const Mongodconfig50Enterprise_Storage_WiredTiger = { message.collectionConfig ) : undefined); + message.indexConfig !== undefined && + (obj.indexConfig = message.indexConfig + ? Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig.toJSON( + message.indexConfig + ) + : undefined); return obj; }, @@ -827,6 +1017,12 @@ export const Mongodconfig50Enterprise_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig.fromPartial( + object.indexConfig + ) + : undefined; return message; }, }; @@ -1015,6 +1211,99 @@ messageTypeRegistry.set( Mongodconfig50Enterprise_Storage_WiredTiger_CollectionConfig ); +const baseMongodconfig50Enterprise_Storage_WiredTiger_IndexConfig: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0_enterprise.Storage.WiredTiger.IndexConfig", +}; + +export const Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0_enterprise.Storage.WiredTiger.IndexConfig" as const, + + encode( + message: Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.prefixCompression !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.prefixCompression!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig50Enterprise_Storage_WiredTiger_IndexConfig, + } as Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prefixCompression = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON( + object: any + ): Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig50Enterprise_Storage_WiredTiger_IndexConfig, + } as Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig; + message.prefixCompression = + object.prefixCompression !== undefined && + object.prefixCompression !== null + ? Boolean(object.prefixCompression) + : undefined; + return message; + }, + + toJSON( + message: Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig + ): unknown { + const obj: any = {}; + message.prefixCompression !== undefined && + (obj.prefixCompression = message.prefixCompression); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig50Enterprise_Storage_WiredTiger_IndexConfig, + } as Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig; + message.prefixCompression = object.prefixCompression ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig.$type, + Mongodconfig50Enterprise_Storage_WiredTiger_IndexConfig +); + const baseMongodconfig50Enterprise_Storage_Journal: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0_enterprise.Storage.Journal", @@ -1123,6 +1412,15 @@ export const Mongodconfig50Enterprise_OperationProfiling = { writer.uint32(18).fork() ).ldelim(); } + if (message.slowOpSampleRate !== undefined) { + DoubleValue.encode( + { + $type: "google.protobuf.DoubleValue", + value: message.slowOpSampleRate!, + }, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -1147,6 +1445,12 @@ export const Mongodconfig50Enterprise_OperationProfiling = { reader.uint32() ).value; break; + case 3: + message.slowOpSampleRate = DoubleValue.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -1167,6 +1471,10 @@ export const Mongodconfig50Enterprise_OperationProfiling = { object.slowOpThreshold !== undefined && object.slowOpThreshold !== null ? Number(object.slowOpThreshold) : undefined; + message.slowOpSampleRate = + object.slowOpSampleRate !== undefined && object.slowOpSampleRate !== null + ? Number(object.slowOpSampleRate) + : undefined; return message; }, @@ -1178,6 +1486,8 @@ export const Mongodconfig50Enterprise_OperationProfiling = { )); message.slowOpThreshold !== undefined && (obj.slowOpThreshold = message.slowOpThreshold); + message.slowOpSampleRate !== undefined && + (obj.slowOpSampleRate = message.slowOpSampleRate); return obj; }, @@ -1189,6 +1499,7 @@ export const Mongodconfig50Enterprise_OperationProfiling = { } as Mongodconfig50Enterprise_OperationProfiling; message.mode = object.mode ?? 0; message.slowOpThreshold = object.slowOpThreshold ?? undefined; + message.slowOpSampleRate = object.slowOpSampleRate ?? undefined; return message; }, }; @@ -1220,6 +1531,12 @@ export const Mongodconfig50Enterprise_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongodconfig50Enterprise_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -1241,6 +1558,13 @@ export const Mongodconfig50Enterprise_Network = { reader.uint32() ).value; break; + case 2: + message.compression = + Mongodconfig50Enterprise_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1258,6 +1582,12 @@ export const Mongodconfig50Enterprise_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig50Enterprise_Network_Compression.fromJSON( + object.compression + ) + : undefined; return message; }, @@ -1265,6 +1595,12 @@ export const Mongodconfig50Enterprise_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongodconfig50Enterprise_Network_Compression.toJSON( + message.compression + ) + : undefined); return obj; }, @@ -1275,6 +1611,12 @@ export const Mongodconfig50Enterprise_Network = { ...baseMongodconfig50Enterprise_Network, } as Mongodconfig50Enterprise_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig50Enterprise_Network_Compression.fromPartial( + object.compression + ) + : undefined; return message; }, }; @@ -1284,6 +1626,100 @@ messageTypeRegistry.set( Mongodconfig50Enterprise_Network ); +const baseMongodconfig50Enterprise_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0_enterprise.Network.Compression", + compressors: 0, +}; + +export const Mongodconfig50Enterprise_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0_enterprise.Network.Compression" as const, + + encode( + message: Mongodconfig50Enterprise_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig50Enterprise_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig50Enterprise_Network_Compression, + } as Mongodconfig50Enterprise_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig50Enterprise_Network_Compression { + const message = { + ...baseMongodconfig50Enterprise_Network_Compression, + } as Mongodconfig50Enterprise_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongodconfig50Enterprise_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongodconfig50Enterprise_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongodconfig50Enterprise_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): Mongodconfig50Enterprise_Network_Compression { + const message = { + ...baseMongodconfig50Enterprise_Network_Compression, + } as Mongodconfig50Enterprise_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig50Enterprise_Network_Compression.$type, + Mongodconfig50Enterprise_Network_Compression +); + const baseMongodconfig50Enterprise_Security: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig5_0_enterprise.Security", @@ -1647,6 +2083,24 @@ export const Mongodconfig50Enterprise_SetParameter = { writer.uint32(10).fork() ).ldelim(); } + if (message.enableFlowControl !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.enableFlowControl!, + }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.minSnapshotHistoryWindowInSeconds !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.minSnapshotHistoryWindowInSeconds!, + }, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -1668,6 +2122,18 @@ export const Mongodconfig50Enterprise_SetParameter = { reader.uint32() ).value; break; + case 2: + message.enableFlowControl = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 3: + message.minSnapshotHistoryWindowInSeconds = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -1685,6 +2151,16 @@ export const Mongodconfig50Enterprise_SetParameter = { object.auditAuthorizationSuccess !== null ? Boolean(object.auditAuthorizationSuccess) : undefined; + message.enableFlowControl = + object.enableFlowControl !== undefined && + object.enableFlowControl !== null + ? Boolean(object.enableFlowControl) + : undefined; + message.minSnapshotHistoryWindowInSeconds = + object.minSnapshotHistoryWindowInSeconds !== undefined && + object.minSnapshotHistoryWindowInSeconds !== null + ? Number(object.minSnapshotHistoryWindowInSeconds) + : undefined; return message; }, @@ -1692,6 +2168,11 @@ export const Mongodconfig50Enterprise_SetParameter = { const obj: any = {}; message.auditAuthorizationSuccess !== undefined && (obj.auditAuthorizationSuccess = message.auditAuthorizationSuccess); + message.enableFlowControl !== undefined && + (obj.enableFlowControl = message.enableFlowControl); + message.minSnapshotHistoryWindowInSeconds !== undefined && + (obj.minSnapshotHistoryWindowInSeconds = + message.minSnapshotHistoryWindowInSeconds); return obj; }, @@ -1703,6 +2184,9 @@ export const Mongodconfig50Enterprise_SetParameter = { } as Mongodconfig50Enterprise_SetParameter; message.auditAuthorizationSuccess = object.auditAuthorizationSuccess ?? undefined; + message.enableFlowControl = object.enableFlowControl ?? undefined; + message.minSnapshotHistoryWindowInSeconds = + object.minSnapshotHistoryWindowInSeconds ?? undefined; return message; }, }; @@ -2435,6 +2919,12 @@ export const Mongosconfig50Enterprise_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongosconfig50Enterprise_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -2456,6 +2946,13 @@ export const Mongosconfig50Enterprise_Network = { reader.uint32() ).value; break; + case 2: + message.compression = + Mongosconfig50Enterprise_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2473,6 +2970,12 @@ export const Mongosconfig50Enterprise_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig50Enterprise_Network_Compression.fromJSON( + object.compression + ) + : undefined; return message; }, @@ -2480,6 +2983,12 @@ export const Mongosconfig50Enterprise_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongosconfig50Enterprise_Network_Compression.toJSON( + message.compression + ) + : undefined); return obj; }, @@ -2490,6 +2999,12 @@ export const Mongosconfig50Enterprise_Network = { ...baseMongosconfig50Enterprise_Network, } as Mongosconfig50Enterprise_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig50Enterprise_Network_Compression.fromPartial( + object.compression + ) + : undefined; return message; }, }; @@ -2499,6 +3014,100 @@ messageTypeRegistry.set( Mongosconfig50Enterprise_Network ); +const baseMongosconfig50Enterprise_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig5_0_enterprise.Network.Compression", + compressors: 0, +}; + +export const Mongosconfig50Enterprise_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig5_0_enterprise.Network.Compression" as const, + + encode( + message: Mongosconfig50Enterprise_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongosconfig50Enterprise_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongosconfig50Enterprise_Network_Compression, + } as Mongosconfig50Enterprise_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongosconfig50Enterprise_Network_Compression { + const message = { + ...baseMongosconfig50Enterprise_Network_Compression, + } as Mongosconfig50Enterprise_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongosconfig50Enterprise_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongosconfig50Enterprise_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongosconfig50Enterprise_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): Mongosconfig50Enterprise_Network_Compression { + const message = { + ...baseMongosconfig50Enterprise_Network_Compression, + } as Mongosconfig50Enterprise_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongosconfig50Enterprise_Network_Compression.$type, + Mongosconfig50Enterprise_Network_Compression +); + const baseMongodconfigset50Enterprise: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfigSet5_0_enterprise", }; diff --git a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb6_0.ts b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb6_0.ts index 53e0a283..ec8337eb 100644 --- a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb6_0.ts +++ b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb6_0.ts @@ -4,6 +4,7 @@ import Long from "long"; import _m0 from "protobufjs/minimal"; import { DoubleValue, + BoolValue, Int64Value, } from "../../../../../../google/protobuf/wrappers"; @@ -21,6 +22,8 @@ export interface Mongodconfig60 { operationProfiling?: Mongodconfig60_OperationProfiling; /** `net` section of mongod configuration. */ net?: Mongodconfig60_Network; + /** `SetParameter` section of mongod configuration. */ + setParameter?: Mongodconfig60_SetParameter; } export interface Mongodconfig60_Storage { @@ -38,6 +41,8 @@ export interface Mongodconfig60_Storage_WiredTiger { engineConfig?: Mongodconfig60_Storage_WiredTiger_EngineConfig; /** Collection configuration for WiredTiger. */ collectionConfig?: Mongodconfig60_Storage_WiredTiger_CollectionConfig; + /** Index configuration for WiredTiger */ + indexConfig?: Mongodconfig60_Storage_WiredTiger_IndexConfig; } export interface Mongodconfig60_Storage_WiredTiger_EngineConfig { @@ -110,6 +115,12 @@ export function mongodconfig60_Storage_WiredTiger_CollectionConfig_CompressorToJ } } +export interface Mongodconfig60_Storage_WiredTiger_IndexConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0.Storage.WiredTiger.IndexConfig"; + /** Enables or disables [prefix compression](https://www.mongodb.com/docs/manual/reference/glossary/#std-term-prefix-compression) */ + prefixCompression?: boolean; +} + export interface Mongodconfig60_Storage_Journal { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0.Storage.Journal"; /** @@ -129,6 +140,11 @@ export interface Mongodconfig60_OperationProfiling { * running in the SLOW_OP mode. */ slowOpThreshold?: number; + /** + * The fraction of slow operations that should be profiled or logged. + * operationProfiling.slowOpSampleRate accepts values between 0 and 1, inclusive. + */ + slowOpSampleRate?: number; } export enum Mongodconfig60_OperationProfiling_Mode { @@ -186,6 +202,90 @@ export interface Mongodconfig60_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0.Network"; /** The maximum number of simultaneous connections that mongod will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongodconfig60_Network_Compression; +} + +export interface Mongodconfig60_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongodconfig60_Network_Compression_Compressor[]; +} + +export enum Mongodconfig60_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongodconfig60_Network_Compression_CompressorFromJSON( + object: any +): Mongodconfig60_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongodconfig60_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongodconfig60_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongodconfig60_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongodconfig60_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongodconfig60_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongodconfig60_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongodconfig60_Network_Compression_CompressorToJSON( + object: Mongodconfig60_Network_Compression_Compressor +): string { + switch (object) { + case Mongodconfig60_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongodconfig60_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongodconfig60_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongodconfig60_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongodconfig60_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } +} + +export interface Mongodconfig60_SetParameter { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0.SetParameter"; + /** + * Enables or disables the mechanism that controls the rate at which the primary applies its writes with the + * goal of keeping the secondary members [majority committed](https://www.mongodb.com/docs/v4.2/reference/command/replSetGetStatus/#replSetGetStatus.optimes.lastCommittedOpTime) + * lag under a configurable maximum value. + */ + enableFlowControl?: boolean; + /** The minimum time window in seconds for which the storage engine keeps the snapshot history. */ + minSnapshotHistoryWindowInSeconds?: number; } export interface Mongocfgconfig60 { @@ -296,6 +396,78 @@ export interface Mongosconfig60_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig6_0.Network"; /** The maximum number of simultaneous connections that mongos will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongosconfig60_Network_Compression; +} + +export interface Mongosconfig60_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig6_0.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongosconfig60_Network_Compression_Compressor[]; +} + +export enum Mongosconfig60_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongosconfig60_Network_Compression_CompressorFromJSON( + object: any +): Mongosconfig60_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongosconfig60_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongosconfig60_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongosconfig60_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongosconfig60_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongosconfig60_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongosconfig60_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongosconfig60_Network_Compression_CompressorToJSON( + object: Mongosconfig60_Network_Compression_Compressor +): string { + switch (object) { + case Mongosconfig60_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongosconfig60_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongosconfig60_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongosconfig60_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongosconfig60_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } } export interface Mongodconfigset60 { @@ -366,6 +538,12 @@ export const Mongodconfig60 = { writer.uint32(26).fork() ).ldelim(); } + if (message.setParameter !== undefined) { + Mongodconfig60_SetParameter.encode( + message.setParameter, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -391,6 +569,12 @@ export const Mongodconfig60 = { case 3: message.net = Mongodconfig60_Network.decode(reader, reader.uint32()); break; + case 4: + message.setParameter = Mongodconfig60_SetParameter.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -414,6 +598,10 @@ export const Mongodconfig60 = { object.net !== undefined && object.net !== null ? Mongodconfig60_Network.fromJSON(object.net) : undefined; + message.setParameter = + object.setParameter !== undefined && object.setParameter !== null + ? Mongodconfig60_SetParameter.fromJSON(object.setParameter) + : undefined; return message; }, @@ -431,6 +619,10 @@ export const Mongodconfig60 = { (obj.net = message.net ? Mongodconfig60_Network.toJSON(message.net) : undefined); + message.setParameter !== undefined && + (obj.setParameter = message.setParameter + ? Mongodconfig60_SetParameter.toJSON(message.setParameter) + : undefined); return obj; }, @@ -453,6 +645,10 @@ export const Mongodconfig60 = { object.net !== undefined && object.net !== null ? Mongodconfig60_Network.fromPartial(object.net) : undefined; + message.setParameter = + object.setParameter !== undefined && object.setParameter !== null + ? Mongodconfig60_SetParameter.fromPartial(object.setParameter) + : undefined; return message; }, }; @@ -584,6 +780,12 @@ export const Mongodconfig60_Storage_WiredTiger = { writer.uint32(18).fork() ).ldelim(); } + if (message.indexConfig !== undefined) { + Mongodconfig60_Storage_WiredTiger_IndexConfig.encode( + message.indexConfig, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -613,6 +815,13 @@ export const Mongodconfig60_Storage_WiredTiger = { reader.uint32() ); break; + case 3: + message.indexConfig = + Mongodconfig60_Storage_WiredTiger_IndexConfig.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -637,6 +846,12 @@ export const Mongodconfig60_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig60_Storage_WiredTiger_IndexConfig.fromJSON( + object.indexConfig + ) + : undefined; return message; }, @@ -654,6 +869,12 @@ export const Mongodconfig60_Storage_WiredTiger = { message.collectionConfig ) : undefined); + message.indexConfig !== undefined && + (obj.indexConfig = message.indexConfig + ? Mongodconfig60_Storage_WiredTiger_IndexConfig.toJSON( + message.indexConfig + ) + : undefined); return obj; }, @@ -675,6 +896,12 @@ export const Mongodconfig60_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig60_Storage_WiredTiger_IndexConfig.fromPartial( + object.indexConfig + ) + : undefined; return message; }, }; @@ -854,6 +1081,95 @@ messageTypeRegistry.set( Mongodconfig60_Storage_WiredTiger_CollectionConfig ); +const baseMongodconfig60_Storage_WiredTiger_IndexConfig: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0.Storage.WiredTiger.IndexConfig", +}; + +export const Mongodconfig60_Storage_WiredTiger_IndexConfig = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0.Storage.WiredTiger.IndexConfig" as const, + + encode( + message: Mongodconfig60_Storage_WiredTiger_IndexConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.prefixCompression !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.prefixCompression!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig60_Storage_WiredTiger_IndexConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig60_Storage_WiredTiger_IndexConfig, + } as Mongodconfig60_Storage_WiredTiger_IndexConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prefixCompression = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig60_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig60_Storage_WiredTiger_IndexConfig, + } as Mongodconfig60_Storage_WiredTiger_IndexConfig; + message.prefixCompression = + object.prefixCompression !== undefined && + object.prefixCompression !== null + ? Boolean(object.prefixCompression) + : undefined; + return message; + }, + + toJSON(message: Mongodconfig60_Storage_WiredTiger_IndexConfig): unknown { + const obj: any = {}; + message.prefixCompression !== undefined && + (obj.prefixCompression = message.prefixCompression); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): Mongodconfig60_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig60_Storage_WiredTiger_IndexConfig, + } as Mongodconfig60_Storage_WiredTiger_IndexConfig; + message.prefixCompression = object.prefixCompression ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig60_Storage_WiredTiger_IndexConfig.$type, + Mongodconfig60_Storage_WiredTiger_IndexConfig +); + const baseMongodconfig60_Storage_Journal: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0.Storage.Journal", }; @@ -961,6 +1277,15 @@ export const Mongodconfig60_OperationProfiling = { writer.uint32(18).fork() ).ldelim(); } + if (message.slowOpSampleRate !== undefined) { + DoubleValue.encode( + { + $type: "google.protobuf.DoubleValue", + value: message.slowOpSampleRate!, + }, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -985,6 +1310,12 @@ export const Mongodconfig60_OperationProfiling = { reader.uint32() ).value; break; + case 3: + message.slowOpSampleRate = DoubleValue.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -1005,6 +1336,10 @@ export const Mongodconfig60_OperationProfiling = { object.slowOpThreshold !== undefined && object.slowOpThreshold !== null ? Number(object.slowOpThreshold) : undefined; + message.slowOpSampleRate = + object.slowOpSampleRate !== undefined && object.slowOpSampleRate !== null + ? Number(object.slowOpSampleRate) + : undefined; return message; }, @@ -1014,6 +1349,8 @@ export const Mongodconfig60_OperationProfiling = { (obj.mode = mongodconfig60_OperationProfiling_ModeToJSON(message.mode)); message.slowOpThreshold !== undefined && (obj.slowOpThreshold = message.slowOpThreshold); + message.slowOpSampleRate !== undefined && + (obj.slowOpSampleRate = message.slowOpSampleRate); return obj; }, @@ -1025,6 +1362,7 @@ export const Mongodconfig60_OperationProfiling = { } as Mongodconfig60_OperationProfiling; message.mode = object.mode ?? 0; message.slowOpThreshold = object.slowOpThreshold ?? undefined; + message.slowOpSampleRate = object.slowOpSampleRate ?? undefined; return message; }, }; @@ -1054,6 +1392,12 @@ export const Mongodconfig60_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongodconfig60_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -1073,6 +1417,12 @@ export const Mongodconfig60_Network = { reader.uint32() ).value; break; + case 2: + message.compression = Mongodconfig60_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1088,6 +1438,10 @@ export const Mongodconfig60_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig60_Network_Compression.fromJSON(object.compression) + : undefined; return message; }, @@ -1095,6 +1449,10 @@ export const Mongodconfig60_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongodconfig60_Network_Compression.toJSON(message.compression) + : undefined); return obj; }, @@ -1103,12 +1461,217 @@ export const Mongodconfig60_Network = { ): Mongodconfig60_Network { const message = { ...baseMongodconfig60_Network } as Mongodconfig60_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig60_Network_Compression.fromPartial(object.compression) + : undefined; return message; }, }; messageTypeRegistry.set(Mongodconfig60_Network.$type, Mongodconfig60_Network); +const baseMongodconfig60_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0.Network.Compression", + compressors: 0, +}; + +export const Mongodconfig60_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0.Network.Compression" as const, + + encode( + message: Mongodconfig60_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig60_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig60_Network_Compression, + } as Mongodconfig60_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig60_Network_Compression { + const message = { + ...baseMongodconfig60_Network_Compression, + } as Mongodconfig60_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongodconfig60_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongodconfig60_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongodconfig60_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): Mongodconfig60_Network_Compression { + const message = { + ...baseMongodconfig60_Network_Compression, + } as Mongodconfig60_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig60_Network_Compression.$type, + Mongodconfig60_Network_Compression +); + +const baseMongodconfig60_SetParameter: object = { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0.SetParameter", +}; + +export const Mongodconfig60_SetParameter = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0.SetParameter" as const, + + encode( + message: Mongodconfig60_SetParameter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enableFlowControl !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.enableFlowControl!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.minSnapshotHistoryWindowInSeconds !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.minSnapshotHistoryWindowInSeconds!, + }, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig60_SetParameter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig60_SetParameter, + } as Mongodconfig60_SetParameter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enableFlowControl = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 2: + message.minSnapshotHistoryWindowInSeconds = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig60_SetParameter { + const message = { + ...baseMongodconfig60_SetParameter, + } as Mongodconfig60_SetParameter; + message.enableFlowControl = + object.enableFlowControl !== undefined && + object.enableFlowControl !== null + ? Boolean(object.enableFlowControl) + : undefined; + message.minSnapshotHistoryWindowInSeconds = + object.minSnapshotHistoryWindowInSeconds !== undefined && + object.minSnapshotHistoryWindowInSeconds !== null + ? Number(object.minSnapshotHistoryWindowInSeconds) + : undefined; + return message; + }, + + toJSON(message: Mongodconfig60_SetParameter): unknown { + const obj: any = {}; + message.enableFlowControl !== undefined && + (obj.enableFlowControl = message.enableFlowControl); + message.minSnapshotHistoryWindowInSeconds !== undefined && + (obj.minSnapshotHistoryWindowInSeconds = + message.minSnapshotHistoryWindowInSeconds); + return obj; + }, + + fromPartial, I>>( + object: I + ): Mongodconfig60_SetParameter { + const message = { + ...baseMongodconfig60_SetParameter, + } as Mongodconfig60_SetParameter; + message.enableFlowControl = object.enableFlowControl ?? undefined; + message.minSnapshotHistoryWindowInSeconds = + object.minSnapshotHistoryWindowInSeconds ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig60_SetParameter.$type, + Mongodconfig60_SetParameter +); + const baseMongocfgconfig60: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongoCfgConfig6_0", }; @@ -1773,6 +2336,12 @@ export const Mongosconfig60_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongosconfig60_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -1792,6 +2361,12 @@ export const Mongosconfig60_Network = { reader.uint32() ).value; break; + case 2: + message.compression = Mongosconfig60_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1807,6 +2382,10 @@ export const Mongosconfig60_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig60_Network_Compression.fromJSON(object.compression) + : undefined; return message; }, @@ -1814,6 +2393,10 @@ export const Mongosconfig60_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongosconfig60_Network_Compression.toJSON(message.compression) + : undefined); return obj; }, @@ -1822,12 +2405,107 @@ export const Mongosconfig60_Network = { ): Mongosconfig60_Network { const message = { ...baseMongosconfig60_Network } as Mongosconfig60_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig60_Network_Compression.fromPartial(object.compression) + : undefined; return message; }, }; messageTypeRegistry.set(Mongosconfig60_Network.$type, Mongosconfig60_Network); +const baseMongosconfig60_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig6_0.Network.Compression", + compressors: 0, +}; + +export const Mongosconfig60_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig6_0.Network.Compression" as const, + + encode( + message: Mongosconfig60_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongosconfig60_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongosconfig60_Network_Compression, + } as Mongosconfig60_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongosconfig60_Network_Compression { + const message = { + ...baseMongosconfig60_Network_Compression, + } as Mongosconfig60_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongosconfig60_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongosconfig60_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongosconfig60_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): Mongosconfig60_Network_Compression { + const message = { + ...baseMongosconfig60_Network_Compression, + } as Mongosconfig60_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongosconfig60_Network_Compression.$type, + Mongosconfig60_Network_Compression +); + const baseMongodconfigset60: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfigSet6_0", }; diff --git a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb6_0_enterprise.ts b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb6_0_enterprise.ts index 9185800a..4d6ff72c 100644 --- a/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb6_0_enterprise.ts +++ b/src/generated/yandex/cloud/mdb/mongodb/v1/config/mongodb6_0_enterprise.ts @@ -4,8 +4,8 @@ import Long from "long"; import _m0 from "protobufjs/minimal"; import { DoubleValue, - Int64Value, BoolValue, + Int64Value, } from "../../../../../../google/protobuf/wrappers"; export const protobufPackage = "yandex.cloud.mdb.mongodb.v1.config"; @@ -45,6 +45,8 @@ export interface Mongodconfig60Enterprise_Storage_WiredTiger { engineConfig?: Mongodconfig60Enterprise_Storage_WiredTiger_EngineConfig; /** Collection configuration for WiredTiger. */ collectionConfig?: Mongodconfig60Enterprise_Storage_WiredTiger_CollectionConfig; + /** Index configuration for WiredTiger */ + indexConfig?: Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig; } export interface Mongodconfig60Enterprise_Storage_WiredTiger_EngineConfig { @@ -117,6 +119,12 @@ export function mongodconfig60Enterprise_Storage_WiredTiger_CollectionConfig_Com } } +export interface Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0_enterprise.Storage.WiredTiger.IndexConfig"; + /** Enables or disables [prefix compression](https://www.mongodb.com/docs/manual/reference/glossary/#std-term-prefix-compression) */ + prefixCompression?: boolean; +} + export interface Mongodconfig60Enterprise_Storage_Journal { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0_enterprise.Storage.Journal"; /** @@ -136,6 +144,11 @@ export interface Mongodconfig60Enterprise_OperationProfiling { * running in the SLOW_OP mode. */ slowOpThreshold?: number; + /** + * The fraction of slow operations that should be profiled or logged. + * operationProfiling.slowOpSampleRate accepts values between 0 and 1, inclusive. + */ + slowOpSampleRate?: number; } export enum Mongodconfig60Enterprise_OperationProfiling_Mode { @@ -193,6 +206,78 @@ export interface Mongodconfig60Enterprise_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0_enterprise.Network"; /** The maximum number of simultaneous connections that mongod will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongodconfig60Enterprise_Network_Compression; +} + +export interface Mongodconfig60Enterprise_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0_enterprise.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongodconfig60Enterprise_Network_Compression_Compressor[]; +} + +export enum Mongodconfig60Enterprise_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongodconfig60Enterprise_Network_Compression_CompressorFromJSON( + object: any +): Mongodconfig60Enterprise_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongodconfig60Enterprise_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongodconfig60Enterprise_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongodconfig60Enterprise_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongodconfig60Enterprise_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongodconfig60Enterprise_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongodconfig60Enterprise_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongodconfig60Enterprise_Network_Compression_CompressorToJSON( + object: Mongodconfig60Enterprise_Network_Compression_Compressor +): string { + switch (object) { + case Mongodconfig60Enterprise_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongodconfig60Enterprise_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongodconfig60Enterprise_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongodconfig60Enterprise_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongodconfig60Enterprise_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } } export interface Mongodconfig60Enterprise_Security { @@ -229,6 +314,14 @@ export interface Mongodconfig60Enterprise_SetParameter { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0_enterprise.SetParameter"; /** Enables the auditing of authorization successes */ auditAuthorizationSuccess?: boolean; + /** + * Enables or disables the mechanism that controls the rate at which the primary applies its writes with the + * goal of keeping the secondary members [majority committed](https://www.mongodb.com/docs/v4.2/reference/command/replSetGetStatus/#replSetGetStatus.optimes.lastCommittedOpTime) + * lag under a configurable maximum value. + */ + enableFlowControl?: boolean; + /** The minimum time window in seconds for which the storage engine keeps the snapshot history. */ + minSnapshotHistoryWindowInSeconds?: number; } export interface Mongocfgconfig60Enterprise { @@ -339,6 +432,78 @@ export interface Mongosconfig60Enterprise_Network { $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig6_0_enterprise.Network"; /** The maximum number of simultaneous connections that mongos will accept. */ maxIncomingConnections?: number; + /** Compression settings */ + compression?: Mongosconfig60Enterprise_Network_Compression; +} + +export interface Mongosconfig60Enterprise_Network_Compression { + $type: "yandex.cloud.mdb.mongodb.v1.config.MongosConfig6_0_enterprise.Network.Compression"; + /** + * Specifies the default compressor(s) to use for communication between this mongod or mongos instance and: + * - other members of the deployment if the instance is part of a replica set or a sharded cluster + * - mongosh + * - drivers that support the OP_COMPRESSED message format. + * MongoDB supports the following compressors: + */ + compressors: Mongosconfig60Enterprise_Network_Compression_Compressor[]; +} + +export enum Mongosconfig60Enterprise_Network_Compression_Compressor { + COMPRESSOR_UNSPECIFIED = 0, + /** SNAPPY - The [Snappy](https://docs.mongodb.com/v4.2/reference/glossary/#term-snappy) compression. */ + SNAPPY = 1, + /** ZLIB - The [zlib](https://docs.mongodb.com/v4.2/reference/glossary/#term-zlib) compression. */ + ZLIB = 2, + /** ZSTD - The [zstd](https://docs.mongodb.com/v4.2/reference/glossary/#term-zstd) compression. */ + ZSTD = 3, + /** DISABLED - No compression */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function mongosconfig60Enterprise_Network_Compression_CompressorFromJSON( + object: any +): Mongosconfig60Enterprise_Network_Compression_Compressor { + switch (object) { + case 0: + case "COMPRESSOR_UNSPECIFIED": + return Mongosconfig60Enterprise_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED; + case 1: + case "SNAPPY": + return Mongosconfig60Enterprise_Network_Compression_Compressor.SNAPPY; + case 2: + case "ZLIB": + return Mongosconfig60Enterprise_Network_Compression_Compressor.ZLIB; + case 3: + case "ZSTD": + return Mongosconfig60Enterprise_Network_Compression_Compressor.ZSTD; + case 4: + case "DISABLED": + return Mongosconfig60Enterprise_Network_Compression_Compressor.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Mongosconfig60Enterprise_Network_Compression_Compressor.UNRECOGNIZED; + } +} + +export function mongosconfig60Enterprise_Network_Compression_CompressorToJSON( + object: Mongosconfig60Enterprise_Network_Compression_Compressor +): string { + switch (object) { + case Mongosconfig60Enterprise_Network_Compression_Compressor.COMPRESSOR_UNSPECIFIED: + return "COMPRESSOR_UNSPECIFIED"; + case Mongosconfig60Enterprise_Network_Compression_Compressor.SNAPPY: + return "SNAPPY"; + case Mongosconfig60Enterprise_Network_Compression_Compressor.ZLIB: + return "ZLIB"; + case Mongosconfig60Enterprise_Network_Compression_Compressor.ZSTD: + return "ZSTD"; + case Mongosconfig60Enterprise_Network_Compression_Compressor.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } } export interface Mongodconfigset60Enterprise { @@ -736,6 +901,12 @@ export const Mongodconfig60Enterprise_Storage_WiredTiger = { writer.uint32(18).fork() ).ldelim(); } + if (message.indexConfig !== undefined) { + Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig.encode( + message.indexConfig, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -765,6 +936,13 @@ export const Mongodconfig60Enterprise_Storage_WiredTiger = { reader.uint32() ); break; + case 3: + message.indexConfig = + Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -789,6 +967,12 @@ export const Mongodconfig60Enterprise_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig.fromJSON( + object.indexConfig + ) + : undefined; return message; }, @@ -806,6 +990,12 @@ export const Mongodconfig60Enterprise_Storage_WiredTiger = { message.collectionConfig ) : undefined); + message.indexConfig !== undefined && + (obj.indexConfig = message.indexConfig + ? Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig.toJSON( + message.indexConfig + ) + : undefined); return obj; }, @@ -827,6 +1017,12 @@ export const Mongodconfig60Enterprise_Storage_WiredTiger = { object.collectionConfig ) : undefined; + message.indexConfig = + object.indexConfig !== undefined && object.indexConfig !== null + ? Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig.fromPartial( + object.indexConfig + ) + : undefined; return message; }, }; @@ -1015,6 +1211,99 @@ messageTypeRegistry.set( Mongodconfig60Enterprise_Storage_WiredTiger_CollectionConfig ); +const baseMongodconfig60Enterprise_Storage_WiredTiger_IndexConfig: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0_enterprise.Storage.WiredTiger.IndexConfig", +}; + +export const Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0_enterprise.Storage.WiredTiger.IndexConfig" as const, + + encode( + message: Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.prefixCompression !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.prefixCompression!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig60Enterprise_Storage_WiredTiger_IndexConfig, + } as Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prefixCompression = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON( + object: any + ): Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig60Enterprise_Storage_WiredTiger_IndexConfig, + } as Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig; + message.prefixCompression = + object.prefixCompression !== undefined && + object.prefixCompression !== null + ? Boolean(object.prefixCompression) + : undefined; + return message; + }, + + toJSON( + message: Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig + ): unknown { + const obj: any = {}; + message.prefixCompression !== undefined && + (obj.prefixCompression = message.prefixCompression); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig { + const message = { + ...baseMongodconfig60Enterprise_Storage_WiredTiger_IndexConfig, + } as Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig; + message.prefixCompression = object.prefixCompression ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig.$type, + Mongodconfig60Enterprise_Storage_WiredTiger_IndexConfig +); + const baseMongodconfig60Enterprise_Storage_Journal: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0_enterprise.Storage.Journal", @@ -1123,6 +1412,15 @@ export const Mongodconfig60Enterprise_OperationProfiling = { writer.uint32(18).fork() ).ldelim(); } + if (message.slowOpSampleRate !== undefined) { + DoubleValue.encode( + { + $type: "google.protobuf.DoubleValue", + value: message.slowOpSampleRate!, + }, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -1147,6 +1445,12 @@ export const Mongodconfig60Enterprise_OperationProfiling = { reader.uint32() ).value; break; + case 3: + message.slowOpSampleRate = DoubleValue.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -1167,6 +1471,10 @@ export const Mongodconfig60Enterprise_OperationProfiling = { object.slowOpThreshold !== undefined && object.slowOpThreshold !== null ? Number(object.slowOpThreshold) : undefined; + message.slowOpSampleRate = + object.slowOpSampleRate !== undefined && object.slowOpSampleRate !== null + ? Number(object.slowOpSampleRate) + : undefined; return message; }, @@ -1178,6 +1486,8 @@ export const Mongodconfig60Enterprise_OperationProfiling = { )); message.slowOpThreshold !== undefined && (obj.slowOpThreshold = message.slowOpThreshold); + message.slowOpSampleRate !== undefined && + (obj.slowOpSampleRate = message.slowOpSampleRate); return obj; }, @@ -1189,6 +1499,7 @@ export const Mongodconfig60Enterprise_OperationProfiling = { } as Mongodconfig60Enterprise_OperationProfiling; message.mode = object.mode ?? 0; message.slowOpThreshold = object.slowOpThreshold ?? undefined; + message.slowOpSampleRate = object.slowOpSampleRate ?? undefined; return message; }, }; @@ -1220,6 +1531,12 @@ export const Mongodconfig60Enterprise_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongodconfig60Enterprise_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -1241,6 +1558,13 @@ export const Mongodconfig60Enterprise_Network = { reader.uint32() ).value; break; + case 2: + message.compression = + Mongodconfig60Enterprise_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1258,6 +1582,12 @@ export const Mongodconfig60Enterprise_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig60Enterprise_Network_Compression.fromJSON( + object.compression + ) + : undefined; return message; }, @@ -1265,6 +1595,12 @@ export const Mongodconfig60Enterprise_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongodconfig60Enterprise_Network_Compression.toJSON( + message.compression + ) + : undefined); return obj; }, @@ -1275,6 +1611,12 @@ export const Mongodconfig60Enterprise_Network = { ...baseMongodconfig60Enterprise_Network, } as Mongodconfig60Enterprise_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongodconfig60Enterprise_Network_Compression.fromPartial( + object.compression + ) + : undefined; return message; }, }; @@ -1284,6 +1626,100 @@ messageTypeRegistry.set( Mongodconfig60Enterprise_Network ); +const baseMongodconfig60Enterprise_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0_enterprise.Network.Compression", + compressors: 0, +}; + +export const Mongodconfig60Enterprise_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0_enterprise.Network.Compression" as const, + + encode( + message: Mongodconfig60Enterprise_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongodconfig60Enterprise_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongodconfig60Enterprise_Network_Compression, + } as Mongodconfig60Enterprise_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongodconfig60Enterprise_Network_Compression { + const message = { + ...baseMongodconfig60Enterprise_Network_Compression, + } as Mongodconfig60Enterprise_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongodconfig60Enterprise_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongodconfig60Enterprise_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongodconfig60Enterprise_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): Mongodconfig60Enterprise_Network_Compression { + const message = { + ...baseMongodconfig60Enterprise_Network_Compression, + } as Mongodconfig60Enterprise_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongodconfig60Enterprise_Network_Compression.$type, + Mongodconfig60Enterprise_Network_Compression +); + const baseMongodconfig60Enterprise_Security: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfig6_0_enterprise.Security", @@ -1647,6 +2083,24 @@ export const Mongodconfig60Enterprise_SetParameter = { writer.uint32(10).fork() ).ldelim(); } + if (message.enableFlowControl !== undefined) { + BoolValue.encode( + { + $type: "google.protobuf.BoolValue", + value: message.enableFlowControl!, + }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.minSnapshotHistoryWindowInSeconds !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.minSnapshotHistoryWindowInSeconds!, + }, + writer.uint32(26).fork() + ).ldelim(); + } return writer; }, @@ -1668,6 +2122,18 @@ export const Mongodconfig60Enterprise_SetParameter = { reader.uint32() ).value; break; + case 2: + message.enableFlowControl = BoolValue.decode( + reader, + reader.uint32() + ).value; + break; + case 3: + message.minSnapshotHistoryWindowInSeconds = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -1685,6 +2151,16 @@ export const Mongodconfig60Enterprise_SetParameter = { object.auditAuthorizationSuccess !== null ? Boolean(object.auditAuthorizationSuccess) : undefined; + message.enableFlowControl = + object.enableFlowControl !== undefined && + object.enableFlowControl !== null + ? Boolean(object.enableFlowControl) + : undefined; + message.minSnapshotHistoryWindowInSeconds = + object.minSnapshotHistoryWindowInSeconds !== undefined && + object.minSnapshotHistoryWindowInSeconds !== null + ? Number(object.minSnapshotHistoryWindowInSeconds) + : undefined; return message; }, @@ -1692,6 +2168,11 @@ export const Mongodconfig60Enterprise_SetParameter = { const obj: any = {}; message.auditAuthorizationSuccess !== undefined && (obj.auditAuthorizationSuccess = message.auditAuthorizationSuccess); + message.enableFlowControl !== undefined && + (obj.enableFlowControl = message.enableFlowControl); + message.minSnapshotHistoryWindowInSeconds !== undefined && + (obj.minSnapshotHistoryWindowInSeconds = + message.minSnapshotHistoryWindowInSeconds); return obj; }, @@ -1703,6 +2184,9 @@ export const Mongodconfig60Enterprise_SetParameter = { } as Mongodconfig60Enterprise_SetParameter; message.auditAuthorizationSuccess = object.auditAuthorizationSuccess ?? undefined; + message.enableFlowControl = object.enableFlowControl ?? undefined; + message.minSnapshotHistoryWindowInSeconds = + object.minSnapshotHistoryWindowInSeconds ?? undefined; return message; }, }; @@ -2435,6 +2919,12 @@ export const Mongosconfig60Enterprise_Network = { writer.uint32(10).fork() ).ldelim(); } + if (message.compression !== undefined) { + Mongosconfig60Enterprise_Network_Compression.encode( + message.compression, + writer.uint32(18).fork() + ).ldelim(); + } return writer; }, @@ -2456,6 +2946,13 @@ export const Mongosconfig60Enterprise_Network = { reader.uint32() ).value; break; + case 2: + message.compression = + Mongosconfig60Enterprise_Network_Compression.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2473,6 +2970,12 @@ export const Mongosconfig60Enterprise_Network = { object.maxIncomingConnections !== null ? Number(object.maxIncomingConnections) : undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig60Enterprise_Network_Compression.fromJSON( + object.compression + ) + : undefined; return message; }, @@ -2480,6 +2983,12 @@ export const Mongosconfig60Enterprise_Network = { const obj: any = {}; message.maxIncomingConnections !== undefined && (obj.maxIncomingConnections = message.maxIncomingConnections); + message.compression !== undefined && + (obj.compression = message.compression + ? Mongosconfig60Enterprise_Network_Compression.toJSON( + message.compression + ) + : undefined); return obj; }, @@ -2490,6 +2999,12 @@ export const Mongosconfig60Enterprise_Network = { ...baseMongosconfig60Enterprise_Network, } as Mongosconfig60Enterprise_Network; message.maxIncomingConnections = object.maxIncomingConnections ?? undefined; + message.compression = + object.compression !== undefined && object.compression !== null + ? Mongosconfig60Enterprise_Network_Compression.fromPartial( + object.compression + ) + : undefined; return message; }, }; @@ -2499,6 +3014,100 @@ messageTypeRegistry.set( Mongosconfig60Enterprise_Network ); +const baseMongosconfig60Enterprise_Network_Compression: object = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig6_0_enterprise.Network.Compression", + compressors: 0, +}; + +export const Mongosconfig60Enterprise_Network_Compression = { + $type: + "yandex.cloud.mdb.mongodb.v1.config.MongosConfig6_0_enterprise.Network.Compression" as const, + + encode( + message: Mongosconfig60Enterprise_Network_Compression, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.compressors) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Mongosconfig60Enterprise_Network_Compression { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMongosconfig60Enterprise_Network_Compression, + } as Mongosconfig60Enterprise_Network_Compression; + message.compressors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.compressors.push(reader.int32() as any); + } + } else { + message.compressors.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mongosconfig60Enterprise_Network_Compression { + const message = { + ...baseMongosconfig60Enterprise_Network_Compression, + } as Mongosconfig60Enterprise_Network_Compression; + message.compressors = (object.compressors ?? []).map((e: any) => + mongosconfig60Enterprise_Network_Compression_CompressorFromJSON(e) + ); + return message; + }, + + toJSON(message: Mongosconfig60Enterprise_Network_Compression): unknown { + const obj: any = {}; + if (message.compressors) { + obj.compressors = message.compressors.map((e) => + mongosconfig60Enterprise_Network_Compression_CompressorToJSON(e) + ); + } else { + obj.compressors = []; + } + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): Mongosconfig60Enterprise_Network_Compression { + const message = { + ...baseMongosconfig60Enterprise_Network_Compression, + } as Mongosconfig60Enterprise_Network_Compression; + message.compressors = object.compressors?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Mongosconfig60Enterprise_Network_Compression.$type, + Mongosconfig60Enterprise_Network_Compression +); + const baseMongodconfigset60Enterprise: object = { $type: "yandex.cloud.mdb.mongodb.v1.config.MongodConfigSet6_0_enterprise", }; diff --git a/src/generated/yandex/cloud/mdb/mysql/v1/backup.ts b/src/generated/yandex/cloud/mdb/mysql/v1/backup.ts index 470e230e..8e601b55 100644 --- a/src/generated/yandex/cloud/mdb/mysql/v1/backup.ts +++ b/src/generated/yandex/cloud/mdb/mysql/v1/backup.ts @@ -27,6 +27,8 @@ export interface Backup { size: number; /** How this backup was created (manual/automatic/etc...) */ type: Backup_BackupCreationType; + /** Status of backup */ + status: Backup_BackupStatus; } export enum Backup_BackupCreationType { @@ -73,6 +75,46 @@ export function backup_BackupCreationTypeToJSON( } } +export enum Backup_BackupStatus { + BACKUP_STATUS_UNSPECIFIED = 0, + /** DONE - Backup is done */ + DONE = 1, + /** CREATING - Backup is creating */ + CREATING = 2, + UNRECOGNIZED = -1, +} + +export function backup_BackupStatusFromJSON(object: any): Backup_BackupStatus { + switch (object) { + case 0: + case "BACKUP_STATUS_UNSPECIFIED": + return Backup_BackupStatus.BACKUP_STATUS_UNSPECIFIED; + case 1: + case "DONE": + return Backup_BackupStatus.DONE; + case 2: + case "CREATING": + return Backup_BackupStatus.CREATING; + case -1: + case "UNRECOGNIZED": + default: + return Backup_BackupStatus.UNRECOGNIZED; + } +} + +export function backup_BackupStatusToJSON(object: Backup_BackupStatus): string { + switch (object) { + case Backup_BackupStatus.BACKUP_STATUS_UNSPECIFIED: + return "BACKUP_STATUS_UNSPECIFIED"; + case Backup_BackupStatus.DONE: + return "DONE"; + case Backup_BackupStatus.CREATING: + return "CREATING"; + default: + return "UNKNOWN"; + } +} + const baseBackup: object = { $type: "yandex.cloud.mdb.mysql.v1.Backup", id: "", @@ -80,6 +122,7 @@ const baseBackup: object = { sourceClusterId: "", size: 0, type: 0, + status: 0, }; export const Backup = { @@ -116,6 +159,9 @@ export const Backup = { if (message.type !== 0) { writer.uint32(56).int32(message.type); } + if (message.status !== 0) { + writer.uint32(64).int32(message.status); + } return writer; }, @@ -151,6 +197,9 @@ export const Backup = { case 7: message.type = reader.int32() as any; break; + case 8: + message.status = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -187,6 +236,10 @@ export const Backup = { object.type !== undefined && object.type !== null ? backup_BackupCreationTypeFromJSON(object.type) : 0; + message.status = + object.status !== undefined && object.status !== null + ? backup_BackupStatusFromJSON(object.status) + : 0; return message; }, @@ -203,6 +256,8 @@ export const Backup = { message.size !== undefined && (obj.size = Math.round(message.size)); message.type !== undefined && (obj.type = backup_BackupCreationTypeToJSON(message.type)); + message.status !== undefined && + (obj.status = backup_BackupStatusToJSON(message.status)); return obj; }, @@ -215,6 +270,7 @@ export const Backup = { message.startedAt = object.startedAt ?? undefined; message.size = object.size ?? 0; message.type = object.type ?? 0; + message.status = object.status ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/mysql/v1/backup_service.ts b/src/generated/yandex/cloud/mdb/mysql/v1/backup_service.ts index bcf4b1c7..26043452 100644 --- a/src/generated/yandex/cloud/mdb/mysql/v1/backup_service.ts +++ b/src/generated/yandex/cloud/mdb/mysql/v1/backup_service.ts @@ -15,6 +15,7 @@ import { } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; import { Backup } from "../../../../../yandex/cloud/mdb/mysql/v1/backup"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; export const protobufPackage = "yandex.cloud.mdb.mysql.v1"; @@ -484,6 +485,18 @@ export const BackupServiceService = { Buffer.from(ListBackupsResponse.encode(value).finish()), responseDeserialize: (value: Buffer) => ListBackupsResponse.decode(value), }, + /** Deletes the specified MySQL cluster backup. */ + delete: { + path: "/yandex.cloud.mdb.mysql.v1.BackupService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteBackupRequest) => + Buffer.from(DeleteBackupRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteBackupRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface BackupServiceServer extends UntypedServiceImplementation { @@ -495,6 +508,8 @@ export interface BackupServiceServer extends UntypedServiceImplementation { * To list backups for an existing cluster, make a [ClusterService.ListBackups] request. */ list: handleUnaryCall; + /** Deletes the specified MySQL cluster backup. */ + delete: handleUnaryCall; } export interface BackupServiceClient extends Client { @@ -543,6 +558,22 @@ export interface BackupServiceClient extends Client { response: ListBackupsResponse ) => void ): ClientUnaryCall; + /** Deletes the specified MySQL cluster backup. */ + delete( + request: DeleteBackupRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteBackupRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteBackupRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const BackupServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/mdb/mysql/v1/cluster.ts b/src/generated/yandex/cloud/mdb/mysql/v1/cluster.ts index 8f1f2975..e0708996 100644 --- a/src/generated/yandex/cloud/mdb/mysql/v1/cluster.ts +++ b/src/generated/yandex/cloud/mdb/mysql/v1/cluster.ts @@ -37,7 +37,7 @@ export interface Cluster { description: string; /** Custom labels for the cluster as `key:value` pairs. */ labels: { [key: string]: string }; - /** Deployment environment of the cluster. */ + /** Deployment environment of the MySQL cluster. */ environment: Cluster_Environment; /** Monitoring systems data that is relevant to the cluster. */ monitoring: Monitoring[]; @@ -284,9 +284,9 @@ export interface Host { zoneId: string; /** Resources allocated to the host. */ resources?: Resources; - /** Role of the host in the cluster. */ + /** Role of the host in the cluster. If the field has default value, it is not returned in the response. */ role: Host_Role; - /** Aggregated health of the host. */ + /** Aggregated health of the host. If the field has default value, it is not returned in the response. */ health: Host_Health; /** List of services provided by the host. */ services: Service[]; @@ -303,7 +303,7 @@ export interface Host { } export enum Host_Role { - /** ROLE_UNKNOWN - Role of the host is unknown. */ + /** ROLE_UNKNOWN - Role of the host is unknown. Default value. */ ROLE_UNKNOWN = 0, /** MASTER - Host is the master. */ MASTER = 1, @@ -344,7 +344,7 @@ export function host_RoleToJSON(object: Host_Role): string { } export enum Host_Health { - /** HEALTH_UNKNOWN - Health of the host is unknown. */ + /** HEALTH_UNKNOWN - Health of the host is unknown. Default value. */ HEALTH_UNKNOWN = 0, /** ALIVE - Host is performing all its functions normally. */ ALIVE = 1, @@ -400,13 +400,14 @@ export function host_HealthToJSON(object: Host_Health): string { export interface Service { $type: "yandex.cloud.mdb.mysql.v1.Service"; - /** Type of the service provided by the host. */ + /** Type of the service provided by the host. If the field has default value, it is not returned in the response. */ type: Service_Type; - /** Aggregated health of the service. */ + /** Aggregated health of the service. If the field has default value, it is not returned in the response. */ health: Service_Health; } export enum Service_Type { + /** TYPE_UNSPECIFIED - Service type of the host is unspecified. Default value. */ TYPE_UNSPECIFIED = 0, /** MYSQL - The host is a MySQL server. */ MYSQL = 1, @@ -440,7 +441,7 @@ export function service_TypeToJSON(object: Service_Type): string { } export enum Service_Health { - /** HEALTH_UNKNOWN - Health of the service is unknown. */ + /** HEALTH_UNKNOWN - Health of the service is unknown. Default value. */ HEALTH_UNKNOWN = 0, /** ALIVE - The service is working normally. */ ALIVE = 1, diff --git a/src/generated/yandex/cloud/mdb/mysql/v1/cluster_service.ts b/src/generated/yandex/cloud/mdb/mysql/v1/cluster_service.ts index cec7e21f..0a8292fb 100644 --- a/src/generated/yandex/cloud/mdb/mysql/v1/cluster_service.ts +++ b/src/generated/yandex/cloud/mdb/mysql/v1/cluster_service.ts @@ -109,7 +109,7 @@ export interface CreateClusterRequest { description: string; /** Custom labels for the cluster as `key:value` pairs. */ labels: { [key: string]: string }; - /** Deployment environment of the cluster. */ + /** Deployment environment of the MySQL cluster. */ environment: Cluster_Environment; /** Configuration of the cluster. */ configSpec?: ConfigSpec; @@ -170,6 +170,8 @@ export interface UpdateClusterRequest { securityGroupIds: string[]; /** This option prevents unintended deletion of the cluster. */ deletionProtection: boolean; + /** ID of the network to move the cluster to. */ + networkId: string; } export interface UpdateClusterRequest_LabelsEntry { @@ -234,7 +236,7 @@ export interface RestoreClusterRequest { description: string; /** Custom labels for the new cluster as `key:value` pairs. */ labels: { [key: string]: string }; - /** Deployment environment for the new cluster. */ + /** Deployment environment of the new cluster. */ environment: Cluster_Environment; /** Configuration of the new cluster. */ configSpec?: ConfigSpec; @@ -1616,6 +1618,7 @@ const baseUpdateClusterRequest: object = { name: "", securityGroupIds: "", deletionProtection: false, + networkId: "", }; export const UpdateClusterRequest = { @@ -1662,6 +1665,9 @@ export const UpdateClusterRequest = { if (message.deletionProtection === true) { writer.uint32(72).bool(message.deletionProtection); } + if (message.networkId !== "") { + writer.uint32(90).string(message.networkId); + } return writer; }, @@ -1713,6 +1719,9 @@ export const UpdateClusterRequest = { case 9: message.deletionProtection = reader.bool(); break; + case 11: + message.networkId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1762,6 +1771,10 @@ export const UpdateClusterRequest = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : false; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; return message; }, @@ -1796,6 +1809,7 @@ export const UpdateClusterRequest = { } message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + message.networkId !== undefined && (obj.networkId = message.networkId); return obj; }, @@ -1829,6 +1843,7 @@ export const UpdateClusterRequest = { : undefined; message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; message.deletionProtection = object.deletionProtection ?? false; + message.networkId = object.networkId ?? ""; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/mysql/v1/config/mysql5_7.ts b/src/generated/yandex/cloud/mdb/mysql/v1/config/mysql5_7.ts index a6ed8dcb..4983a85f 100644 --- a/src/generated/yandex/cloud/mdb/mysql/v1/config/mysql5_7.ts +++ b/src/generated/yandex/cloud/mdb/mysql/v1/config/mysql5_7.ts @@ -514,6 +514,18 @@ export interface Mysqlconfig57 { * For details, see [Percona documentation for the variable](https://docs.percona.com/percona-server/5.7/diagnostics/response_time_distribution.html#query_response_time_stats). */ queryResponseTimeStats?: boolean; + /** + * Enables or disables collection of statistics + * + * For details, see [Percona documentation for the variable](https://docs.percona.com/percona-server/5.7/diagnostics/user_stats.html#userstat). + */ + userstat?: boolean; + /** + * The execution timeout for SELECT statements, in milliseconds. If the value is 0, timeouts are not enabled. + * + * For details, see [MySQL documentation for the variable](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_execution_time) + */ + maxExecutionTime?: number; } export enum Mysqlconfig57_SQLMode { @@ -1759,6 +1771,21 @@ export const Mysqlconfig57 = { writer.uint32(682).fork() ).ldelim(); } + if (message.userstat !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.userstat! }, + writer.uint32(690).fork() + ).ldelim(); + } + if (message.maxExecutionTime !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.maxExecutionTime!, + }, + writer.uint32(698).fork() + ).ldelim(); + } return writer; }, @@ -2247,6 +2274,15 @@ export const Mysqlconfig57 = { reader.uint32() ).value; break; + case 86: + message.userstat = BoolValue.decode(reader, reader.uint32()).value; + break; + case 87: + message.maxExecutionTime = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -2649,6 +2685,14 @@ export const Mysqlconfig57 = { object.queryResponseTimeStats !== null ? Boolean(object.queryResponseTimeStats) : undefined; + message.userstat = + object.userstat !== undefined && object.userstat !== null + ? Boolean(object.userstat) + : undefined; + message.maxExecutionTime = + object.maxExecutionTime !== undefined && object.maxExecutionTime !== null + ? Number(object.maxExecutionTime) + : undefined; return message; }, @@ -2843,6 +2887,9 @@ export const Mysqlconfig57 = { (obj.optimizerSearchDepth = message.optimizerSearchDepth); message.queryResponseTimeStats !== undefined && (obj.queryResponseTimeStats = message.queryResponseTimeStats); + message.userstat !== undefined && (obj.userstat = message.userstat); + message.maxExecutionTime !== undefined && + (obj.maxExecutionTime = message.maxExecutionTime); return obj; }, @@ -2954,6 +3001,8 @@ export const Mysqlconfig57 = { message.optimizerSwitch = object.optimizerSwitch ?? ""; message.optimizerSearchDepth = object.optimizerSearchDepth ?? undefined; message.queryResponseTimeStats = object.queryResponseTimeStats ?? undefined; + message.userstat = object.userstat ?? undefined; + message.maxExecutionTime = object.maxExecutionTime ?? undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/mysql/v1/config/mysql8_0.ts b/src/generated/yandex/cloud/mdb/mysql/v1/config/mysql8_0.ts index bf0064df..5d5b036f 100644 --- a/src/generated/yandex/cloud/mdb/mysql/v1/config/mysql8_0.ts +++ b/src/generated/yandex/cloud/mdb/mysql/v1/config/mysql8_0.ts @@ -490,6 +490,18 @@ export interface Mysqlconfig80 { * For details, see [MySQL documentation for the variable](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html) */ optimizerSearchDepth?: number; + /** + * Enables or disables collection of statistics + * + * For details, see [Percona documentation for the variable](https://docs.percona.com/percona-server/8.0/diagnostics/user_stats.html#userstat). + */ + userstat?: boolean; + /** + * The execution timeout for SELECT statements, in milliseconds. If the value is 0, timeouts are not enabled. + * + * For details, see [MySQL documentation for the variable](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_execution_time) + */ + maxExecutionTime?: number; } export enum Mysqlconfig80_SQLMode { @@ -1645,6 +1657,21 @@ export const Mysqlconfig80 = { writer.uint32(650).fork() ).ldelim(); } + if (message.userstat !== undefined) { + BoolValue.encode( + { $type: "google.protobuf.BoolValue", value: message.userstat! }, + writer.uint32(658).fork() + ).ldelim(); + } + if (message.maxExecutionTime !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.maxExecutionTime!, + }, + writer.uint32(666).fork() + ).ldelim(); + } return writer; }, @@ -2109,6 +2136,15 @@ export const Mysqlconfig80 = { reader.uint32() ).value; break; + case 82: + message.userstat = BoolValue.decode(reader, reader.uint32()).value; + break; + case 83: + message.maxExecutionTime = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -2493,6 +2529,14 @@ export const Mysqlconfig80 = { object.optimizerSearchDepth !== null ? Number(object.optimizerSearchDepth) : undefined; + message.userstat = + object.userstat !== undefined && object.userstat !== null + ? Boolean(object.userstat) + : undefined; + message.maxExecutionTime = + object.maxExecutionTime !== undefined && object.maxExecutionTime !== null + ? Number(object.maxExecutionTime) + : undefined; return message; }, @@ -2679,6 +2723,9 @@ export const Mysqlconfig80 = { (obj.optimizerSwitch = message.optimizerSwitch); message.optimizerSearchDepth !== undefined && (obj.optimizerSearchDepth = message.optimizerSearchDepth); + message.userstat !== undefined && (obj.userstat = message.userstat); + message.maxExecutionTime !== undefined && + (obj.maxExecutionTime = message.maxExecutionTime); return obj; }, @@ -2786,6 +2833,8 @@ export const Mysqlconfig80 = { message.maxPreparedStmtCount = object.maxPreparedStmtCount ?? undefined; message.optimizerSwitch = object.optimizerSwitch ?? ""; message.optimizerSearchDepth = object.optimizerSearchDepth ?? undefined; + message.userstat = object.userstat ?? undefined; + message.maxExecutionTime = object.maxExecutionTime ?? undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/opensearch/v1/auth.ts b/src/generated/yandex/cloud/mdb/opensearch/v1/auth.ts index 5a092114..b664b9fd 100644 --- a/src/generated/yandex/cloud/mdb/opensearch/v1/auth.ts +++ b/src/generated/yandex/cloud/mdb/opensearch/v1/auth.ts @@ -2,6 +2,7 @@ import { messageTypeRegistry } from "../../../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; +import { Int64Value } from "../../../../../google/protobuf/wrappers"; export const protobufPackage = "yandex.cloud.mdb.opensearch.v1"; @@ -26,6 +27,8 @@ export interface SAMLSettings { rolesKey: string; /** Optional. The attribute in the SAML response where the subject is stored. If not configured, the NameID attribute is used. */ subjectKey: string; + /** default jwt expiration timeout. */ + jwtDefaultExpirationTimeout?: number; } const baseAuthSettings: object = { @@ -131,6 +134,15 @@ export const SAMLSettings = { if (message.subjectKey !== "") { writer.uint32(58).string(message.subjectKey); } + if (message.jwtDefaultExpirationTimeout !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.jwtDefaultExpirationTimeout!, + }, + writer.uint32(66).fork() + ).ldelim(); + } return writer; }, @@ -163,6 +175,12 @@ export const SAMLSettings = { case 7: message.subjectKey = reader.string(); break; + case 8: + message.jwtDefaultExpirationTimeout = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; default: reader.skipType(tag & 7); break; @@ -201,6 +219,11 @@ export const SAMLSettings = { object.subjectKey !== undefined && object.subjectKey !== null ? String(object.subjectKey) : ""; + message.jwtDefaultExpirationTimeout = + object.jwtDefaultExpirationTimeout !== undefined && + object.jwtDefaultExpirationTimeout !== null + ? Number(object.jwtDefaultExpirationTimeout) + : undefined; return message; }, @@ -220,6 +243,8 @@ export const SAMLSettings = { (obj.dashboardsUrl = message.dashboardsUrl); message.rolesKey !== undefined && (obj.rolesKey = message.rolesKey); message.subjectKey !== undefined && (obj.subjectKey = message.subjectKey); + message.jwtDefaultExpirationTimeout !== undefined && + (obj.jwtDefaultExpirationTimeout = message.jwtDefaultExpirationTimeout); return obj; }, @@ -234,6 +259,8 @@ export const SAMLSettings = { message.dashboardsUrl = object.dashboardsUrl ?? ""; message.rolesKey = object.rolesKey ?? ""; message.subjectKey = object.subjectKey ?? ""; + message.jwtDefaultExpirationTimeout = + object.jwtDefaultExpirationTimeout ?? undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/opensearch/v1/cluster.ts b/src/generated/yandex/cloud/mdb/opensearch/v1/cluster.ts index 040946ae..0b70f096 100644 --- a/src/generated/yandex/cloud/mdb/opensearch/v1/cluster.ts +++ b/src/generated/yandex/cloud/mdb/opensearch/v1/cluster.ts @@ -268,6 +268,8 @@ export interface OpenSearch { /** Host groups of the OpenSearch type. */ nodeGroups: OpenSearch_NodeGroup[]; opensearchConfigSet2?: OpenSearchConfigSet2 | undefined; + /** Keystore entries names. */ + keystoreSettings: string[]; } export enum OpenSearch_GroupRole { @@ -329,6 +331,8 @@ export interface OpenSearch_NodeGroup { assignPublicIp: boolean; /** Roles of the host group. */ roles: OpenSearch_GroupRole[]; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } /** The Dashboards host group type configuration. */ @@ -352,6 +356,8 @@ export interface Dashboards_NodeGroup { subnetIds: string[]; /** Determines whether a public IP is assigned to the hosts in the group. */ assignPublicIp: boolean; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } /** A list of computational resources allocated to a host. */ @@ -382,9 +388,9 @@ export interface Host { zoneId: string; /** Resources allocated to the OpenSearch host. */ resources?: Resources; - /** Type of the host. */ + /** Type of the host. If the field has default value, it is not returned in the response. */ type: Host_Type; - /** Status code of the aggregated health of the host. */ + /** Aggregated health of the host. If the field has default value, it is not returned in the response. */ health: Host_Health; /** ID of the subnet that the host belongs to. */ subnetId: string; @@ -399,7 +405,7 @@ export interface Host { } export enum Host_Health { - /** UNKNOWN - Health of the host is unknown. */ + /** UNKNOWN - Health of the host is unknown. Default value. */ UNKNOWN = 0, /** ALIVE - The host is performing all its functions normally. */ ALIVE = 1, @@ -447,7 +453,7 @@ export function host_HealthToJSON(object: Host_Health): string { } export enum Host_Type { - /** TYPE_UNSPECIFIED - The type is not specified. */ + /** TYPE_UNSPECIFIED - Type of the host is unspecified. Default value. */ TYPE_UNSPECIFIED = 0, /** OPENSEARCH - An OpenSearch type host. */ OPENSEARCH = 1, @@ -538,6 +544,16 @@ export interface Access { serverless: boolean; } +export interface DiskSizeAutoscaling { + $type: "yandex.cloud.mdb.opensearch.v1.DiskSizeAutoscaling"; + /** Amount of used storage for automatic disk scaling in the maintenance window, 0 means disabled, in percent. */ + plannedUsageThreshold: number; + /** Amount of used storage for immediately automatic disk scaling, 0 means disabled, in percent. */ + emergencyUsageThreshold: number; + /** Limit on how large the storage for database instances can automatically grow, in bytes. */ + diskSizeLimit: number; +} + const baseCluster: object = { $type: "yandex.cloud.mdb.opensearch.v1.Cluster", id: "", @@ -1158,6 +1174,7 @@ messageTypeRegistry.set(ClusterConfig.$type, ClusterConfig); const baseOpenSearch: object = { $type: "yandex.cloud.mdb.opensearch.v1.OpenSearch", plugins: "", + keystoreSettings: "", }; export const OpenSearch = { @@ -1179,6 +1196,9 @@ export const OpenSearch = { writer.uint32(26).fork() ).ldelim(); } + for (const v of message.keystoreSettings) { + writer.uint32(34).string(v!); + } return writer; }, @@ -1188,6 +1208,7 @@ export const OpenSearch = { const message = { ...baseOpenSearch } as OpenSearch; message.plugins = []; message.nodeGroups = []; + message.keystoreSettings = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1205,6 +1226,9 @@ export const OpenSearch = { reader.uint32() ); break; + case 4: + message.keystoreSettings.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -1224,6 +1248,9 @@ export const OpenSearch = { object.opensearchConfigSet_2 !== null ? OpenSearchConfigSet2.fromJSON(object.opensearchConfigSet_2) : undefined; + message.keystoreSettings = (object.keystoreSettings ?? []).map((e: any) => + String(e) + ); return message; }, @@ -1245,6 +1272,11 @@ export const OpenSearch = { (obj.opensearchConfigSet_2 = message.opensearchConfigSet2 ? OpenSearchConfigSet2.toJSON(message.opensearchConfigSet2) : undefined); + if (message.keystoreSettings) { + obj.keystoreSettings = message.keystoreSettings.map((e) => e); + } else { + obj.keystoreSettings = []; + } return obj; }, @@ -1260,6 +1292,7 @@ export const OpenSearch = { object.opensearchConfigSet2 !== null ? OpenSearchConfigSet2.fromPartial(object.opensearchConfigSet2) : undefined; + message.keystoreSettings = object.keystoreSettings?.map((e) => e) || []; return message; }, }; @@ -1306,6 +1339,12 @@ export const OpenSearch_NodeGroup = { writer.int32(v); } writer.ldelim(); + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(74).fork() + ).ldelim(); + } return writer; }, @@ -1350,6 +1389,12 @@ export const OpenSearch_NodeGroup = { message.roles.push(reader.int32() as any); } break; + case 9: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1381,6 +1426,11 @@ export const OpenSearch_NodeGroup = { message.roles = (object.roles ?? []).map((e: any) => openSearch_GroupRoleFromJSON(e) ); + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -1410,6 +1460,10 @@ export const OpenSearch_NodeGroup = { } else { obj.roles = []; } + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -1427,6 +1481,11 @@ export const OpenSearch_NodeGroup = { message.subnetIds = object.subnetIds?.map((e) => e) || []; message.assignPublicIp = object.assignPublicIp ?? false; message.roles = object.roles?.map((e) => e) || []; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -1537,6 +1596,12 @@ export const Dashboards_NodeGroup = { if (message.assignPublicIp === true) { writer.uint32(48).bool(message.assignPublicIp); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(74).fork() + ).ldelim(); + } return writer; }, @@ -1570,6 +1635,12 @@ export const Dashboards_NodeGroup = { case 6: message.assignPublicIp = reader.bool(); break; + case 9: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1598,6 +1669,11 @@ export const Dashboards_NodeGroup = { object.assignPublicIp !== undefined && object.assignPublicIp !== null ? Boolean(object.assignPublicIp) : false; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -1622,6 +1698,10 @@ export const Dashboards_NodeGroup = { } message.assignPublicIp !== undefined && (obj.assignPublicIp = message.assignPublicIp); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -1638,6 +1718,11 @@ export const Dashboards_NodeGroup = { message.zoneIds = object.zoneIds?.map((e) => e) || []; message.subnetIds = object.subnetIds?.map((e) => e) || []; message.assignPublicIp = object.assignPublicIp ?? false; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -2381,6 +2466,103 @@ export const Access = { messageTypeRegistry.set(Access.$type, Access); +const baseDiskSizeAutoscaling: object = { + $type: "yandex.cloud.mdb.opensearch.v1.DiskSizeAutoscaling", + plannedUsageThreshold: 0, + emergencyUsageThreshold: 0, + diskSizeLimit: 0, +}; + +export const DiskSizeAutoscaling = { + $type: "yandex.cloud.mdb.opensearch.v1.DiskSizeAutoscaling" as const, + + encode( + message: DiskSizeAutoscaling, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.plannedUsageThreshold !== 0) { + writer.uint32(8).int64(message.plannedUsageThreshold); + } + if (message.emergencyUsageThreshold !== 0) { + writer.uint32(16).int64(message.emergencyUsageThreshold); + } + if (message.diskSizeLimit !== 0) { + writer.uint32(24).int64(message.diskSizeLimit); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DiskSizeAutoscaling { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDiskSizeAutoscaling } as DiskSizeAutoscaling; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plannedUsageThreshold = longToNumber(reader.int64() as Long); + break; + case 2: + message.emergencyUsageThreshold = longToNumber( + reader.int64() as Long + ); + break; + case 3: + message.diskSizeLimit = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DiskSizeAutoscaling { + const message = { ...baseDiskSizeAutoscaling } as DiskSizeAutoscaling; + message.plannedUsageThreshold = + object.plannedUsageThreshold !== undefined && + object.plannedUsageThreshold !== null + ? Number(object.plannedUsageThreshold) + : 0; + message.emergencyUsageThreshold = + object.emergencyUsageThreshold !== undefined && + object.emergencyUsageThreshold !== null + ? Number(object.emergencyUsageThreshold) + : 0; + message.diskSizeLimit = + object.diskSizeLimit !== undefined && object.diskSizeLimit !== null + ? Number(object.diskSizeLimit) + : 0; + return message; + }, + + toJSON(message: DiskSizeAutoscaling): unknown { + const obj: any = {}; + message.plannedUsageThreshold !== undefined && + (obj.plannedUsageThreshold = Math.round(message.plannedUsageThreshold)); + message.emergencyUsageThreshold !== undefined && + (obj.emergencyUsageThreshold = Math.round( + message.emergencyUsageThreshold + )); + message.diskSizeLimit !== undefined && + (obj.diskSizeLimit = Math.round(message.diskSizeLimit)); + return obj; + }, + + fromPartial, I>>( + object: I + ): DiskSizeAutoscaling { + const message = { ...baseDiskSizeAutoscaling } as DiskSizeAutoscaling; + message.plannedUsageThreshold = object.plannedUsageThreshold ?? 0; + message.emergencyUsageThreshold = object.emergencyUsageThreshold ?? 0; + message.diskSizeLimit = object.diskSizeLimit ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(DiskSizeAutoscaling.$type, DiskSizeAutoscaling); + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/generated/yandex/cloud/mdb/opensearch/v1/cluster_service.ts b/src/generated/yandex/cloud/mdb/opensearch/v1/cluster_service.ts index 372ce5af..695506be 100644 --- a/src/generated/yandex/cloud/mdb/opensearch/v1/cluster_service.ts +++ b/src/generated/yandex/cloud/mdb/opensearch/v1/cluster_service.ts @@ -20,6 +20,7 @@ import { Cluster_Environment, Access, Resources, + DiskSizeAutoscaling, Cluster, Host, OpenSearch_GroupRole, @@ -169,6 +170,8 @@ export interface UpdateClusterRequest { deletionProtection: boolean; /** Cluster maintenance window. Should be defined by either one of the two options. */ maintenanceWindow?: MaintenanceWindow; + /** ID of the network to move the cluster to. */ + networkId: string; } export interface UpdateClusterRequest_LabelsEntry { @@ -555,6 +558,15 @@ export interface ConfigCreateSpec { access?: Access; } +/** Single keystore entry. */ +export interface KeystoreSetting { + $type: "yandex.cloud.mdb.opensearch.v1.KeystoreSetting"; + /** Keystore entry name. */ + name: string; + /** Keystore entry value. */ + value: string; +} + /** OpenSearch create-time configuration. */ export interface OpenSearchCreateSpec { $type: "yandex.cloud.mdb.opensearch.v1.OpenSearchCreateSpec"; @@ -563,6 +575,8 @@ export interface OpenSearchCreateSpec { /** OpenSearch type host groups of the cluster. */ nodeGroups: OpenSearchCreateSpec_NodeGroup[]; opensearchConfig2?: OpenSearchConfig2 | undefined; + /** Initial cluster keystore settings. */ + keystoreSettings: KeystoreSetting[]; } /** Configuration of the host group. */ @@ -582,6 +596,8 @@ export interface OpenSearchCreateSpec_NodeGroup { assignPublicIp: boolean; /** Roles of the hosts in the group. */ roles: OpenSearch_GroupRole[]; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } /** Dashboards create-time configuration. */ @@ -605,6 +621,8 @@ export interface DashboardsCreateSpec_NodeGroup { subnetIds: string[]; /** Determines whether a public IP is assigned to the hosts in the group. */ assignPublicIp: boolean; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface ConfigUpdateSpec { @@ -626,6 +644,10 @@ export interface OpenSearchClusterUpdateSpec { /** Names of the cluster plugins. */ plugins: string[]; opensearchConfig2?: OpenSearchConfig2 | undefined; + /** Keystore settings to add/replace. Old entries not listed here will be left unchanged. */ + setKeystoreSettings: KeystoreSetting[]; + /** Keystore entries names to remove. */ + removeKeystoreSettings: string[]; } /** Dashboards configuration. */ @@ -850,8 +872,16 @@ export interface OpenSearchNodeGroupUpdateSpec { resources?: Resources; /** Number of hosts in the group. */ hostsCount: number; - /** Roles of the host group. */ + /** Opensearch roles applicable to the node group. */ roles: OpenSearch_GroupRole[]; + /** IDs of the availability zones for hosts */ + zoneIds: string[]; + /** IDs of the subnets for hosts */ + subnetIds: string[]; + /** Whether the hosts should get a public IP address. */ + assignPublicIp: boolean; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface AddOpenSearchNodeGroupRequest { @@ -896,6 +926,14 @@ export interface DashboardsNodeGroupUpdateSpec { resources?: Resources; /** Number of hosts in the group. */ hostsCount: number; + /** IDs of the availability zones for hosts */ + zoneIds: string[]; + /** IDs of the subnets for hosts */ + subnetIds: string[]; + /** Whether the hosts should get a public IP address. */ + assignPublicIp: boolean; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface AddDashboardsNodeGroupRequest { @@ -1615,6 +1653,7 @@ const baseUpdateClusterRequest: object = { securityGroupIds: "", serviceAccountId: "", deletionProtection: false, + networkId: "", }; export const UpdateClusterRequest = { @@ -1668,6 +1707,9 @@ export const UpdateClusterRequest = { writer.uint32(82).fork() ).ldelim(); } + if (message.networkId !== "") { + writer.uint32(90).string(message.networkId); + } return writer; }, @@ -1722,6 +1764,9 @@ export const UpdateClusterRequest = { reader.uint32() ); break; + case 11: + message.networkId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1775,6 +1820,10 @@ export const UpdateClusterRequest = { object.maintenanceWindow !== null ? MaintenanceWindow.fromJSON(object.maintenanceWindow) : undefined; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; return message; }, @@ -1811,6 +1860,7 @@ export const UpdateClusterRequest = { (obj.maintenanceWindow = message.maintenanceWindow ? MaintenanceWindow.toJSON(message.maintenanceWindow) : undefined); + message.networkId !== undefined && (obj.networkId = message.networkId); return obj; }, @@ -1845,6 +1895,7 @@ export const UpdateClusterRequest = { object.maintenanceWindow !== null ? MaintenanceWindow.fromPartial(object.maintenanceWindow) : undefined; + message.networkId = object.networkId ?? ""; return message; }, }; @@ -3778,6 +3829,81 @@ export const ConfigCreateSpec = { messageTypeRegistry.set(ConfigCreateSpec.$type, ConfigCreateSpec); +const baseKeystoreSetting: object = { + $type: "yandex.cloud.mdb.opensearch.v1.KeystoreSetting", + name: "", + value: "", +}; + +export const KeystoreSetting = { + $type: "yandex.cloud.mdb.opensearch.v1.KeystoreSetting" as const, + + encode( + message: KeystoreSetting, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): KeystoreSetting { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseKeystoreSetting } as KeystoreSetting; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): KeystoreSetting { + const message = { ...baseKeystoreSetting } as KeystoreSetting; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: KeystoreSetting): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): KeystoreSetting { + const message = { ...baseKeystoreSetting } as KeystoreSetting; + message.name = object.name ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(KeystoreSetting.$type, KeystoreSetting); + const baseOpenSearchCreateSpec: object = { $type: "yandex.cloud.mdb.opensearch.v1.OpenSearchCreateSpec", plugins: "", @@ -3805,6 +3931,9 @@ export const OpenSearchCreateSpec = { writer.uint32(26).fork() ).ldelim(); } + for (const v of message.keystoreSettings) { + KeystoreSetting.encode(v!, writer.uint32(34).fork()).ldelim(); + } return writer; }, @@ -3817,6 +3946,7 @@ export const OpenSearchCreateSpec = { const message = { ...baseOpenSearchCreateSpec } as OpenSearchCreateSpec; message.plugins = []; message.nodeGroups = []; + message.keystoreSettings = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3834,6 +3964,11 @@ export const OpenSearchCreateSpec = { reader.uint32() ); break; + case 4: + message.keystoreSettings.push( + KeystoreSetting.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -3853,6 +3988,9 @@ export const OpenSearchCreateSpec = { object.opensearchConfig_2 !== null ? OpenSearchConfig2.fromJSON(object.opensearchConfig_2) : undefined; + message.keystoreSettings = (object.keystoreSettings ?? []).map((e: any) => + KeystoreSetting.fromJSON(e) + ); return message; }, @@ -3874,6 +4012,13 @@ export const OpenSearchCreateSpec = { (obj.opensearchConfig_2 = message.opensearchConfig2 ? OpenSearchConfig2.toJSON(message.opensearchConfig2) : undefined); + if (message.keystoreSettings) { + obj.keystoreSettings = message.keystoreSettings.map((e) => + e ? KeystoreSetting.toJSON(e) : undefined + ); + } else { + obj.keystoreSettings = []; + } return obj; }, @@ -3891,6 +4036,8 @@ export const OpenSearchCreateSpec = { object.opensearchConfig2 !== null ? OpenSearchConfig2.fromPartial(object.opensearchConfig2) : undefined; + message.keystoreSettings = + object.keystoreSettings?.map((e) => KeystoreSetting.fromPartial(e)) || []; return message; }, }; @@ -3938,6 +4085,12 @@ export const OpenSearchCreateSpec_NodeGroup = { writer.int32(v); } writer.ldelim(); + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(66).fork() + ).ldelim(); + } return writer; }, @@ -3984,6 +4137,12 @@ export const OpenSearchCreateSpec_NodeGroup = { message.roles.push(reader.int32() as any); } break; + case 8: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -4017,6 +4176,11 @@ export const OpenSearchCreateSpec_NodeGroup = { message.roles = (object.roles ?? []).map((e: any) => openSearch_GroupRoleFromJSON(e) ); + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -4046,6 +4210,10 @@ export const OpenSearchCreateSpec_NodeGroup = { } else { obj.roles = []; } + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -4065,6 +4233,11 @@ export const OpenSearchCreateSpec_NodeGroup = { message.subnetIds = object.subnetIds?.map((e) => e) || []; message.assignPublicIp = object.assignPublicIp ?? false; message.roles = object.roles?.map((e) => e) || []; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -4187,6 +4360,12 @@ export const DashboardsCreateSpec_NodeGroup = { if (message.assignPublicIp === true) { writer.uint32(48).bool(message.assignPublicIp); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(58).fork() + ).ldelim(); + } return writer; }, @@ -4222,6 +4401,12 @@ export const DashboardsCreateSpec_NodeGroup = { case 6: message.assignPublicIp = reader.bool(); break; + case 7: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -4252,6 +4437,11 @@ export const DashboardsCreateSpec_NodeGroup = { object.assignPublicIp !== undefined && object.assignPublicIp !== null ? Boolean(object.assignPublicIp) : false; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -4276,6 +4466,10 @@ export const DashboardsCreateSpec_NodeGroup = { } message.assignPublicIp !== undefined && (obj.assignPublicIp = message.assignPublicIp); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -4294,6 +4488,11 @@ export const DashboardsCreateSpec_NodeGroup = { message.zoneIds = object.zoneIds?.map((e) => e) || []; message.subnetIds = object.subnetIds?.map((e) => e) || []; message.assignPublicIp = object.assignPublicIp ?? false; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -4446,6 +4645,7 @@ messageTypeRegistry.set(ConfigUpdateSpec.$type, ConfigUpdateSpec); const baseOpenSearchClusterUpdateSpec: object = { $type: "yandex.cloud.mdb.opensearch.v1.OpenSearchClusterUpdateSpec", plugins: "", + removeKeystoreSettings: "", }; export const OpenSearchClusterUpdateSpec = { @@ -4464,6 +4664,12 @@ export const OpenSearchClusterUpdateSpec = { writer.uint32(18).fork() ).ldelim(); } + for (const v of message.setKeystoreSettings) { + KeystoreSetting.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.removeKeystoreSettings) { + writer.uint32(34).string(v!); + } return writer; }, @@ -4477,6 +4683,8 @@ export const OpenSearchClusterUpdateSpec = { ...baseOpenSearchClusterUpdateSpec, } as OpenSearchClusterUpdateSpec; message.plugins = []; + message.setKeystoreSettings = []; + message.removeKeystoreSettings = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4489,6 +4697,14 @@ export const OpenSearchClusterUpdateSpec = { reader.uint32() ); break; + case 3: + message.setKeystoreSettings.push( + KeystoreSetting.decode(reader, reader.uint32()) + ); + break; + case 4: + message.removeKeystoreSettings.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -4507,6 +4723,12 @@ export const OpenSearchClusterUpdateSpec = { object.opensearchConfig_2 !== null ? OpenSearchConfig2.fromJSON(object.opensearchConfig_2) : undefined; + message.setKeystoreSettings = (object.setKeystoreSettings ?? []).map( + (e: any) => KeystoreSetting.fromJSON(e) + ); + message.removeKeystoreSettings = (object.removeKeystoreSettings ?? []).map( + (e: any) => String(e) + ); return message; }, @@ -4521,6 +4743,18 @@ export const OpenSearchClusterUpdateSpec = { (obj.opensearchConfig_2 = message.opensearchConfig2 ? OpenSearchConfig2.toJSON(message.opensearchConfig2) : undefined); + if (message.setKeystoreSettings) { + obj.setKeystoreSettings = message.setKeystoreSettings.map((e) => + e ? KeystoreSetting.toJSON(e) : undefined + ); + } else { + obj.setKeystoreSettings = []; + } + if (message.removeKeystoreSettings) { + obj.removeKeystoreSettings = message.removeKeystoreSettings.map((e) => e); + } else { + obj.removeKeystoreSettings = []; + } return obj; }, @@ -4536,6 +4770,11 @@ export const OpenSearchClusterUpdateSpec = { object.opensearchConfig2 !== null ? OpenSearchConfig2.fromPartial(object.opensearchConfig2) : undefined; + message.setKeystoreSettings = + object.setKeystoreSettings?.map((e) => KeystoreSetting.fromPartial(e)) || + []; + message.removeKeystoreSettings = + object.removeKeystoreSettings?.map((e) => e) || []; return message; }, }; @@ -5785,6 +6024,9 @@ const baseOpenSearchNodeGroupUpdateSpec: object = { $type: "yandex.cloud.mdb.opensearch.v1.OpenSearchNodeGroupUpdateSpec", hostsCount: 0, roles: 0, + zoneIds: "", + subnetIds: "", + assignPublicIp: false, }; export const OpenSearchNodeGroupUpdateSpec = { @@ -5806,6 +6048,21 @@ export const OpenSearchNodeGroupUpdateSpec = { writer.int32(v); } writer.ldelim(); + for (const v of message.zoneIds) { + writer.uint32(34).string(v!); + } + for (const v of message.subnetIds) { + writer.uint32(42).string(v!); + } + if (message.assignPublicIp === true) { + writer.uint32(48).bool(message.assignPublicIp); + } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(58).fork() + ).ldelim(); + } return writer; }, @@ -5819,6 +6076,8 @@ export const OpenSearchNodeGroupUpdateSpec = { ...baseOpenSearchNodeGroupUpdateSpec, } as OpenSearchNodeGroupUpdateSpec; message.roles = []; + message.zoneIds = []; + message.subnetIds = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5838,6 +6097,21 @@ export const OpenSearchNodeGroupUpdateSpec = { message.roles.push(reader.int32() as any); } break; + case 4: + message.zoneIds.push(reader.string()); + break; + case 5: + message.subnetIds.push(reader.string()); + break; + case 6: + message.assignPublicIp = reader.bool(); + break; + case 7: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -5861,6 +6135,17 @@ export const OpenSearchNodeGroupUpdateSpec = { message.roles = (object.roles ?? []).map((e: any) => openSearch_GroupRoleFromJSON(e) ); + message.zoneIds = (object.zoneIds ?? []).map((e: any) => String(e)); + message.subnetIds = (object.subnetIds ?? []).map((e: any) => String(e)); + message.assignPublicIp = + object.assignPublicIp !== undefined && object.assignPublicIp !== null + ? Boolean(object.assignPublicIp) + : false; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -5877,6 +6162,22 @@ export const OpenSearchNodeGroupUpdateSpec = { } else { obj.roles = []; } + if (message.zoneIds) { + obj.zoneIds = message.zoneIds.map((e) => e); + } else { + obj.zoneIds = []; + } + if (message.subnetIds) { + obj.subnetIds = message.subnetIds.map((e) => e); + } else { + obj.subnetIds = []; + } + message.assignPublicIp !== undefined && + (obj.assignPublicIp = message.assignPublicIp); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -5892,6 +6193,14 @@ export const OpenSearchNodeGroupUpdateSpec = { : undefined; message.hostsCount = object.hostsCount ?? 0; message.roles = object.roles?.map((e) => e) || []; + message.zoneIds = object.zoneIds?.map((e) => e) || []; + message.subnetIds = object.subnetIds?.map((e) => e) || []; + message.assignPublicIp = object.assignPublicIp ?? false; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -6221,6 +6530,9 @@ messageTypeRegistry.set( const baseDashboardsNodeGroupUpdateSpec: object = { $type: "yandex.cloud.mdb.opensearch.v1.DashboardsNodeGroupUpdateSpec", hostsCount: 0, + zoneIds: "", + subnetIds: "", + assignPublicIp: false, }; export const DashboardsNodeGroupUpdateSpec = { @@ -6237,6 +6549,21 @@ export const DashboardsNodeGroupUpdateSpec = { if (message.hostsCount !== 0) { writer.uint32(16).int64(message.hostsCount); } + for (const v of message.zoneIds) { + writer.uint32(26).string(v!); + } + for (const v of message.subnetIds) { + writer.uint32(34).string(v!); + } + if (message.assignPublicIp === true) { + writer.uint32(40).bool(message.assignPublicIp); + } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(50).fork() + ).ldelim(); + } return writer; }, @@ -6249,6 +6576,8 @@ export const DashboardsNodeGroupUpdateSpec = { const message = { ...baseDashboardsNodeGroupUpdateSpec, } as DashboardsNodeGroupUpdateSpec; + message.zoneIds = []; + message.subnetIds = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6258,6 +6587,21 @@ export const DashboardsNodeGroupUpdateSpec = { case 2: message.hostsCount = longToNumber(reader.int64() as Long); break; + case 3: + message.zoneIds.push(reader.string()); + break; + case 4: + message.subnetIds.push(reader.string()); + break; + case 5: + message.assignPublicIp = reader.bool(); + break; + case 6: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -6278,6 +6622,17 @@ export const DashboardsNodeGroupUpdateSpec = { object.hostsCount !== undefined && object.hostsCount !== null ? Number(object.hostsCount) : 0; + message.zoneIds = (object.zoneIds ?? []).map((e: any) => String(e)); + message.subnetIds = (object.subnetIds ?? []).map((e: any) => String(e)); + message.assignPublicIp = + object.assignPublicIp !== undefined && object.assignPublicIp !== null + ? Boolean(object.assignPublicIp) + : false; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -6289,6 +6644,22 @@ export const DashboardsNodeGroupUpdateSpec = { : undefined); message.hostsCount !== undefined && (obj.hostsCount = Math.round(message.hostsCount)); + if (message.zoneIds) { + obj.zoneIds = message.zoneIds.map((e) => e); + } else { + obj.zoneIds = []; + } + if (message.subnetIds) { + obj.subnetIds = message.subnetIds.map((e) => e); + } else { + obj.subnetIds = []; + } + message.assignPublicIp !== undefined && + (obj.assignPublicIp = message.assignPublicIp); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -6303,6 +6674,14 @@ export const DashboardsNodeGroupUpdateSpec = { ? Resources.fromPartial(object.resources) : undefined; message.hostsCount = object.hostsCount ?? 0; + message.zoneIds = object.zoneIds?.map((e) => e) || []; + message.subnetIds = object.subnetIds?.map((e) => e) || []; + message.assignPublicIp = object.assignPublicIp ?? false; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/backup.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/backup.ts index 5d777bf5..f4e1176b 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/backup.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/backup.ts @@ -33,6 +33,8 @@ export interface Backup { method: Backup_BackupMethod; /** Size of the journal associated with backup, in bytes */ journalSize: number; + /** Status of backup */ + status: Backup_BackupStatus; } export enum Backup_BackupMethod { @@ -119,6 +121,46 @@ export function backup_BackupCreationTypeToJSON( } } +export enum Backup_BackupStatus { + BACKUP_STATUS_UNSPECIFIED = 0, + /** DONE - Backup is done */ + DONE = 1, + /** CREATING - Backup is creating */ + CREATING = 2, + UNRECOGNIZED = -1, +} + +export function backup_BackupStatusFromJSON(object: any): Backup_BackupStatus { + switch (object) { + case 0: + case "BACKUP_STATUS_UNSPECIFIED": + return Backup_BackupStatus.BACKUP_STATUS_UNSPECIFIED; + case 1: + case "DONE": + return Backup_BackupStatus.DONE; + case 2: + case "CREATING": + return Backup_BackupStatus.CREATING; + case -1: + case "UNRECOGNIZED": + default: + return Backup_BackupStatus.UNRECOGNIZED; + } +} + +export function backup_BackupStatusToJSON(object: Backup_BackupStatus): string { + switch (object) { + case Backup_BackupStatus.BACKUP_STATUS_UNSPECIFIED: + return "BACKUP_STATUS_UNSPECIFIED"; + case Backup_BackupStatus.DONE: + return "DONE"; + case Backup_BackupStatus.CREATING: + return "CREATING"; + default: + return "UNKNOWN"; + } +} + const baseBackup: object = { $type: "yandex.cloud.mdb.postgresql.v1.Backup", id: "", @@ -128,6 +170,7 @@ const baseBackup: object = { type: 0, method: 0, journalSize: 0, + status: 0, }; export const Backup = { @@ -170,6 +213,9 @@ export const Backup = { if (message.journalSize !== 0) { writer.uint32(72).int64(message.journalSize); } + if (message.status !== 0) { + writer.uint32(80).int32(message.status); + } return writer; }, @@ -211,6 +257,9 @@ export const Backup = { case 9: message.journalSize = longToNumber(reader.int64() as Long); break; + case 10: + message.status = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -255,6 +304,10 @@ export const Backup = { object.journalSize !== undefined && object.journalSize !== null ? Number(object.journalSize) : 0; + message.status = + object.status !== undefined && object.status !== null + ? backup_BackupStatusFromJSON(object.status) + : 0; return message; }, @@ -275,6 +328,8 @@ export const Backup = { (obj.method = backup_BackupMethodToJSON(message.method)); message.journalSize !== undefined && (obj.journalSize = Math.round(message.journalSize)); + message.status !== undefined && + (obj.status = backup_BackupStatusToJSON(message.status)); return obj; }, @@ -289,6 +344,7 @@ export const Backup = { message.type = object.type ?? 0; message.method = object.method ?? 0; message.journalSize = object.journalSize ?? 0; + message.status = object.status ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/cluster.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/cluster.ts index 020c0959..0129459b 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/cluster.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/cluster.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { MessageType, messageTypeRegistry } from "../../../../../typeRegistry"; +import { messageTypeRegistry } from "../../../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; import { @@ -409,9 +409,9 @@ export interface Host { zoneId: string; /** Resources allocated to the PostgreSQL host. */ resources?: Resources; - /** Role of the host in the cluster. */ + /** Role of the host in the cluster. If the field has default value, it is not returned in the response. */ role: Host_Role; - /** Status code of the aggregated health of the host. */ + /** Aggregated health of the host. If the field has default value, it is not returned in the response. */ health: Host_Health; /** Services provided by the host. */ services: Service[]; @@ -436,7 +436,7 @@ export interface Host { } export enum Host_Role { - /** ROLE_UNKNOWN - Role of the host in the cluster is unknown. */ + /** ROLE_UNKNOWN - Role of the host in the cluster is unknown. Default value. */ ROLE_UNKNOWN = 0, /** MASTER - Host is the master PostgreSQL server in the cluster. */ MASTER = 1, @@ -522,7 +522,7 @@ export function host_ReplicaTypeToJSON(object: Host_ReplicaType): string { } export enum Host_Health { - /** HEALTH_UNKNOWN - Health of the host is unknown. */ + /** HEALTH_UNKNOWN - Health of the host is unknown. Default value. */ HEALTH_UNKNOWN = 0, /** ALIVE - The host is performing all its functions normally. */ ALIVE = 1, @@ -612,13 +612,14 @@ export interface HostConfig { export interface Service { $type: "yandex.cloud.mdb.postgresql.v1.Service"; - /** Type of the service provided by the host. */ + /** Type of the service provided by the host. If the field has default value, it is not returned in the response. */ type: Service_Type; - /** Status code of server availability. */ + /** Aggregated health of the service. If the field has default value, it is not returned in the response. */ health: Service_Health; } export enum Service_Type { + /** TYPE_UNSPECIFIED - Service type of the host is unspecified. Default value. */ TYPE_UNSPECIFIED = 0, /** POSTGRESQL - The host is a PostgreSQL server. */ POSTGRESQL = 1, @@ -659,7 +660,7 @@ export function service_TypeToJSON(object: Service_Type): string { } export enum Service_Health { - /** HEALTH_UNKNOWN - Health of the server is unknown. */ + /** HEALTH_UNKNOWN - Health of the server is unknown. Default value. */ HEALTH_UNKNOWN = 0, /** ALIVE - The server is working normally. */ ALIVE = 1, @@ -755,11 +756,11 @@ export interface PerformanceDiagnostics { export interface DiskSizeAutoscaling { $type: "yandex.cloud.mdb.postgresql.v1.DiskSizeAutoscaling"; - /** Amount of used storage for automatic disk scaling in the maintenance window, 0 means disabled, in percent. */ + /** Threshold of storage usage (in percent) that triggers automatic scaling of the storage during the maintenance window. Zero value means disabled threshold. */ plannedUsageThreshold: number; - /** Amount of used storage for immediately automatic disk scaling, 0 means disabled, in percent. */ + /** Threshold of storage usage (in percent) that triggers immediate automatic scaling of the storage. Zero value means disabled threshold. */ emergencyUsageThreshold: number; - /** Limit on how large the storage for database instances can automatically grow, in bytes. */ + /** New storage size (in bytes) that is set when one of the thresholds is achieved. */ diskSizeLimit: number; } @@ -778,7 +779,15 @@ const baseCluster: object = { hostGroupIds: "", }; -export const Cluster: MessageType = { +type ClusterType = { + $type: "yandex.cloud.mdb.postgresql.v1.Cluster"; + encode(message: Cluster, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): Cluster; + fromJSON(object: any): Cluster; + toJSON(message: Cluster): unknown; + fromPartial, I>>(object: I): Cluster; +} +export const Cluster: ClusterType = { $type: "yandex.cloud.mdb.postgresql.v1.Cluster" as const, encode( @@ -1274,7 +1283,15 @@ const baseClusterConfig: object = { version: "", }; -export const ClusterConfig: MessageType = { +type ClusterConfigType = { + $type: "yandex.cloud.mdb.postgresql.v1.ClusterConfig"; + encode(message: ClusterConfig, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): ClusterConfig; + fromJSON(object: any): ClusterConfig; + toJSON(message: ClusterConfig): unknown; + fromPartial, I>>(object: I): ClusterConfig; +} +export const ClusterConfig: ClusterConfigType = { $type: "yandex.cloud.mdb.postgresql.v1.ClusterConfig" as const, encode( diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/cluster_service.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/cluster_service.ts index da088d77..1cee110d 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/cluster_service.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/cluster_service.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { MessageType, messageTypeRegistry } from "../../../../../typeRegistry"; +import { messageTypeRegistry } from "../../../../../typeRegistry"; import Long from "long"; import { makeGenericClientConstructor, @@ -194,6 +194,8 @@ export interface UpdateClusterRequest { securityGroupIds: string[]; /** Deletion Protection inhibits deletion of the cluster */ deletionProtection: boolean; + /** ID of the network to move the cluster to. */ + networkId: string; } export interface UpdateClusterRequest_LabelsEntry { @@ -1101,7 +1103,15 @@ const baseListClustersResponse: object = { nextPageToken: "", }; -export const ListClustersResponse: MessageType = { +type ListClustersResponseType = { + $type: "yandex.cloud.mdb.postgresql.v1.ListClustersResponse"; + encode(message: ListClustersResponse, writer?: _m0.Writer): _m0.Writer; + decode(input: _m0.Reader | Uint8Array, length?: number): ListClustersResponse; + fromJSON(object: any): ListClustersResponse; + toJSON(message: ListClustersResponse): unknown; + fromPartial, I>>(object: I): ListClustersResponse; +} +export const ListClustersResponse: ListClustersResponseType = { $type: "yandex.cloud.mdb.postgresql.v1.ListClustersResponse" as const, encode( @@ -1625,6 +1635,7 @@ const baseUpdateClusterRequest: object = { name: "", securityGroupIds: "", deletionProtection: false, + networkId: "", }; export const UpdateClusterRequest = { @@ -1672,6 +1683,9 @@ export const UpdateClusterRequest = { if (message.deletionProtection === true) { writer.uint32(72).bool(message.deletionProtection); } + if (message.networkId !== "") { + writer.uint32(90).string(message.networkId); + } return writer; }, @@ -1723,6 +1737,9 @@ export const UpdateClusterRequest = { case 9: message.deletionProtection = reader.bool(); break; + case 11: + message.networkId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1772,6 +1789,10 @@ export const UpdateClusterRequest = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : false; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; return message; }, @@ -1806,6 +1827,7 @@ export const UpdateClusterRequest = { } message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + message.networkId !== undefined && (obj.networkId = message.networkId); return obj; }, @@ -1839,6 +1861,7 @@ export const UpdateClusterRequest = { : undefined; message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; message.deletionProtection = object.deletionProtection ?? false; + message.networkId = object.networkId ?? ""; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql10.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql10.ts index 800a7a3e..6ae39c89 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql10.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql10.ts @@ -42,7 +42,9 @@ export interface PostgresqlConfig10 { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: PostgresqlConfig10_WalLevel; @@ -50,6 +52,7 @@ export interface PostgresqlConfig10 { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -177,6 +180,8 @@ export interface PostgresqlConfig10 { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: PostgresqlConfig10_PasswordEncryption; } export enum PostgresqlConfig10_WalLevel { @@ -575,6 +580,48 @@ export function postgresqlConfig10_LogStatementToJSON( } } +export enum PostgresqlConfig10_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlConfig10_PasswordEncryptionFromJSON( + object: any +): PostgresqlConfig10_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return PostgresqlConfig10_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return PostgresqlConfig10_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return PostgresqlConfig10_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return PostgresqlConfig10_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlConfig10_PasswordEncryptionToJSON( + object: PostgresqlConfig10_PasswordEncryption +): string { + switch (object) { + case PostgresqlConfig10_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case PostgresqlConfig10_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case PostgresqlConfig10_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum PostgresqlConfig10_TransactionIsolation { TRANSACTION_ISOLATION_UNSPECIFIED = 0, TRANSACTION_ISOLATION_READ_UNCOMMITTED = 1, @@ -975,6 +1022,7 @@ const basePostgresqlConfig10: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const PostgresqlConfig10 = { @@ -1916,6 +1964,9 @@ export const PostgresqlConfig10 = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -2612,6 +2663,9 @@ export const PostgresqlConfig10 = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3214,6 +3268,13 @@ export const PostgresqlConfig10 = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlConfig10_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -3499,6 +3560,10 @@ export const PostgresqlConfig10 = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlConfig10_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -3656,6 +3721,7 @@ export const PostgresqlConfig10 = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql10_1c.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql10_1c.ts index ac44e53b..1dc9dd5c 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql10_1c.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql10_1c.ts @@ -42,7 +42,9 @@ export interface Postgresqlconfig101c { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: Postgresqlconfig101c_WalLevel; @@ -50,6 +52,7 @@ export interface Postgresqlconfig101c { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -179,6 +182,8 @@ export interface Postgresqlconfig101c { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: Postgresqlconfig101c_PasswordEncryption; } export enum Postgresqlconfig101c_WalLevel { @@ -577,6 +582,48 @@ export function postgresqlconfig101c_LogStatementToJSON( } } +export enum Postgresqlconfig101c_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlconfig101c_PasswordEncryptionFromJSON( + object: any +): Postgresqlconfig101c_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return Postgresqlconfig101c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return Postgresqlconfig101c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return Postgresqlconfig101c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return Postgresqlconfig101c_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlconfig101c_PasswordEncryptionToJSON( + object: Postgresqlconfig101c_PasswordEncryption +): string { + switch (object) { + case Postgresqlconfig101c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case Postgresqlconfig101c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case Postgresqlconfig101c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum Postgresqlconfig101c_TransactionIsolation { TRANSACTION_ISOLATION_UNSPECIFIED = 0, TRANSACTION_ISOLATION_READ_UNCOMMITTED = 1, @@ -977,6 +1024,7 @@ const basePostgresqlconfig101c: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const Postgresqlconfig101c = { @@ -1936,6 +1984,9 @@ export const Postgresqlconfig101c = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -2647,6 +2698,9 @@ export const Postgresqlconfig101c = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3265,6 +3319,13 @@ export const Postgresqlconfig101c = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlconfig101c_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -3555,6 +3616,10 @@ export const Postgresqlconfig101c = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlconfig101c_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -3714,6 +3779,7 @@ export const Postgresqlconfig101c = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql11.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql11.ts index e67d4123..d42529f9 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql11.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql11.ts @@ -41,7 +41,9 @@ export interface PostgresqlConfig11 { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: PostgresqlConfig11_WalLevel; @@ -49,6 +51,7 @@ export interface PostgresqlConfig11 { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -188,6 +191,8 @@ export interface PostgresqlConfig11 { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: PostgresqlConfig11_PasswordEncryption; } export enum PostgresqlConfig11_BackslashQuote { @@ -580,6 +585,48 @@ export function postgresqlConfig11_LogStatementToJSON( } } +export enum PostgresqlConfig11_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlConfig11_PasswordEncryptionFromJSON( + object: any +): PostgresqlConfig11_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return PostgresqlConfig11_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return PostgresqlConfig11_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return PostgresqlConfig11_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return PostgresqlConfig11_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlConfig11_PasswordEncryptionToJSON( + object: PostgresqlConfig11_PasswordEncryption +): string { + switch (object) { + case PostgresqlConfig11_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case PostgresqlConfig11_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case PostgresqlConfig11_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum PostgresqlConfig11_PgHintPlanDebugPrint { PG_HINT_PLAN_DEBUG_PRINT_UNSPECIFIED = 0, PG_HINT_PLAN_DEBUG_PRINT_OFF = 1, @@ -986,6 +1033,7 @@ const basePostgresqlConfig11: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const PostgresqlConfig11 = { @@ -2023,6 +2071,9 @@ export const PostgresqlConfig11 = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -2782,6 +2833,9 @@ export const PostgresqlConfig11 = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3438,6 +3492,13 @@ export const PostgresqlConfig11 = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlConfig11_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -3748,6 +3809,10 @@ export const PostgresqlConfig11 = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlConfig11_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -3924,6 +3989,7 @@ export const PostgresqlConfig11 = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql11_1c.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql11_1c.ts index 06bd2e1d..00f33cb2 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql11_1c.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql11_1c.ts @@ -41,7 +41,9 @@ export interface Postgresqlconfig111c { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: Postgresqlconfig111c_WalLevel; @@ -49,6 +51,7 @@ export interface Postgresqlconfig111c { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -190,6 +193,8 @@ export interface Postgresqlconfig111c { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: Postgresqlconfig111c_PasswordEncryption; } export enum Postgresqlconfig111c_BackslashQuote { @@ -582,6 +587,48 @@ export function postgresqlconfig111c_LogStatementToJSON( } } +export enum Postgresqlconfig111c_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlconfig111c_PasswordEncryptionFromJSON( + object: any +): Postgresqlconfig111c_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return Postgresqlconfig111c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return Postgresqlconfig111c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return Postgresqlconfig111c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return Postgresqlconfig111c_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlconfig111c_PasswordEncryptionToJSON( + object: Postgresqlconfig111c_PasswordEncryption +): string { + switch (object) { + case Postgresqlconfig111c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case Postgresqlconfig111c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case Postgresqlconfig111c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum Postgresqlconfig111c_PgHintPlanDebugPrint { PG_HINT_PLAN_DEBUG_PRINT_UNSPECIFIED = 0, PG_HINT_PLAN_DEBUG_PRINT_OFF = 1, @@ -988,6 +1035,7 @@ const basePostgresqlconfig111c: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const Postgresqlconfig111c = { @@ -2043,6 +2091,9 @@ export const Postgresqlconfig111c = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -2817,6 +2868,9 @@ export const Postgresqlconfig111c = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3489,6 +3543,13 @@ export const Postgresqlconfig111c = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlconfig111c_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -3804,6 +3865,10 @@ export const Postgresqlconfig111c = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlconfig111c_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -3982,6 +4047,7 @@ export const Postgresqlconfig111c = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql12.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql12.ts index 36637883..6581c564 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql12.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql12.ts @@ -41,7 +41,9 @@ export interface PostgresqlConfig12 { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: PostgresqlConfig12_WalLevel; @@ -49,6 +51,7 @@ export interface PostgresqlConfig12 { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -190,6 +193,8 @@ export interface PostgresqlConfig12 { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: PostgresqlConfig12_PasswordEncryption; } export enum PostgresqlConfig12_BackslashQuote { @@ -582,6 +587,48 @@ export function postgresqlConfig12_LogStatementToJSON( } } +export enum PostgresqlConfig12_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlConfig12_PasswordEncryptionFromJSON( + object: any +): PostgresqlConfig12_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return PostgresqlConfig12_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return PostgresqlConfig12_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return PostgresqlConfig12_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return PostgresqlConfig12_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlConfig12_PasswordEncryptionToJSON( + object: PostgresqlConfig12_PasswordEncryption +): string { + switch (object) { + case PostgresqlConfig12_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case PostgresqlConfig12_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case PostgresqlConfig12_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum PostgresqlConfig12_PgHintPlanDebugPrint { PG_HINT_PLAN_DEBUG_PRINT_UNSPECIFIED = 0, PG_HINT_PLAN_DEBUG_PRINT_OFF = 1, @@ -1037,6 +1084,7 @@ const basePostgresqlConfig12: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const PostgresqlConfig12 = { @@ -2086,6 +2134,9 @@ export const PostgresqlConfig12 = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -2854,6 +2905,9 @@ export const PostgresqlConfig12 = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3519,6 +3573,13 @@ export const PostgresqlConfig12 = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlConfig12_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -3835,6 +3896,10 @@ export const PostgresqlConfig12 = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlConfig12_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -4014,6 +4079,7 @@ export const PostgresqlConfig12 = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql12_1c.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql12_1c.ts index 13f5124b..e0ae2c52 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql12_1c.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql12_1c.ts @@ -41,7 +41,9 @@ export interface Postgresqlconfig121c { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: Postgresqlconfig121c_WalLevel; @@ -49,6 +51,7 @@ export interface Postgresqlconfig121c { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -192,6 +195,8 @@ export interface Postgresqlconfig121c { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: Postgresqlconfig121c_PasswordEncryption; } export enum Postgresqlconfig121c_BackslashQuote { @@ -584,6 +589,48 @@ export function postgresqlconfig121c_LogStatementToJSON( } } +export enum Postgresqlconfig121c_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlconfig121c_PasswordEncryptionFromJSON( + object: any +): Postgresqlconfig121c_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return Postgresqlconfig121c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return Postgresqlconfig121c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return Postgresqlconfig121c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return Postgresqlconfig121c_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlconfig121c_PasswordEncryptionToJSON( + object: Postgresqlconfig121c_PasswordEncryption +): string { + switch (object) { + case Postgresqlconfig121c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case Postgresqlconfig121c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case Postgresqlconfig121c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum Postgresqlconfig121c_PgHintPlanDebugPrint { PG_HINT_PLAN_DEBUG_PRINT_UNSPECIFIED = 0, PG_HINT_PLAN_DEBUG_PRINT_OFF = 1, @@ -1039,6 +1086,7 @@ const basePostgresqlconfig121c: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const Postgresqlconfig121c = { @@ -2106,6 +2154,9 @@ export const Postgresqlconfig121c = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -2889,6 +2940,9 @@ export const Postgresqlconfig121c = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3570,6 +3624,13 @@ export const Postgresqlconfig121c = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlconfig121c_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -3891,6 +3952,10 @@ export const Postgresqlconfig121c = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlconfig121c_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -4072,6 +4137,7 @@ export const Postgresqlconfig121c = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql13.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql13.ts index ea2e2169..d8787f1b 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql13.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql13.ts @@ -41,7 +41,9 @@ export interface PostgresqlConfig13 { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: PostgresqlConfig13_WalLevel; @@ -49,6 +51,7 @@ export interface PostgresqlConfig13 { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -208,6 +211,8 @@ export interface PostgresqlConfig13 { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: PostgresqlConfig13_PasswordEncryption; } export enum PostgresqlConfig13_BackslashQuote { @@ -600,6 +605,48 @@ export function postgresqlConfig13_LogStatementToJSON( } } +export enum PostgresqlConfig13_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlConfig13_PasswordEncryptionFromJSON( + object: any +): PostgresqlConfig13_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return PostgresqlConfig13_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return PostgresqlConfig13_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return PostgresqlConfig13_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return PostgresqlConfig13_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlConfig13_PasswordEncryptionToJSON( + object: PostgresqlConfig13_PasswordEncryption +): string { + switch (object) { + case PostgresqlConfig13_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case PostgresqlConfig13_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case PostgresqlConfig13_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum PostgresqlConfig13_PgHintPlanDebugPrint { PG_HINT_PLAN_DEBUG_PRINT_UNSPECIFIED = 0, PG_HINT_PLAN_DEBUG_PRINT_OFF = 1, @@ -1055,6 +1102,7 @@ const basePostgresqlConfig13: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const PostgresqlConfig13 = { @@ -2209,6 +2257,9 @@ export const PostgresqlConfig13 = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -3049,6 +3100,9 @@ export const PostgresqlConfig13 = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3773,6 +3827,13 @@ export const PostgresqlConfig13 = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlConfig13_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -4115,6 +4176,10 @@ export const PostgresqlConfig13 = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlConfig13_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -4310,6 +4375,7 @@ export const PostgresqlConfig13 = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql13_1c.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql13_1c.ts index 8f7f4371..4a0b0b73 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql13_1c.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql13_1c.ts @@ -41,7 +41,9 @@ export interface Postgresqlconfig131c { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: Postgresqlconfig131c_WalLevel; @@ -49,6 +51,7 @@ export interface Postgresqlconfig131c { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -208,6 +211,8 @@ export interface Postgresqlconfig131c { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: Postgresqlconfig131c_PasswordEncryption; } export enum Postgresqlconfig131c_BackslashQuote { @@ -600,6 +605,48 @@ export function postgresqlconfig131c_LogStatementToJSON( } } +export enum Postgresqlconfig131c_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlconfig131c_PasswordEncryptionFromJSON( + object: any +): Postgresqlconfig131c_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return Postgresqlconfig131c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return Postgresqlconfig131c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return Postgresqlconfig131c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return Postgresqlconfig131c_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlconfig131c_PasswordEncryptionToJSON( + object: Postgresqlconfig131c_PasswordEncryption +): string { + switch (object) { + case Postgresqlconfig131c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case Postgresqlconfig131c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case Postgresqlconfig131c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum Postgresqlconfig131c_PgHintPlanDebugPrint { PG_HINT_PLAN_DEBUG_PRINT_UNSPECIFIED = 0, PG_HINT_PLAN_DEBUG_PRINT_OFF = 1, @@ -1055,6 +1102,7 @@ const basePostgresqlconfig131c: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const Postgresqlconfig131c = { @@ -2221,6 +2269,9 @@ export const Postgresqlconfig131c = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -3070,6 +3121,9 @@ export const Postgresqlconfig131c = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3806,6 +3860,13 @@ export const Postgresqlconfig131c = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlconfig131c_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -4151,6 +4212,10 @@ export const Postgresqlconfig131c = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlconfig131c_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -4347,6 +4412,7 @@ export const Postgresqlconfig131c = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql14.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql14.ts index 05822cbd..ec6b5aa7 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql14.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql14.ts @@ -41,7 +41,9 @@ export interface PostgresqlConfig14 { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: PostgresqlConfig14_WalLevel; @@ -49,6 +51,7 @@ export interface PostgresqlConfig14 { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -217,6 +220,8 @@ export interface PostgresqlConfig14 { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: PostgresqlConfig14_PasswordEncryption; } export enum PostgresqlConfig14_BackslashQuote { @@ -609,6 +614,48 @@ export function postgresqlConfig14_LogStatementToJSON( } } +export enum PostgresqlConfig14_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlConfig14_PasswordEncryptionFromJSON( + object: any +): PostgresqlConfig14_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return PostgresqlConfig14_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return PostgresqlConfig14_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return PostgresqlConfig14_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return PostgresqlConfig14_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlConfig14_PasswordEncryptionToJSON( + object: PostgresqlConfig14_PasswordEncryption +): string { + switch (object) { + case PostgresqlConfig14_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case PostgresqlConfig14_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case PostgresqlConfig14_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum PostgresqlConfig14_PgHintPlanDebugPrint { PG_HINT_PLAN_DEBUG_PRINT_UNSPECIFIED = 0, PG_HINT_PLAN_DEBUG_PRINT_OFF = 1, @@ -1064,6 +1111,7 @@ const basePostgresqlConfig14: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const PostgresqlConfig14 = { @@ -2260,6 +2308,9 @@ export const PostgresqlConfig14 = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -3130,6 +3181,9 @@ export const PostgresqlConfig14 = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3878,6 +3932,13 @@ export const PostgresqlConfig14 = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlConfig14_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -4230,6 +4291,10 @@ export const PostgresqlConfig14 = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlConfig14_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -4431,6 +4496,7 @@ export const PostgresqlConfig14 = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql14_1c.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql14_1c.ts index 6dab914a..5fe79957 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql14_1c.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql14_1c.ts @@ -41,7 +41,9 @@ export interface Postgresqlconfig141c { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: Postgresqlconfig141c_WalLevel; @@ -49,6 +51,7 @@ export interface Postgresqlconfig141c { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -217,6 +220,8 @@ export interface Postgresqlconfig141c { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: Postgresqlconfig141c_PasswordEncryption; } export enum Postgresqlconfig141c_BackslashQuote { @@ -609,6 +614,48 @@ export function postgresqlconfig141c_LogStatementToJSON( } } +export enum Postgresqlconfig141c_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlconfig141c_PasswordEncryptionFromJSON( + object: any +): Postgresqlconfig141c_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return Postgresqlconfig141c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return Postgresqlconfig141c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return Postgresqlconfig141c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return Postgresqlconfig141c_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlconfig141c_PasswordEncryptionToJSON( + object: Postgresqlconfig141c_PasswordEncryption +): string { + switch (object) { + case Postgresqlconfig141c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case Postgresqlconfig141c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case Postgresqlconfig141c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum Postgresqlconfig141c_PgHintPlanDebugPrint { PG_HINT_PLAN_DEBUG_PRINT_UNSPECIFIED = 0, PG_HINT_PLAN_DEBUG_PRINT_OFF = 1, @@ -1064,6 +1111,7 @@ const basePostgresqlconfig141c: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const Postgresqlconfig141c = { @@ -2272,6 +2320,9 @@ export const Postgresqlconfig141c = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -3151,6 +3202,9 @@ export const Postgresqlconfig141c = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3911,6 +3965,13 @@ export const Postgresqlconfig141c = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlconfig141c_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -4266,6 +4327,10 @@ export const Postgresqlconfig141c = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlconfig141c_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -4468,6 +4533,7 @@ export const Postgresqlconfig141c = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql15.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql15.ts index 8216bd3a..337ac26b 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql15.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql15.ts @@ -41,7 +41,9 @@ export interface PostgresqlConfig15 { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: PostgresqlConfig15_WalLevel; @@ -49,6 +51,7 @@ export interface PostgresqlConfig15 { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -218,6 +221,8 @@ export interface PostgresqlConfig15 { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: PostgresqlConfig15_PasswordEncryption; } export enum PostgresqlConfig15_BackslashQuote { @@ -610,6 +615,48 @@ export function postgresqlConfig15_LogStatementToJSON( } } +export enum PostgresqlConfig15_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlConfig15_PasswordEncryptionFromJSON( + object: any +): PostgresqlConfig15_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return PostgresqlConfig15_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return PostgresqlConfig15_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return PostgresqlConfig15_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return PostgresqlConfig15_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlConfig15_PasswordEncryptionToJSON( + object: PostgresqlConfig15_PasswordEncryption +): string { + switch (object) { + case PostgresqlConfig15_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case PostgresqlConfig15_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case PostgresqlConfig15_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum PostgresqlConfig15_PgHintPlanDebugPrint { PG_HINT_PLAN_DEBUG_PRINT_UNSPECIFIED = 0, PG_HINT_PLAN_DEBUG_PRINT_OFF = 1, @@ -722,6 +769,7 @@ export enum PostgresqlConfig15_SharedPreloadLibraries { SHARED_PRELOAD_LIBRARIES_PGLOGICAL = 6, SHARED_PRELOAD_LIBRARIES_PG_PREWARM = 7, SHARED_PRELOAD_LIBRARIES_PGAUDIT = 8, + SHARED_PRELOAD_LIBRARIES_ANON = 9, UNRECOGNIZED = -1, } @@ -756,6 +804,9 @@ export function postgresqlConfig15_SharedPreloadLibrariesFromJSON( case 8: case "SHARED_PRELOAD_LIBRARIES_PGAUDIT": return PostgresqlConfig15_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_PGAUDIT; + case 9: + case "SHARED_PRELOAD_LIBRARIES_ANON": + return PostgresqlConfig15_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_ANON; case -1: case "UNRECOGNIZED": default: @@ -785,6 +836,8 @@ export function postgresqlConfig15_SharedPreloadLibrariesToJSON( return "SHARED_PRELOAD_LIBRARIES_PG_PREWARM"; case PostgresqlConfig15_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_PGAUDIT: return "SHARED_PRELOAD_LIBRARIES_PGAUDIT"; + case PostgresqlConfig15_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_ANON: + return "SHARED_PRELOAD_LIBRARIES_ANON"; default: return "UNKNOWN"; } @@ -1065,6 +1118,7 @@ const basePostgresqlConfig15: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const PostgresqlConfig15 = { @@ -2270,6 +2324,9 @@ export const PostgresqlConfig15 = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -3146,6 +3203,9 @@ export const PostgresqlConfig15 = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3899,6 +3959,13 @@ export const PostgresqlConfig15 = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlConfig15_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -4253,6 +4320,10 @@ export const PostgresqlConfig15 = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlConfig15_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -4456,6 +4527,7 @@ export const PostgresqlConfig15 = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql15_1c.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql15_1c.ts index df809f9c..5462ddcf 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql15_1c.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql15_1c.ts @@ -41,7 +41,9 @@ export interface Postgresqlconfig151c { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: Postgresqlconfig151c_WalLevel; @@ -49,6 +51,7 @@ export interface Postgresqlconfig151c { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -220,6 +223,8 @@ export interface Postgresqlconfig151c { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: Postgresqlconfig151c_PasswordEncryption; } export enum Postgresqlconfig151c_BackslashQuote { @@ -612,6 +617,48 @@ export function postgresqlconfig151c_LogStatementToJSON( } } +export enum Postgresqlconfig151c_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlconfig151c_PasswordEncryptionFromJSON( + object: any +): Postgresqlconfig151c_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return Postgresqlconfig151c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return Postgresqlconfig151c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return Postgresqlconfig151c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return Postgresqlconfig151c_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlconfig151c_PasswordEncryptionToJSON( + object: Postgresqlconfig151c_PasswordEncryption +): string { + switch (object) { + case Postgresqlconfig151c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case Postgresqlconfig151c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case Postgresqlconfig151c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum Postgresqlconfig151c_PgHintPlanDebugPrint { PG_HINT_PLAN_DEBUG_PRINT_UNSPECIFIED = 0, PG_HINT_PLAN_DEBUG_PRINT_OFF = 1, @@ -724,6 +771,7 @@ export enum Postgresqlconfig151c_SharedPreloadLibraries { SHARED_PRELOAD_LIBRARIES_PGLOGICAL = 6, SHARED_PRELOAD_LIBRARIES_PG_PREWARM = 7, SHARED_PRELOAD_LIBRARIES_PGAUDIT = 8, + SHARED_PRELOAD_LIBRARIES_ANON = 9, UNRECOGNIZED = -1, } @@ -758,6 +806,9 @@ export function postgresqlconfig151c_SharedPreloadLibrariesFromJSON( case 8: case "SHARED_PRELOAD_LIBRARIES_PGAUDIT": return Postgresqlconfig151c_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_PGAUDIT; + case 9: + case "SHARED_PRELOAD_LIBRARIES_ANON": + return Postgresqlconfig151c_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_ANON; case -1: case "UNRECOGNIZED": default: @@ -787,6 +838,8 @@ export function postgresqlconfig151c_SharedPreloadLibrariesToJSON( return "SHARED_PRELOAD_LIBRARIES_PG_PREWARM"; case Postgresqlconfig151c_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_PGAUDIT: return "SHARED_PRELOAD_LIBRARIES_PGAUDIT"; + case Postgresqlconfig151c_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_ANON: + return "SHARED_PRELOAD_LIBRARIES_ANON"; default: return "UNKNOWN"; } @@ -1067,6 +1120,7 @@ const basePostgresqlconfig151c: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const Postgresqlconfig151c = { @@ -2290,6 +2344,9 @@ export const Postgresqlconfig151c = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -3181,6 +3238,9 @@ export const Postgresqlconfig151c = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3950,6 +4010,13 @@ export const Postgresqlconfig151c = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlconfig151c_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -4309,6 +4376,10 @@ export const Postgresqlconfig151c = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlconfig151c_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -4514,6 +4585,7 @@ export const Postgresqlconfig151c = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql16.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql16.ts index 7da64e34..ce4f39be 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql16.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql16.ts @@ -41,7 +41,9 @@ export interface PostgresqlConfig16 { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: PostgresqlConfig16_WalLevel; @@ -49,6 +51,7 @@ export interface PostgresqlConfig16 { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -218,6 +221,8 @@ export interface PostgresqlConfig16 { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: PostgresqlConfig16_PasswordEncryption; } export enum PostgresqlConfig16_BackslashQuote { @@ -616,6 +621,48 @@ export function postgresqlConfig16_LogStatementToJSON( } } +export enum PostgresqlConfig16_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlConfig16_PasswordEncryptionFromJSON( + object: any +): PostgresqlConfig16_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return PostgresqlConfig16_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return PostgresqlConfig16_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return PostgresqlConfig16_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return PostgresqlConfig16_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlConfig16_PasswordEncryptionToJSON( + object: PostgresqlConfig16_PasswordEncryption +): string { + switch (object) { + case PostgresqlConfig16_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case PostgresqlConfig16_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case PostgresqlConfig16_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum PostgresqlConfig16_PgHintPlanDebugPrint { PG_HINT_PLAN_DEBUG_PRINT_UNSPECIFIED = 0, PG_HINT_PLAN_DEBUG_PRINT_OFF = 1, @@ -728,6 +775,7 @@ export enum PostgresqlConfig16_SharedPreloadLibraries { SHARED_PRELOAD_LIBRARIES_PGLOGICAL = 6, SHARED_PRELOAD_LIBRARIES_PG_PREWARM = 7, SHARED_PRELOAD_LIBRARIES_PGAUDIT = 8, + SHARED_PRELOAD_LIBRARIES_ANON = 9, UNRECOGNIZED = -1, } @@ -762,6 +810,9 @@ export function postgresqlConfig16_SharedPreloadLibrariesFromJSON( case 8: case "SHARED_PRELOAD_LIBRARIES_PGAUDIT": return PostgresqlConfig16_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_PGAUDIT; + case 9: + case "SHARED_PRELOAD_LIBRARIES_ANON": + return PostgresqlConfig16_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_ANON; case -1: case "UNRECOGNIZED": default: @@ -791,6 +842,8 @@ export function postgresqlConfig16_SharedPreloadLibrariesToJSON( return "SHARED_PRELOAD_LIBRARIES_PG_PREWARM"; case PostgresqlConfig16_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_PGAUDIT: return "SHARED_PRELOAD_LIBRARIES_PGAUDIT"; + case PostgresqlConfig16_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_ANON: + return "SHARED_PRELOAD_LIBRARIES_ANON"; default: return "UNKNOWN"; } @@ -1071,6 +1124,7 @@ const basePostgresqlConfig16: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const PostgresqlConfig16 = { @@ -2276,6 +2330,9 @@ export const PostgresqlConfig16 = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -3152,6 +3209,9 @@ export const PostgresqlConfig16 = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3907,6 +3967,13 @@ export const PostgresqlConfig16 = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlConfig16_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -4261,6 +4328,10 @@ export const PostgresqlConfig16 = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlConfig16_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -4464,6 +4535,7 @@ export const PostgresqlConfig16 = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql16_1c.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql16_1c.ts index 276f47c8..d30aa579 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql16_1c.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql16_1c.ts @@ -41,7 +41,9 @@ export interface Postgresqlconfig161c { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: Postgresqlconfig161c_WalLevel; @@ -49,6 +51,7 @@ export interface Postgresqlconfig161c { /** in milliseconds. */ checkpointTimeout?: number; checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; @@ -220,6 +223,8 @@ export interface Postgresqlconfig161c { logReplicationCommands?: boolean; /** in milliseconds. The default is 1000 (1 sec). */ logAutovacuumMinDuration?: number; + /** A default value for `` user_password_encryption `` user-level setting, if it not specified for new users. Possible values are `` PASSWORD_ENCRYPTION_MD5 `` or `` PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. The default is `` PASSWORD_ENCRYPTION_MD5 ``. */ + passwordEncryption: Postgresqlconfig161c_PasswordEncryption; } export enum Postgresqlconfig161c_BackslashQuote { @@ -618,6 +623,48 @@ export function postgresqlconfig161c_LogStatementToJSON( } } +export enum Postgresqlconfig161c_PasswordEncryption { + PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + PASSWORD_ENCRYPTION_MD5 = 1, + PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function postgresqlconfig161c_PasswordEncryptionFromJSON( + object: any +): Postgresqlconfig161c_PasswordEncryption { + switch (object) { + case 0: + case "PASSWORD_ENCRYPTION_UNSPECIFIED": + return Postgresqlconfig161c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "PASSWORD_ENCRYPTION_MD5": + return Postgresqlconfig161c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5; + case 2: + case "PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return Postgresqlconfig161c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return Postgresqlconfig161c_PasswordEncryption.UNRECOGNIZED; + } +} + +export function postgresqlconfig161c_PasswordEncryptionToJSON( + object: Postgresqlconfig161c_PasswordEncryption +): string { + switch (object) { + case Postgresqlconfig161c_PasswordEncryption.PASSWORD_ENCRYPTION_UNSPECIFIED: + return "PASSWORD_ENCRYPTION_UNSPECIFIED"; + case Postgresqlconfig161c_PasswordEncryption.PASSWORD_ENCRYPTION_MD5: + return "PASSWORD_ENCRYPTION_MD5"; + case Postgresqlconfig161c_PasswordEncryption.PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + export enum Postgresqlconfig161c_PgHintPlanDebugPrint { PG_HINT_PLAN_DEBUG_PRINT_UNSPECIFIED = 0, PG_HINT_PLAN_DEBUG_PRINT_OFF = 1, @@ -730,6 +777,7 @@ export enum Postgresqlconfig161c_SharedPreloadLibraries { SHARED_PRELOAD_LIBRARIES_PGLOGICAL = 6, SHARED_PRELOAD_LIBRARIES_PG_PREWARM = 7, SHARED_PRELOAD_LIBRARIES_PGAUDIT = 8, + SHARED_PRELOAD_LIBRARIES_ANON = 9, UNRECOGNIZED = -1, } @@ -764,6 +812,9 @@ export function postgresqlconfig161c_SharedPreloadLibrariesFromJSON( case 8: case "SHARED_PRELOAD_LIBRARIES_PGAUDIT": return Postgresqlconfig161c_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_PGAUDIT; + case 9: + case "SHARED_PRELOAD_LIBRARIES_ANON": + return Postgresqlconfig161c_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_ANON; case -1: case "UNRECOGNIZED": default: @@ -793,6 +844,8 @@ export function postgresqlconfig161c_SharedPreloadLibrariesToJSON( return "SHARED_PRELOAD_LIBRARIES_PG_PREWARM"; case Postgresqlconfig161c_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_PGAUDIT: return "SHARED_PRELOAD_LIBRARIES_PGAUDIT"; + case Postgresqlconfig161c_SharedPreloadLibraries.SHARED_PRELOAD_LIBRARIES_ANON: + return "SHARED_PRELOAD_LIBRARIES_ANON"; default: return "UNKNOWN"; } @@ -1073,6 +1126,7 @@ const basePostgresqlconfig161c: object = { sharedPreloadLibraries: 0, pgHintPlanDebugPrint: 0, pgHintPlanMessageLevel: 0, + passwordEncryption: 0, }; export const Postgresqlconfig161c = { @@ -2296,6 +2350,9 @@ export const Postgresqlconfig161c = { writer.uint32(1322).fork() ).ldelim(); } + if (message.passwordEncryption !== 0) { + writer.uint32(1336).int32(message.passwordEncryption); + } return writer; }, @@ -3187,6 +3244,9 @@ export const Postgresqlconfig161c = { reader.uint32() ).value; break; + case 167: + message.passwordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -3956,6 +4016,13 @@ export const Postgresqlconfig161c = { object.logAutovacuumMinDuration !== null ? Number(object.logAutovacuumMinDuration) : undefined; + message.passwordEncryption = + object.passwordEncryption !== undefined && + object.passwordEncryption !== null + ? postgresqlconfig161c_PasswordEncryptionFromJSON( + object.passwordEncryption + ) + : 0; return message; }, @@ -4315,6 +4382,10 @@ export const Postgresqlconfig161c = { (obj.logReplicationCommands = message.logReplicationCommands); message.logAutovacuumMinDuration !== undefined && (obj.logAutovacuumMinDuration = message.logAutovacuumMinDuration); + message.passwordEncryption !== undefined && + (obj.passwordEncryption = postgresqlconfig161c_PasswordEncryptionToJSON( + message.passwordEncryption + )); return obj; }, @@ -4520,6 +4591,7 @@ export const Postgresqlconfig161c = { message.logReplicationCommands = object.logReplicationCommands ?? undefined; message.logAutovacuumMinDuration = object.logAutovacuumMinDuration ?? undefined; + message.passwordEncryption = object.passwordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql9_6.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql9_6.ts index a1e64387..e9b5ec5a 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql9_6.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/config/postgresql9_6.ts @@ -42,7 +42,9 @@ export interface Postgresqlconfig96 { bgwriterDelay?: number; bgwriterLruMaxpages?: number; bgwriterLruMultiplier?: number; + /** in bytes */ bgwriterFlushAfter?: number; + /** in bytes */ backendFlushAfter?: number; oldSnapshotThreshold?: number; walLevel: Postgresqlconfig96_WalLevel; @@ -51,6 +53,7 @@ export interface Postgresqlconfig96 { checkpointTimeout?: number; /** Acceptable values are 0.0 to 1.0, inclusive. */ checkpointCompletionTarget?: number; + /** in bytes */ checkpointFlushAfter?: number; /** in bytes. */ maxWalSize?: number; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/user.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/user.ts index 333d9fe4..3733f44a 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/user.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/user.ts @@ -6,6 +6,48 @@ import { BoolValue, Int64Value } from "../../../../../google/protobuf/wrappers"; export const protobufPackage = "yandex.cloud.mdb.postgresql.v1"; +export enum UserPasswordEncryption { + USER_PASSWORD_ENCRYPTION_UNSPECIFIED = 0, + USER_PASSWORD_ENCRYPTION_MD5 = 1, + USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 = 2, + UNRECOGNIZED = -1, +} + +export function userPasswordEncryptionFromJSON( + object: any +): UserPasswordEncryption { + switch (object) { + case 0: + case "USER_PASSWORD_ENCRYPTION_UNSPECIFIED": + return UserPasswordEncryption.USER_PASSWORD_ENCRYPTION_UNSPECIFIED; + case 1: + case "USER_PASSWORD_ENCRYPTION_MD5": + return UserPasswordEncryption.USER_PASSWORD_ENCRYPTION_MD5; + case 2: + case "USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256": + return UserPasswordEncryption.USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256; + case -1: + case "UNRECOGNIZED": + default: + return UserPasswordEncryption.UNRECOGNIZED; + } +} + +export function userPasswordEncryptionToJSON( + object: UserPasswordEncryption +): string { + switch (object) { + case UserPasswordEncryption.USER_PASSWORD_ENCRYPTION_UNSPECIFIED: + return "USER_PASSWORD_ENCRYPTION_UNSPECIFIED"; + case UserPasswordEncryption.USER_PASSWORD_ENCRYPTION_MD5: + return "USER_PASSWORD_ENCRYPTION_MD5"; + case UserPasswordEncryption.USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256: + return "USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256"; + default: + return "UNKNOWN"; + } +} + /** * A PostgreSQL User resource. For more information, see * the [Developer's Guide](/docs/managed-postgresql/concepts). @@ -42,11 +84,17 @@ export interface User { */ grants: string[]; /** - * Deletion Protection inhibits deletion of the user + * Determines whether the user deletion protection is enabled. * - * Default value: `unspecified` (inherits cluster's deletion_protection) + * The default value is `unspecified`. In this case, the user configuration inherits the cluster's deletion protection settings. */ deletionProtection?: boolean; + /** + * Password-based authentication method for user. + * Possible values are `` USER_PASSWORD_ENCRYPTION_MD5 `` or `` USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. + * The default is `` password_encryption `` setting for cluster. + */ + userPasswordEncryption: UserPasswordEncryption; } export interface Permission { @@ -93,6 +141,104 @@ export interface UserSpec { * Default value: `unspecified` (inherits cluster's deletion_protection) */ deletionProtection?: boolean; + /** + * Password-based authentication method for user. + * Possible values are `` USER_PASSWORD_ENCRYPTION_MD5 `` or `` USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. + * The default is `` password_encryption `` setting for cluster. + */ + userPasswordEncryption: UserPasswordEncryption; +} + +export interface PGAuditSettings { + $type: "yandex.cloud.mdb.postgresql.v1.PGAuditSettings"; + /** + * Defines which user queries will be written to the audit log. Corresponds to the [Pg audit log](https://yandex.cloud/en/docs/managed-postgresql/concepts/settings-list#setting-pg-audit-log) user setting. + * + * The possible values are the following: + * + * * PG_AUDIT_SETTINGS_LOG_READ: `SELECT` and `COPY` queries are logged if the data source is a relation or query. + * * PG_AUDIT_SETTINGS_LOG_WRITE: `INSERT`, `UPDATE`, `DELETE`, `TRUNCATE`, and `COPY` queries are logged if the data target is a relation. + * * PG_AUDIT_SETTINGS_LOG_FUNCTION: Function invocations and `DO` sections are logged. + * * PG_AUDIT_SETTINGS_LOG_ROLE: Statements related to role and privilege management, such as `GRANT`, `REVOKE`, or `CREATE/ALTER/DROP ROLE`, are logged. + * * PG_AUDIT_SETTINGS_LOG_DDL: Any `DDL` statements that do not belong to the `ROLE` class are logged. + * * PG_AUDIT_SETTINGS_LOG_MISC: Miscellaneous commands, such as `DISCARD`, `FETCH`, `CHECKPOINT`, `VACUUM`, and `SET`, are logged. + * * PG_AUDIT_SETTINGS_LOG_MISC_SET: Miscellaneous `SET` commands, e.g., `SET ROLE`, are logged. + * + * The default value is PG_AUDIT_SETTINGS_LOG_UNSPECIFIED. In this case, the parameter is not configured. + */ + log: PGAuditSettings_PGAuditSettingsLog[]; +} + +export enum PGAuditSettings_PGAuditSettingsLog { + PG_AUDIT_SETTINGS_LOG_UNSPECIFIED = 0, + PG_AUDIT_SETTINGS_LOG_READ = 1, + PG_AUDIT_SETTINGS_LOG_WRITE = 2, + PG_AUDIT_SETTINGS_LOG_FUNCTION = 3, + PG_AUDIT_SETTINGS_LOG_ROLE = 4, + PG_AUDIT_SETTINGS_LOG_DDL = 5, + PG_AUDIT_SETTINGS_LOG_MISC = 6, + PG_AUDIT_SETTINGS_LOG_MISC_SET = 7, + UNRECOGNIZED = -1, +} + +export function pGAuditSettings_PGAuditSettingsLogFromJSON( + object: any +): PGAuditSettings_PGAuditSettingsLog { + switch (object) { + case 0: + case "PG_AUDIT_SETTINGS_LOG_UNSPECIFIED": + return PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_UNSPECIFIED; + case 1: + case "PG_AUDIT_SETTINGS_LOG_READ": + return PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_READ; + case 2: + case "PG_AUDIT_SETTINGS_LOG_WRITE": + return PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_WRITE; + case 3: + case "PG_AUDIT_SETTINGS_LOG_FUNCTION": + return PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_FUNCTION; + case 4: + case "PG_AUDIT_SETTINGS_LOG_ROLE": + return PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_ROLE; + case 5: + case "PG_AUDIT_SETTINGS_LOG_DDL": + return PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_DDL; + case 6: + case "PG_AUDIT_SETTINGS_LOG_MISC": + return PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_MISC; + case 7: + case "PG_AUDIT_SETTINGS_LOG_MISC_SET": + return PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_MISC_SET; + case -1: + case "UNRECOGNIZED": + default: + return PGAuditSettings_PGAuditSettingsLog.UNRECOGNIZED; + } +} + +export function pGAuditSettings_PGAuditSettingsLogToJSON( + object: PGAuditSettings_PGAuditSettingsLog +): string { + switch (object) { + case PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_UNSPECIFIED: + return "PG_AUDIT_SETTINGS_LOG_UNSPECIFIED"; + case PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_READ: + return "PG_AUDIT_SETTINGS_LOG_READ"; + case PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_WRITE: + return "PG_AUDIT_SETTINGS_LOG_WRITE"; + case PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_FUNCTION: + return "PG_AUDIT_SETTINGS_LOG_FUNCTION"; + case PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_ROLE: + return "PG_AUDIT_SETTINGS_LOG_ROLE"; + case PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_DDL: + return "PG_AUDIT_SETTINGS_LOG_DDL"; + case PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_MISC: + return "PG_AUDIT_SETTINGS_LOG_MISC"; + case PGAuditSettings_PGAuditSettingsLog.PG_AUDIT_SETTINGS_LOG_MISC_SET: + return "PG_AUDIT_SETTINGS_LOG_MISC_SET"; + default: + return "UNKNOWN"; + } } /** PostgreSQL user settings. */ @@ -102,7 +248,7 @@ export interface UserSettings { * SQL sets an isolation level for each transaction. * This setting defines the default isolation level to be set for all new SQL transactions. * - * See in-depth description in [PostgreSQL documentation](https://www.postgresql.org/docs/current/transaction-iso.html). + * For more information, see the [PostgreSQL documentation](https://www.postgresql.org/docs/current/transaction-iso.html). */ defaultTransactionIsolation: UserSettings_TransactionIsolation; /** @@ -122,7 +268,7 @@ export interface UserSettings { * * Value of `-1` (default) disables logging of the duration of statements. * - * See in-depth description in [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-logging.html). + * For more information, see the [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-logging.html). */ logMinDurationStatement?: number; /** @@ -131,7 +277,7 @@ export interface UserSettings { * When synchronization is enabled, cluster waits for the synchronous operations to be completed prior to reporting `success` to the client. * These operations guarantee different levels of the data safety and visibility in the cluster. * - * See in-depth description in [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT). + * For more information, see the [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT). */ synchronousCommit: UserSettings_SynchronousCommit; /** @@ -144,19 +290,19 @@ export interface UserSettings { /** * This setting specifies which SQL statements should be logged (on the user level). * - * See in-depth description in [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-logging.html). + * For more information, see the [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-logging.html). */ logStatement: UserSettings_LogStatement; /** * Mode that the connection pooler is working in with specified user. * - * See in-depth description in [Odyssey documentation](https://github.com/yandex/odyssey/blob/master/documentation/configuration.md#pool-string) + * For more information, see the [Odyssey documentation](https://github.com/yandex/odyssey/blob/master/documentation/configuration.md#pool-string). */ poolMode: UserSettings_PoolingMode; /** * User can use prepared statements with transaction pooling. * - * See in-depth description in [PostgreSQL documentation](https://www.postgresql.org/docs/current/sql-prepare.html) + * For more information, see the [PostgreSQL documentation](https://www.postgresql.org/docs/current/sql-prepare.html). */ preparedStatementsPooling?: boolean; /** @@ -177,51 +323,53 @@ export interface UserSettings { * * Value of `0` disables the timeout mechanism. * - * See in-depth description in [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-replication.html) + * For more information, see the [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-replication.html). */ walSenderTimeout?: number; /** - * Sets the maximum allowed idle time (in milliseconds) between queries, when in a transaction. + * Sets the maximum allowed idle time, in milliseconds, between queries while in a transaction. * - * Values of `0` (default) disables the timeout. + * The default value is `0`, which disables the timeout. * - * See in-depth description in [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-client.html) + * For more information, see the [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-client.html). */ idleInTransactionSessionTimeout?: number; /** - * The maximum time (in milliseconds) to wait for statement + * The maximum time (in milliseconds) to wait for statement. * The timeout is measured from the time a command arrives at the server until it is completed by the server. * * If `log_min_error_statement` is set to ERROR or lower, the statement that timed out will also be logged. * * Value of `0` (default) disables the timeout * - * See in-depth description in [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-client.html) + * For more information, see the [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-client.html). */ statementTimeout?: number; + /** Settings of the [PostgreSQL Audit Extension](https://www.pgaudit.org/) (pgaudit). */ + pgaudit?: PGAuditSettings; } export enum UserSettings_SynchronousCommit { SYNCHRONOUS_COMMIT_UNSPECIFIED = 0, - /** SYNCHRONOUS_COMMIT_ON - (default value) success is reported to the client if the data is in WAL (Write-Ahead Log), and WAL is written to the storage of both the master and its synchronous standby server. */ + /** SYNCHRONOUS_COMMIT_ON - Success is reported to the client if the data is in WAL (Write-Ahead Log), and WAL is written to the storage of both the master and its synchronous standby server. Default value. */ SYNCHRONOUS_COMMIT_ON = 1, /** - * SYNCHRONOUS_COMMIT_OFF - success is reported to the client even if the data is not in WAL. + * SYNCHRONOUS_COMMIT_OFF - Success is reported to the client even if the data is not in WAL. * There is no synchronous write operation, data may be loss in case of storage subsystem failure. */ SYNCHRONOUS_COMMIT_OFF = 2, /** - * SYNCHRONOUS_COMMIT_LOCAL - success is reported to the client if the data is in WAL, and WAL is written to the storage of the master server. + * SYNCHRONOUS_COMMIT_LOCAL - Success is reported to the client if the data is in WAL, and WAL is written to the storage of the master server. * The transaction may be lost due to storage subsystem failure on the master server. */ SYNCHRONOUS_COMMIT_LOCAL = 3, /** - * SYNCHRONOUS_COMMIT_REMOTE_WRITE - success is reported to the client if the data is in WAL, WAL is written to the storage of the master server, and the server's synchronous standby indicates that it has received WAL and written it out to its operating system. + * SYNCHRONOUS_COMMIT_REMOTE_WRITE - Success is reported to the client if the data is in WAL, WAL is written to the storage of the master server, and the server's synchronous standby indicates that it has received WAL and written it out to its operating system. * The transaction may be lost due to simultaneous storage subsystem failure on the master and operating system's failure on the synchronous standby. */ SYNCHRONOUS_COMMIT_REMOTE_WRITE = 4, /** - * SYNCHRONOUS_COMMIT_REMOTE_APPLY - success is reported to the client if the data is in WAL (Write-Ahead Log), WAL is written to the storage of the master server, and its synchronous standby indicates that it has received WAL and applied it. + * SYNCHRONOUS_COMMIT_REMOTE_APPLY - Success is reported to the client if the data is in WAL (Write-Ahead Log), WAL is written to the storage of the master server, and its synchronous standby indicates that it has received WAL and applied it. * The transaction may be lost due to irrecoverably failure of both the master and its synchronous standby. */ SYNCHRONOUS_COMMIT_REMOTE_APPLY = 5, @@ -280,13 +428,13 @@ export function userSettings_SynchronousCommitToJSON( export enum UserSettings_LogStatement { LOG_STATEMENT_UNSPECIFIED = 0, - /** LOG_STATEMENT_NONE - (default) logs none of SQL statements. */ + /** LOG_STATEMENT_NONE - Logs none of SQL statements. Default value. */ LOG_STATEMENT_NONE = 1, - /** LOG_STATEMENT_DDL - logs all data definition statements (such as `CREATE`, `ALTER`, `DROP` and others). */ + /** LOG_STATEMENT_DDL - Logs all data definition statements (such as `CREATE`, `ALTER`, `DROP` and others). */ LOG_STATEMENT_DDL = 2, - /** LOG_STATEMENT_MOD - logs all statements that fall in the `LOG_STATEMENT_DDL` category plus data-modifying statements (such as `INSERT`, `UPDATE` and others). */ + /** LOG_STATEMENT_MOD - Logs all statements that fall in the `LOG_STATEMENT_DDL` category plus data-modifying statements (such as `INSERT`, `UPDATE` and others). */ LOG_STATEMENT_MOD = 3, - /** LOG_STATEMENT_ALL - logs all SQL statements. */ + /** LOG_STATEMENT_ALL - Logs all SQL statements. */ LOG_STATEMENT_ALL = 4, UNRECOGNIZED = -1, } @@ -338,14 +486,14 @@ export function userSettings_LogStatementToJSON( export enum UserSettings_TransactionIsolation { TRANSACTION_ISOLATION_UNSPECIFIED = 0, - /** TRANSACTION_ISOLATION_READ_UNCOMMITTED - this level behaves like `TRANSACTION_ISOLATION_READ_COMMITTED` in PostgreSQL. */ + /** TRANSACTION_ISOLATION_READ_UNCOMMITTED - This level behaves like `TRANSACTION_ISOLATION_READ_COMMITTED` in PostgreSQL. */ TRANSACTION_ISOLATION_READ_UNCOMMITTED = 1, - /** TRANSACTION_ISOLATION_READ_COMMITTED - (default) on this level query sees only data committed before the query began. */ + /** TRANSACTION_ISOLATION_READ_COMMITTED - On this level query sees only data committed before the query began. Default value. */ TRANSACTION_ISOLATION_READ_COMMITTED = 2, - /** TRANSACTION_ISOLATION_REPEATABLE_READ - on this level all subsequent queries in a transaction will see the same rows, that were read by the first `SELECT` or `INSERT` query in this transaction, unchanged (these rows are locked during the first query). */ + /** TRANSACTION_ISOLATION_REPEATABLE_READ - On this level all subsequent queries in a transaction will see the same rows, that were read by the first `SELECT` or `INSERT` query in this transaction, unchanged (these rows are locked during the first query). */ TRANSACTION_ISOLATION_REPEATABLE_READ = 3, /** - * TRANSACTION_ISOLATION_SERIALIZABLE - this level provides the strictest transaction isolation. + * TRANSACTION_ISOLATION_SERIALIZABLE - This level provides the strictest transaction isolation. * All queries in the current transaction see only the rows that were fixed prior to execution of the first `SELECT` or `INSERT` query in this transaction. * If read and write operations in a concurrent set of serializable transactions overlap and this may cause an inconsistency that is not possible during the serial transaction execution, then one of the transaction will be rolled back, triggering a serialization failure. */ @@ -400,11 +548,11 @@ export function userSettings_TransactionIsolationToJSON( export enum UserSettings_PoolingMode { POOLING_MODE_UNSPECIFIED = 0, - /** SESSION - (default) server connection will be assigned to it for the whole duration the client stays connected */ + /** SESSION - Server connection will be assigned to it for the whole duration the client stays connected. Default value. */ SESSION = 1, - /** TRANSACTION - server connection is assigned to a client only during a transaction */ + /** TRANSACTION - Server connection is assigned to a client only during a transaction. */ TRANSACTION = 2, - /** STATEMENT - server connection will be put back into the pool immediately after a query completes */ + /** STATEMENT - Server connection will be put back into the pool immediately after a query completes. */ STATEMENT = 3, UNRECOGNIZED = -1, } @@ -455,6 +603,7 @@ const baseUser: object = { clusterId: "", connLimit: 0, grants: "", + userPasswordEncryption: 0, }; export const User = { @@ -494,6 +643,9 @@ export const User = { writer.uint32(66).fork() ).ldelim(); } + if (message.userPasswordEncryption !== 0) { + writer.uint32(72).int32(message.userPasswordEncryption); + } return writer; }, @@ -533,6 +685,9 @@ export const User = { reader.uint32() ).value; break; + case 9: + message.userPasswordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -572,6 +727,11 @@ export const User = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : undefined; + message.userPasswordEncryption = + object.userPasswordEncryption !== undefined && + object.userPasswordEncryption !== null + ? userPasswordEncryptionFromJSON(object.userPasswordEncryption) + : 0; return message; }, @@ -600,6 +760,10 @@ export const User = { } message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + message.userPasswordEncryption !== undefined && + (obj.userPasswordEncryption = userPasswordEncryptionToJSON( + message.userPasswordEncryption + )); return obj; }, @@ -617,6 +781,7 @@ export const User = { message.login = object.login ?? undefined; message.grants = object.grants?.map((e) => e) || []; message.deletionProtection = object.deletionProtection ?? undefined; + message.userPasswordEncryption = object.userPasswordEncryption ?? 0; return message; }, }; @@ -691,6 +856,7 @@ const baseUserSpec: object = { name: "", password: "", grants: "", + userPasswordEncryption: 0, }; export const UserSpec = { @@ -736,6 +902,9 @@ export const UserSpec = { writer.uint32(66).fork() ).ldelim(); } + if (message.userPasswordEncryption !== 0) { + writer.uint32(72).int32(message.userPasswordEncryption); + } return writer; }, @@ -775,6 +944,9 @@ export const UserSpec = { reader.uint32() ).value; break; + case 9: + message.userPasswordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -814,6 +986,11 @@ export const UserSpec = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : undefined; + message.userPasswordEncryption = + object.userPasswordEncryption !== undefined && + object.userPasswordEncryption !== null + ? userPasswordEncryptionFromJSON(object.userPasswordEncryption) + : 0; return message; }, @@ -841,6 +1018,10 @@ export const UserSpec = { } message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + message.userPasswordEncryption !== undefined && + (obj.userPasswordEncryption = userPasswordEncryptionToJSON( + message.userPasswordEncryption + )); return obj; }, @@ -858,12 +1039,90 @@ export const UserSpec = { message.login = object.login ?? undefined; message.grants = object.grants?.map((e) => e) || []; message.deletionProtection = object.deletionProtection ?? undefined; + message.userPasswordEncryption = object.userPasswordEncryption ?? 0; return message; }, }; messageTypeRegistry.set(UserSpec.$type, UserSpec); +const basePGAuditSettings: object = { + $type: "yandex.cloud.mdb.postgresql.v1.PGAuditSettings", + log: 0, +}; + +export const PGAuditSettings = { + $type: "yandex.cloud.mdb.postgresql.v1.PGAuditSettings" as const, + + encode( + message: PGAuditSettings, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.log) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PGAuditSettings { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePGAuditSettings } as PGAuditSettings; + message.log = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.log.push(reader.int32() as any); + } + } else { + message.log.push(reader.int32() as any); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PGAuditSettings { + const message = { ...basePGAuditSettings } as PGAuditSettings; + message.log = (object.log ?? []).map((e: any) => + pGAuditSettings_PGAuditSettingsLogFromJSON(e) + ); + return message; + }, + + toJSON(message: PGAuditSettings): unknown { + const obj: any = {}; + if (message.log) { + obj.log = message.log.map((e) => + pGAuditSettings_PGAuditSettingsLogToJSON(e) + ); + } else { + obj.log = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): PGAuditSettings { + const message = { ...basePGAuditSettings } as PGAuditSettings; + message.log = object.log?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(PGAuditSettings.$type, PGAuditSettings); + const baseUserSettings: object = { $type: "yandex.cloud.mdb.postgresql.v1.UserSettings", defaultTransactionIsolation: 0, @@ -954,6 +1213,12 @@ export const UserSettings = { writer.uint32(98).fork() ).ldelim(); } + if (message.pgaudit !== undefined) { + PGAuditSettings.encode( + message.pgaudit, + writer.uint32(106).fork() + ).ldelim(); + } return writer; }, @@ -1024,6 +1289,9 @@ export const UserSettings = { reader.uint32() ).value; break; + case 13: + message.pgaudit = PGAuditSettings.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1089,6 +1357,10 @@ export const UserSettings = { object.statementTimeout !== undefined && object.statementTimeout !== null ? Number(object.statementTimeout) : undefined; + message.pgaudit = + object.pgaudit !== undefined && object.pgaudit !== null + ? PGAuditSettings.fromJSON(object.pgaudit) + : undefined; return message; }, @@ -1126,6 +1398,10 @@ export const UserSettings = { message.idleInTransactionSessionTimeout); message.statementTimeout !== undefined && (obj.statementTimeout = message.statementTimeout); + message.pgaudit !== undefined && + (obj.pgaudit = message.pgaudit + ? PGAuditSettings.toJSON(message.pgaudit) + : undefined); return obj; }, @@ -1149,6 +1425,10 @@ export const UserSettings = { message.idleInTransactionSessionTimeout = object.idleInTransactionSessionTimeout ?? undefined; message.statementTimeout = object.statementTimeout ?? undefined; + message.pgaudit = + object.pgaudit !== undefined && object.pgaudit !== null + ? PGAuditSettings.fromPartial(object.pgaudit) + : undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/user_service.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/user_service.ts index 6bd6f062..cfad3728 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/user_service.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/user_service.ts @@ -17,8 +17,11 @@ import _m0 from "protobufjs/minimal"; import { UserSpec, UserSettings, + UserPasswordEncryption, Permission, User, + userPasswordEncryptionFromJSON, + userPasswordEncryptionToJSON, } from "../../../../../yandex/cloud/mdb/postgresql/v1/user"; import { FieldMask } from "../../../../../google/protobuf/field_mask"; import { Operation } from "../../../../../yandex/cloud/operation/operation"; @@ -139,6 +142,11 @@ export interface UpdateUserRequest { * Default value: `unspecified` (inherits cluster's deletion_protection) */ deletionProtection?: boolean; + /** + * New password-based authentication method for user. + * Possible values are `` USER_PASSWORD_ENCRYPTION_MD5 `` or `` USER_PASSWORD_ENCRYPTION_SCRAM_SHA_256 ``. + */ + userPasswordEncryption: UserPasswordEncryption; } export interface UpdateUserMetadata { @@ -625,6 +633,7 @@ const baseUpdateUserRequest: object = { password: "", connLimit: 0, grants: "", + userPasswordEncryption: 0, }; export const UpdateUserRequest = { @@ -673,6 +682,9 @@ export const UpdateUserRequest = { writer.uint32(82).fork() ).ldelim(); } + if (message.userPasswordEncryption !== 0) { + writer.uint32(88).int32(message.userPasswordEncryption); + } return writer; }, @@ -718,6 +730,9 @@ export const UpdateUserRequest = { reader.uint32() ).value; break; + case 11: + message.userPasswordEncryption = reader.int32() as any; + break; default: reader.skipType(tag & 7); break; @@ -765,6 +780,11 @@ export const UpdateUserRequest = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : undefined; + message.userPasswordEncryption = + object.userPasswordEncryption !== undefined && + object.userPasswordEncryption !== null + ? userPasswordEncryptionFromJSON(object.userPasswordEncryption) + : 0; return message; }, @@ -798,6 +818,10 @@ export const UpdateUserRequest = { } message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + message.userPasswordEncryption !== undefined && + (obj.userPasswordEncryption = userPasswordEncryptionToJSON( + message.userPasswordEncryption + )); return obj; }, @@ -822,6 +846,7 @@ export const UpdateUserRequest = { message.login = object.login ?? undefined; message.grants = object.grants?.map((e) => e) || []; message.deletionProtection = object.deletionProtection ?? undefined; + message.userPasswordEncryption = object.userPasswordEncryption ?? 0; return message; }, }; diff --git a/src/generated/yandex/cloud/mdb/redis/v1/backup_service.ts b/src/generated/yandex/cloud/mdb/redis/v1/backup_service.ts index 818aa21e..a23dda5f 100644 --- a/src/generated/yandex/cloud/mdb/redis/v1/backup_service.ts +++ b/src/generated/yandex/cloud/mdb/redis/v1/backup_service.ts @@ -15,6 +15,7 @@ import { } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; import { Backup } from "../../../../../yandex/cloud/mdb/redis/v1/backup"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; export const protobufPackage = "yandex.cloud.mdb.redis.v1"; @@ -60,6 +61,18 @@ export interface ListBackupsResponse { nextPageToken: string; } +export interface DeleteBackupRequest { + $type: "yandex.cloud.mdb.redis.v1.DeleteBackupRequest"; + /** Required. ID of the backup to delete. */ + backupId: string; +} + +export interface DeleteBackupMetadata { + $type: "yandex.cloud.mdb.redis.v1.DeleteBackupMetadata"; + /** Required. ID of the deleting Redis backup. */ + backupId: string; +} + const baseGetBackupRequest: object = { $type: "yandex.cloud.mdb.redis.v1.GetBackupRequest", backupId: "", @@ -292,6 +305,133 @@ export const ListBackupsResponse = { messageTypeRegistry.set(ListBackupsResponse.$type, ListBackupsResponse); +const baseDeleteBackupRequest: object = { + $type: "yandex.cloud.mdb.redis.v1.DeleteBackupRequest", + backupId: "", +}; + +export const DeleteBackupRequest = { + $type: "yandex.cloud.mdb.redis.v1.DeleteBackupRequest" as const, + + encode( + message: DeleteBackupRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.backupId !== "") { + writer.uint32(10).string(message.backupId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteBackupRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteBackupRequest } as DeleteBackupRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.backupId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteBackupRequest { + const message = { ...baseDeleteBackupRequest } as DeleteBackupRequest; + message.backupId = + object.backupId !== undefined && object.backupId !== null + ? String(object.backupId) + : ""; + return message; + }, + + toJSON(message: DeleteBackupRequest): unknown { + const obj: any = {}; + message.backupId !== undefined && (obj.backupId = message.backupId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteBackupRequest { + const message = { ...baseDeleteBackupRequest } as DeleteBackupRequest; + message.backupId = object.backupId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteBackupRequest.$type, DeleteBackupRequest); + +const baseDeleteBackupMetadata: object = { + $type: "yandex.cloud.mdb.redis.v1.DeleteBackupMetadata", + backupId: "", +}; + +export const DeleteBackupMetadata = { + $type: "yandex.cloud.mdb.redis.v1.DeleteBackupMetadata" as const, + + encode( + message: DeleteBackupMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.backupId !== "") { + writer.uint32(10).string(message.backupId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteBackupMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteBackupMetadata } as DeleteBackupMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.backupId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteBackupMetadata { + const message = { ...baseDeleteBackupMetadata } as DeleteBackupMetadata; + message.backupId = + object.backupId !== undefined && object.backupId !== null + ? String(object.backupId) + : ""; + return message; + }, + + toJSON(message: DeleteBackupMetadata): unknown { + const obj: any = {}; + message.backupId !== undefined && (obj.backupId = message.backupId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteBackupMetadata { + const message = { ...baseDeleteBackupMetadata } as DeleteBackupMetadata; + message.backupId = object.backupId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteBackupMetadata.$type, DeleteBackupMetadata); + /** A set of methods for managing Redis backups. */ export const BackupServiceService = { /** @@ -322,6 +462,18 @@ export const BackupServiceService = { Buffer.from(ListBackupsResponse.encode(value).finish()), responseDeserialize: (value: Buffer) => ListBackupsResponse.decode(value), }, + /** Returns the list of available backups for the specified Redis cluster. */ + delete: { + path: "/yandex.cloud.mdb.redis.v1.BackupService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteBackupRequest) => + Buffer.from(DeleteBackupRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteBackupRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface BackupServiceServer extends UntypedServiceImplementation { @@ -333,6 +485,8 @@ export interface BackupServiceServer extends UntypedServiceImplementation { get: handleUnaryCall; /** Retrieves the list of Redis backups available for the specified folder. */ list: handleUnaryCall; + /** Returns the list of available backups for the specified Redis cluster. */ + delete: handleUnaryCall; } export interface BackupServiceClient extends Client { @@ -381,6 +535,22 @@ export interface BackupServiceClient extends Client { response: ListBackupsResponse ) => void ): ClientUnaryCall; + /** Returns the list of available backups for the specified Redis cluster. */ + delete( + request: DeleteBackupRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteBackupRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteBackupRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const BackupServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/mdb/redis/v1/cluster.ts b/src/generated/yandex/cloud/mdb/redis/v1/cluster.ts index 2cb71323..528f0b25 100644 --- a/src/generated/yandex/cloud/mdb/redis/v1/cluster.ts +++ b/src/generated/yandex/cloud/mdb/redis/v1/cluster.ts @@ -317,6 +317,8 @@ export interface ClusterConfig { access?: Access; /** Unified configuration of a Redis cluster. */ redis?: RedisConfigSet; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } export interface Shard { @@ -347,9 +349,9 @@ export interface Host { subnetId: string; /** Resources allocated to the Redis host. */ resources?: Resources; - /** Role of the host in the cluster. */ + /** Role of the host in the cluster. If the field has default value, it is not returned in the response. */ role: Host_Role; - /** Status code of the aggregated health of the host. */ + /** Aggregated health of the host. If the field has default value, it is not returned in the response. */ health: Host_Health; /** Services provided by the host. */ services: Service[]; @@ -365,7 +367,7 @@ export interface Host { } export enum Host_Role { - /** ROLE_UNKNOWN - Role of the host in the cluster is unknown. */ + /** ROLE_UNKNOWN - Role of the host in the cluster is unknown. Default value. */ ROLE_UNKNOWN = 0, /** MASTER - Host is the master Redis server in the cluster. */ MASTER = 1, @@ -406,7 +408,7 @@ export function host_RoleToJSON(object: Host_Role): string { } export enum Host_Health { - /** HEALTH_UNKNOWN - Health of the host is unknown. */ + /** HEALTH_UNKNOWN - Health of the host is unknown. Default value. */ HEALTH_UNKNOWN = 0, /** ALIVE - The host is performing all its functions normally. */ ALIVE = 1, @@ -455,13 +457,14 @@ export function host_HealthToJSON(object: Host_Health): string { export interface Service { $type: "yandex.cloud.mdb.redis.v1.Service"; - /** Type of the service provided by the host. */ + /** Type of the service provided by the host. If the field has default value, it is not returned in the response. */ type: Service_Type; - /** Status code of server availability. */ + /** Aggregated health of the service. If the field has default value, it is not returned in the response. */ health: Service_Health; } export enum Service_Type { + /** TYPE_UNSPECIFIED - Service type of the host is unspecified. Default value. */ TYPE_UNSPECIFIED = 0, /** REDIS - The host is a Redis server. */ REDIS = 1, @@ -509,7 +512,7 @@ export function service_TypeToJSON(object: Service_Type): string { } export enum Service_Health { - /** HEALTH_UNKNOWN - Health of the server is unknown. */ + /** HEALTH_UNKNOWN - Health of the server is unknown. Default value. */ HEALTH_UNKNOWN = 0, /** ALIVE - The server is working normally. */ ALIVE = 1, @@ -571,6 +574,18 @@ export interface Access { $type: "yandex.cloud.mdb.redis.v1.Access"; /** Allow access for DataLens */ dataLens: boolean; + /** Allow access for Web SQL. */ + webSql: boolean; +} + +export interface DiskSizeAutoscaling { + $type: "yandex.cloud.mdb.redis.v1.DiskSizeAutoscaling"; + /** Amount of used storage for automatic disk scaling in the maintenance window, 0 means disabled, in percent. */ + plannedUsageThreshold?: number; + /** Amount of used storage for immediately automatic disk scaling, 0 means disabled, in percent. */ + emergencyUsageThreshold?: number; + /** Limit on how large the storage for database instances can automatically grow, in bytes. */ + diskSizeLimit?: number; } const baseCluster: object = { @@ -1173,6 +1188,12 @@ export const ClusterConfig = { if (message.redis !== undefined) { RedisConfigSet.encode(message.redis, writer.uint32(74).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(82).fork() + ).ldelim(); + } return writer; }, @@ -1222,6 +1243,12 @@ export const ClusterConfig = { case 9: message.redis = RedisConfigSet.decode(reader, reader.uint32()); break; + case 10: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1269,6 +1296,11 @@ export const ClusterConfig = { object.redis !== undefined && object.redis !== null ? RedisConfigSet.fromJSON(object.redis) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -1305,6 +1337,10 @@ export const ClusterConfig = { (obj.redis = message.redis ? RedisConfigSet.toJSON(message.redis) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -1346,6 +1382,11 @@ export const ClusterConfig = { object.redis !== undefined && object.redis !== null ? RedisConfigSet.fromPartial(object.redis) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -1798,6 +1839,7 @@ messageTypeRegistry.set(Resources.$type, Resources); const baseAccess: object = { $type: "yandex.cloud.mdb.redis.v1.Access", dataLens: false, + webSql: false, }; export const Access = { @@ -1810,6 +1852,9 @@ export const Access = { if (message.dataLens === true) { writer.uint32(8).bool(message.dataLens); } + if (message.webSql === true) { + writer.uint32(16).bool(message.webSql); + } return writer; }, @@ -1823,6 +1868,9 @@ export const Access = { case 1: message.dataLens = reader.bool(); break; + case 2: + message.webSql = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -1837,24 +1885,145 @@ export const Access = { object.dataLens !== undefined && object.dataLens !== null ? Boolean(object.dataLens) : false; + message.webSql = + object.webSql !== undefined && object.webSql !== null + ? Boolean(object.webSql) + : false; return message; }, toJSON(message: Access): unknown { const obj: any = {}; message.dataLens !== undefined && (obj.dataLens = message.dataLens); + message.webSql !== undefined && (obj.webSql = message.webSql); return obj; }, fromPartial, I>>(object: I): Access { const message = { ...baseAccess } as Access; message.dataLens = object.dataLens ?? false; + message.webSql = object.webSql ?? false; return message; }, }; messageTypeRegistry.set(Access.$type, Access); +const baseDiskSizeAutoscaling: object = { + $type: "yandex.cloud.mdb.redis.v1.DiskSizeAutoscaling", +}; + +export const DiskSizeAutoscaling = { + $type: "yandex.cloud.mdb.redis.v1.DiskSizeAutoscaling" as const, + + encode( + message: DiskSizeAutoscaling, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.plannedUsageThreshold !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.plannedUsageThreshold!, + }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.emergencyUsageThreshold !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.emergencyUsageThreshold!, + }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.diskSizeLimit !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.diskSizeLimit! }, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DiskSizeAutoscaling { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDiskSizeAutoscaling } as DiskSizeAutoscaling; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plannedUsageThreshold = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 2: + message.emergencyUsageThreshold = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 3: + message.diskSizeLimit = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DiskSizeAutoscaling { + const message = { ...baseDiskSizeAutoscaling } as DiskSizeAutoscaling; + message.plannedUsageThreshold = + object.plannedUsageThreshold !== undefined && + object.plannedUsageThreshold !== null + ? Number(object.plannedUsageThreshold) + : undefined; + message.emergencyUsageThreshold = + object.emergencyUsageThreshold !== undefined && + object.emergencyUsageThreshold !== null + ? Number(object.emergencyUsageThreshold) + : undefined; + message.diskSizeLimit = + object.diskSizeLimit !== undefined && object.diskSizeLimit !== null + ? Number(object.diskSizeLimit) + : undefined; + return message; + }, + + toJSON(message: DiskSizeAutoscaling): unknown { + const obj: any = {}; + message.plannedUsageThreshold !== undefined && + (obj.plannedUsageThreshold = message.plannedUsageThreshold); + message.emergencyUsageThreshold !== undefined && + (obj.emergencyUsageThreshold = message.emergencyUsageThreshold); + message.diskSizeLimit !== undefined && + (obj.diskSizeLimit = message.diskSizeLimit); + return obj; + }, + + fromPartial, I>>( + object: I + ): DiskSizeAutoscaling { + const message = { ...baseDiskSizeAutoscaling } as DiskSizeAutoscaling; + message.plannedUsageThreshold = object.plannedUsageThreshold ?? undefined; + message.emergencyUsageThreshold = + object.emergencyUsageThreshold ?? undefined; + message.diskSizeLimit = object.diskSizeLimit ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(DiskSizeAutoscaling.$type, DiskSizeAutoscaling); + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/generated/yandex/cloud/mdb/redis/v1/cluster_service.ts b/src/generated/yandex/cloud/mdb/redis/v1/cluster_service.ts index 49504049..b7dd4223 100644 --- a/src/generated/yandex/cloud/mdb/redis/v1/cluster_service.ts +++ b/src/generated/yandex/cloud/mdb/redis/v1/cluster_service.ts @@ -21,6 +21,7 @@ import { Cluster_PersistenceMode, Resources, Access, + DiskSizeAutoscaling, Cluster, Host, Shard, @@ -29,8 +30,8 @@ import { cluster_EnvironmentToJSON, cluster_PersistenceModeToJSON, } from "../../../../../yandex/cloud/mdb/redis/v1/cluster"; -import { FieldMask } from "../../../../../google/protobuf/field_mask"; import { MaintenanceWindow } from "../../../../../yandex/cloud/mdb/redis/v1/maintenance"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; import { TimeOfDay } from "../../../../../google/type/timeofday"; import { RedisConfig } from "../../../../../yandex/cloud/mdb/redis/v1/config/redis"; import { Timestamp } from "../../../../../google/protobuf/timestamp"; @@ -44,6 +45,17 @@ import { BoolValue, Int64Value } from "../../../../../google/protobuf/wrappers"; export const protobufPackage = "yandex.cloud.mdb.redis.v1"; +export interface EnableShardingClusterMetadata { + $type: "yandex.cloud.mdb.redis.v1.EnableShardingClusterMetadata"; + clusterId: string; +} + +export interface EnableShardingClusterRequest { + $type: "yandex.cloud.mdb.redis.v1.EnableShardingClusterRequest"; + /** Required. ID of the Redis cluster to return. */ + clusterId: string; +} + export interface GetClusterRequest { $type: "yandex.cloud.mdb.redis.v1.GetClusterRequest"; /** @@ -127,6 +139,8 @@ export interface CreateClusterRequest { persistenceMode: Cluster_PersistenceMode; /** Enable FQDN instead of ip */ announceHostnames: boolean; + /** Window of maintenance operations. */ + maintenanceWindow?: MaintenanceWindow; } export interface CreateClusterRequest_LabelsEntry { @@ -172,6 +186,8 @@ export interface UpdateClusterRequest { deletionProtection: boolean; /** Persistence mode */ persistenceMode: Cluster_PersistenceMode; + /** ID of the network to move the cluster to. */ + networkId: string; /** Enable FQDN instead of ip */ announceHostnames: boolean; } @@ -318,6 +334,8 @@ export interface RestoreClusterRequest { deletionProtection: boolean; /** Enable FQDN instead of ip */ announceHostnames: boolean; + /** Window of maintenance operations. */ + maintenanceWindow?: MaintenanceWindow; } export interface RestoreClusterRequest_LabelsEntry { @@ -913,8 +931,158 @@ export interface ConfigSpec { access?: Access; /** Unified configuration of a Redis cluster */ redis?: RedisConfig; + /** Disk size autoscaling settings */ + diskSizeAutoscaling?: DiskSizeAutoscaling; } +const baseEnableShardingClusterMetadata: object = { + $type: "yandex.cloud.mdb.redis.v1.EnableShardingClusterMetadata", + clusterId: "", +}; + +export const EnableShardingClusterMetadata = { + $type: "yandex.cloud.mdb.redis.v1.EnableShardingClusterMetadata" as const, + + encode( + message: EnableShardingClusterMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): EnableShardingClusterMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEnableShardingClusterMetadata, + } as EnableShardingClusterMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnableShardingClusterMetadata { + const message = { + ...baseEnableShardingClusterMetadata, + } as EnableShardingClusterMetadata; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: EnableShardingClusterMetadata): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): EnableShardingClusterMetadata { + const message = { + ...baseEnableShardingClusterMetadata, + } as EnableShardingClusterMetadata; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + EnableShardingClusterMetadata.$type, + EnableShardingClusterMetadata +); + +const baseEnableShardingClusterRequest: object = { + $type: "yandex.cloud.mdb.redis.v1.EnableShardingClusterRequest", + clusterId: "", +}; + +export const EnableShardingClusterRequest = { + $type: "yandex.cloud.mdb.redis.v1.EnableShardingClusterRequest" as const, + + encode( + message: EnableShardingClusterRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.clusterId !== "") { + writer.uint32(10).string(message.clusterId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): EnableShardingClusterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEnableShardingClusterRequest, + } as EnableShardingClusterRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clusterId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnableShardingClusterRequest { + const message = { + ...baseEnableShardingClusterRequest, + } as EnableShardingClusterRequest; + message.clusterId = + object.clusterId !== undefined && object.clusterId !== null + ? String(object.clusterId) + : ""; + return message; + }, + + toJSON(message: EnableShardingClusterRequest): unknown { + const obj: any = {}; + message.clusterId !== undefined && (obj.clusterId = message.clusterId); + return obj; + }, + + fromPartial, I>>( + object: I + ): EnableShardingClusterRequest { + const message = { + ...baseEnableShardingClusterRequest, + } as EnableShardingClusterRequest; + message.clusterId = object.clusterId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + EnableShardingClusterRequest.$type, + EnableShardingClusterRequest +); + const baseGetClusterRequest: object = { $type: "yandex.cloud.mdb.redis.v1.GetClusterRequest", clusterId: "", @@ -1237,6 +1405,12 @@ export const CreateClusterRequest = { if (message.announceHostnames === true) { writer.uint32(128).bool(message.announceHostnames); } + if (message.maintenanceWindow !== undefined) { + MaintenanceWindow.encode( + message.maintenanceWindow, + writer.uint32(138).fork() + ).ldelim(); + } return writer; }, @@ -1301,6 +1475,12 @@ export const CreateClusterRequest = { case 16: message.announceHostnames = reader.bool(); break; + case 17: + message.maintenanceWindow = MaintenanceWindow.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1369,6 +1549,11 @@ export const CreateClusterRequest = { object.announceHostnames !== null ? Boolean(object.announceHostnames) : false; + message.maintenanceWindow = + object.maintenanceWindow !== undefined && + object.maintenanceWindow !== null + ? MaintenanceWindow.fromJSON(object.maintenanceWindow) + : undefined; return message; }, @@ -1413,6 +1598,10 @@ export const CreateClusterRequest = { )); message.announceHostnames !== undefined && (obj.announceHostnames = message.announceHostnames); + message.maintenanceWindow !== undefined && + (obj.maintenanceWindow = message.maintenanceWindow + ? MaintenanceWindow.toJSON(message.maintenanceWindow) + : undefined); return obj; }, @@ -1445,6 +1634,11 @@ export const CreateClusterRequest = { message.deletionProtection = object.deletionProtection ?? false; message.persistenceMode = object.persistenceMode ?? 0; message.announceHostnames = object.announceHostnames ?? false; + message.maintenanceWindow = + object.maintenanceWindow !== undefined && + object.maintenanceWindow !== null + ? MaintenanceWindow.fromPartial(object.maintenanceWindow) + : undefined; return message; }, }; @@ -1609,6 +1803,7 @@ const baseUpdateClusterRequest: object = { securityGroupIds: "", deletionProtection: false, persistenceMode: 0, + networkId: "", announceHostnames: false, }; @@ -1659,6 +1854,9 @@ export const UpdateClusterRequest = { if (message.persistenceMode !== 0) { writer.uint32(80).int32(message.persistenceMode); } + if (message.networkId !== "") { + writer.uint32(90).string(message.networkId); + } if (message.announceHostnames === true) { writer.uint32(96).bool(message.announceHostnames); } @@ -1716,6 +1914,9 @@ export const UpdateClusterRequest = { case 10: message.persistenceMode = reader.int32() as any; break; + case 11: + message.networkId = reader.string(); + break; case 12: message.announceHostnames = reader.bool(); break; @@ -1772,6 +1973,10 @@ export const UpdateClusterRequest = { object.persistenceMode !== undefined && object.persistenceMode !== null ? cluster_PersistenceModeFromJSON(object.persistenceMode) : 0; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; message.announceHostnames = object.announceHostnames !== undefined && object.announceHostnames !== null @@ -1815,6 +2020,7 @@ export const UpdateClusterRequest = { (obj.persistenceMode = cluster_PersistenceModeToJSON( message.persistenceMode )); + message.networkId !== undefined && (obj.networkId = message.networkId); message.announceHostnames !== undefined && (obj.announceHostnames = message.announceHostnames); return obj; @@ -1851,6 +2057,7 @@ export const UpdateClusterRequest = { message.securityGroupIds = object.securityGroupIds?.map((e) => e) || []; message.deletionProtection = object.deletionProtection ?? false; message.persistenceMode = object.persistenceMode ?? 0; + message.networkId = object.networkId ?? ""; message.announceHostnames = object.announceHostnames ?? false; return message; }, @@ -2944,6 +3151,12 @@ export const RestoreClusterRequest = { if (message.announceHostnames === true) { writer.uint32(112).bool(message.announceHostnames); } + if (message.maintenanceWindow !== undefined) { + MaintenanceWindow.encode( + message.maintenanceWindow, + writer.uint32(122).fork() + ).ldelim(); + } return writer; }, @@ -3008,6 +3221,12 @@ export const RestoreClusterRequest = { case 14: message.announceHostnames = reader.bool(); break; + case 15: + message.maintenanceWindow = MaintenanceWindow.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3076,6 +3295,11 @@ export const RestoreClusterRequest = { object.announceHostnames !== null ? Boolean(object.announceHostnames) : false; + message.maintenanceWindow = + object.maintenanceWindow !== undefined && + object.maintenanceWindow !== null + ? MaintenanceWindow.fromJSON(object.maintenanceWindow) + : undefined; return message; }, @@ -3120,6 +3344,10 @@ export const RestoreClusterRequest = { (obj.deletionProtection = message.deletionProtection); message.announceHostnames !== undefined && (obj.announceHostnames = message.announceHostnames); + message.maintenanceWindow !== undefined && + (obj.maintenanceWindow = message.maintenanceWindow + ? MaintenanceWindow.toJSON(message.maintenanceWindow) + : undefined); return obj; }, @@ -3152,6 +3380,11 @@ export const RestoreClusterRequest = { message.persistenceMode = object.persistenceMode ?? 0; message.deletionProtection = object.deletionProtection ?? false; message.announceHostnames = object.announceHostnames ?? false; + message.maintenanceWindow = + object.maintenanceWindow !== undefined && + object.maintenanceWindow !== null + ? MaintenanceWindow.fromPartial(object.maintenanceWindow) + : undefined; return message; }, }; @@ -6359,6 +6592,12 @@ export const ConfigSpec = { if (message.redis !== undefined) { RedisConfig.encode(message.redis, writer.uint32(90).fork()).ldelim(); } + if (message.diskSizeAutoscaling !== undefined) { + DiskSizeAutoscaling.encode( + message.diskSizeAutoscaling, + writer.uint32(98).fork() + ).ldelim(); + } return writer; }, @@ -6396,6 +6635,12 @@ export const ConfigSpec = { case 11: message.redis = RedisConfig.decode(reader, reader.uint32()); break; + case 12: + message.diskSizeAutoscaling = DiskSizeAutoscaling.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -6443,6 +6688,11 @@ export const ConfigSpec = { object.redis !== undefined && object.redis !== null ? RedisConfig.fromJSON(object.redis) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromJSON(object.diskSizeAutoscaling) + : undefined; return message; }, @@ -6479,6 +6729,10 @@ export const ConfigSpec = { (obj.redis = message.redis ? RedisConfig.toJSON(message.redis) : undefined); + message.diskSizeAutoscaling !== undefined && + (obj.diskSizeAutoscaling = message.diskSizeAutoscaling + ? DiskSizeAutoscaling.toJSON(message.diskSizeAutoscaling) + : undefined); return obj; }, @@ -6520,6 +6774,11 @@ export const ConfigSpec = { object.redis !== undefined && object.redis !== null ? RedisConfig.fromPartial(object.redis) : undefined; + message.diskSizeAutoscaling = + object.diskSizeAutoscaling !== undefined && + object.diskSizeAutoscaling !== null + ? DiskSizeAutoscaling.fromPartial(object.diskSizeAutoscaling) + : undefined; return message; }, }; @@ -6851,6 +7110,19 @@ export const ClusterServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Enable Sharding on non sharded cluster */ + enableSharding: { + path: "/yandex.cloud.mdb.redis.v1.ClusterService/EnableSharding", + requestStream: false, + responseStream: false, + requestSerialize: (value: EnableShardingClusterRequest) => + Buffer.from(EnableShardingClusterRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + EnableShardingClusterRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, } as const; export interface ClusterServiceServer extends UntypedServiceImplementation { @@ -6926,6 +7198,8 @@ export interface ClusterServiceServer extends UntypedServiceImplementation { deleteShard: handleUnaryCall; /** Rebalances the cluster. Evenly distributes all the hash slots between the shards. */ rebalance: handleUnaryCall; + /** Enable Sharding on non sharded cluster */ + enableSharding: handleUnaryCall; } export interface ClusterServiceClient extends Client { @@ -7384,6 +7658,22 @@ export interface ClusterServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Enable Sharding on non sharded cluster */ + enableSharding( + request: EnableShardingClusterRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + enableSharding( + request: EnableShardingClusterRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + enableSharding( + request: EnableShardingClusterRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; } export const ClusterServiceClient = makeGenericClientConstructor( diff --git a/src/generated/yandex/cloud/mdb/redis/v1/config/redis.ts b/src/generated/yandex/cloud/mdb/redis/v1/config/redis.ts index 9f7bf40f..8561722a 100644 --- a/src/generated/yandex/cloud/mdb/redis/v1/config/redis.ts +++ b/src/generated/yandex/cloud/mdb/redis/v1/config/redis.ts @@ -33,7 +33,7 @@ export interface RedisConfig { slowlogLogSlowerThan?: number; /** Max slow requests number to log. */ slowlogMaxLen?: number; - /** String setting for pub\sub functionality; subset of KEg$lshzxeAtm. */ + /** String setting for pub\sub functionality. */ notifyKeyspaceEvents: string; /** Redis connection output buffers limits for pubsub operations. */ clientOutputBufferLimitPubsub?: RedisConfig_ClientOutputBufferLimit; diff --git a/src/generated/yandex/cloud/mdb/redis/v1/config/redis5_0.ts b/src/generated/yandex/cloud/mdb/redis/v1/config/redis5_0.ts index f95c9aa0..a9a23df5 100644 --- a/src/generated/yandex/cloud/mdb/redis/v1/config/redis5_0.ts +++ b/src/generated/yandex/cloud/mdb/redis/v1/config/redis5_0.ts @@ -33,7 +33,7 @@ export interface Redisconfig50 { slowlogLogSlowerThan?: number; /** Max slow requests number to log. */ slowlogMaxLen?: number; - /** String setting for pub\sub functionality; subset of KEg$lshzxeAt. */ + /** String setting for pub\sub functionality. */ notifyKeyspaceEvents: string; /** Redis connection output buffers limits for pubsub operations. */ clientOutputBufferLimitPubsub?: Redisconfig50_ClientOutputBufferLimit; diff --git a/src/generated/yandex/cloud/mdb/redis/v1/config/redis6_0.ts b/src/generated/yandex/cloud/mdb/redis/v1/config/redis6_0.ts index fbb5b756..1e3a98b8 100644 --- a/src/generated/yandex/cloud/mdb/redis/v1/config/redis6_0.ts +++ b/src/generated/yandex/cloud/mdb/redis/v1/config/redis6_0.ts @@ -33,7 +33,7 @@ export interface Redisconfig60 { slowlogLogSlowerThan?: number; /** Max slow requests number to log. */ slowlogMaxLen?: number; - /** String setting for pub\sub functionality; subset of KEg$lshzxeAtm. */ + /** String setting for pub\sub functionality. */ notifyKeyspaceEvents: string; /** Redis connection output buffers limits for pubsub operations. */ clientOutputBufferLimitPubsub?: Redisconfig60_ClientOutputBufferLimit; diff --git a/src/generated/yandex/cloud/mdb/redis/v1/config/redis6_2.ts b/src/generated/yandex/cloud/mdb/redis/v1/config/redis6_2.ts index 8fe6917a..f67e7dc5 100644 --- a/src/generated/yandex/cloud/mdb/redis/v1/config/redis6_2.ts +++ b/src/generated/yandex/cloud/mdb/redis/v1/config/redis6_2.ts @@ -33,7 +33,7 @@ export interface Redisconfig62 { slowlogLogSlowerThan?: number; /** Max slow requests number to log. */ slowlogMaxLen?: number; - /** String setting for pub\sub functionality; subset of KEg$lshzxeAtm. */ + /** String setting for pub\sub functionality. */ notifyKeyspaceEvents: string; /** Redis connection output buffers limits for pubsub operations. */ clientOutputBufferLimitPubsub?: Redisconfig62_ClientOutputBufferLimit; diff --git a/src/generated/yandex/cloud/mdb/redis/v1/config/redis7_0.ts b/src/generated/yandex/cloud/mdb/redis/v1/config/redis7_0.ts index da4479f1..63a849d2 100644 --- a/src/generated/yandex/cloud/mdb/redis/v1/config/redis7_0.ts +++ b/src/generated/yandex/cloud/mdb/redis/v1/config/redis7_0.ts @@ -33,7 +33,7 @@ export interface Redisconfig70 { slowlogLogSlowerThan?: number; /** Max slow requests number to log. */ slowlogMaxLen?: number; - /** String setting for pub\sub functionality; subset of KEg$lshzxeAtm. */ + /** String setting for pub\sub functionality. */ notifyKeyspaceEvents: string; /** Redis connection output buffers limits for pubsub operations. */ clientOutputBufferLimitPubsub?: Redisconfig70_ClientOutputBufferLimit; diff --git a/src/generated/yandex/cloud/monitoring/index.ts b/src/generated/yandex/cloud/monitoring/index.ts index 9c576d0e..060b83c7 100644 --- a/src/generated/yandex/cloud/monitoring/index.ts +++ b/src/generated/yandex/cloud/monitoring/index.ts @@ -1,9 +1,9 @@ -export * as chart_widget from './v3/chart_widget' -export * as dashboard from './v3/dashboard' -export * as dashboard_service from './v3/dashboard_service' -export * as downsampling from './v3/downsampling' -export * as parametrization from './v3/parametrization' -export * as text_widget from './v3/text_widget' -export * as title_widget from './v3/title_widget' -export * as unit_format from './v3/unit_format' -export * as widget from './v3/widget' \ No newline at end of file +export * as v3_chart_widget from './v3/chart_widget' +export * as v3_dashboard from './v3/dashboard' +export * as v3_dashboard_service from './v3/dashboard_service' +export * as v3_downsampling from './v3/downsampling' +export * as v3_parametrization from './v3/parametrization' +export * as v3_text_widget from './v3/text_widget' +export * as v3_title_widget from './v3/title_widget' +export * as v3_unit_format from './v3/unit_format' +export * as v3_widget from './v3/widget' \ No newline at end of file diff --git a/src/generated/yandex/cloud/monitoring/v3/chart_widget.ts b/src/generated/yandex/cloud/monitoring/v3/chart_widget.ts index 7fafb1dd..24c0e662 100644 --- a/src/generated/yandex/cloud/monitoring/v3/chart_widget.ts +++ b/src/generated/yandex/cloud/monitoring/v3/chart_widget.ts @@ -33,6 +33,8 @@ export interface ChartWidget { displayLegend: boolean; /** Fixed time interval for chart. */ freeze: ChartWidget_FreezeDuration; + /** Setting for repeat panel / repeat row */ + repeat?: ChartWidget_RepeatSettings; } export enum ChartWidget_FreezeDuration { @@ -111,6 +113,8 @@ export interface ChartWidget_Queries_Target { textMode: boolean; /** Checks that target is visible or invisible. */ hidden: boolean; + /** Name of the query. */ + name: string; } /** Visualization settings. */ @@ -405,6 +409,10 @@ export interface ChartWidget_VisualizationSettings_ColorSchemeSettings { gradient?: | ChartWidget_VisualizationSettings_ColorSchemeSettings_GradientColorScheme | undefined; + /** Hash color scheme. Based on line name or value. */ + hash?: + | ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme + | undefined; } export interface ChartWidget_VisualizationSettings_ColorSchemeSettings_AutomaticColorScheme { @@ -427,6 +435,10 @@ export interface ChartWidget_VisualizationSettings_ColorSchemeSettings_GradientC violetValue: string; } +export interface ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme { + $type: "yandex.cloud.monitoring.v3.ChartWidget.VisualizationSettings.ColorSchemeSettings.HashColorScheme"; +} + export interface ChartWidget_VisualizationSettings_HeatmapSettings { $type: "yandex.cloud.monitoring.v3.ChartWidget.VisualizationSettings.HeatmapSettings"; /** Heatmap green value. */ @@ -604,6 +616,14 @@ export interface ChartWidget_NameHidingSettings { names: string[]; } +export interface ChartWidget_RepeatSettings { + $type: "yandex.cloud.monitoring.v3.ChartWidget.RepeatSettings"; + /** Parameters to repeat by. */ + repeatBy: string[]; + /** Max number of chart in one row. */ + maxChartsInRow: number; +} + const baseChartWidget: object = { $type: "yandex.cloud.monitoring.v3.ChartWidget", id: "", @@ -656,6 +676,12 @@ export const ChartWidget = { if (message.freeze !== 0) { writer.uint32(72).int32(message.freeze); } + if (message.repeat !== undefined) { + ChartWidget_RepeatSettings.encode( + message.repeat, + writer.uint32(82).fork() + ).ldelim(); + } return writer; }, @@ -700,6 +726,12 @@ export const ChartWidget = { case 9: message.freeze = reader.int32() as any; break; + case 10: + message.repeat = ChartWidget_RepeatSettings.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -747,6 +779,10 @@ export const ChartWidget = { object.freeze !== undefined && object.freeze !== null ? chartWidget_FreezeDurationFromJSON(object.freeze) : 0; + message.repeat = + object.repeat !== undefined && object.repeat !== null + ? ChartWidget_RepeatSettings.fromJSON(object.repeat) + : undefined; return message; }, @@ -781,6 +817,10 @@ export const ChartWidget = { (obj.displayLegend = message.displayLegend); message.freeze !== undefined && (obj.freeze = chartWidget_FreezeDurationToJSON(message.freeze)); + message.repeat !== undefined && + (obj.repeat = message.repeat + ? ChartWidget_RepeatSettings.toJSON(message.repeat) + : undefined); return obj; }, @@ -813,6 +853,10 @@ export const ChartWidget = { message.title = object.title ?? ""; message.displayLegend = object.displayLegend ?? false; message.freeze = object.freeze ?? 0; + message.repeat = + object.repeat !== undefined && object.repeat !== null + ? ChartWidget_RepeatSettings.fromPartial(object.repeat) + : undefined; return message; }, }; @@ -916,6 +960,7 @@ const baseChartWidget_Queries_Target: object = { query: "", textMode: false, hidden: false, + name: "", }; export const ChartWidget_Queries_Target = { @@ -934,6 +979,9 @@ export const ChartWidget_Queries_Target = { if (message.hidden === true) { writer.uint32(24).bool(message.hidden); } + if (message.name !== "") { + writer.uint32(34).string(message.name); + } return writer; }, @@ -958,6 +1006,9 @@ export const ChartWidget_Queries_Target = { case 3: message.hidden = reader.bool(); break; + case 4: + message.name = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -982,6 +1033,10 @@ export const ChartWidget_Queries_Target = { object.hidden !== undefined && object.hidden !== null ? Boolean(object.hidden) : false; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; return message; }, @@ -990,6 +1045,7 @@ export const ChartWidget_Queries_Target = { message.query !== undefined && (obj.query = message.query); message.textMode !== undefined && (obj.textMode = message.textMode); message.hidden !== undefined && (obj.hidden = message.hidden); + message.name !== undefined && (obj.name = message.name); return obj; }, @@ -1002,6 +1058,7 @@ export const ChartWidget_Queries_Target = { message.query = object.query ?? ""; message.textMode = object.textMode ?? false; message.hidden = object.hidden ?? false; + message.name = object.name ?? ""; return message; }, }; @@ -1293,6 +1350,12 @@ export const ChartWidget_VisualizationSettings_ColorSchemeSettings = { writer.uint32(26).fork() ).ldelim(); } + if (message.hash !== undefined) { + ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme.encode( + message.hash, + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -1329,6 +1392,13 @@ export const ChartWidget_VisualizationSettings_ColorSchemeSettings = { reader.uint32() ); break; + case 4: + message.hash = + ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1359,6 +1429,12 @@ export const ChartWidget_VisualizationSettings_ColorSchemeSettings = { object.gradient ) : undefined; + message.hash = + object.hash !== undefined && object.hash !== null + ? ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme.fromJSON( + object.hash + ) + : undefined; return message; }, @@ -1384,6 +1460,12 @@ export const ChartWidget_VisualizationSettings_ColorSchemeSettings = { message.gradient ) : undefined); + message.hash !== undefined && + (obj.hash = message.hash + ? ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme.toJSON( + message.hash + ) + : undefined); return obj; }, @@ -1414,6 +1496,12 @@ export const ChartWidget_VisualizationSettings_ColorSchemeSettings = { object.gradient ) : undefined; + message.hash = + object.hash !== undefined && object.hash !== null + ? ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme.fromPartial( + object.hash + ) + : undefined; return message; }, }; @@ -1702,6 +1790,81 @@ messageTypeRegistry.set( ChartWidget_VisualizationSettings_ColorSchemeSettings_GradientColorScheme ); +const baseChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme: object = + { + $type: + "yandex.cloud.monitoring.v3.ChartWidget.VisualizationSettings.ColorSchemeSettings.HashColorScheme", + }; + +export const ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme = + { + $type: + "yandex.cloud.monitoring.v3.ChartWidget.VisualizationSettings.ColorSchemeSettings.HashColorScheme" as const, + + encode( + _: ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme { + const reader = + input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme, + } as ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON( + _: any + ): ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme { + const message = { + ...baseChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme, + } as ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme; + return message; + }, + + toJSON( + _: ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme + ): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >( + _: I + ): ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme { + const message = { + ...baseChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme, + } as ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme; + return message; + }, + }; + +messageTypeRegistry.set( + ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme.$type, + ChartWidget_VisualizationSettings_ColorSchemeSettings_HashColorScheme +); + const baseChartWidget_VisualizationSettings_HeatmapSettings: object = { $type: "yandex.cloud.monitoring.v3.ChartWidget.VisualizationSettings.HeatmapSettings", @@ -2438,6 +2601,107 @@ messageTypeRegistry.set( ChartWidget_NameHidingSettings ); +const baseChartWidget_RepeatSettings: object = { + $type: "yandex.cloud.monitoring.v3.ChartWidget.RepeatSettings", + repeatBy: "", + maxChartsInRow: 0, +}; + +export const ChartWidget_RepeatSettings = { + $type: "yandex.cloud.monitoring.v3.ChartWidget.RepeatSettings" as const, + + encode( + message: ChartWidget_RepeatSettings, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.repeatBy) { + writer.uint32(10).string(v!); + } + if (message.maxChartsInRow !== 0) { + writer.uint32(16).int64(message.maxChartsInRow); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ChartWidget_RepeatSettings { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseChartWidget_RepeatSettings, + } as ChartWidget_RepeatSettings; + message.repeatBy = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.repeatBy.push(reader.string()); + break; + case 2: + message.maxChartsInRow = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ChartWidget_RepeatSettings { + const message = { + ...baseChartWidget_RepeatSettings, + } as ChartWidget_RepeatSettings; + message.repeatBy = (object.repeatBy ?? []).map((e: any) => String(e)); + message.maxChartsInRow = + object.maxChartsInRow !== undefined && object.maxChartsInRow !== null + ? Number(object.maxChartsInRow) + : 0; + return message; + }, + + toJSON(message: ChartWidget_RepeatSettings): unknown { + const obj: any = {}; + if (message.repeatBy) { + obj.repeatBy = message.repeatBy.map((e) => e); + } else { + obj.repeatBy = []; + } + message.maxChartsInRow !== undefined && + (obj.maxChartsInRow = Math.round(message.maxChartsInRow)); + return obj; + }, + + fromPartial, I>>( + object: I + ): ChartWidget_RepeatSettings { + const message = { + ...baseChartWidget_RepeatSettings, + } as ChartWidget_RepeatSettings; + message.repeatBy = object.repeatBy?.map((e) => e) || []; + message.maxChartsInRow = object.maxChartsInRow ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + ChartWidget_RepeatSettings.$type, + ChartWidget_RepeatSettings +); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + type Builtin = | Date | Function @@ -2465,6 +2729,13 @@ export type Exact = P extends Builtin never >; +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/src/generated/yandex/cloud/monitoring/v3/dashboard.ts b/src/generated/yandex/cloud/monitoring/v3/dashboard.ts index 8a95f8e8..7025ed1c 100644 --- a/src/generated/yandex/cloud/monitoring/v3/dashboard.ts +++ b/src/generated/yandex/cloud/monitoring/v3/dashboard.ts @@ -37,6 +37,16 @@ export interface Dashboard { parametrization?: Parametrization; /** Dashboard etag. */ etag: string; + /** + * Entity that controls dashboard + * Must match the regular expression "[\w \-]{1,100}" + */ + managedBy: string; + /** + * Information about entity that controls dashboard + * Must be valid URI + */ + managedLink: string; } export interface Dashboard_LabelsEntry { @@ -54,6 +64,8 @@ const baseDashboard: object = { description: "", title: "", etag: "", + managedBy: "", + managedLink: "", }; export const Dashboard = { @@ -118,6 +130,12 @@ export const Dashboard = { if (message.etag !== "") { writer.uint32(242).string(message.etag); } + if (message.managedBy !== "") { + writer.uint32(258).string(message.managedBy); + } + if (message.managedLink !== "") { + writer.uint32(266).string(message.managedLink); + } return writer; }, @@ -179,6 +197,12 @@ export const Dashboard = { case 30: message.etag = reader.string(); break; + case 32: + message.managedBy = reader.string(); + break; + case 33: + message.managedLink = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -240,6 +264,14 @@ export const Dashboard = { object.etag !== undefined && object.etag !== null ? String(object.etag) : ""; + message.managedBy = + object.managedBy !== undefined && object.managedBy !== null + ? String(object.managedBy) + : ""; + message.managedLink = + object.managedLink !== undefined && object.managedLink !== null + ? String(object.managedLink) + : ""; return message; }, @@ -275,6 +307,9 @@ export const Dashboard = { ? Parametrization.toJSON(message.parametrization) : undefined); message.etag !== undefined && (obj.etag = message.etag); + message.managedBy !== undefined && (obj.managedBy = message.managedBy); + message.managedLink !== undefined && + (obj.managedLink = message.managedLink); return obj; }, @@ -305,6 +340,8 @@ export const Dashboard = { ? Parametrization.fromPartial(object.parametrization) : undefined; message.etag = object.etag ?? ""; + message.managedBy = object.managedBy ?? ""; + message.managedLink = object.managedLink ?? ""; return message; }, }; diff --git a/src/generated/yandex/cloud/monitoring/v3/dashboard_service.ts b/src/generated/yandex/cloud/monitoring/v3/dashboard_service.ts index 3e1031bc..99840eed 100644 --- a/src/generated/yandex/cloud/monitoring/v3/dashboard_service.ts +++ b/src/generated/yandex/cloud/monitoring/v3/dashboard_service.ts @@ -77,6 +77,16 @@ export interface CreateDashboardRequest { widgets: Widget[]; /** Dashboard parametrization. */ parametrization?: Parametrization; + /** + * Entity that controls dashboard + * Must match the regular expression "[\w \-]{1,100}" + */ + managedBy: string; + /** + * Information about entity that controls dashboard + * Must be valid URI + */ + managedLink: string; } export interface CreateDashboardRequest_LabelsEntry { @@ -113,6 +123,16 @@ export interface UpdateDashboardRequest { parametrization?: Parametrization; /** The current etag of the dashboard. */ etag: string; + /** + * Entity that controls dashboard + * Must match the regular expression "[\w \-]{1,100}" + */ + managedBy: string; + /** + * Information about entity that controls dashboard + * Must be valid URI + */ + managedLink: string; } export interface UpdateDashboardRequest_LabelsEntry { @@ -428,6 +448,8 @@ const baseCreateDashboardRequest: object = { name: "", description: "", title: "", + managedBy: "", + managedLink: "", }; export const CreateDashboardRequest = { @@ -469,6 +491,12 @@ export const CreateDashboardRequest = { writer.uint32(194).fork() ).ldelim(); } + if (message.managedBy !== "") { + writer.uint32(210).string(message.managedBy); + } + if (message.managedLink !== "") { + writer.uint32(218).string(message.managedLink); + } return writer; }, @@ -514,6 +542,12 @@ export const CreateDashboardRequest = { reader.uint32() ); break; + case 26: + message.managedBy = reader.string(); + break; + case 27: + message.managedLink = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -553,6 +587,14 @@ export const CreateDashboardRequest = { object.parametrization !== undefined && object.parametrization !== null ? Parametrization.fromJSON(object.parametrization) : undefined; + message.managedBy = + object.managedBy !== undefined && object.managedBy !== null + ? String(object.managedBy) + : ""; + message.managedLink = + object.managedLink !== undefined && object.managedLink !== null + ? String(object.managedLink) + : ""; return message; }, @@ -580,6 +622,9 @@ export const CreateDashboardRequest = { (obj.parametrization = message.parametrization ? Parametrization.toJSON(message.parametrization) : undefined); + message.managedBy !== undefined && (obj.managedBy = message.managedBy); + message.managedLink !== undefined && + (obj.managedLink = message.managedLink); return obj; }, @@ -604,6 +649,8 @@ export const CreateDashboardRequest = { object.parametrization !== undefined && object.parametrization !== null ? Parametrization.fromPartial(object.parametrization) : undefined; + message.managedBy = object.managedBy ?? ""; + message.managedLink = object.managedLink ?? ""; return message; }, }; @@ -775,6 +822,8 @@ const baseUpdateDashboardRequest: object = { description: "", title: "", etag: "", + managedBy: "", + managedLink: "", }; export const UpdateDashboardRequest = { @@ -819,6 +868,12 @@ export const UpdateDashboardRequest = { if (message.etag !== "") { writer.uint32(66).string(message.etag); } + if (message.managedBy !== "") { + writer.uint32(210).string(message.managedBy); + } + if (message.managedLink !== "") { + writer.uint32(218).string(message.managedLink); + } return writer; }, @@ -867,6 +922,12 @@ export const UpdateDashboardRequest = { case 8: message.etag = reader.string(); break; + case 26: + message.managedBy = reader.string(); + break; + case 27: + message.managedLink = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -910,6 +971,14 @@ export const UpdateDashboardRequest = { object.etag !== undefined && object.etag !== null ? String(object.etag) : ""; + message.managedBy = + object.managedBy !== undefined && object.managedBy !== null + ? String(object.managedBy) + : ""; + message.managedLink = + object.managedLink !== undefined && object.managedLink !== null + ? String(object.managedLink) + : ""; return message; }, @@ -939,6 +1008,9 @@ export const UpdateDashboardRequest = { ? Parametrization.toJSON(message.parametrization) : undefined); message.etag !== undefined && (obj.etag = message.etag); + message.managedBy !== undefined && (obj.managedBy = message.managedBy); + message.managedLink !== undefined && + (obj.managedLink = message.managedLink); return obj; }, @@ -964,6 +1036,8 @@ export const UpdateDashboardRequest = { ? Parametrization.fromPartial(object.parametrization) : undefined; message.etag = object.etag ?? ""; + message.managedBy = object.managedBy ?? ""; + message.managedLink = object.managedLink ?? ""; return message; }, }; diff --git a/src/generated/yandex/cloud/oauth/claims.ts b/src/generated/yandex/cloud/oauth/claims.ts index 033831ba..2f0bfc73 100644 --- a/src/generated/yandex/cloud/oauth/claims.ts +++ b/src/generated/yandex/cloud/oauth/claims.ts @@ -2,6 +2,7 @@ import { messageTypeRegistry } from "../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../google/protobuf/timestamp"; export const protobufPackage = "yandex.cloud.oauth"; @@ -97,6 +98,8 @@ export interface SubjectClaims { subType: SubjectType; /** User federation, non-empty only for federated users. */ federation?: Federation; + /** Last time the access token was created. Filled only for federated users (not for global users). */ + lastAuthenticatedAt?: Date; } /** Minimalistic analog of yandex.cloud.organizationmanager.v1.saml.Federation */ @@ -166,6 +169,12 @@ export const SubjectClaims = { if (message.federation !== undefined) { Federation.encode(message.federation, writer.uint32(802).fork()).ldelim(); } + if (message.lastAuthenticatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.lastAuthenticatedAt), + writer.uint32(842).fork() + ).ldelim(); + } return writer; }, @@ -212,6 +221,11 @@ export const SubjectClaims = { case 100: message.federation = Federation.decode(reader, reader.uint32()); break; + case 105: + message.lastAuthenticatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -269,6 +283,11 @@ export const SubjectClaims = { object.federation !== undefined && object.federation !== null ? Federation.fromJSON(object.federation) : undefined; + message.lastAuthenticatedAt = + object.lastAuthenticatedAt !== undefined && + object.lastAuthenticatedAt !== null + ? fromJsonTimestamp(object.lastAuthenticatedAt) + : undefined; return message; }, @@ -292,6 +311,8 @@ export const SubjectClaims = { (obj.federation = message.federation ? Federation.toJSON(message.federation) : undefined); + message.lastAuthenticatedAt !== undefined && + (obj.lastAuthenticatedAt = message.lastAuthenticatedAt.toISOString()); return obj; }, @@ -314,6 +335,7 @@ export const SubjectClaims = { object.federation !== undefined && object.federation !== null ? Federation.fromPartial(object.federation) : undefined; + message.lastAuthenticatedAt = object.lastAuthenticatedAt ?? undefined; return message; }, }; @@ -420,6 +442,28 @@ export type Exact = P extends Builtin never >; +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/src/generated/yandex/cloud/organizationmanager/index.ts b/src/generated/yandex/cloud/organizationmanager/index.ts index b451482a..b2c1d5ee 100644 --- a/src/generated/yandex/cloud/organizationmanager/index.ts +++ b/src/generated/yandex/cloud/organizationmanager/index.ts @@ -1,13 +1,16 @@ -export * as group from './v1/group' -export * as group_mapping from './v1/group_mapping' -export * as group_mapping_service from './v1/group_mapping_service' -export * as group_service from './v1/group_service' -export * as organization from './v1/organization' -export * as organization_service from './v1/organization_service' -export * as ssh_certificate_service from './v1/ssh_certificate_service' -export * as user_account from './v1/user_account' -export * as user_service from './v1/user_service' -export * as certificate from './v1/saml/certificate' -export * as certificate_service from './v1/saml/certificate_service' -export * as federation from './v1/saml/federation' -export * as federation_service from './v1/saml/federation_service' \ No newline at end of file +export * as v1_group from './v1/group' +export * as v1_group_mapping from './v1/group_mapping' +export * as v1_group_mapping_service from './v1/group_mapping_service' +export * as v1_group_service from './v1/group_service' +export * as v1_organization from './v1/organization' +export * as v1_organization_service from './v1/organization_service' +export * as v1_os_login_service from './v1/os_login_service' +export * as v1_ssh_certificate_service from './v1/ssh_certificate_service' +export * as v1_user_account from './v1/user_account' +export * as v1_user_service from './v1/user_service' +export * as v1_user_ssh_key from './v1/user_ssh_key' +export * as v1_user_ssh_key_service from './v1/user_ssh_key_service' +export * as v1_saml_certificate from './v1/saml/certificate' +export * as v1_saml_certificate_service from './v1/saml/certificate_service' +export * as v1_saml_federation from './v1/saml/federation' +export * as v1_saml_federation_service from './v1/saml/federation_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/organizationmanager/v1/group.ts b/src/generated/yandex/cloud/organizationmanager/v1/group.ts index 8d88ad89..a66e9087 100644 --- a/src/generated/yandex/cloud/organizationmanager/v1/group.ts +++ b/src/generated/yandex/cloud/organizationmanager/v1/group.ts @@ -8,7 +8,7 @@ export const protobufPackage = "yandex.cloud.organizationmanager.v1"; /** * A Group resource. - * For more information, see [Groups](/docs/organization/manage-groups). + * For more information, see [Groups](/docs/organization/operations/manage-groups). */ export interface Group { $type: "yandex.cloud.organizationmanager.v1.Group"; diff --git a/src/generated/yandex/cloud/organizationmanager/v1/os_login_service.ts b/src/generated/yandex/cloud/organizationmanager/v1/os_login_service.ts new file mode 100644 index 00000000..9b158cb1 --- /dev/null +++ b/src/generated/yandex/cloud/organizationmanager/v1/os_login_service.ts @@ -0,0 +1,2431 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.organizationmanager.v1"; + +export interface GetOsLoginSettingsRequest { + $type: "yandex.cloud.organizationmanager.v1.GetOsLoginSettingsRequest"; + organizationId: string; +} + +export interface OsLoginSettings { + $type: "yandex.cloud.organizationmanager.v1.OsLoginSettings"; + userSshKeySettings?: UserSshKeySettings; + sshCertificateSettings?: SshCertificateSettings; +} + +export interface UserSshKeySettings { + $type: "yandex.cloud.organizationmanager.v1.UserSshKeySettings"; + enabled: boolean; + allowManageOwnKeys: boolean; +} + +export interface SshCertificateSettings { + $type: "yandex.cloud.organizationmanager.v1.SshCertificateSettings"; + enabled: boolean; +} + +export interface UpdateOsLoginSettingsRequest { + $type: "yandex.cloud.organizationmanager.v1.UpdateOsLoginSettingsRequest"; + organizationId: string; + userSshKeySettings?: UpdateOsLoginSettingsRequest_UserSshKeySettings; + sshCertificateSettings?: UpdateOsLoginSettingsRequest_SshCertificateSettings; + updateMask?: FieldMask; +} + +export interface UpdateOsLoginSettingsRequest_UserSshKeySettings { + $type: "yandex.cloud.organizationmanager.v1.UpdateOsLoginSettingsRequest.UserSshKeySettings"; + enabled: boolean; + allowManageOwnKeys: boolean; +} + +export interface UpdateOsLoginSettingsRequest_SshCertificateSettings { + $type: "yandex.cloud.organizationmanager.v1.UpdateOsLoginSettingsRequest.SshCertificateSettings"; + enabled: boolean; +} + +export interface SetDefaultOsLoginProfileRequest { + $type: "yandex.cloud.organizationmanager.v1.SetDefaultOsLoginProfileRequest"; + osLoginProfileId: string; +} + +export interface GetOsLoginProfileRequest { + $type: "yandex.cloud.organizationmanager.v1.GetOsLoginProfileRequest"; + osLoginProfileId: string; +} + +export interface ListOsLoginProfilesRequest { + $type: "yandex.cloud.organizationmanager.v1.ListOsLoginProfilesRequest"; + organizationId: string; + pageSize: number; + pageToken: string; + /** + * A filter expression that filters profiles listed in the response. + * The expression must specify: + * 1. The field name. Currently you can use filtering by subject_id, uid or login. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). + * E.g. login="example-login" + */ + filter: string; +} + +export interface ListOsLoginProfilesResponse { + $type: "yandex.cloud.organizationmanager.v1.ListOsLoginProfilesResponse"; + profiles: OsLoginProfile[]; + nextPageToken: string; +} + +export interface OsLoginProfile { + $type: "yandex.cloud.organizationmanager.v1.OsLoginProfile"; + id: string; + organizationId: string; + subjectId: string; + login: string; + uid: number; + isDefault: boolean; + homeDirectory: string; + shell: string; +} + +export interface UpdateOsLoginProfileRequest { + $type: "yandex.cloud.organizationmanager.v1.UpdateOsLoginProfileRequest"; + osLoginProfileId: string; + /** must not contain . or end in ~ */ + login: string; + /** 1000 - 2^63 - 1 */ + uid: number; + homeDirectory: string; + shell: string; + updateMask?: FieldMask; +} + +export interface DeleteOsLoginProfileRequest { + $type: "yandex.cloud.organizationmanager.v1.DeleteOsLoginProfileRequest"; + id: string; +} + +export interface CreateOsLoginProfileRequest { + $type: "yandex.cloud.organizationmanager.v1.CreateOsLoginProfileRequest"; + organizationId: string; + subjectId: string; + /** must not contain . or end in ~ */ + login: string; + /** 1000 - 2^63 - 1 */ + uid: number; + homeDirectory: string; + shell: string; +} + +export interface UpdateOsLoginProfileMetadata { + $type: "yandex.cloud.organizationmanager.v1.UpdateOsLoginProfileMetadata"; + osLoginProfileId: string; +} + +export interface DeleteOsLoginProfileMetadata { + $type: "yandex.cloud.organizationmanager.v1.DeleteOsLoginProfileMetadata"; + osLoginProfileId: string; +} + +export interface CreateOsLoginProfileMetadata { + $type: "yandex.cloud.organizationmanager.v1.CreateOsLoginProfileMetadata"; + osLoginProfileId: string; + organizationId: string; + subjectId: string; +} + +export interface UpdateOsLoginSettingsMetadata { + $type: "yandex.cloud.organizationmanager.v1.UpdateOsLoginSettingsMetadata"; + organizationId: string; +} + +export interface SetDefaultOsLoginProfileMetadata { + $type: "yandex.cloud.organizationmanager.v1.SetDefaultOsLoginProfileMetadata"; + previousDefaultProfileId: string; + currentDefaultProfileId: string; +} + +const baseGetOsLoginSettingsRequest: object = { + $type: "yandex.cloud.organizationmanager.v1.GetOsLoginSettingsRequest", + organizationId: "", +}; + +export const GetOsLoginSettingsRequest = { + $type: + "yandex.cloud.organizationmanager.v1.GetOsLoginSettingsRequest" as const, + + encode( + message: GetOsLoginSettingsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.organizationId !== "") { + writer.uint32(10).string(message.organizationId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetOsLoginSettingsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetOsLoginSettingsRequest, + } as GetOsLoginSettingsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetOsLoginSettingsRequest { + const message = { + ...baseGetOsLoginSettingsRequest, + } as GetOsLoginSettingsRequest; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + return message; + }, + + toJSON(message: GetOsLoginSettingsRequest): unknown { + const obj: any = {}; + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetOsLoginSettingsRequest { + const message = { + ...baseGetOsLoginSettingsRequest, + } as GetOsLoginSettingsRequest; + message.organizationId = object.organizationId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetOsLoginSettingsRequest.$type, + GetOsLoginSettingsRequest +); + +const baseOsLoginSettings: object = { + $type: "yandex.cloud.organizationmanager.v1.OsLoginSettings", +}; + +export const OsLoginSettings = { + $type: "yandex.cloud.organizationmanager.v1.OsLoginSettings" as const, + + encode( + message: OsLoginSettings, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.userSshKeySettings !== undefined) { + UserSshKeySettings.encode( + message.userSshKeySettings, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.sshCertificateSettings !== undefined) { + SshCertificateSettings.encode( + message.sshCertificateSettings, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OsLoginSettings { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOsLoginSettings } as OsLoginSettings; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userSshKeySettings = UserSshKeySettings.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.sshCertificateSettings = SshCertificateSettings.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OsLoginSettings { + const message = { ...baseOsLoginSettings } as OsLoginSettings; + message.userSshKeySettings = + object.userSshKeySettings !== undefined && + object.userSshKeySettings !== null + ? UserSshKeySettings.fromJSON(object.userSshKeySettings) + : undefined; + message.sshCertificateSettings = + object.sshCertificateSettings !== undefined && + object.sshCertificateSettings !== null + ? SshCertificateSettings.fromJSON(object.sshCertificateSettings) + : undefined; + return message; + }, + + toJSON(message: OsLoginSettings): unknown { + const obj: any = {}; + message.userSshKeySettings !== undefined && + (obj.userSshKeySettings = message.userSshKeySettings + ? UserSshKeySettings.toJSON(message.userSshKeySettings) + : undefined); + message.sshCertificateSettings !== undefined && + (obj.sshCertificateSettings = message.sshCertificateSettings + ? SshCertificateSettings.toJSON(message.sshCertificateSettings) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): OsLoginSettings { + const message = { ...baseOsLoginSettings } as OsLoginSettings; + message.userSshKeySettings = + object.userSshKeySettings !== undefined && + object.userSshKeySettings !== null + ? UserSshKeySettings.fromPartial(object.userSshKeySettings) + : undefined; + message.sshCertificateSettings = + object.sshCertificateSettings !== undefined && + object.sshCertificateSettings !== null + ? SshCertificateSettings.fromPartial(object.sshCertificateSettings) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(OsLoginSettings.$type, OsLoginSettings); + +const baseUserSshKeySettings: object = { + $type: "yandex.cloud.organizationmanager.v1.UserSshKeySettings", + enabled: false, + allowManageOwnKeys: false, +}; + +export const UserSshKeySettings = { + $type: "yandex.cloud.organizationmanager.v1.UserSshKeySettings" as const, + + encode( + message: UserSshKeySettings, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + if (message.allowManageOwnKeys === true) { + writer.uint32(16).bool(message.allowManageOwnKeys); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UserSshKeySettings { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUserSshKeySettings } as UserSshKeySettings; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + case 2: + message.allowManageOwnKeys = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UserSshKeySettings { + const message = { ...baseUserSshKeySettings } as UserSshKeySettings; + message.enabled = + object.enabled !== undefined && object.enabled !== null + ? Boolean(object.enabled) + : false; + message.allowManageOwnKeys = + object.allowManageOwnKeys !== undefined && + object.allowManageOwnKeys !== null + ? Boolean(object.allowManageOwnKeys) + : false; + return message; + }, + + toJSON(message: UserSshKeySettings): unknown { + const obj: any = {}; + message.enabled !== undefined && (obj.enabled = message.enabled); + message.allowManageOwnKeys !== undefined && + (obj.allowManageOwnKeys = message.allowManageOwnKeys); + return obj; + }, + + fromPartial, I>>( + object: I + ): UserSshKeySettings { + const message = { ...baseUserSshKeySettings } as UserSshKeySettings; + message.enabled = object.enabled ?? false; + message.allowManageOwnKeys = object.allowManageOwnKeys ?? false; + return message; + }, +}; + +messageTypeRegistry.set(UserSshKeySettings.$type, UserSshKeySettings); + +const baseSshCertificateSettings: object = { + $type: "yandex.cloud.organizationmanager.v1.SshCertificateSettings", + enabled: false, +}; + +export const SshCertificateSettings = { + $type: "yandex.cloud.organizationmanager.v1.SshCertificateSettings" as const, + + encode( + message: SshCertificateSettings, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SshCertificateSettings { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSshCertificateSettings } as SshCertificateSettings; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SshCertificateSettings { + const message = { ...baseSshCertificateSettings } as SshCertificateSettings; + message.enabled = + object.enabled !== undefined && object.enabled !== null + ? Boolean(object.enabled) + : false; + return message; + }, + + toJSON(message: SshCertificateSettings): unknown { + const obj: any = {}; + message.enabled !== undefined && (obj.enabled = message.enabled); + return obj; + }, + + fromPartial, I>>( + object: I + ): SshCertificateSettings { + const message = { ...baseSshCertificateSettings } as SshCertificateSettings; + message.enabled = object.enabled ?? false; + return message; + }, +}; + +messageTypeRegistry.set(SshCertificateSettings.$type, SshCertificateSettings); + +const baseUpdateOsLoginSettingsRequest: object = { + $type: "yandex.cloud.organizationmanager.v1.UpdateOsLoginSettingsRequest", + organizationId: "", +}; + +export const UpdateOsLoginSettingsRequest = { + $type: + "yandex.cloud.organizationmanager.v1.UpdateOsLoginSettingsRequest" as const, + + encode( + message: UpdateOsLoginSettingsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.organizationId !== "") { + writer.uint32(10).string(message.organizationId); + } + if (message.userSshKeySettings !== undefined) { + UpdateOsLoginSettingsRequest_UserSshKeySettings.encode( + message.userSshKeySettings, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.sshCertificateSettings !== undefined) { + UpdateOsLoginSettingsRequest_SshCertificateSettings.encode( + message.sshCertificateSettings, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateOsLoginSettingsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateOsLoginSettingsRequest, + } as UpdateOsLoginSettingsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationId = reader.string(); + break; + case 2: + message.userSshKeySettings = + UpdateOsLoginSettingsRequest_UserSshKeySettings.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.sshCertificateSettings = + UpdateOsLoginSettingsRequest_SshCertificateSettings.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateOsLoginSettingsRequest { + const message = { + ...baseUpdateOsLoginSettingsRequest, + } as UpdateOsLoginSettingsRequest; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.userSshKeySettings = + object.userSshKeySettings !== undefined && + object.userSshKeySettings !== null + ? UpdateOsLoginSettingsRequest_UserSshKeySettings.fromJSON( + object.userSshKeySettings + ) + : undefined; + message.sshCertificateSettings = + object.sshCertificateSettings !== undefined && + object.sshCertificateSettings !== null + ? UpdateOsLoginSettingsRequest_SshCertificateSettings.fromJSON( + object.sshCertificateSettings + ) + : undefined; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + return message; + }, + + toJSON(message: UpdateOsLoginSettingsRequest): unknown { + const obj: any = {}; + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.userSshKeySettings !== undefined && + (obj.userSshKeySettings = message.userSshKeySettings + ? UpdateOsLoginSettingsRequest_UserSshKeySettings.toJSON( + message.userSshKeySettings + ) + : undefined); + message.sshCertificateSettings !== undefined && + (obj.sshCertificateSettings = message.sshCertificateSettings + ? UpdateOsLoginSettingsRequest_SshCertificateSettings.toJSON( + message.sshCertificateSettings + ) + : undefined); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateOsLoginSettingsRequest { + const message = { + ...baseUpdateOsLoginSettingsRequest, + } as UpdateOsLoginSettingsRequest; + message.organizationId = object.organizationId ?? ""; + message.userSshKeySettings = + object.userSshKeySettings !== undefined && + object.userSshKeySettings !== null + ? UpdateOsLoginSettingsRequest_UserSshKeySettings.fromPartial( + object.userSshKeySettings + ) + : undefined; + message.sshCertificateSettings = + object.sshCertificateSettings !== undefined && + object.sshCertificateSettings !== null + ? UpdateOsLoginSettingsRequest_SshCertificateSettings.fromPartial( + object.sshCertificateSettings + ) + : undefined; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateOsLoginSettingsRequest.$type, + UpdateOsLoginSettingsRequest +); + +const baseUpdateOsLoginSettingsRequest_UserSshKeySettings: object = { + $type: + "yandex.cloud.organizationmanager.v1.UpdateOsLoginSettingsRequest.UserSshKeySettings", + enabled: false, + allowManageOwnKeys: false, +}; + +export const UpdateOsLoginSettingsRequest_UserSshKeySettings = { + $type: + "yandex.cloud.organizationmanager.v1.UpdateOsLoginSettingsRequest.UserSshKeySettings" as const, + + encode( + message: UpdateOsLoginSettingsRequest_UserSshKeySettings, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + if (message.allowManageOwnKeys === true) { + writer.uint32(16).bool(message.allowManageOwnKeys); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateOsLoginSettingsRequest_UserSshKeySettings { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateOsLoginSettingsRequest_UserSshKeySettings, + } as UpdateOsLoginSettingsRequest_UserSshKeySettings; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + case 2: + message.allowManageOwnKeys = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateOsLoginSettingsRequest_UserSshKeySettings { + const message = { + ...baseUpdateOsLoginSettingsRequest_UserSshKeySettings, + } as UpdateOsLoginSettingsRequest_UserSshKeySettings; + message.enabled = + object.enabled !== undefined && object.enabled !== null + ? Boolean(object.enabled) + : false; + message.allowManageOwnKeys = + object.allowManageOwnKeys !== undefined && + object.allowManageOwnKeys !== null + ? Boolean(object.allowManageOwnKeys) + : false; + return message; + }, + + toJSON(message: UpdateOsLoginSettingsRequest_UserSshKeySettings): unknown { + const obj: any = {}; + message.enabled !== undefined && (obj.enabled = message.enabled); + message.allowManageOwnKeys !== undefined && + (obj.allowManageOwnKeys = message.allowManageOwnKeys); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): UpdateOsLoginSettingsRequest_UserSshKeySettings { + const message = { + ...baseUpdateOsLoginSettingsRequest_UserSshKeySettings, + } as UpdateOsLoginSettingsRequest_UserSshKeySettings; + message.enabled = object.enabled ?? false; + message.allowManageOwnKeys = object.allowManageOwnKeys ?? false; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateOsLoginSettingsRequest_UserSshKeySettings.$type, + UpdateOsLoginSettingsRequest_UserSshKeySettings +); + +const baseUpdateOsLoginSettingsRequest_SshCertificateSettings: object = { + $type: + "yandex.cloud.organizationmanager.v1.UpdateOsLoginSettingsRequest.SshCertificateSettings", + enabled: false, +}; + +export const UpdateOsLoginSettingsRequest_SshCertificateSettings = { + $type: + "yandex.cloud.organizationmanager.v1.UpdateOsLoginSettingsRequest.SshCertificateSettings" as const, + + encode( + message: UpdateOsLoginSettingsRequest_SshCertificateSettings, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateOsLoginSettingsRequest_SshCertificateSettings { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateOsLoginSettingsRequest_SshCertificateSettings, + } as UpdateOsLoginSettingsRequest_SshCertificateSettings; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateOsLoginSettingsRequest_SshCertificateSettings { + const message = { + ...baseUpdateOsLoginSettingsRequest_SshCertificateSettings, + } as UpdateOsLoginSettingsRequest_SshCertificateSettings; + message.enabled = + object.enabled !== undefined && object.enabled !== null + ? Boolean(object.enabled) + : false; + return message; + }, + + toJSON( + message: UpdateOsLoginSettingsRequest_SshCertificateSettings + ): unknown { + const obj: any = {}; + message.enabled !== undefined && (obj.enabled = message.enabled); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): UpdateOsLoginSettingsRequest_SshCertificateSettings { + const message = { + ...baseUpdateOsLoginSettingsRequest_SshCertificateSettings, + } as UpdateOsLoginSettingsRequest_SshCertificateSettings; + message.enabled = object.enabled ?? false; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateOsLoginSettingsRequest_SshCertificateSettings.$type, + UpdateOsLoginSettingsRequest_SshCertificateSettings +); + +const baseSetDefaultOsLoginProfileRequest: object = { + $type: "yandex.cloud.organizationmanager.v1.SetDefaultOsLoginProfileRequest", + osLoginProfileId: "", +}; + +export const SetDefaultOsLoginProfileRequest = { + $type: + "yandex.cloud.organizationmanager.v1.SetDefaultOsLoginProfileRequest" as const, + + encode( + message: SetDefaultOsLoginProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.osLoginProfileId !== "") { + writer.uint32(10).string(message.osLoginProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SetDefaultOsLoginProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSetDefaultOsLoginProfileRequest, + } as SetDefaultOsLoginProfileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.osLoginProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SetDefaultOsLoginProfileRequest { + const message = { + ...baseSetDefaultOsLoginProfileRequest, + } as SetDefaultOsLoginProfileRequest; + message.osLoginProfileId = + object.osLoginProfileId !== undefined && object.osLoginProfileId !== null + ? String(object.osLoginProfileId) + : ""; + return message; + }, + + toJSON(message: SetDefaultOsLoginProfileRequest): unknown { + const obj: any = {}; + message.osLoginProfileId !== undefined && + (obj.osLoginProfileId = message.osLoginProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): SetDefaultOsLoginProfileRequest { + const message = { + ...baseSetDefaultOsLoginProfileRequest, + } as SetDefaultOsLoginProfileRequest; + message.osLoginProfileId = object.osLoginProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + SetDefaultOsLoginProfileRequest.$type, + SetDefaultOsLoginProfileRequest +); + +const baseGetOsLoginProfileRequest: object = { + $type: "yandex.cloud.organizationmanager.v1.GetOsLoginProfileRequest", + osLoginProfileId: "", +}; + +export const GetOsLoginProfileRequest = { + $type: + "yandex.cloud.organizationmanager.v1.GetOsLoginProfileRequest" as const, + + encode( + message: GetOsLoginProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.osLoginProfileId !== "") { + writer.uint32(10).string(message.osLoginProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetOsLoginProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetOsLoginProfileRequest, + } as GetOsLoginProfileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.osLoginProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetOsLoginProfileRequest { + const message = { + ...baseGetOsLoginProfileRequest, + } as GetOsLoginProfileRequest; + message.osLoginProfileId = + object.osLoginProfileId !== undefined && object.osLoginProfileId !== null + ? String(object.osLoginProfileId) + : ""; + return message; + }, + + toJSON(message: GetOsLoginProfileRequest): unknown { + const obj: any = {}; + message.osLoginProfileId !== undefined && + (obj.osLoginProfileId = message.osLoginProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetOsLoginProfileRequest { + const message = { + ...baseGetOsLoginProfileRequest, + } as GetOsLoginProfileRequest; + message.osLoginProfileId = object.osLoginProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetOsLoginProfileRequest.$type, + GetOsLoginProfileRequest +); + +const baseListOsLoginProfilesRequest: object = { + $type: "yandex.cloud.organizationmanager.v1.ListOsLoginProfilesRequest", + organizationId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListOsLoginProfilesRequest = { + $type: + "yandex.cloud.organizationmanager.v1.ListOsLoginProfilesRequest" as const, + + encode( + message: ListOsLoginProfilesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.organizationId !== "") { + writer.uint32(10).string(message.organizationId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListOsLoginProfilesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListOsLoginProfilesRequest, + } as ListOsLoginProfilesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListOsLoginProfilesRequest { + const message = { + ...baseListOsLoginProfilesRequest, + } as ListOsLoginProfilesRequest; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListOsLoginProfilesRequest): unknown { + const obj: any = {}; + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListOsLoginProfilesRequest { + const message = { + ...baseListOsLoginProfilesRequest, + } as ListOsLoginProfilesRequest; + message.organizationId = object.organizationId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListOsLoginProfilesRequest.$type, + ListOsLoginProfilesRequest +); + +const baseListOsLoginProfilesResponse: object = { + $type: "yandex.cloud.organizationmanager.v1.ListOsLoginProfilesResponse", + nextPageToken: "", +}; + +export const ListOsLoginProfilesResponse = { + $type: + "yandex.cloud.organizationmanager.v1.ListOsLoginProfilesResponse" as const, + + encode( + message: ListOsLoginProfilesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.profiles) { + OsLoginProfile.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListOsLoginProfilesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListOsLoginProfilesResponse, + } as ListOsLoginProfilesResponse; + message.profiles = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.profiles.push(OsLoginProfile.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListOsLoginProfilesResponse { + const message = { + ...baseListOsLoginProfilesResponse, + } as ListOsLoginProfilesResponse; + message.profiles = (object.profiles ?? []).map((e: any) => + OsLoginProfile.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListOsLoginProfilesResponse): unknown { + const obj: any = {}; + if (message.profiles) { + obj.profiles = message.profiles.map((e) => + e ? OsLoginProfile.toJSON(e) : undefined + ); + } else { + obj.profiles = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListOsLoginProfilesResponse { + const message = { + ...baseListOsLoginProfilesResponse, + } as ListOsLoginProfilesResponse; + message.profiles = + object.profiles?.map((e) => OsLoginProfile.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListOsLoginProfilesResponse.$type, + ListOsLoginProfilesResponse +); + +const baseOsLoginProfile: object = { + $type: "yandex.cloud.organizationmanager.v1.OsLoginProfile", + id: "", + organizationId: "", + subjectId: "", + login: "", + uid: 0, + isDefault: false, + homeDirectory: "", + shell: "", +}; + +export const OsLoginProfile = { + $type: "yandex.cloud.organizationmanager.v1.OsLoginProfile" as const, + + encode( + message: OsLoginProfile, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.organizationId !== "") { + writer.uint32(18).string(message.organizationId); + } + if (message.subjectId !== "") { + writer.uint32(26).string(message.subjectId); + } + if (message.login !== "") { + writer.uint32(34).string(message.login); + } + if (message.uid !== 0) { + writer.uint32(40).int64(message.uid); + } + if (message.isDefault === true) { + writer.uint32(48).bool(message.isDefault); + } + if (message.homeDirectory !== "") { + writer.uint32(58).string(message.homeDirectory); + } + if (message.shell !== "") { + writer.uint32(66).string(message.shell); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OsLoginProfile { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOsLoginProfile } as OsLoginProfile; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.organizationId = reader.string(); + break; + case 3: + message.subjectId = reader.string(); + break; + case 4: + message.login = reader.string(); + break; + case 5: + message.uid = longToNumber(reader.int64() as Long); + break; + case 6: + message.isDefault = reader.bool(); + break; + case 7: + message.homeDirectory = reader.string(); + break; + case 8: + message.shell = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OsLoginProfile { + const message = { ...baseOsLoginProfile } as OsLoginProfile; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.subjectId = + object.subjectId !== undefined && object.subjectId !== null + ? String(object.subjectId) + : ""; + message.login = + object.login !== undefined && object.login !== null + ? String(object.login) + : ""; + message.uid = + object.uid !== undefined && object.uid !== null ? Number(object.uid) : 0; + message.isDefault = + object.isDefault !== undefined && object.isDefault !== null + ? Boolean(object.isDefault) + : false; + message.homeDirectory = + object.homeDirectory !== undefined && object.homeDirectory !== null + ? String(object.homeDirectory) + : ""; + message.shell = + object.shell !== undefined && object.shell !== null + ? String(object.shell) + : ""; + return message; + }, + + toJSON(message: OsLoginProfile): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.subjectId !== undefined && (obj.subjectId = message.subjectId); + message.login !== undefined && (obj.login = message.login); + message.uid !== undefined && (obj.uid = Math.round(message.uid)); + message.isDefault !== undefined && (obj.isDefault = message.isDefault); + message.homeDirectory !== undefined && + (obj.homeDirectory = message.homeDirectory); + message.shell !== undefined && (obj.shell = message.shell); + return obj; + }, + + fromPartial, I>>( + object: I + ): OsLoginProfile { + const message = { ...baseOsLoginProfile } as OsLoginProfile; + message.id = object.id ?? ""; + message.organizationId = object.organizationId ?? ""; + message.subjectId = object.subjectId ?? ""; + message.login = object.login ?? ""; + message.uid = object.uid ?? 0; + message.isDefault = object.isDefault ?? false; + message.homeDirectory = object.homeDirectory ?? ""; + message.shell = object.shell ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(OsLoginProfile.$type, OsLoginProfile); + +const baseUpdateOsLoginProfileRequest: object = { + $type: "yandex.cloud.organizationmanager.v1.UpdateOsLoginProfileRequest", + osLoginProfileId: "", + login: "", + uid: 0, + homeDirectory: "", + shell: "", +}; + +export const UpdateOsLoginProfileRequest = { + $type: + "yandex.cloud.organizationmanager.v1.UpdateOsLoginProfileRequest" as const, + + encode( + message: UpdateOsLoginProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.osLoginProfileId !== "") { + writer.uint32(10).string(message.osLoginProfileId); + } + if (message.login !== "") { + writer.uint32(18).string(message.login); + } + if (message.uid !== 0) { + writer.uint32(24).int64(message.uid); + } + if (message.homeDirectory !== "") { + writer.uint32(34).string(message.homeDirectory); + } + if (message.shell !== "") { + writer.uint32(42).string(message.shell); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateOsLoginProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateOsLoginProfileRequest, + } as UpdateOsLoginProfileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.osLoginProfileId = reader.string(); + break; + case 2: + message.login = reader.string(); + break; + case 3: + message.uid = longToNumber(reader.int64() as Long); + break; + case 4: + message.homeDirectory = reader.string(); + break; + case 5: + message.shell = reader.string(); + break; + case 6: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateOsLoginProfileRequest { + const message = { + ...baseUpdateOsLoginProfileRequest, + } as UpdateOsLoginProfileRequest; + message.osLoginProfileId = + object.osLoginProfileId !== undefined && object.osLoginProfileId !== null + ? String(object.osLoginProfileId) + : ""; + message.login = + object.login !== undefined && object.login !== null + ? String(object.login) + : ""; + message.uid = + object.uid !== undefined && object.uid !== null ? Number(object.uid) : 0; + message.homeDirectory = + object.homeDirectory !== undefined && object.homeDirectory !== null + ? String(object.homeDirectory) + : ""; + message.shell = + object.shell !== undefined && object.shell !== null + ? String(object.shell) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + return message; + }, + + toJSON(message: UpdateOsLoginProfileRequest): unknown { + const obj: any = {}; + message.osLoginProfileId !== undefined && + (obj.osLoginProfileId = message.osLoginProfileId); + message.login !== undefined && (obj.login = message.login); + message.uid !== undefined && (obj.uid = Math.round(message.uid)); + message.homeDirectory !== undefined && + (obj.homeDirectory = message.homeDirectory); + message.shell !== undefined && (obj.shell = message.shell); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateOsLoginProfileRequest { + const message = { + ...baseUpdateOsLoginProfileRequest, + } as UpdateOsLoginProfileRequest; + message.osLoginProfileId = object.osLoginProfileId ?? ""; + message.login = object.login ?? ""; + message.uid = object.uid ?? 0; + message.homeDirectory = object.homeDirectory ?? ""; + message.shell = object.shell ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateOsLoginProfileRequest.$type, + UpdateOsLoginProfileRequest +); + +const baseDeleteOsLoginProfileRequest: object = { + $type: "yandex.cloud.organizationmanager.v1.DeleteOsLoginProfileRequest", + id: "", +}; + +export const DeleteOsLoginProfileRequest = { + $type: + "yandex.cloud.organizationmanager.v1.DeleteOsLoginProfileRequest" as const, + + encode( + message: DeleteOsLoginProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteOsLoginProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteOsLoginProfileRequest, + } as DeleteOsLoginProfileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteOsLoginProfileRequest { + const message = { + ...baseDeleteOsLoginProfileRequest, + } as DeleteOsLoginProfileRequest; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + return message; + }, + + toJSON(message: DeleteOsLoginProfileRequest): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteOsLoginProfileRequest { + const message = { + ...baseDeleteOsLoginProfileRequest, + } as DeleteOsLoginProfileRequest; + message.id = object.id ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteOsLoginProfileRequest.$type, + DeleteOsLoginProfileRequest +); + +const baseCreateOsLoginProfileRequest: object = { + $type: "yandex.cloud.organizationmanager.v1.CreateOsLoginProfileRequest", + organizationId: "", + subjectId: "", + login: "", + uid: 0, + homeDirectory: "", + shell: "", +}; + +export const CreateOsLoginProfileRequest = { + $type: + "yandex.cloud.organizationmanager.v1.CreateOsLoginProfileRequest" as const, + + encode( + message: CreateOsLoginProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.organizationId !== "") { + writer.uint32(10).string(message.organizationId); + } + if (message.subjectId !== "") { + writer.uint32(18).string(message.subjectId); + } + if (message.login !== "") { + writer.uint32(26).string(message.login); + } + if (message.uid !== 0) { + writer.uint32(32).int64(message.uid); + } + if (message.homeDirectory !== "") { + writer.uint32(42).string(message.homeDirectory); + } + if (message.shell !== "") { + writer.uint32(50).string(message.shell); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateOsLoginProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateOsLoginProfileRequest, + } as CreateOsLoginProfileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationId = reader.string(); + break; + case 2: + message.subjectId = reader.string(); + break; + case 3: + message.login = reader.string(); + break; + case 4: + message.uid = longToNumber(reader.int64() as Long); + break; + case 5: + message.homeDirectory = reader.string(); + break; + case 6: + message.shell = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateOsLoginProfileRequest { + const message = { + ...baseCreateOsLoginProfileRequest, + } as CreateOsLoginProfileRequest; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.subjectId = + object.subjectId !== undefined && object.subjectId !== null + ? String(object.subjectId) + : ""; + message.login = + object.login !== undefined && object.login !== null + ? String(object.login) + : ""; + message.uid = + object.uid !== undefined && object.uid !== null ? Number(object.uid) : 0; + message.homeDirectory = + object.homeDirectory !== undefined && object.homeDirectory !== null + ? String(object.homeDirectory) + : ""; + message.shell = + object.shell !== undefined && object.shell !== null + ? String(object.shell) + : ""; + return message; + }, + + toJSON(message: CreateOsLoginProfileRequest): unknown { + const obj: any = {}; + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.subjectId !== undefined && (obj.subjectId = message.subjectId); + message.login !== undefined && (obj.login = message.login); + message.uid !== undefined && (obj.uid = Math.round(message.uid)); + message.homeDirectory !== undefined && + (obj.homeDirectory = message.homeDirectory); + message.shell !== undefined && (obj.shell = message.shell); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateOsLoginProfileRequest { + const message = { + ...baseCreateOsLoginProfileRequest, + } as CreateOsLoginProfileRequest; + message.organizationId = object.organizationId ?? ""; + message.subjectId = object.subjectId ?? ""; + message.login = object.login ?? ""; + message.uid = object.uid ?? 0; + message.homeDirectory = object.homeDirectory ?? ""; + message.shell = object.shell ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateOsLoginProfileRequest.$type, + CreateOsLoginProfileRequest +); + +const baseUpdateOsLoginProfileMetadata: object = { + $type: "yandex.cloud.organizationmanager.v1.UpdateOsLoginProfileMetadata", + osLoginProfileId: "", +}; + +export const UpdateOsLoginProfileMetadata = { + $type: + "yandex.cloud.organizationmanager.v1.UpdateOsLoginProfileMetadata" as const, + + encode( + message: UpdateOsLoginProfileMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.osLoginProfileId !== "") { + writer.uint32(10).string(message.osLoginProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateOsLoginProfileMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateOsLoginProfileMetadata, + } as UpdateOsLoginProfileMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.osLoginProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateOsLoginProfileMetadata { + const message = { + ...baseUpdateOsLoginProfileMetadata, + } as UpdateOsLoginProfileMetadata; + message.osLoginProfileId = + object.osLoginProfileId !== undefined && object.osLoginProfileId !== null + ? String(object.osLoginProfileId) + : ""; + return message; + }, + + toJSON(message: UpdateOsLoginProfileMetadata): unknown { + const obj: any = {}; + message.osLoginProfileId !== undefined && + (obj.osLoginProfileId = message.osLoginProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateOsLoginProfileMetadata { + const message = { + ...baseUpdateOsLoginProfileMetadata, + } as UpdateOsLoginProfileMetadata; + message.osLoginProfileId = object.osLoginProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateOsLoginProfileMetadata.$type, + UpdateOsLoginProfileMetadata +); + +const baseDeleteOsLoginProfileMetadata: object = { + $type: "yandex.cloud.organizationmanager.v1.DeleteOsLoginProfileMetadata", + osLoginProfileId: "", +}; + +export const DeleteOsLoginProfileMetadata = { + $type: + "yandex.cloud.organizationmanager.v1.DeleteOsLoginProfileMetadata" as const, + + encode( + message: DeleteOsLoginProfileMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.osLoginProfileId !== "") { + writer.uint32(10).string(message.osLoginProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteOsLoginProfileMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteOsLoginProfileMetadata, + } as DeleteOsLoginProfileMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.osLoginProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteOsLoginProfileMetadata { + const message = { + ...baseDeleteOsLoginProfileMetadata, + } as DeleteOsLoginProfileMetadata; + message.osLoginProfileId = + object.osLoginProfileId !== undefined && object.osLoginProfileId !== null + ? String(object.osLoginProfileId) + : ""; + return message; + }, + + toJSON(message: DeleteOsLoginProfileMetadata): unknown { + const obj: any = {}; + message.osLoginProfileId !== undefined && + (obj.osLoginProfileId = message.osLoginProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteOsLoginProfileMetadata { + const message = { + ...baseDeleteOsLoginProfileMetadata, + } as DeleteOsLoginProfileMetadata; + message.osLoginProfileId = object.osLoginProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteOsLoginProfileMetadata.$type, + DeleteOsLoginProfileMetadata +); + +const baseCreateOsLoginProfileMetadata: object = { + $type: "yandex.cloud.organizationmanager.v1.CreateOsLoginProfileMetadata", + osLoginProfileId: "", + organizationId: "", + subjectId: "", +}; + +export const CreateOsLoginProfileMetadata = { + $type: + "yandex.cloud.organizationmanager.v1.CreateOsLoginProfileMetadata" as const, + + encode( + message: CreateOsLoginProfileMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.osLoginProfileId !== "") { + writer.uint32(10).string(message.osLoginProfileId); + } + if (message.organizationId !== "") { + writer.uint32(18).string(message.organizationId); + } + if (message.subjectId !== "") { + writer.uint32(26).string(message.subjectId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateOsLoginProfileMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateOsLoginProfileMetadata, + } as CreateOsLoginProfileMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.osLoginProfileId = reader.string(); + break; + case 2: + message.organizationId = reader.string(); + break; + case 3: + message.subjectId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateOsLoginProfileMetadata { + const message = { + ...baseCreateOsLoginProfileMetadata, + } as CreateOsLoginProfileMetadata; + message.osLoginProfileId = + object.osLoginProfileId !== undefined && object.osLoginProfileId !== null + ? String(object.osLoginProfileId) + : ""; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.subjectId = + object.subjectId !== undefined && object.subjectId !== null + ? String(object.subjectId) + : ""; + return message; + }, + + toJSON(message: CreateOsLoginProfileMetadata): unknown { + const obj: any = {}; + message.osLoginProfileId !== undefined && + (obj.osLoginProfileId = message.osLoginProfileId); + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.subjectId !== undefined && (obj.subjectId = message.subjectId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateOsLoginProfileMetadata { + const message = { + ...baseCreateOsLoginProfileMetadata, + } as CreateOsLoginProfileMetadata; + message.osLoginProfileId = object.osLoginProfileId ?? ""; + message.organizationId = object.organizationId ?? ""; + message.subjectId = object.subjectId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateOsLoginProfileMetadata.$type, + CreateOsLoginProfileMetadata +); + +const baseUpdateOsLoginSettingsMetadata: object = { + $type: "yandex.cloud.organizationmanager.v1.UpdateOsLoginSettingsMetadata", + organizationId: "", +}; + +export const UpdateOsLoginSettingsMetadata = { + $type: + "yandex.cloud.organizationmanager.v1.UpdateOsLoginSettingsMetadata" as const, + + encode( + message: UpdateOsLoginSettingsMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.organizationId !== "") { + writer.uint32(10).string(message.organizationId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateOsLoginSettingsMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateOsLoginSettingsMetadata, + } as UpdateOsLoginSettingsMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateOsLoginSettingsMetadata { + const message = { + ...baseUpdateOsLoginSettingsMetadata, + } as UpdateOsLoginSettingsMetadata; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + return message; + }, + + toJSON(message: UpdateOsLoginSettingsMetadata): unknown { + const obj: any = {}; + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateOsLoginSettingsMetadata { + const message = { + ...baseUpdateOsLoginSettingsMetadata, + } as UpdateOsLoginSettingsMetadata; + message.organizationId = object.organizationId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateOsLoginSettingsMetadata.$type, + UpdateOsLoginSettingsMetadata +); + +const baseSetDefaultOsLoginProfileMetadata: object = { + $type: "yandex.cloud.organizationmanager.v1.SetDefaultOsLoginProfileMetadata", + previousDefaultProfileId: "", + currentDefaultProfileId: "", +}; + +export const SetDefaultOsLoginProfileMetadata = { + $type: + "yandex.cloud.organizationmanager.v1.SetDefaultOsLoginProfileMetadata" as const, + + encode( + message: SetDefaultOsLoginProfileMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.previousDefaultProfileId !== "") { + writer.uint32(10).string(message.previousDefaultProfileId); + } + if (message.currentDefaultProfileId !== "") { + writer.uint32(18).string(message.currentDefaultProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SetDefaultOsLoginProfileMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSetDefaultOsLoginProfileMetadata, + } as SetDefaultOsLoginProfileMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.previousDefaultProfileId = reader.string(); + break; + case 2: + message.currentDefaultProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SetDefaultOsLoginProfileMetadata { + const message = { + ...baseSetDefaultOsLoginProfileMetadata, + } as SetDefaultOsLoginProfileMetadata; + message.previousDefaultProfileId = + object.previousDefaultProfileId !== undefined && + object.previousDefaultProfileId !== null + ? String(object.previousDefaultProfileId) + : ""; + message.currentDefaultProfileId = + object.currentDefaultProfileId !== undefined && + object.currentDefaultProfileId !== null + ? String(object.currentDefaultProfileId) + : ""; + return message; + }, + + toJSON(message: SetDefaultOsLoginProfileMetadata): unknown { + const obj: any = {}; + message.previousDefaultProfileId !== undefined && + (obj.previousDefaultProfileId = message.previousDefaultProfileId); + message.currentDefaultProfileId !== undefined && + (obj.currentDefaultProfileId = message.currentDefaultProfileId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): SetDefaultOsLoginProfileMetadata { + const message = { + ...baseSetDefaultOsLoginProfileMetadata, + } as SetDefaultOsLoginProfileMetadata; + message.previousDefaultProfileId = object.previousDefaultProfileId ?? ""; + message.currentDefaultProfileId = object.currentDefaultProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + SetDefaultOsLoginProfileMetadata.$type, + SetDefaultOsLoginProfileMetadata +); + +export const OsLoginServiceService = { + /** OsLogin settings */ + getSettings: { + path: "/yandex.cloud.organizationmanager.v1.OsLoginService/GetSettings", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetOsLoginSettingsRequest) => + Buffer.from(GetOsLoginSettingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetOsLoginSettingsRequest.decode(value), + responseSerialize: (value: OsLoginSettings) => + Buffer.from(OsLoginSettings.encode(value).finish()), + responseDeserialize: (value: Buffer) => OsLoginSettings.decode(value), + }, + updateSettings: { + path: "/yandex.cloud.organizationmanager.v1.OsLoginService/UpdateSettings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateOsLoginSettingsRequest) => + Buffer.from(UpdateOsLoginSettingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateOsLoginSettingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** OsLogin Profiles */ + getProfile: { + path: "/yandex.cloud.organizationmanager.v1.OsLoginService/GetProfile", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetOsLoginProfileRequest) => + Buffer.from(GetOsLoginProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetOsLoginProfileRequest.decode(value), + responseSerialize: (value: OsLoginProfile) => + Buffer.from(OsLoginProfile.encode(value).finish()), + responseDeserialize: (value: Buffer) => OsLoginProfile.decode(value), + }, + listProfiles: { + path: "/yandex.cloud.organizationmanager.v1.OsLoginService/ListProfiles", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListOsLoginProfilesRequest) => + Buffer.from(ListOsLoginProfilesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListOsLoginProfilesRequest.decode(value), + responseSerialize: (value: ListOsLoginProfilesResponse) => + Buffer.from(ListOsLoginProfilesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListOsLoginProfilesResponse.decode(value), + }, + createProfile: { + path: "/yandex.cloud.organizationmanager.v1.OsLoginService/CreateProfile", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateOsLoginProfileRequest) => + Buffer.from(CreateOsLoginProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CreateOsLoginProfileRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + updateProfile: { + path: "/yandex.cloud.organizationmanager.v1.OsLoginService/UpdateProfile", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateOsLoginProfileRequest) => + Buffer.from(UpdateOsLoginProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateOsLoginProfileRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Sets a profile as a default for the subject assigned to this profile */ + setDefaultProfile: { + path: "/yandex.cloud.organizationmanager.v1.OsLoginService/SetDefaultProfile", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetDefaultOsLoginProfileRequest) => + Buffer.from(SetDefaultOsLoginProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetDefaultOsLoginProfileRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + deleteProfile: { + path: "/yandex.cloud.organizationmanager.v1.OsLoginService/DeleteProfile", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteOsLoginProfileRequest) => + Buffer.from(DeleteOsLoginProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteOsLoginProfileRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface OsLoginServiceServer extends UntypedServiceImplementation { + /** OsLogin settings */ + getSettings: handleUnaryCall; + updateSettings: handleUnaryCall; + /** OsLogin Profiles */ + getProfile: handleUnaryCall; + listProfiles: handleUnaryCall< + ListOsLoginProfilesRequest, + ListOsLoginProfilesResponse + >; + createProfile: handleUnaryCall; + updateProfile: handleUnaryCall; + /** Sets a profile as a default for the subject assigned to this profile */ + setDefaultProfile: handleUnaryCall< + SetDefaultOsLoginProfileRequest, + Operation + >; + deleteProfile: handleUnaryCall; +} + +export interface OsLoginServiceClient extends Client { + /** OsLogin settings */ + getSettings( + request: GetOsLoginSettingsRequest, + callback: (error: ServiceError | null, response: OsLoginSettings) => void + ): ClientUnaryCall; + getSettings( + request: GetOsLoginSettingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: OsLoginSettings) => void + ): ClientUnaryCall; + getSettings( + request: GetOsLoginSettingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: OsLoginSettings) => void + ): ClientUnaryCall; + updateSettings( + request: UpdateOsLoginSettingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateSettings( + request: UpdateOsLoginSettingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateSettings( + request: UpdateOsLoginSettingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** OsLogin Profiles */ + getProfile( + request: GetOsLoginProfileRequest, + callback: (error: ServiceError | null, response: OsLoginProfile) => void + ): ClientUnaryCall; + getProfile( + request: GetOsLoginProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: OsLoginProfile) => void + ): ClientUnaryCall; + getProfile( + request: GetOsLoginProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: OsLoginProfile) => void + ): ClientUnaryCall; + listProfiles( + request: ListOsLoginProfilesRequest, + callback: ( + error: ServiceError | null, + response: ListOsLoginProfilesResponse + ) => void + ): ClientUnaryCall; + listProfiles( + request: ListOsLoginProfilesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListOsLoginProfilesResponse + ) => void + ): ClientUnaryCall; + listProfiles( + request: ListOsLoginProfilesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListOsLoginProfilesResponse + ) => void + ): ClientUnaryCall; + createProfile( + request: CreateOsLoginProfileRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + createProfile( + request: CreateOsLoginProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + createProfile( + request: CreateOsLoginProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateProfile( + request: UpdateOsLoginProfileRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateProfile( + request: UpdateOsLoginProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateProfile( + request: UpdateOsLoginProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Sets a profile as a default for the subject assigned to this profile */ + setDefaultProfile( + request: SetDefaultOsLoginProfileRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setDefaultProfile( + request: SetDefaultOsLoginProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setDefaultProfile( + request: SetDefaultOsLoginProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deleteProfile( + request: DeleteOsLoginProfileRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deleteProfile( + request: DeleteOsLoginProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deleteProfile( + request: DeleteOsLoginProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const OsLoginServiceClient = makeGenericClientConstructor( + OsLoginServiceService, + "yandex.cloud.organizationmanager.v1.OsLoginService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): OsLoginServiceClient; + service: typeof OsLoginServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/organizationmanager/v1/saml/federation_service.ts b/src/generated/yandex/cloud/organizationmanager/v1/saml/federation_service.ts index 19649a43..32506b1a 100644 --- a/src/generated/yandex/cloud/organizationmanager/v1/saml/federation_service.ts +++ b/src/generated/yandex/cloud/organizationmanager/v1/saml/federation_service.ts @@ -257,6 +257,28 @@ export interface AddFederatedUserAccountsResponse { userAccounts: UserAccount[]; } +export interface DeleteFederatedUserAccountsRequest { + $type: "yandex.cloud.organizationmanager.v1.saml.DeleteFederatedUserAccountsRequest"; + /** ID of the federation to delete users from. */ + federationId: string; + /** List of subjects to delete. */ + subjectIds: string[]; +} + +export interface DeleteFederatedUserAccountsMetadata { + $type: "yandex.cloud.organizationmanager.v1.saml.DeleteFederatedUserAccountsMetadata"; + /** ID of the federation that is being altered. */ + federationId: string; +} + +export interface DeleteFederatedUserAccountsResponse { + $type: "yandex.cloud.organizationmanager.v1.saml.DeleteFederatedUserAccountsResponse"; + /** List of subjects deleted by [FederationService.DeleteUserAccounts] request. */ + deletedSubjects: string[]; + /** List of subjects found in [FederationService.DeleteUserAccounts] request that do not exist. */ + nonExistingSubjects: string[]; +} + export interface ListFederatedUserAccountsRequest { $type: "yandex.cloud.organizationmanager.v1.saml.ListFederatedUserAccountsRequest"; /** ID of the federation to list user accounts for. */ @@ -1848,6 +1870,273 @@ messageTypeRegistry.set( AddFederatedUserAccountsResponse ); +const baseDeleteFederatedUserAccountsRequest: object = { + $type: + "yandex.cloud.organizationmanager.v1.saml.DeleteFederatedUserAccountsRequest", + federationId: "", + subjectIds: "", +}; + +export const DeleteFederatedUserAccountsRequest = { + $type: + "yandex.cloud.organizationmanager.v1.saml.DeleteFederatedUserAccountsRequest" as const, + + encode( + message: DeleteFederatedUserAccountsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.federationId !== "") { + writer.uint32(10).string(message.federationId); + } + for (const v of message.subjectIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteFederatedUserAccountsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteFederatedUserAccountsRequest, + } as DeleteFederatedUserAccountsRequest; + message.subjectIds = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federationId = reader.string(); + break; + case 2: + message.subjectIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteFederatedUserAccountsRequest { + const message = { + ...baseDeleteFederatedUserAccountsRequest, + } as DeleteFederatedUserAccountsRequest; + message.federationId = + object.federationId !== undefined && object.federationId !== null + ? String(object.federationId) + : ""; + message.subjectIds = (object.subjectIds ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: DeleteFederatedUserAccountsRequest): unknown { + const obj: any = {}; + message.federationId !== undefined && + (obj.federationId = message.federationId); + if (message.subjectIds) { + obj.subjectIds = message.subjectIds.map((e) => e); + } else { + obj.subjectIds = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): DeleteFederatedUserAccountsRequest { + const message = { + ...baseDeleteFederatedUserAccountsRequest, + } as DeleteFederatedUserAccountsRequest; + message.federationId = object.federationId ?? ""; + message.subjectIds = object.subjectIds?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteFederatedUserAccountsRequest.$type, + DeleteFederatedUserAccountsRequest +); + +const baseDeleteFederatedUserAccountsMetadata: object = { + $type: + "yandex.cloud.organizationmanager.v1.saml.DeleteFederatedUserAccountsMetadata", + federationId: "", +}; + +export const DeleteFederatedUserAccountsMetadata = { + $type: + "yandex.cloud.organizationmanager.v1.saml.DeleteFederatedUserAccountsMetadata" as const, + + encode( + message: DeleteFederatedUserAccountsMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.federationId !== "") { + writer.uint32(10).string(message.federationId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteFederatedUserAccountsMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteFederatedUserAccountsMetadata, + } as DeleteFederatedUserAccountsMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.federationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteFederatedUserAccountsMetadata { + const message = { + ...baseDeleteFederatedUserAccountsMetadata, + } as DeleteFederatedUserAccountsMetadata; + message.federationId = + object.federationId !== undefined && object.federationId !== null + ? String(object.federationId) + : ""; + return message; + }, + + toJSON(message: DeleteFederatedUserAccountsMetadata): unknown { + const obj: any = {}; + message.federationId !== undefined && + (obj.federationId = message.federationId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): DeleteFederatedUserAccountsMetadata { + const message = { + ...baseDeleteFederatedUserAccountsMetadata, + } as DeleteFederatedUserAccountsMetadata; + message.federationId = object.federationId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteFederatedUserAccountsMetadata.$type, + DeleteFederatedUserAccountsMetadata +); + +const baseDeleteFederatedUserAccountsResponse: object = { + $type: + "yandex.cloud.organizationmanager.v1.saml.DeleteFederatedUserAccountsResponse", + deletedSubjects: "", + nonExistingSubjects: "", +}; + +export const DeleteFederatedUserAccountsResponse = { + $type: + "yandex.cloud.organizationmanager.v1.saml.DeleteFederatedUserAccountsResponse" as const, + + encode( + message: DeleteFederatedUserAccountsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.deletedSubjects) { + writer.uint32(10).string(v!); + } + for (const v of message.nonExistingSubjects) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteFederatedUserAccountsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteFederatedUserAccountsResponse, + } as DeleteFederatedUserAccountsResponse; + message.deletedSubjects = []; + message.nonExistingSubjects = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deletedSubjects.push(reader.string()); + break; + case 2: + message.nonExistingSubjects.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteFederatedUserAccountsResponse { + const message = { + ...baseDeleteFederatedUserAccountsResponse, + } as DeleteFederatedUserAccountsResponse; + message.deletedSubjects = (object.deletedSubjects ?? []).map((e: any) => + String(e) + ); + message.nonExistingSubjects = (object.nonExistingSubjects ?? []).map( + (e: any) => String(e) + ); + return message; + }, + + toJSON(message: DeleteFederatedUserAccountsResponse): unknown { + const obj: any = {}; + if (message.deletedSubjects) { + obj.deletedSubjects = message.deletedSubjects.map((e) => e); + } else { + obj.deletedSubjects = []; + } + if (message.nonExistingSubjects) { + obj.nonExistingSubjects = message.nonExistingSubjects.map((e) => e); + } else { + obj.nonExistingSubjects = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): DeleteFederatedUserAccountsResponse { + const message = { + ...baseDeleteFederatedUserAccountsResponse, + } as DeleteFederatedUserAccountsResponse; + message.deletedSubjects = object.deletedSubjects?.map((e) => e) || []; + message.nonExistingSubjects = + object.nonExistingSubjects?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteFederatedUserAccountsResponse.$type, + DeleteFederatedUserAccountsResponse +); + const baseListFederatedUserAccountsRequest: object = { $type: "yandex.cloud.organizationmanager.v1.saml.ListFederatedUserAccountsRequest", @@ -2346,6 +2635,19 @@ export const FederationServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Deletes users from the specified federation. */ + deleteUserAccounts: { + path: "/yandex.cloud.organizationmanager.v1.saml.FederationService/DeleteUserAccounts", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteFederatedUserAccountsRequest) => + Buffer.from(DeleteFederatedUserAccountsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteFederatedUserAccountsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, /** Lists users for the specified federation. */ listUserAccounts: { path: "/yandex.cloud.organizationmanager.v1.saml.FederationService/ListUserAccounts", @@ -2393,6 +2695,11 @@ export interface FederationServiceServer extends UntypedServiceImplementation { delete: handleUnaryCall; /** Adds users to the specified federation. */ addUserAccounts: handleUnaryCall; + /** Deletes users from the specified federation. */ + deleteUserAccounts: handleUnaryCall< + DeleteFederatedUserAccountsRequest, + Operation + >; /** Lists users for the specified federation. */ listUserAccounts: handleUnaryCall< ListFederatedUserAccountsRequest, @@ -2515,6 +2822,22 @@ export interface FederationServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Deletes users from the specified federation. */ + deleteUserAccounts( + request: DeleteFederatedUserAccountsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deleteUserAccounts( + request: DeleteFederatedUserAccountsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + deleteUserAccounts( + request: DeleteFederatedUserAccountsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; /** Lists users for the specified federation. */ listUserAccounts( request: ListFederatedUserAccountsRequest, diff --git a/src/generated/yandex/cloud/organizationmanager/v1/user_ssh_key.ts b/src/generated/yandex/cloud/organizationmanager/v1/user_ssh_key.ts new file mode 100644 index 00000000..0485a39d --- /dev/null +++ b/src/generated/yandex/cloud/organizationmanager/v1/user_ssh_key.ts @@ -0,0 +1,237 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.organizationmanager.v1"; + +export interface UserSshKey { + $type: "yandex.cloud.organizationmanager.v1.UserSshKey"; + id: string; + subjectId: string; + data: string; + name: string; + fingerprint: string; + organizationId: string; + createdAt?: Date; + /** Used for temporary keys, if empty the key doesn't expire */ + expiresAt?: Date; +} + +const baseUserSshKey: object = { + $type: "yandex.cloud.organizationmanager.v1.UserSshKey", + id: "", + subjectId: "", + data: "", + name: "", + fingerprint: "", + organizationId: "", +}; + +export const UserSshKey = { + $type: "yandex.cloud.organizationmanager.v1.UserSshKey" as const, + + encode( + message: UserSshKey, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.subjectId !== "") { + writer.uint32(18).string(message.subjectId); + } + if (message.data !== "") { + writer.uint32(26).string(message.data); + } + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + if (message.fingerprint !== "") { + writer.uint32(42).string(message.fingerprint); + } + if (message.organizationId !== "") { + writer.uint32(50).string(message.organizationId); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(58).fork() + ).ldelim(); + } + if (message.expiresAt !== undefined) { + Timestamp.encode( + toTimestamp(message.expiresAt), + writer.uint32(66).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UserSshKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUserSshKey } as UserSshKey; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.subjectId = reader.string(); + break; + case 3: + message.data = reader.string(); + break; + case 4: + message.name = reader.string(); + break; + case 5: + message.fingerprint = reader.string(); + break; + case 6: + message.organizationId = reader.string(); + break; + case 7: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 8: + message.expiresAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UserSshKey { + const message = { ...baseUserSshKey } as UserSshKey; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.subjectId = + object.subjectId !== undefined && object.subjectId !== null + ? String(object.subjectId) + : ""; + message.data = + object.data !== undefined && object.data !== null + ? String(object.data) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.fingerprint = + object.fingerprint !== undefined && object.fingerprint !== null + ? String(object.fingerprint) + : ""; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.expiresAt = + object.expiresAt !== undefined && object.expiresAt !== null + ? fromJsonTimestamp(object.expiresAt) + : undefined; + return message; + }, + + toJSON(message: UserSshKey): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.subjectId !== undefined && (obj.subjectId = message.subjectId); + message.data !== undefined && (obj.data = message.data); + message.name !== undefined && (obj.name = message.name); + message.fingerprint !== undefined && + (obj.fingerprint = message.fingerprint); + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.expiresAt !== undefined && + (obj.expiresAt = message.expiresAt.toISOString()); + return obj; + }, + + fromPartial, I>>( + object: I + ): UserSshKey { + const message = { ...baseUserSshKey } as UserSshKey; + message.id = object.id ?? ""; + message.subjectId = object.subjectId ?? ""; + message.data = object.data ?? ""; + message.name = object.name ?? ""; + message.fingerprint = object.fingerprint ?? ""; + message.organizationId = object.organizationId ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.expiresAt = object.expiresAt ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(UserSshKey.$type, UserSshKey); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/organizationmanager/v1/user_ssh_key_service.ts b/src/generated/yandex/cloud/organizationmanager/v1/user_ssh_key_service.ts new file mode 100644 index 00000000..e0ebe21f --- /dev/null +++ b/src/generated/yandex/cloud/organizationmanager/v1/user_ssh_key_service.ts @@ -0,0 +1,1148 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { UserSshKey } from "../../../../yandex/cloud/organizationmanager/v1/user_ssh_key"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.organizationmanager.v1"; + +export interface GetUserSshKeyRequest { + $type: "yandex.cloud.organizationmanager.v1.GetUserSshKeyRequest"; + userSshKeyId: string; +} + +export interface ListUserSshKeysRequest { + $type: "yandex.cloud.organizationmanager.v1.ListUserSshKeysRequest"; + organizationId: string; + /** if empty, list all organization keys */ + subjectId: string; + pageSize: number; + pageToken: string; +} + +export interface ListUserSshKeysResponse { + $type: "yandex.cloud.organizationmanager.v1.ListUserSshKeysResponse"; + sshKeys: UserSshKey[]; + nextPageToken: string; +} + +export interface CreateUserSshKeyRequest { + $type: "yandex.cloud.organizationmanager.v1.CreateUserSshKeyRequest"; + organizationId: string; + subjectId: string; + name: string; + data: string; + expiresAt?: Date; +} + +export interface CreateUserSshKeyMetadata { + $type: "yandex.cloud.organizationmanager.v1.CreateUserSshKeyMetadata"; + userSshKeyId: string; + organizationId: string; +} + +export interface UpdateUserSshKeyRequest { + $type: "yandex.cloud.organizationmanager.v1.UpdateUserSshKeyRequest"; + userSshKeyId: string; + name: string; + updateMask?: FieldMask; + expiresAt?: Date; +} + +export interface UpdateUserSshKeyMetadata { + $type: "yandex.cloud.organizationmanager.v1.UpdateUserSshKeyMetadata"; + userSshKeyId: string; +} + +export interface DeleteUserSshKeyRequest { + $type: "yandex.cloud.organizationmanager.v1.DeleteUserSshKeyRequest"; + userSshKeyId: string; +} + +export interface DeleteUserSshKeyMetadata { + $type: "yandex.cloud.organizationmanager.v1.DeleteUserSshKeyMetadata"; + userSshKeyId: string; +} + +const baseGetUserSshKeyRequest: object = { + $type: "yandex.cloud.organizationmanager.v1.GetUserSshKeyRequest", + userSshKeyId: "", +}; + +export const GetUserSshKeyRequest = { + $type: "yandex.cloud.organizationmanager.v1.GetUserSshKeyRequest" as const, + + encode( + message: GetUserSshKeyRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.userSshKeyId !== "") { + writer.uint32(10).string(message.userSshKeyId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetUserSshKeyRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetUserSshKeyRequest } as GetUserSshKeyRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userSshKeyId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetUserSshKeyRequest { + const message = { ...baseGetUserSshKeyRequest } as GetUserSshKeyRequest; + message.userSshKeyId = + object.userSshKeyId !== undefined && object.userSshKeyId !== null + ? String(object.userSshKeyId) + : ""; + return message; + }, + + toJSON(message: GetUserSshKeyRequest): unknown { + const obj: any = {}; + message.userSshKeyId !== undefined && + (obj.userSshKeyId = message.userSshKeyId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetUserSshKeyRequest { + const message = { ...baseGetUserSshKeyRequest } as GetUserSshKeyRequest; + message.userSshKeyId = object.userSshKeyId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetUserSshKeyRequest.$type, GetUserSshKeyRequest); + +const baseListUserSshKeysRequest: object = { + $type: "yandex.cloud.organizationmanager.v1.ListUserSshKeysRequest", + organizationId: "", + subjectId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListUserSshKeysRequest = { + $type: "yandex.cloud.organizationmanager.v1.ListUserSshKeysRequest" as const, + + encode( + message: ListUserSshKeysRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.organizationId !== "") { + writer.uint32(10).string(message.organizationId); + } + if (message.subjectId !== "") { + writer.uint32(18).string(message.subjectId); + } + if (message.pageSize !== 0) { + writer.uint32(24).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(34).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListUserSshKeysRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListUserSshKeysRequest } as ListUserSshKeysRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationId = reader.string(); + break; + case 2: + message.subjectId = reader.string(); + break; + case 3: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 4: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListUserSshKeysRequest { + const message = { ...baseListUserSshKeysRequest } as ListUserSshKeysRequest; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.subjectId = + object.subjectId !== undefined && object.subjectId !== null + ? String(object.subjectId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListUserSshKeysRequest): unknown { + const obj: any = {}; + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.subjectId !== undefined && (obj.subjectId = message.subjectId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListUserSshKeysRequest { + const message = { ...baseListUserSshKeysRequest } as ListUserSshKeysRequest; + message.organizationId = object.organizationId ?? ""; + message.subjectId = object.subjectId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListUserSshKeysRequest.$type, ListUserSshKeysRequest); + +const baseListUserSshKeysResponse: object = { + $type: "yandex.cloud.organizationmanager.v1.ListUserSshKeysResponse", + nextPageToken: "", +}; + +export const ListUserSshKeysResponse = { + $type: "yandex.cloud.organizationmanager.v1.ListUserSshKeysResponse" as const, + + encode( + message: ListUserSshKeysResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.sshKeys) { + UserSshKey.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListUserSshKeysResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListUserSshKeysResponse, + } as ListUserSshKeysResponse; + message.sshKeys = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sshKeys.push(UserSshKey.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListUserSshKeysResponse { + const message = { + ...baseListUserSshKeysResponse, + } as ListUserSshKeysResponse; + message.sshKeys = (object.sshKeys ?? []).map((e: any) => + UserSshKey.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListUserSshKeysResponse): unknown { + const obj: any = {}; + if (message.sshKeys) { + obj.sshKeys = message.sshKeys.map((e) => + e ? UserSshKey.toJSON(e) : undefined + ); + } else { + obj.sshKeys = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListUserSshKeysResponse { + const message = { + ...baseListUserSshKeysResponse, + } as ListUserSshKeysResponse; + message.sshKeys = + object.sshKeys?.map((e) => UserSshKey.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListUserSshKeysResponse.$type, ListUserSshKeysResponse); + +const baseCreateUserSshKeyRequest: object = { + $type: "yandex.cloud.organizationmanager.v1.CreateUserSshKeyRequest", + organizationId: "", + subjectId: "", + name: "", + data: "", +}; + +export const CreateUserSshKeyRequest = { + $type: "yandex.cloud.organizationmanager.v1.CreateUserSshKeyRequest" as const, + + encode( + message: CreateUserSshKeyRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.organizationId !== "") { + writer.uint32(10).string(message.organizationId); + } + if (message.subjectId !== "") { + writer.uint32(18).string(message.subjectId); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.data !== "") { + writer.uint32(34).string(message.data); + } + if (message.expiresAt !== undefined) { + Timestamp.encode( + toTimestamp(message.expiresAt), + writer.uint32(42).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateUserSshKeyRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateUserSshKeyRequest, + } as CreateUserSshKeyRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationId = reader.string(); + break; + case 2: + message.subjectId = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.data = reader.string(); + break; + case 5: + message.expiresAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateUserSshKeyRequest { + const message = { + ...baseCreateUserSshKeyRequest, + } as CreateUserSshKeyRequest; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.subjectId = + object.subjectId !== undefined && object.subjectId !== null + ? String(object.subjectId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.data = + object.data !== undefined && object.data !== null + ? String(object.data) + : ""; + message.expiresAt = + object.expiresAt !== undefined && object.expiresAt !== null + ? fromJsonTimestamp(object.expiresAt) + : undefined; + return message; + }, + + toJSON(message: CreateUserSshKeyRequest): unknown { + const obj: any = {}; + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.subjectId !== undefined && (obj.subjectId = message.subjectId); + message.name !== undefined && (obj.name = message.name); + message.data !== undefined && (obj.data = message.data); + message.expiresAt !== undefined && + (obj.expiresAt = message.expiresAt.toISOString()); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateUserSshKeyRequest { + const message = { + ...baseCreateUserSshKeyRequest, + } as CreateUserSshKeyRequest; + message.organizationId = object.organizationId ?? ""; + message.subjectId = object.subjectId ?? ""; + message.name = object.name ?? ""; + message.data = object.data ?? ""; + message.expiresAt = object.expiresAt ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(CreateUserSshKeyRequest.$type, CreateUserSshKeyRequest); + +const baseCreateUserSshKeyMetadata: object = { + $type: "yandex.cloud.organizationmanager.v1.CreateUserSshKeyMetadata", + userSshKeyId: "", + organizationId: "", +}; + +export const CreateUserSshKeyMetadata = { + $type: + "yandex.cloud.organizationmanager.v1.CreateUserSshKeyMetadata" as const, + + encode( + message: CreateUserSshKeyMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.userSshKeyId !== "") { + writer.uint32(10).string(message.userSshKeyId); + } + if (message.organizationId !== "") { + writer.uint32(18).string(message.organizationId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateUserSshKeyMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateUserSshKeyMetadata, + } as CreateUserSshKeyMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userSshKeyId = reader.string(); + break; + case 2: + message.organizationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateUserSshKeyMetadata { + const message = { + ...baseCreateUserSshKeyMetadata, + } as CreateUserSshKeyMetadata; + message.userSshKeyId = + object.userSshKeyId !== undefined && object.userSshKeyId !== null + ? String(object.userSshKeyId) + : ""; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + return message; + }, + + toJSON(message: CreateUserSshKeyMetadata): unknown { + const obj: any = {}; + message.userSshKeyId !== undefined && + (obj.userSshKeyId = message.userSshKeyId); + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateUserSshKeyMetadata { + const message = { + ...baseCreateUserSshKeyMetadata, + } as CreateUserSshKeyMetadata; + message.userSshKeyId = object.userSshKeyId ?? ""; + message.organizationId = object.organizationId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateUserSshKeyMetadata.$type, + CreateUserSshKeyMetadata +); + +const baseUpdateUserSshKeyRequest: object = { + $type: "yandex.cloud.organizationmanager.v1.UpdateUserSshKeyRequest", + userSshKeyId: "", + name: "", +}; + +export const UpdateUserSshKeyRequest = { + $type: "yandex.cloud.organizationmanager.v1.UpdateUserSshKeyRequest" as const, + + encode( + message: UpdateUserSshKeyRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.userSshKeyId !== "") { + writer.uint32(10).string(message.userSshKeyId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(26).fork()).ldelim(); + } + if (message.expiresAt !== undefined) { + Timestamp.encode( + toTimestamp(message.expiresAt), + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateUserSshKeyRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateUserSshKeyRequest, + } as UpdateUserSshKeyRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userSshKeyId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 4: + message.expiresAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateUserSshKeyRequest { + const message = { + ...baseUpdateUserSshKeyRequest, + } as UpdateUserSshKeyRequest; + message.userSshKeyId = + object.userSshKeyId !== undefined && object.userSshKeyId !== null + ? String(object.userSshKeyId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.expiresAt = + object.expiresAt !== undefined && object.expiresAt !== null + ? fromJsonTimestamp(object.expiresAt) + : undefined; + return message; + }, + + toJSON(message: UpdateUserSshKeyRequest): unknown { + const obj: any = {}; + message.userSshKeyId !== undefined && + (obj.userSshKeyId = message.userSshKeyId); + message.name !== undefined && (obj.name = message.name); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.expiresAt !== undefined && + (obj.expiresAt = message.expiresAt.toISOString()); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateUserSshKeyRequest { + const message = { + ...baseUpdateUserSshKeyRequest, + } as UpdateUserSshKeyRequest; + message.userSshKeyId = object.userSshKeyId ?? ""; + message.name = object.name ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.expiresAt = object.expiresAt ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(UpdateUserSshKeyRequest.$type, UpdateUserSshKeyRequest); + +const baseUpdateUserSshKeyMetadata: object = { + $type: "yandex.cloud.organizationmanager.v1.UpdateUserSshKeyMetadata", + userSshKeyId: "", +}; + +export const UpdateUserSshKeyMetadata = { + $type: + "yandex.cloud.organizationmanager.v1.UpdateUserSshKeyMetadata" as const, + + encode( + message: UpdateUserSshKeyMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.userSshKeyId !== "") { + writer.uint32(10).string(message.userSshKeyId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateUserSshKeyMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateUserSshKeyMetadata, + } as UpdateUserSshKeyMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userSshKeyId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateUserSshKeyMetadata { + const message = { + ...baseUpdateUserSshKeyMetadata, + } as UpdateUserSshKeyMetadata; + message.userSshKeyId = + object.userSshKeyId !== undefined && object.userSshKeyId !== null + ? String(object.userSshKeyId) + : ""; + return message; + }, + + toJSON(message: UpdateUserSshKeyMetadata): unknown { + const obj: any = {}; + message.userSshKeyId !== undefined && + (obj.userSshKeyId = message.userSshKeyId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateUserSshKeyMetadata { + const message = { + ...baseUpdateUserSshKeyMetadata, + } as UpdateUserSshKeyMetadata; + message.userSshKeyId = object.userSshKeyId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateUserSshKeyMetadata.$type, + UpdateUserSshKeyMetadata +); + +const baseDeleteUserSshKeyRequest: object = { + $type: "yandex.cloud.organizationmanager.v1.DeleteUserSshKeyRequest", + userSshKeyId: "", +}; + +export const DeleteUserSshKeyRequest = { + $type: "yandex.cloud.organizationmanager.v1.DeleteUserSshKeyRequest" as const, + + encode( + message: DeleteUserSshKeyRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.userSshKeyId !== "") { + writer.uint32(10).string(message.userSshKeyId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteUserSshKeyRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteUserSshKeyRequest, + } as DeleteUserSshKeyRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userSshKeyId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteUserSshKeyRequest { + const message = { + ...baseDeleteUserSshKeyRequest, + } as DeleteUserSshKeyRequest; + message.userSshKeyId = + object.userSshKeyId !== undefined && object.userSshKeyId !== null + ? String(object.userSshKeyId) + : ""; + return message; + }, + + toJSON(message: DeleteUserSshKeyRequest): unknown { + const obj: any = {}; + message.userSshKeyId !== undefined && + (obj.userSshKeyId = message.userSshKeyId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteUserSshKeyRequest { + const message = { + ...baseDeleteUserSshKeyRequest, + } as DeleteUserSshKeyRequest; + message.userSshKeyId = object.userSshKeyId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteUserSshKeyRequest.$type, DeleteUserSshKeyRequest); + +const baseDeleteUserSshKeyMetadata: object = { + $type: "yandex.cloud.organizationmanager.v1.DeleteUserSshKeyMetadata", + userSshKeyId: "", +}; + +export const DeleteUserSshKeyMetadata = { + $type: + "yandex.cloud.organizationmanager.v1.DeleteUserSshKeyMetadata" as const, + + encode( + message: DeleteUserSshKeyMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.userSshKeyId !== "") { + writer.uint32(10).string(message.userSshKeyId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteUserSshKeyMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteUserSshKeyMetadata, + } as DeleteUserSshKeyMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userSshKeyId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteUserSshKeyMetadata { + const message = { + ...baseDeleteUserSshKeyMetadata, + } as DeleteUserSshKeyMetadata; + message.userSshKeyId = + object.userSshKeyId !== undefined && object.userSshKeyId !== null + ? String(object.userSshKeyId) + : ""; + return message; + }, + + toJSON(message: DeleteUserSshKeyMetadata): unknown { + const obj: any = {}; + message.userSshKeyId !== undefined && + (obj.userSshKeyId = message.userSshKeyId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteUserSshKeyMetadata { + const message = { + ...baseDeleteUserSshKeyMetadata, + } as DeleteUserSshKeyMetadata; + message.userSshKeyId = object.userSshKeyId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteUserSshKeyMetadata.$type, + DeleteUserSshKeyMetadata +); + +export const UserSshKeyServiceService = { + get: { + path: "/yandex.cloud.organizationmanager.v1.UserSshKeyService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetUserSshKeyRequest) => + Buffer.from(GetUserSshKeyRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetUserSshKeyRequest.decode(value), + responseSerialize: (value: UserSshKey) => + Buffer.from(UserSshKey.encode(value).finish()), + responseDeserialize: (value: Buffer) => UserSshKey.decode(value), + }, + list: { + path: "/yandex.cloud.organizationmanager.v1.UserSshKeyService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListUserSshKeysRequest) => + Buffer.from(ListUserSshKeysRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListUserSshKeysRequest.decode(value), + responseSerialize: (value: ListUserSshKeysResponse) => + Buffer.from(ListUserSshKeysResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListUserSshKeysResponse.decode(value), + }, + create: { + path: "/yandex.cloud.organizationmanager.v1.UserSshKeyService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateUserSshKeyRequest) => + Buffer.from(CreateUserSshKeyRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CreateUserSshKeyRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + update: { + path: "/yandex.cloud.organizationmanager.v1.UserSshKeyService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateUserSshKeyRequest) => + Buffer.from(UpdateUserSshKeyRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateUserSshKeyRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + delete: { + path: "/yandex.cloud.organizationmanager.v1.UserSshKeyService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteUserSshKeyRequest) => + Buffer.from(DeleteUserSshKeyRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteUserSshKeyRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface UserSshKeyServiceServer extends UntypedServiceImplementation { + get: handleUnaryCall; + list: handleUnaryCall; + create: handleUnaryCall; + update: handleUnaryCall; + delete: handleUnaryCall; +} + +export interface UserSshKeyServiceClient extends Client { + get( + request: GetUserSshKeyRequest, + callback: (error: ServiceError | null, response: UserSshKey) => void + ): ClientUnaryCall; + get( + request: GetUserSshKeyRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: UserSshKey) => void + ): ClientUnaryCall; + get( + request: GetUserSshKeyRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: UserSshKey) => void + ): ClientUnaryCall; + list( + request: ListUserSshKeysRequest, + callback: ( + error: ServiceError | null, + response: ListUserSshKeysResponse + ) => void + ): ClientUnaryCall; + list( + request: ListUserSshKeysRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListUserSshKeysResponse + ) => void + ): ClientUnaryCall; + list( + request: ListUserSshKeysRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListUserSshKeysResponse + ) => void + ): ClientUnaryCall; + create( + request: CreateUserSshKeyRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateUserSshKeyRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateUserSshKeyRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateUserSshKeyRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateUserSshKeyRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateUserSshKeyRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteUserSshKeyRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteUserSshKeyRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteUserSshKeyRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const UserSshKeyServiceClient = makeGenericClientConstructor( + UserSshKeyServiceService, + "yandex.cloud.organizationmanager.v1.UserSshKeyService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): UserSshKeyServiceClient; + service: typeof UserSshKeyServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/resourcemanager/index.ts b/src/generated/yandex/cloud/resourcemanager/index.ts index ec43d8e9..4932b02e 100644 --- a/src/generated/yandex/cloud/resourcemanager/index.ts +++ b/src/generated/yandex/cloud/resourcemanager/index.ts @@ -1,4 +1,4 @@ -export * as cloud from './v1/cloud' -export * as cloud_service from './v1/cloud_service' -export * as folder from './v1/folder' -export * as folder_service from './v1/folder_service' \ No newline at end of file +export * as v1_cloud from './v1/cloud' +export * as v1_cloud_service from './v1/cloud_service' +export * as v1_folder from './v1/folder' +export * as v1_folder_service from './v1/folder_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/resourcemanager/v1/cloud_service.ts b/src/generated/yandex/cloud/resourcemanager/v1/cloud_service.ts index b52298f8..e3c926fc 100644 --- a/src/generated/yandex/cloud/resourcemanager/v1/cloud_service.ts +++ b/src/generated/yandex/cloud/resourcemanager/v1/cloud_service.ts @@ -194,6 +194,9 @@ export interface DeleteCloudMetadata { cloudId: string; /** The timestamp after which the process of deleting the cloud should begin. */ deleteAfter?: Date; + /** Information about operation cancellation */ + cancelledBy: string; + cancelledAt?: Date; } const baseGetCloudRequest: object = { @@ -1291,6 +1294,7 @@ messageTypeRegistry.set(DeleteCloudRequest.$type, DeleteCloudRequest); const baseDeleteCloudMetadata: object = { $type: "yandex.cloud.resourcemanager.v1.DeleteCloudMetadata", cloudId: "", + cancelledBy: "", }; export const DeleteCloudMetadata = { @@ -1309,6 +1313,15 @@ export const DeleteCloudMetadata = { writer.uint32(18).fork() ).ldelim(); } + if (message.cancelledBy !== "") { + writer.uint32(26).string(message.cancelledBy); + } + if (message.cancelledAt !== undefined) { + Timestamp.encode( + toTimestamp(message.cancelledAt), + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -1327,6 +1340,14 @@ export const DeleteCloudMetadata = { Timestamp.decode(reader, reader.uint32()) ); break; + case 3: + message.cancelledBy = reader.string(); + break; + case 4: + message.cancelledAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -1345,6 +1366,14 @@ export const DeleteCloudMetadata = { object.deleteAfter !== undefined && object.deleteAfter !== null ? fromJsonTimestamp(object.deleteAfter) : undefined; + message.cancelledBy = + object.cancelledBy !== undefined && object.cancelledBy !== null + ? String(object.cancelledBy) + : ""; + message.cancelledAt = + object.cancelledAt !== undefined && object.cancelledAt !== null + ? fromJsonTimestamp(object.cancelledAt) + : undefined; return message; }, @@ -1353,6 +1382,10 @@ export const DeleteCloudMetadata = { message.cloudId !== undefined && (obj.cloudId = message.cloudId); message.deleteAfter !== undefined && (obj.deleteAfter = message.deleteAfter.toISOString()); + message.cancelledBy !== undefined && + (obj.cancelledBy = message.cancelledBy); + message.cancelledAt !== undefined && + (obj.cancelledAt = message.cancelledAt.toISOString()); return obj; }, @@ -1362,6 +1395,8 @@ export const DeleteCloudMetadata = { const message = { ...baseDeleteCloudMetadata } as DeleteCloudMetadata; message.cloudId = object.cloudId ?? ""; message.deleteAfter = object.deleteAfter ?? undefined; + message.cancelledBy = object.cancelledBy ?? ""; + message.cancelledAt = object.cancelledAt ?? undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/resourcemanager/v1/folder_service.ts b/src/generated/yandex/cloud/resourcemanager/v1/folder_service.ts index cc16cc4a..536e032d 100644 --- a/src/generated/yandex/cloud/resourcemanager/v1/folder_service.ts +++ b/src/generated/yandex/cloud/resourcemanager/v1/folder_service.ts @@ -168,6 +168,9 @@ export interface DeleteFolderMetadata { folderId: string; /** The timestamp after which the process of deleting the folder should begin. */ deleteAfter?: Date; + /** Information about operation cancellation */ + cancelledBy: string; + cancelledAt?: Date; } export interface ListFolderOperationsRequest { @@ -1110,6 +1113,7 @@ messageTypeRegistry.set(DeleteFolderRequest.$type, DeleteFolderRequest); const baseDeleteFolderMetadata: object = { $type: "yandex.cloud.resourcemanager.v1.DeleteFolderMetadata", folderId: "", + cancelledBy: "", }; export const DeleteFolderMetadata = { @@ -1128,6 +1132,15 @@ export const DeleteFolderMetadata = { writer.uint32(18).fork() ).ldelim(); } + if (message.cancelledBy !== "") { + writer.uint32(26).string(message.cancelledBy); + } + if (message.cancelledAt !== undefined) { + Timestamp.encode( + toTimestamp(message.cancelledAt), + writer.uint32(34).fork() + ).ldelim(); + } return writer; }, @@ -1149,6 +1162,14 @@ export const DeleteFolderMetadata = { Timestamp.decode(reader, reader.uint32()) ); break; + case 3: + message.cancelledBy = reader.string(); + break; + case 4: + message.cancelledAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -1167,6 +1188,14 @@ export const DeleteFolderMetadata = { object.deleteAfter !== undefined && object.deleteAfter !== null ? fromJsonTimestamp(object.deleteAfter) : undefined; + message.cancelledBy = + object.cancelledBy !== undefined && object.cancelledBy !== null + ? String(object.cancelledBy) + : ""; + message.cancelledAt = + object.cancelledAt !== undefined && object.cancelledAt !== null + ? fromJsonTimestamp(object.cancelledAt) + : undefined; return message; }, @@ -1175,6 +1204,10 @@ export const DeleteFolderMetadata = { message.folderId !== undefined && (obj.folderId = message.folderId); message.deleteAfter !== undefined && (obj.deleteAfter = message.deleteAfter.toISOString()); + message.cancelledBy !== undefined && + (obj.cancelledBy = message.cancelledBy); + message.cancelledAt !== undefined && + (obj.cancelledAt = message.cancelledAt.toISOString()); return obj; }, @@ -1184,6 +1217,8 @@ export const DeleteFolderMetadata = { const message = { ...baseDeleteFolderMetadata } as DeleteFolderMetadata; message.folderId = object.folderId ?? ""; message.deleteAfter = object.deleteAfter ?? undefined; + message.cancelledBy = object.cancelledBy ?? ""; + message.cancelledAt = object.cancelledAt ?? undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/serverless/apigateway/v1/apigateway.ts b/src/generated/yandex/cloud/serverless/apigateway/v1/apigateway.ts index c03d8489..43b26e29 100644 --- a/src/generated/yandex/cloud/serverless/apigateway/v1/apigateway.ts +++ b/src/generated/yandex/cloud/serverless/apigateway/v1/apigateway.ts @@ -2,6 +2,7 @@ import { messageTypeRegistry } from "../../../../../typeRegistry"; import Long from "long"; import _m0 from "protobufjs/minimal"; +import { Duration } from "../../../../../google/protobuf/duration"; import { LogLevel_Level, logLevel_LevelFromJSON, @@ -41,6 +42,8 @@ export interface ApiGateway { variables: { [key: string]: VariableInput }; /** Canary release of the gateway. */ canary?: Canary; + /** Timeout for gateway call execution */ + executionTimeout?: Duration; } export enum ApiGateway_Status { @@ -262,6 +265,12 @@ export const ApiGateway = { if (message.canary !== undefined) { Canary.encode(message.canary, writer.uint32(122).fork()).ldelim(); } + if (message.executionTimeout !== undefined) { + Duration.encode( + message.executionTimeout, + writer.uint32(130).fork() + ).ldelim(); + } return writer; }, @@ -330,6 +339,9 @@ export const ApiGateway = { case 15: message.canary = Canary.decode(reader, reader.uint32()); break; + case 16: + message.executionTimeout = Duration.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -397,6 +409,10 @@ export const ApiGateway = { object.canary !== undefined && object.canary !== null ? Canary.fromJSON(object.canary) : undefined; + message.executionTimeout = + object.executionTimeout !== undefined && object.executionTimeout !== null + ? Duration.fromJSON(object.executionTimeout) + : undefined; return message; }, @@ -442,6 +458,10 @@ export const ApiGateway = { } message.canary !== undefined && (obj.canary = message.canary ? Canary.toJSON(message.canary) : undefined); + message.executionTimeout !== undefined && + (obj.executionTimeout = message.executionTimeout + ? Duration.toJSON(message.executionTimeout) + : undefined); return obj; }, @@ -487,6 +507,10 @@ export const ApiGateway = { object.canary !== undefined && object.canary !== null ? Canary.fromPartial(object.canary) : undefined; + message.executionTimeout = + object.executionTimeout !== undefined && object.executionTimeout !== null + ? Duration.fromPartial(object.executionTimeout) + : undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/serverless/apigateway/v1/apigateway_service.ts b/src/generated/yandex/cloud/serverless/apigateway/v1/apigateway_service.ts index d3a8c485..b9cd4ca1 100644 --- a/src/generated/yandex/cloud/serverless/apigateway/v1/apigateway_service.ts +++ b/src/generated/yandex/cloud/serverless/apigateway/v1/apigateway_service.ts @@ -21,6 +21,7 @@ import { VariableInput, ApiGateway, } from "../../../../../yandex/cloud/serverless/apigateway/v1/apigateway"; +import { Duration } from "../../../../../google/protobuf/duration"; import { FieldMask } from "../../../../../google/protobuf/field_mask"; import { Operation } from "../../../../../yandex/cloud/operation/operation"; import { @@ -116,6 +117,8 @@ export interface CreateApiGatewayRequest { variables: { [key: string]: VariableInput }; /** Canary release of the gateway. */ canary?: Canary; + /** Timeout for gateway call execution */ + executionTimeout?: Duration; } export interface CreateApiGatewayRequest_LabelsEntry { @@ -164,6 +167,8 @@ export interface UpdateApiGatewayRequest { variables: { [key: string]: VariableInput }; /** Canary release of the gateway. */ canary?: Canary; + /** Timeout for gateway call execution */ + executionTimeout?: Duration; } export interface UpdateApiGatewayRequest_LabelsEntry { @@ -663,6 +668,12 @@ export const CreateApiGatewayRequest = { if (message.canary !== undefined) { Canary.encode(message.canary, writer.uint32(74).fork()).ldelim(); } + if (message.executionTimeout !== undefined) { + Duration.encode( + message.executionTimeout, + writer.uint32(82).fork() + ).ldelim(); + } return writer; }, @@ -719,6 +730,9 @@ export const CreateApiGatewayRequest = { case 9: message.canary = Canary.decode(reader, reader.uint32()); break; + case 10: + message.executionTimeout = Duration.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -771,6 +785,10 @@ export const CreateApiGatewayRequest = { object.canary !== undefined && object.canary !== null ? Canary.fromJSON(object.canary) : undefined; + message.executionTimeout = + object.executionTimeout !== undefined && object.executionTimeout !== null + ? Duration.fromJSON(object.executionTimeout) + : undefined; return message; }, @@ -804,6 +822,10 @@ export const CreateApiGatewayRequest = { } message.canary !== undefined && (obj.canary = message.canary ? Canary.toJSON(message.canary) : undefined); + message.executionTimeout !== undefined && + (obj.executionTimeout = message.executionTimeout + ? Duration.toJSON(message.executionTimeout) + : undefined); return obj; }, @@ -845,6 +867,10 @@ export const CreateApiGatewayRequest = { object.canary !== undefined && object.canary !== null ? Canary.fromPartial(object.canary) : undefined; + message.executionTimeout = + object.executionTimeout !== undefined && object.executionTimeout !== null + ? Duration.fromPartial(object.executionTimeout) + : undefined; return message; }, }; @@ -1094,6 +1120,12 @@ export const UpdateApiGatewayRequest = { if (message.canary !== undefined) { Canary.encode(message.canary, writer.uint32(82).fork()).ldelim(); } + if (message.executionTimeout !== undefined) { + Duration.encode( + message.executionTimeout, + writer.uint32(90).fork() + ).ldelim(); + } return writer; }, @@ -1153,6 +1185,9 @@ export const UpdateApiGatewayRequest = { case 10: message.canary = Canary.decode(reader, reader.uint32()); break; + case 11: + message.executionTimeout = Duration.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1209,6 +1244,10 @@ export const UpdateApiGatewayRequest = { object.canary !== undefined && object.canary !== null ? Canary.fromJSON(object.canary) : undefined; + message.executionTimeout = + object.executionTimeout !== undefined && object.executionTimeout !== null + ? Duration.fromJSON(object.executionTimeout) + : undefined; return message; }, @@ -1247,6 +1286,10 @@ export const UpdateApiGatewayRequest = { } message.canary !== undefined && (obj.canary = message.canary ? Canary.toJSON(message.canary) : undefined); + message.executionTimeout !== undefined && + (obj.executionTimeout = message.executionTimeout + ? Duration.toJSON(message.executionTimeout) + : undefined); return obj; }, @@ -1292,6 +1335,10 @@ export const UpdateApiGatewayRequest = { object.canary !== undefined && object.canary !== null ? Canary.fromPartial(object.canary) : undefined; + message.executionTimeout = + object.executionTimeout !== undefined && object.executionTimeout !== null + ? Duration.fromPartial(object.executionTimeout) + : undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/serverless/containers/v1/container.ts b/src/generated/yandex/cloud/serverless/containers/v1/container.ts index 66daa67d..98ba768d 100644 --- a/src/generated/yandex/cloud/serverless/containers/v1/container.ts +++ b/src/generated/yandex/cloud/serverless/containers/v1/container.ts @@ -132,8 +132,10 @@ export interface Revision { scalingPolicy?: ScalingPolicy; /** Options for logging from the container. */ logOptions?: LogOptions; - /** S3 mounts to be used by the version. */ + /** S3 mounts to be used by the revision. */ storageMounts: StorageMount[]; + /** Mounts to be used by the revision. */ + mounts: Mount[]; } export enum Revision_Status { @@ -309,6 +311,7 @@ export interface ScalingPolicy { zoneRequestsLimit: number; } +/** @deprecated */ export interface StorageMount { $type: "yandex.cloud.serverless.containers.v1.StorageMount"; /** S3 bucket name for mounting. */ @@ -321,6 +324,75 @@ export interface StorageMount { mountPointPath: string; } +/** Mount contains an information about version's external storage mount */ +export interface Mount { + $type: "yandex.cloud.serverless.containers.v1.Mount"; + /** The absolute mount point path inside the container for mounting. */ + mountPointPath: string; + /** Mount's mode */ + mode: Mount_Mode; + /** Object storage mounts */ + objectStorage?: Mount_ObjectStorage | undefined; + /** Working disk (worker-local non-shared read-write NBS disk templates) */ + ephemeralDiskSpec?: Mount_DiskSpec | undefined; +} + +export enum Mount_Mode { + MODE_UNSPECIFIED = 0, + READ_ONLY = 1, + READ_WRITE = 2, + UNRECOGNIZED = -1, +} + +export function mount_ModeFromJSON(object: any): Mount_Mode { + switch (object) { + case 0: + case "MODE_UNSPECIFIED": + return Mount_Mode.MODE_UNSPECIFIED; + case 1: + case "READ_ONLY": + return Mount_Mode.READ_ONLY; + case 2: + case "READ_WRITE": + return Mount_Mode.READ_WRITE; + case -1: + case "UNRECOGNIZED": + default: + return Mount_Mode.UNRECOGNIZED; + } +} + +export function mount_ModeToJSON(object: Mount_Mode): string { + switch (object) { + case Mount_Mode.MODE_UNSPECIFIED: + return "MODE_UNSPECIFIED"; + case Mount_Mode.READ_ONLY: + return "READ_ONLY"; + case Mount_Mode.READ_WRITE: + return "READ_WRITE"; + default: + return "UNKNOWN"; + } +} + +/** ObjectStorage as a mount */ +export interface Mount_ObjectStorage { + $type: "yandex.cloud.serverless.containers.v1.Mount.ObjectStorage"; + /** ObjectStorage bucket name for mounting. */ + bucketId: string; + /** ObjectStorage bucket prefix for mounting. */ + prefix: string; +} + +/** Disk as a mount */ +export interface Mount_DiskSpec { + $type: "yandex.cloud.serverless.containers.v1.Mount.DiskSpec"; + /** The size of disk for mount in bytes */ + size: number; + /** Optional block size of disk for mount in bytes */ + blockSize: number; +} + const baseContainer: object = { $type: "yandex.cloud.serverless.containers.v1.Container", id: "", @@ -657,6 +729,9 @@ export const Revision = { for (const v of message.storageMounts) { StorageMount.encode(v!, writer.uint32(130).fork()).ldelim(); } + for (const v of message.mounts) { + Mount.encode(v!, writer.uint32(138).fork()).ldelim(); + } return writer; }, @@ -666,6 +741,7 @@ export const Revision = { const message = { ...baseRevision } as Revision; message.secrets = []; message.storageMounts = []; + message.mounts = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -724,6 +800,9 @@ export const Revision = { StorageMount.decode(reader, reader.uint32()) ); break; + case 17: + message.mounts.push(Mount.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -794,6 +873,7 @@ export const Revision = { message.storageMounts = (object.storageMounts ?? []).map((e: any) => StorageMount.fromJSON(e) ); + message.mounts = (object.mounts ?? []).map((e: any) => Mount.fromJSON(e)); return message; }, @@ -852,6 +932,11 @@ export const Revision = { } else { obj.storageMounts = []; } + if (message.mounts) { + obj.mounts = message.mounts.map((e) => (e ? Mount.toJSON(e) : undefined)); + } else { + obj.mounts = []; + } return obj; }, @@ -895,6 +980,7 @@ export const Revision = { : undefined; message.storageMounts = object.storageMounts?.map((e) => StorageMount.fromPartial(e)) || []; + message.mounts = object.mounts?.map((e) => Mount.fromPartial(e)) || []; return message; }, }; @@ -1860,6 +1946,278 @@ export const StorageMount = { messageTypeRegistry.set(StorageMount.$type, StorageMount); +const baseMount: object = { + $type: "yandex.cloud.serverless.containers.v1.Mount", + mountPointPath: "", + mode: 0, +}; + +export const Mount = { + $type: "yandex.cloud.serverless.containers.v1.Mount" as const, + + encode(message: Mount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.mountPointPath !== "") { + writer.uint32(18).string(message.mountPointPath); + } + if (message.mode !== 0) { + writer.uint32(24).int32(message.mode); + } + if (message.objectStorage !== undefined) { + Mount_ObjectStorage.encode( + message.objectStorage, + writer.uint32(82).fork() + ).ldelim(); + } + if (message.ephemeralDiskSpec !== undefined) { + Mount_DiskSpec.encode( + message.ephemeralDiskSpec, + writer.uint32(90).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Mount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMount } as Mount; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.mountPointPath = reader.string(); + break; + case 3: + message.mode = reader.int32() as any; + break; + case 10: + message.objectStorage = Mount_ObjectStorage.decode( + reader, + reader.uint32() + ); + break; + case 11: + message.ephemeralDiskSpec = Mount_DiskSpec.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mount { + const message = { ...baseMount } as Mount; + message.mountPointPath = + object.mountPointPath !== undefined && object.mountPointPath !== null + ? String(object.mountPointPath) + : ""; + message.mode = + object.mode !== undefined && object.mode !== null + ? mount_ModeFromJSON(object.mode) + : 0; + message.objectStorage = + object.objectStorage !== undefined && object.objectStorage !== null + ? Mount_ObjectStorage.fromJSON(object.objectStorage) + : undefined; + message.ephemeralDiskSpec = + object.ephemeralDiskSpec !== undefined && + object.ephemeralDiskSpec !== null + ? Mount_DiskSpec.fromJSON(object.ephemeralDiskSpec) + : undefined; + return message; + }, + + toJSON(message: Mount): unknown { + const obj: any = {}; + message.mountPointPath !== undefined && + (obj.mountPointPath = message.mountPointPath); + message.mode !== undefined && (obj.mode = mount_ModeToJSON(message.mode)); + message.objectStorage !== undefined && + (obj.objectStorage = message.objectStorage + ? Mount_ObjectStorage.toJSON(message.objectStorage) + : undefined); + message.ephemeralDiskSpec !== undefined && + (obj.ephemeralDiskSpec = message.ephemeralDiskSpec + ? Mount_DiskSpec.toJSON(message.ephemeralDiskSpec) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Mount { + const message = { ...baseMount } as Mount; + message.mountPointPath = object.mountPointPath ?? ""; + message.mode = object.mode ?? 0; + message.objectStorage = + object.objectStorage !== undefined && object.objectStorage !== null + ? Mount_ObjectStorage.fromPartial(object.objectStorage) + : undefined; + message.ephemeralDiskSpec = + object.ephemeralDiskSpec !== undefined && + object.ephemeralDiskSpec !== null + ? Mount_DiskSpec.fromPartial(object.ephemeralDiskSpec) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Mount.$type, Mount); + +const baseMount_ObjectStorage: object = { + $type: "yandex.cloud.serverless.containers.v1.Mount.ObjectStorage", + bucketId: "", + prefix: "", +}; + +export const Mount_ObjectStorage = { + $type: "yandex.cloud.serverless.containers.v1.Mount.ObjectStorage" as const, + + encode( + message: Mount_ObjectStorage, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.bucketId !== "") { + writer.uint32(10).string(message.bucketId); + } + if (message.prefix !== "") { + writer.uint32(18).string(message.prefix); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Mount_ObjectStorage { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMount_ObjectStorage } as Mount_ObjectStorage; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bucketId = reader.string(); + break; + case 2: + message.prefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mount_ObjectStorage { + const message = { ...baseMount_ObjectStorage } as Mount_ObjectStorage; + message.bucketId = + object.bucketId !== undefined && object.bucketId !== null + ? String(object.bucketId) + : ""; + message.prefix = + object.prefix !== undefined && object.prefix !== null + ? String(object.prefix) + : ""; + return message; + }, + + toJSON(message: Mount_ObjectStorage): unknown { + const obj: any = {}; + message.bucketId !== undefined && (obj.bucketId = message.bucketId); + message.prefix !== undefined && (obj.prefix = message.prefix); + return obj; + }, + + fromPartial, I>>( + object: I + ): Mount_ObjectStorage { + const message = { ...baseMount_ObjectStorage } as Mount_ObjectStorage; + message.bucketId = object.bucketId ?? ""; + message.prefix = object.prefix ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Mount_ObjectStorage.$type, Mount_ObjectStorage); + +const baseMount_DiskSpec: object = { + $type: "yandex.cloud.serverless.containers.v1.Mount.DiskSpec", + size: 0, + blockSize: 0, +}; + +export const Mount_DiskSpec = { + $type: "yandex.cloud.serverless.containers.v1.Mount.DiskSpec" as const, + + encode( + message: Mount_DiskSpec, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.size !== 0) { + writer.uint32(8).int64(message.size); + } + if (message.blockSize !== 0) { + writer.uint32(16).int64(message.blockSize); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Mount_DiskSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMount_DiskSpec } as Mount_DiskSpec; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.size = longToNumber(reader.int64() as Long); + break; + case 2: + message.blockSize = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mount_DiskSpec { + const message = { ...baseMount_DiskSpec } as Mount_DiskSpec; + message.size = + object.size !== undefined && object.size !== null + ? Number(object.size) + : 0; + message.blockSize = + object.blockSize !== undefined && object.blockSize !== null + ? Number(object.blockSize) + : 0; + return message; + }, + + toJSON(message: Mount_DiskSpec): unknown { + const obj: any = {}; + message.size !== undefined && (obj.size = Math.round(message.size)); + message.blockSize !== undefined && + (obj.blockSize = Math.round(message.blockSize)); + return obj; + }, + + fromPartial, I>>( + object: I + ): Mount_DiskSpec { + const message = { ...baseMount_DiskSpec } as Mount_DiskSpec; + message.size = object.size ?? 0; + message.blockSize = object.blockSize ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Mount_DiskSpec.$type, Mount_DiskSpec); + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/generated/yandex/cloud/serverless/containers/v1/container_service.ts b/src/generated/yandex/cloud/serverless/containers/v1/container_service.ts index 728d858c..d13a3c79 100644 --- a/src/generated/yandex/cloud/serverless/containers/v1/container_service.ts +++ b/src/generated/yandex/cloud/serverless/containers/v1/container_service.ts @@ -27,6 +27,7 @@ import { Revision, Secret, StorageMount, + Mount, } from "../../../../../yandex/cloud/serverless/containers/v1/container"; import { Duration } from "../../../../../google/protobuf/duration"; import { Operation } from "../../../../../yandex/cloud/operation/operation"; @@ -283,8 +284,10 @@ export interface DeployContainerRevisionRequest { scalingPolicy?: ScalingPolicy; /** Options for logging from the container. */ logOptions?: LogOptions; - /** S3 mounts to be used by the version. */ + /** S3 mounts to be used by the revision. */ storageMounts: StorageMount[]; + /** Mounts to be used by the revision. */ + mounts: Mount[]; } /** Revision image specification. */ @@ -1749,6 +1752,9 @@ export const DeployContainerRevisionRequest = { for (const v of message.storageMounts) { StorageMount.encode(v!, writer.uint32(122).fork()).ldelim(); } + for (const v of message.mounts) { + Mount.encode(v!, writer.uint32(130).fork()).ldelim(); + } return writer; }, @@ -1763,6 +1769,7 @@ export const DeployContainerRevisionRequest = { } as DeployContainerRevisionRequest; message.secrets = []; message.storageMounts = []; + message.mounts = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1810,6 +1817,9 @@ export const DeployContainerRevisionRequest = { StorageMount.decode(reader, reader.uint32()) ); break; + case 16: + message.mounts.push(Mount.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -1872,6 +1882,7 @@ export const DeployContainerRevisionRequest = { message.storageMounts = (object.storageMounts ?? []).map((e: any) => StorageMount.fromJSON(e) ); + message.mounts = (object.mounts ?? []).map((e: any) => Mount.fromJSON(e)); return message; }, @@ -1927,6 +1938,11 @@ export const DeployContainerRevisionRequest = { } else { obj.storageMounts = []; } + if (message.mounts) { + obj.mounts = message.mounts.map((e) => (e ? Mount.toJSON(e) : undefined)); + } else { + obj.mounts = []; + } return obj; }, @@ -1971,6 +1987,7 @@ export const DeployContainerRevisionRequest = { : undefined; message.storageMounts = object.storageMounts?.map((e) => StorageMount.fromPartial(e)) || []; + message.mounts = object.mounts?.map((e) => Mount.fromPartial(e)) || []; return message; }, }; diff --git a/src/generated/yandex/cloud/serverless/eventrouter/v1/bus.ts b/src/generated/yandex/cloud/serverless/eventrouter/v1/bus.ts new file mode 100644 index 00000000..7f481c4c --- /dev/null +++ b/src/generated/yandex/cloud/serverless/eventrouter/v1/bus.ts @@ -0,0 +1,398 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.serverless.eventrouter.v1"; + +export interface Bus { + $type: "yandex.cloud.serverless.eventrouter.v1.Bus"; + /** ID of the bus. */ + id: string; + /** ID of the folder that the bus belongs to. */ + folderId: string; + /** ID of the cloud that the bus resides in. */ + cloudId: string; + /** Creation timestamp. */ + createdAt?: Date; + /** Name of the bus. */ + name: string; + /** Description of the bus. */ + description: string; + /** Resource labels as `key:value` pairs. */ + labels: { [key: string]: string }; + /** Deletion protection. */ + deletionProtection: boolean; + /** Status of the bus. */ + status: Bus_Status; +} + +export enum Bus_Status { + STATUS_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + UNRECOGNIZED = -1, +} + +export function bus_StatusFromJSON(object: any): Bus_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return Bus_Status.STATUS_UNSPECIFIED; + case 1: + case "CREATING": + return Bus_Status.CREATING; + case 2: + case "ACTIVE": + return Bus_Status.ACTIVE; + case 3: + case "DELETING": + return Bus_Status.DELETING; + case -1: + case "UNRECOGNIZED": + default: + return Bus_Status.UNRECOGNIZED; + } +} + +export function bus_StatusToJSON(object: Bus_Status): string { + switch (object) { + case Bus_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case Bus_Status.CREATING: + return "CREATING"; + case Bus_Status.ACTIVE: + return "ACTIVE"; + case Bus_Status.DELETING: + return "DELETING"; + default: + return "UNKNOWN"; + } +} + +export interface Bus_LabelsEntry { + $type: "yandex.cloud.serverless.eventrouter.v1.Bus.LabelsEntry"; + key: string; + value: string; +} + +const baseBus: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.Bus", + id: "", + folderId: "", + cloudId: "", + name: "", + description: "", + deletionProtection: false, + status: 0, +}; + +export const Bus = { + $type: "yandex.cloud.serverless.eventrouter.v1.Bus" as const, + + encode(message: Bus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.cloudId !== "") { + writer.uint32(26).string(message.cloudId); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(34).fork() + ).ldelim(); + } + if (message.name !== "") { + writer.uint32(42).string(message.name); + } + if (message.description !== "") { + writer.uint32(50).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + Bus_LabelsEntry.encode( + { + $type: "yandex.cloud.serverless.eventrouter.v1.Bus.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(58).fork() + ).ldelim(); + }); + if (message.deletionProtection === true) { + writer.uint32(64).bool(message.deletionProtection); + } + if (message.status !== 0) { + writer.uint32(72).int32(message.status); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Bus { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBus } as Bus; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.cloudId = reader.string(); + break; + case 4: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 5: + message.name = reader.string(); + break; + case 6: + message.description = reader.string(); + break; + case 7: + const entry7 = Bus_LabelsEntry.decode(reader, reader.uint32()); + if (entry7.value !== undefined) { + message.labels[entry7.key] = entry7.value; + } + break; + case 8: + message.deletionProtection = reader.bool(); + break; + case 9: + message.status = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Bus { + const message = { ...baseBus } as Bus; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.cloudId = + object.cloudId !== undefined && object.cloudId !== null + ? String(object.cloudId) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + message.status = + object.status !== undefined && object.status !== null + ? bus_StatusFromJSON(object.status) + : 0; + return message; + }, + + toJSON(message: Bus): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.cloudId !== undefined && (obj.cloudId = message.cloudId); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + message.status !== undefined && + (obj.status = bus_StatusToJSON(message.status)); + return obj; + }, + + fromPartial, I>>(object: I): Bus { + const message = { ...baseBus } as Bus; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.cloudId = object.cloudId ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.deletionProtection = object.deletionProtection ?? false; + message.status = object.status ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Bus.$type, Bus); + +const baseBus_LabelsEntry: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.Bus.LabelsEntry", + key: "", + value: "", +}; + +export const Bus_LabelsEntry = { + $type: "yandex.cloud.serverless.eventrouter.v1.Bus.LabelsEntry" as const, + + encode( + message: Bus_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Bus_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBus_LabelsEntry } as Bus_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Bus_LabelsEntry { + const message = { ...baseBus_LabelsEntry } as Bus_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Bus_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Bus_LabelsEntry { + const message = { ...baseBus_LabelsEntry } as Bus_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Bus_LabelsEntry.$type, Bus_LabelsEntry); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/serverless/eventrouter/v1/bus_service.ts b/src/generated/yandex/cloud/serverless/eventrouter/v1/bus_service.ts new file mode 100644 index 00000000..11fe2a37 --- /dev/null +++ b/src/generated/yandex/cloud/serverless/eventrouter/v1/bus_service.ts @@ -0,0 +1,1730 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; +import { Bus } from "../../../../../yandex/cloud/serverless/eventrouter/v1/bus"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../../yandex/cloud/access/access"; + +export const protobufPackage = "yandex.cloud.serverless.eventrouter.v1"; + +export interface GetBusRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.GetBusRequest"; + /** ID of the bus to get. */ + busId: string; +} + +export interface ListBusesRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.ListBusesRequest"; + /** ID of the folder to list buses in. */ + folderId: string; + /** Maximum number of buses to return. */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * [ListBusesResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * Supported fields for filter: + * name + * created_at + */ + filter: string; +} + +export interface ListBusesResponse { + $type: "yandex.cloud.serverless.eventrouter.v1.ListBusesResponse"; + /** List of buses. */ + buses: Bus[]; + /** Token for getting the next page of the list of buses. */ + nextPageToken: string; +} + +export interface CreateBusRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateBusRequest"; + /** ID of the folder to create a bus in. */ + folderId: string; + /** Name of the bus. */ + name: string; + /** Description of the bus. */ + description: string; + /** Labels for the bus. */ + labels: { [key: string]: string }; + /** Flag that disallow deletion of the bus. */ + deletionProtection: boolean; +} + +export interface CreateBusRequest_LabelsEntry { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateBusRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface CreateBusMetadata { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateBusMetadata"; + /** ID of the bus that is being created. */ + busId: string; + /** ID of the folder that the bus is being created in. */ + folderId: string; +} + +export interface UpdateBusRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateBusRequest"; + /** ID of the bus to update. */ + busId: string; + /** Field mask that specifies which fields of the bus are going to be updated. */ + updateMask?: FieldMask; + /** New name of the bus. */ + name: string; + /** New description of the bus. */ + description: string; + /** New labels of the bus. */ + labels: { [key: string]: string }; + /** New flag that disallow deletion of the bus. */ + deletionProtection: boolean; +} + +export interface UpdateBusRequest_LabelsEntry { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateBusRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateBusMetadata { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateBusMetadata"; + /** ID of the bus that is being updated. */ + busId: string; +} + +export interface DeleteBusRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteBusRequest"; + /** ID of the bus to delete. */ + busId: string; +} + +export interface DeleteBusMetadata { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteBusMetadata"; + /** ID of the bus that is being deleted. */ + busId: string; +} + +export interface ListBusOperationsRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.ListBusOperationsRequest"; + /** ID of the bus to list operations for. */ + busId: string; + /** Maximum number of operations to return. */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * [ListBusesResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * Supported attributes for filter: + * description + * created_at + * modified_at + * created_by + * done + */ + filter: string; +} + +export interface ListBusOperationsResponse { + $type: "yandex.cloud.serverless.eventrouter.v1.ListBusOperationsResponse"; + /** List of operations for the specified bus. */ + operations: Operation[]; + /** Token for getting the next page of the list of operations. */ + nextPageToken: string; +} + +const baseGetBusRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.GetBusRequest", + busId: "", +}; + +export const GetBusRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.GetBusRequest" as const, + + encode( + message: GetBusRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.busId !== "") { + writer.uint32(10).string(message.busId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetBusRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetBusRequest } as GetBusRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.busId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetBusRequest { + const message = { ...baseGetBusRequest } as GetBusRequest; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + return message; + }, + + toJSON(message: GetBusRequest): unknown { + const obj: any = {}; + message.busId !== undefined && (obj.busId = message.busId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetBusRequest { + const message = { ...baseGetBusRequest } as GetBusRequest; + message.busId = object.busId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetBusRequest.$type, GetBusRequest); + +const baseListBusesRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListBusesRequest", + folderId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListBusesRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListBusesRequest" as const, + + encode( + message: ListBusesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListBusesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListBusesRequest } as ListBusesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListBusesRequest { + const message = { ...baseListBusesRequest } as ListBusesRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListBusesRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListBusesRequest { + const message = { ...baseListBusesRequest } as ListBusesRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListBusesRequest.$type, ListBusesRequest); + +const baseListBusesResponse: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListBusesResponse", + nextPageToken: "", +}; + +export const ListBusesResponse = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListBusesResponse" as const, + + encode( + message: ListBusesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.buses) { + Bus.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListBusesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListBusesResponse } as ListBusesResponse; + message.buses = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.buses.push(Bus.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListBusesResponse { + const message = { ...baseListBusesResponse } as ListBusesResponse; + message.buses = (object.buses ?? []).map((e: any) => Bus.fromJSON(e)); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListBusesResponse): unknown { + const obj: any = {}; + if (message.buses) { + obj.buses = message.buses.map((e) => (e ? Bus.toJSON(e) : undefined)); + } else { + obj.buses = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListBusesResponse { + const message = { ...baseListBusesResponse } as ListBusesResponse; + message.buses = object.buses?.map((e) => Bus.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListBusesResponse.$type, ListBusesResponse); + +const baseCreateBusRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateBusRequest", + folderId: "", + name: "", + description: "", + deletionProtection: false, +}; + +export const CreateBusRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateBusRequest" as const, + + encode( + message: CreateBusRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateBusRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.serverless.eventrouter.v1.CreateBusRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(34).fork() + ).ldelim(); + }); + if (message.deletionProtection === true) { + writer.uint32(40).bool(message.deletionProtection); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateBusRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateBusRequest } as CreateBusRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + const entry4 = CreateBusRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry4.value !== undefined) { + message.labels[entry4.key] = entry4.value; + } + break; + case 5: + message.deletionProtection = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateBusRequest { + const message = { ...baseCreateBusRequest } as CreateBusRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + return message; + }, + + toJSON(message: CreateBusRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateBusRequest { + const message = { ...baseCreateBusRequest } as CreateBusRequest; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.deletionProtection = object.deletionProtection ?? false; + return message; + }, +}; + +messageTypeRegistry.set(CreateBusRequest.$type, CreateBusRequest); + +const baseCreateBusRequest_LabelsEntry: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateBusRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateBusRequest_LabelsEntry = { + $type: + "yandex.cloud.serverless.eventrouter.v1.CreateBusRequest.LabelsEntry" as const, + + encode( + message: CreateBusRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateBusRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateBusRequest_LabelsEntry, + } as CreateBusRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateBusRequest_LabelsEntry { + const message = { + ...baseCreateBusRequest_LabelsEntry, + } as CreateBusRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateBusRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateBusRequest_LabelsEntry { + const message = { + ...baseCreateBusRequest_LabelsEntry, + } as CreateBusRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateBusRequest_LabelsEntry.$type, + CreateBusRequest_LabelsEntry +); + +const baseCreateBusMetadata: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateBusMetadata", + busId: "", + folderId: "", +}; + +export const CreateBusMetadata = { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateBusMetadata" as const, + + encode( + message: CreateBusMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.busId !== "") { + writer.uint32(10).string(message.busId); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateBusMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateBusMetadata } as CreateBusMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.busId = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateBusMetadata { + const message = { ...baseCreateBusMetadata } as CreateBusMetadata; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + return message; + }, + + toJSON(message: CreateBusMetadata): unknown { + const obj: any = {}; + message.busId !== undefined && (obj.busId = message.busId); + message.folderId !== undefined && (obj.folderId = message.folderId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateBusMetadata { + const message = { ...baseCreateBusMetadata } as CreateBusMetadata; + message.busId = object.busId ?? ""; + message.folderId = object.folderId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateBusMetadata.$type, CreateBusMetadata); + +const baseUpdateBusRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateBusRequest", + busId: "", + name: "", + description: "", + deletionProtection: false, +}; + +export const UpdateBusRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateBusRequest" as const, + + encode( + message: UpdateBusRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.busId !== "") { + writer.uint32(10).string(message.busId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateBusRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.serverless.eventrouter.v1.UpdateBusRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(42).fork() + ).ldelim(); + }); + if (message.deletionProtection === true) { + writer.uint32(48).bool(message.deletionProtection); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateBusRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateBusRequest } as UpdateBusRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.busId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + const entry5 = UpdateBusRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry5.value !== undefined) { + message.labels[entry5.key] = entry5.value; + } + break; + case 6: + message.deletionProtection = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateBusRequest { + const message = { ...baseUpdateBusRequest } as UpdateBusRequest; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + return message; + }, + + toJSON(message: UpdateBusRequest): unknown { + const obj: any = {}; + message.busId !== undefined && (obj.busId = message.busId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateBusRequest { + const message = { ...baseUpdateBusRequest } as UpdateBusRequest; + message.busId = object.busId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.deletionProtection = object.deletionProtection ?? false; + return message; + }, +}; + +messageTypeRegistry.set(UpdateBusRequest.$type, UpdateBusRequest); + +const baseUpdateBusRequest_LabelsEntry: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateBusRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateBusRequest_LabelsEntry = { + $type: + "yandex.cloud.serverless.eventrouter.v1.UpdateBusRequest.LabelsEntry" as const, + + encode( + message: UpdateBusRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateBusRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateBusRequest_LabelsEntry, + } as UpdateBusRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateBusRequest_LabelsEntry { + const message = { + ...baseUpdateBusRequest_LabelsEntry, + } as UpdateBusRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateBusRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateBusRequest_LabelsEntry { + const message = { + ...baseUpdateBusRequest_LabelsEntry, + } as UpdateBusRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateBusRequest_LabelsEntry.$type, + UpdateBusRequest_LabelsEntry +); + +const baseUpdateBusMetadata: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateBusMetadata", + busId: "", +}; + +export const UpdateBusMetadata = { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateBusMetadata" as const, + + encode( + message: UpdateBusMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.busId !== "") { + writer.uint32(10).string(message.busId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateBusMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateBusMetadata } as UpdateBusMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.busId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateBusMetadata { + const message = { ...baseUpdateBusMetadata } as UpdateBusMetadata; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + return message; + }, + + toJSON(message: UpdateBusMetadata): unknown { + const obj: any = {}; + message.busId !== undefined && (obj.busId = message.busId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateBusMetadata { + const message = { ...baseUpdateBusMetadata } as UpdateBusMetadata; + message.busId = object.busId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateBusMetadata.$type, UpdateBusMetadata); + +const baseDeleteBusRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteBusRequest", + busId: "", +}; + +export const DeleteBusRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteBusRequest" as const, + + encode( + message: DeleteBusRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.busId !== "") { + writer.uint32(10).string(message.busId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteBusRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteBusRequest } as DeleteBusRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.busId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteBusRequest { + const message = { ...baseDeleteBusRequest } as DeleteBusRequest; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + return message; + }, + + toJSON(message: DeleteBusRequest): unknown { + const obj: any = {}; + message.busId !== undefined && (obj.busId = message.busId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteBusRequest { + const message = { ...baseDeleteBusRequest } as DeleteBusRequest; + message.busId = object.busId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteBusRequest.$type, DeleteBusRequest); + +const baseDeleteBusMetadata: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteBusMetadata", + busId: "", +}; + +export const DeleteBusMetadata = { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteBusMetadata" as const, + + encode( + message: DeleteBusMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.busId !== "") { + writer.uint32(10).string(message.busId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteBusMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteBusMetadata } as DeleteBusMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.busId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteBusMetadata { + const message = { ...baseDeleteBusMetadata } as DeleteBusMetadata; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + return message; + }, + + toJSON(message: DeleteBusMetadata): unknown { + const obj: any = {}; + message.busId !== undefined && (obj.busId = message.busId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteBusMetadata { + const message = { ...baseDeleteBusMetadata } as DeleteBusMetadata; + message.busId = object.busId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteBusMetadata.$type, DeleteBusMetadata); + +const baseListBusOperationsRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListBusOperationsRequest", + busId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListBusOperationsRequest = { + $type: + "yandex.cloud.serverless.eventrouter.v1.ListBusOperationsRequest" as const, + + encode( + message: ListBusOperationsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.busId !== "") { + writer.uint32(10).string(message.busId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListBusOperationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListBusOperationsRequest, + } as ListBusOperationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.busId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListBusOperationsRequest { + const message = { + ...baseListBusOperationsRequest, + } as ListBusOperationsRequest; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListBusOperationsRequest): unknown { + const obj: any = {}; + message.busId !== undefined && (obj.busId = message.busId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListBusOperationsRequest { + const message = { + ...baseListBusOperationsRequest, + } as ListBusOperationsRequest; + message.busId = object.busId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListBusOperationsRequest.$type, + ListBusOperationsRequest +); + +const baseListBusOperationsResponse: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListBusOperationsResponse", + nextPageToken: "", +}; + +export const ListBusOperationsResponse = { + $type: + "yandex.cloud.serverless.eventrouter.v1.ListBusOperationsResponse" as const, + + encode( + message: ListBusOperationsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.operations) { + Operation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListBusOperationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListBusOperationsResponse, + } as ListBusOperationsResponse; + message.operations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operations.push(Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListBusOperationsResponse { + const message = { + ...baseListBusOperationsResponse, + } as ListBusOperationsResponse; + message.operations = (object.operations ?? []).map((e: any) => + Operation.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListBusOperationsResponse): unknown { + const obj: any = {}; + if (message.operations) { + obj.operations = message.operations.map((e) => + e ? Operation.toJSON(e) : undefined + ); + } else { + obj.operations = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListBusOperationsResponse { + const message = { + ...baseListBusOperationsResponse, + } as ListBusOperationsResponse; + message.operations = + object.operations?.map((e) => Operation.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListBusOperationsResponse.$type, + ListBusOperationsResponse +); + +/** A set of methods for managing buses for serverless eventrouter. */ +export const BusServiceService = { + /** + * Returns the specified bus. + * To get the list of all available buses, make a [List] request. + */ + get: { + path: "/yandex.cloud.serverless.eventrouter.v1.BusService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetBusRequest) => + Buffer.from(GetBusRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetBusRequest.decode(value), + responseSerialize: (value: Bus) => Buffer.from(Bus.encode(value).finish()), + responseDeserialize: (value: Buffer) => Bus.decode(value), + }, + /** Retrieves the list of buses in the specified folder. */ + list: { + path: "/yandex.cloud.serverless.eventrouter.v1.BusService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListBusesRequest) => + Buffer.from(ListBusesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListBusesRequest.decode(value), + responseSerialize: (value: ListBusesResponse) => + Buffer.from(ListBusesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListBusesResponse.decode(value), + }, + /** Creates a bus in the specified folder. */ + create: { + path: "/yandex.cloud.serverless.eventrouter.v1.BusService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateBusRequest) => + Buffer.from(CreateBusRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateBusRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates the specified bus. */ + update: { + path: "/yandex.cloud.serverless.eventrouter.v1.BusService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateBusRequest) => + Buffer.from(UpdateBusRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateBusRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes the specified bus. */ + delete: { + path: "/yandex.cloud.serverless.eventrouter.v1.BusService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteBusRequest) => + Buffer.from(DeleteBusRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteBusRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Lists operations for the specified bus. */ + listOperations: { + path: "/yandex.cloud.serverless.eventrouter.v1.BusService/ListOperations", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListBusOperationsRequest) => + Buffer.from(ListBusOperationsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListBusOperationsRequest.decode(value), + responseSerialize: (value: ListBusOperationsResponse) => + Buffer.from(ListBusOperationsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListBusOperationsResponse.decode(value), + }, + /** Lists existing access bindings for the specified bus. */ + listAccessBindings: { + path: "/yandex.cloud.serverless.eventrouter.v1.BusService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the bus. */ + setAccessBindings: { + path: "/yandex.cloud.serverless.eventrouter.v1.BusService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the specified bus. */ + updateAccessBindings: { + path: "/yandex.cloud.serverless.eventrouter.v1.BusService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface BusServiceServer extends UntypedServiceImplementation { + /** + * Returns the specified bus. + * To get the list of all available buses, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of buses in the specified folder. */ + list: handleUnaryCall; + /** Creates a bus in the specified folder. */ + create: handleUnaryCall; + /** Updates the specified bus. */ + update: handleUnaryCall; + /** Deletes the specified bus. */ + delete: handleUnaryCall; + /** Lists operations for the specified bus. */ + listOperations: handleUnaryCall< + ListBusOperationsRequest, + ListBusOperationsResponse + >; + /** Lists existing access bindings for the specified bus. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the bus. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the specified bus. */ + updateAccessBindings: handleUnaryCall; +} + +export interface BusServiceClient extends Client { + /** + * Returns the specified bus. + * To get the list of all available buses, make a [List] request. + */ + get( + request: GetBusRequest, + callback: (error: ServiceError | null, response: Bus) => void + ): ClientUnaryCall; + get( + request: GetBusRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Bus) => void + ): ClientUnaryCall; + get( + request: GetBusRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Bus) => void + ): ClientUnaryCall; + /** Retrieves the list of buses in the specified folder. */ + list( + request: ListBusesRequest, + callback: (error: ServiceError | null, response: ListBusesResponse) => void + ): ClientUnaryCall; + list( + request: ListBusesRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: ListBusesResponse) => void + ): ClientUnaryCall; + list( + request: ListBusesRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: ListBusesResponse) => void + ): ClientUnaryCall; + /** Creates a bus in the specified folder. */ + create( + request: CreateBusRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateBusRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateBusRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates the specified bus. */ + update( + request: UpdateBusRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateBusRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateBusRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes the specified bus. */ + delete( + request: DeleteBusRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteBusRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteBusRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Lists operations for the specified bus. */ + listOperations( + request: ListBusOperationsRequest, + callback: ( + error: ServiceError | null, + response: ListBusOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListBusOperationsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListBusOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListBusOperationsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListBusOperationsResponse + ) => void + ): ClientUnaryCall; + /** Lists existing access bindings for the specified bus. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the bus. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the specified bus. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const BusServiceClient = makeGenericClientConstructor( + BusServiceService, + "yandex.cloud.serverless.eventrouter.v1.BusService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): BusServiceClient; + service: typeof BusServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/serverless/eventrouter/v1/connector.ts b/src/generated/yandex/cloud/serverless/eventrouter/v1/connector.ts new file mode 100644 index 00000000..32e99a58 --- /dev/null +++ b/src/generated/yandex/cloud/serverless/eventrouter/v1/connector.ts @@ -0,0 +1,836 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Duration } from "../../../../../google/protobuf/duration"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.serverless.eventrouter.v1"; + +export interface Connector { + $type: "yandex.cloud.serverless.eventrouter.v1.Connector"; + /** ID of the connector. */ + id: string; + /** ID of the bus that the connector belongs to. */ + busId: string; + /** ID of the folder that the connector resides in. */ + folderId: string; + /** ID of the cloud that the connector resides in. */ + cloudId: string; + /** Creation timestamp. */ + createdAt?: Date; + /** Name of the connector. */ + name: string; + /** Description of the connector. */ + description: string; + /** Resource labels as `key:value` pairs. */ + labels: { [key: string]: string }; + /** Source of the connector. */ + source?: Source; + /** Deletion protection. */ + deletionProtection: boolean; + /** Status of the connector. */ + status: Connector_Status; +} + +/** Status of the connector. */ +export enum Connector_Status { + STATUS_UNSPECIFIED = 0, + RUNNING = 1, + /** STOPPED - disabled by user */ + STOPPED = 2, + /** RESOURCE_NOT_FOUND - source does not exist */ + RESOURCE_NOT_FOUND = 3, + /** PERMISSION_DENIED - service account does not have read permission on source */ + PERMISSION_DENIED = 4, + /** SUBJECT_NOT_FOUND - service account not found */ + SUBJECT_NOT_FOUND = 5, + UNRECOGNIZED = -1, +} + +export function connector_StatusFromJSON(object: any): Connector_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return Connector_Status.STATUS_UNSPECIFIED; + case 1: + case "RUNNING": + return Connector_Status.RUNNING; + case 2: + case "STOPPED": + return Connector_Status.STOPPED; + case 3: + case "RESOURCE_NOT_FOUND": + return Connector_Status.RESOURCE_NOT_FOUND; + case 4: + case "PERMISSION_DENIED": + return Connector_Status.PERMISSION_DENIED; + case 5: + case "SUBJECT_NOT_FOUND": + return Connector_Status.SUBJECT_NOT_FOUND; + case -1: + case "UNRECOGNIZED": + default: + return Connector_Status.UNRECOGNIZED; + } +} + +export function connector_StatusToJSON(object: Connector_Status): string { + switch (object) { + case Connector_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case Connector_Status.RUNNING: + return "RUNNING"; + case Connector_Status.STOPPED: + return "STOPPED"; + case Connector_Status.RESOURCE_NOT_FOUND: + return "RESOURCE_NOT_FOUND"; + case Connector_Status.PERMISSION_DENIED: + return "PERMISSION_DENIED"; + case Connector_Status.SUBJECT_NOT_FOUND: + return "SUBJECT_NOT_FOUND"; + default: + return "UNKNOWN"; + } +} + +export interface Connector_LabelsEntry { + $type: "yandex.cloud.serverless.eventrouter.v1.Connector.LabelsEntry"; + key: string; + value: string; +} + +export interface Source { + $type: "yandex.cloud.serverless.eventrouter.v1.Source"; + dataStream?: DataStream | undefined; + messageQueue?: MessageQueue | undefined; +} + +export interface DataStream { + $type: "yandex.cloud.serverless.eventrouter.v1.DataStream"; + /** + * Stream database. + * example: /ru-central1/aoegtvhtp8ob******** /cc8004q4lbo6******** + */ + database: string; + /** Stream name, absolute or relative. */ + streamName: string; + /** Consumer name. */ + consumer: string; + /** Service account which has read permission on the stream. */ + serviceAccountId: string; +} + +export interface MessageQueue { + $type: "yandex.cloud.serverless.eventrouter.v1.MessageQueue"; + /** + * Queue ARN. + * Example: yrn:yc:ymq:ru-central1:aoe***:test + */ + queueArn: string; + /** Service account which has read access to the queue. */ + serviceAccountId: string; + /** Queue visibility timeout override. */ + visibilityTimeout?: Duration; + /** Batch size for polling. */ + batchSize: number; + /** Queue polling timeout. */ + pollingTimeout?: Duration; +} + +const baseConnector: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.Connector", + id: "", + busId: "", + folderId: "", + cloudId: "", + name: "", + description: "", + deletionProtection: false, + status: 0, +}; + +export const Connector = { + $type: "yandex.cloud.serverless.eventrouter.v1.Connector" as const, + + encode( + message: Connector, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.busId !== "") { + writer.uint32(18).string(message.busId); + } + if (message.folderId !== "") { + writer.uint32(26).string(message.folderId); + } + if (message.cloudId !== "") { + writer.uint32(34).string(message.cloudId); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.name !== "") { + writer.uint32(50).string(message.name); + } + if (message.description !== "") { + writer.uint32(58).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + Connector_LabelsEntry.encode( + { + $type: "yandex.cloud.serverless.eventrouter.v1.Connector.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(66).fork() + ).ldelim(); + }); + if (message.source !== undefined) { + Source.encode(message.source, writer.uint32(74).fork()).ldelim(); + } + if (message.deletionProtection === true) { + writer.uint32(80).bool(message.deletionProtection); + } + if (message.status !== 0) { + writer.uint32(88).int32(message.status); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Connector { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConnector } as Connector; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.busId = reader.string(); + break; + case 3: + message.folderId = reader.string(); + break; + case 4: + message.cloudId = reader.string(); + break; + case 5: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + message.name = reader.string(); + break; + case 7: + message.description = reader.string(); + break; + case 8: + const entry8 = Connector_LabelsEntry.decode(reader, reader.uint32()); + if (entry8.value !== undefined) { + message.labels[entry8.key] = entry8.value; + } + break; + case 9: + message.source = Source.decode(reader, reader.uint32()); + break; + case 10: + message.deletionProtection = reader.bool(); + break; + case 11: + message.status = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Connector { + const message = { ...baseConnector } as Connector; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.cloudId = + object.cloudId !== undefined && object.cloudId !== null + ? String(object.cloudId) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.source = + object.source !== undefined && object.source !== null + ? Source.fromJSON(object.source) + : undefined; + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + message.status = + object.status !== undefined && object.status !== null + ? connector_StatusFromJSON(object.status) + : 0; + return message; + }, + + toJSON(message: Connector): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.busId !== undefined && (obj.busId = message.busId); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.cloudId !== undefined && (obj.cloudId = message.cloudId); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.source !== undefined && + (obj.source = message.source ? Source.toJSON(message.source) : undefined); + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + message.status !== undefined && + (obj.status = connector_StatusToJSON(message.status)); + return obj; + }, + + fromPartial, I>>( + object: I + ): Connector { + const message = { ...baseConnector } as Connector; + message.id = object.id ?? ""; + message.busId = object.busId ?? ""; + message.folderId = object.folderId ?? ""; + message.cloudId = object.cloudId ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.source = + object.source !== undefined && object.source !== null + ? Source.fromPartial(object.source) + : undefined; + message.deletionProtection = object.deletionProtection ?? false; + message.status = object.status ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Connector.$type, Connector); + +const baseConnector_LabelsEntry: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.Connector.LabelsEntry", + key: "", + value: "", +}; + +export const Connector_LabelsEntry = { + $type: + "yandex.cloud.serverless.eventrouter.v1.Connector.LabelsEntry" as const, + + encode( + message: Connector_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Connector_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConnector_LabelsEntry } as Connector_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Connector_LabelsEntry { + const message = { ...baseConnector_LabelsEntry } as Connector_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Connector_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Connector_LabelsEntry { + const message = { ...baseConnector_LabelsEntry } as Connector_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Connector_LabelsEntry.$type, Connector_LabelsEntry); + +const baseSource: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.Source", +}; + +export const Source = { + $type: "yandex.cloud.serverless.eventrouter.v1.Source" as const, + + encode( + message: Source, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.dataStream !== undefined) { + DataStream.encode(message.dataStream, writer.uint32(10).fork()).ldelim(); + } + if (message.messageQueue !== undefined) { + MessageQueue.encode( + message.messageQueue, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Source { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSource } as Source; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataStream = DataStream.decode(reader, reader.uint32()); + break; + case 2: + message.messageQueue = MessageQueue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Source { + const message = { ...baseSource } as Source; + message.dataStream = + object.dataStream !== undefined && object.dataStream !== null + ? DataStream.fromJSON(object.dataStream) + : undefined; + message.messageQueue = + object.messageQueue !== undefined && object.messageQueue !== null + ? MessageQueue.fromJSON(object.messageQueue) + : undefined; + return message; + }, + + toJSON(message: Source): unknown { + const obj: any = {}; + message.dataStream !== undefined && + (obj.dataStream = message.dataStream + ? DataStream.toJSON(message.dataStream) + : undefined); + message.messageQueue !== undefined && + (obj.messageQueue = message.messageQueue + ? MessageQueue.toJSON(message.messageQueue) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Source { + const message = { ...baseSource } as Source; + message.dataStream = + object.dataStream !== undefined && object.dataStream !== null + ? DataStream.fromPartial(object.dataStream) + : undefined; + message.messageQueue = + object.messageQueue !== undefined && object.messageQueue !== null + ? MessageQueue.fromPartial(object.messageQueue) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Source.$type, Source); + +const baseDataStream: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.DataStream", + database: "", + streamName: "", + consumer: "", + serviceAccountId: "", +}; + +export const DataStream = { + $type: "yandex.cloud.serverless.eventrouter.v1.DataStream" as const, + + encode( + message: DataStream, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.database !== "") { + writer.uint32(10).string(message.database); + } + if (message.streamName !== "") { + writer.uint32(18).string(message.streamName); + } + if (message.consumer !== "") { + writer.uint32(26).string(message.consumer); + } + if (message.serviceAccountId !== "") { + writer.uint32(34).string(message.serviceAccountId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DataStream { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDataStream } as DataStream; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.database = reader.string(); + break; + case 2: + message.streamName = reader.string(); + break; + case 3: + message.consumer = reader.string(); + break; + case 4: + message.serviceAccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DataStream { + const message = { ...baseDataStream } as DataStream; + message.database = + object.database !== undefined && object.database !== null + ? String(object.database) + : ""; + message.streamName = + object.streamName !== undefined && object.streamName !== null + ? String(object.streamName) + : ""; + message.consumer = + object.consumer !== undefined && object.consumer !== null + ? String(object.consumer) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + return message; + }, + + toJSON(message: DataStream): unknown { + const obj: any = {}; + message.database !== undefined && (obj.database = message.database); + message.streamName !== undefined && (obj.streamName = message.streamName); + message.consumer !== undefined && (obj.consumer = message.consumer); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DataStream { + const message = { ...baseDataStream } as DataStream; + message.database = object.database ?? ""; + message.streamName = object.streamName ?? ""; + message.consumer = object.consumer ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DataStream.$type, DataStream); + +const baseMessageQueue: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.MessageQueue", + queueArn: "", + serviceAccountId: "", + batchSize: 0, +}; + +export const MessageQueue = { + $type: "yandex.cloud.serverless.eventrouter.v1.MessageQueue" as const, + + encode( + message: MessageQueue, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.queueArn !== "") { + writer.uint32(10).string(message.queueArn); + } + if (message.serviceAccountId !== "") { + writer.uint32(18).string(message.serviceAccountId); + } + if (message.visibilityTimeout !== undefined) { + Duration.encode( + message.visibilityTimeout, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.batchSize !== 0) { + writer.uint32(32).int64(message.batchSize); + } + if (message.pollingTimeout !== undefined) { + Duration.encode( + message.pollingTimeout, + writer.uint32(42).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MessageQueue { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessageQueue } as MessageQueue; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.queueArn = reader.string(); + break; + case 2: + message.serviceAccountId = reader.string(); + break; + case 3: + message.visibilityTimeout = Duration.decode(reader, reader.uint32()); + break; + case 4: + message.batchSize = longToNumber(reader.int64() as Long); + break; + case 5: + message.pollingTimeout = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MessageQueue { + const message = { ...baseMessageQueue } as MessageQueue; + message.queueArn = + object.queueArn !== undefined && object.queueArn !== null + ? String(object.queueArn) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.visibilityTimeout = + object.visibilityTimeout !== undefined && + object.visibilityTimeout !== null + ? Duration.fromJSON(object.visibilityTimeout) + : undefined; + message.batchSize = + object.batchSize !== undefined && object.batchSize !== null + ? Number(object.batchSize) + : 0; + message.pollingTimeout = + object.pollingTimeout !== undefined && object.pollingTimeout !== null + ? Duration.fromJSON(object.pollingTimeout) + : undefined; + return message; + }, + + toJSON(message: MessageQueue): unknown { + const obj: any = {}; + message.queueArn !== undefined && (obj.queueArn = message.queueArn); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.visibilityTimeout !== undefined && + (obj.visibilityTimeout = message.visibilityTimeout + ? Duration.toJSON(message.visibilityTimeout) + : undefined); + message.batchSize !== undefined && + (obj.batchSize = Math.round(message.batchSize)); + message.pollingTimeout !== undefined && + (obj.pollingTimeout = message.pollingTimeout + ? Duration.toJSON(message.pollingTimeout) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): MessageQueue { + const message = { ...baseMessageQueue } as MessageQueue; + message.queueArn = object.queueArn ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.visibilityTimeout = + object.visibilityTimeout !== undefined && + object.visibilityTimeout !== null + ? Duration.fromPartial(object.visibilityTimeout) + : undefined; + message.batchSize = object.batchSize ?? 0; + message.pollingTimeout = + object.pollingTimeout !== undefined && object.pollingTimeout !== null + ? Duration.fromPartial(object.pollingTimeout) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(MessageQueue.$type, MessageQueue); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/serverless/eventrouter/v1/connector_service.ts b/src/generated/yandex/cloud/serverless/eventrouter/v1/connector_service.ts new file mode 100644 index 00000000..fd39305c --- /dev/null +++ b/src/generated/yandex/cloud/serverless/eventrouter/v1/connector_service.ts @@ -0,0 +1,2192 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + Source, + Connector, +} from "../../../../../yandex/cloud/serverless/eventrouter/v1/connector"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../../yandex/cloud/access/access"; + +export const protobufPackage = "yandex.cloud.serverless.eventrouter.v1"; + +export interface GetConnectorRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.GetConnectorRequest"; + /** ID of the connector to return. */ + connectorId: string; +} + +export interface ListConnectorsRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.ListConnectorsRequest"; + /** ID of the bus to list connectors in. */ + busId: string | undefined; + /** ID of the folder to list connectors in. */ + folderId: string | undefined; + /** The maximum number of results per response. */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * `next_page_token` returned by a previous list request. + */ + pageToken: string; + /** + * Supported fields for filter: + * name + * created_at + */ + filter: string; +} + +export interface ListConnectorsResponse { + $type: "yandex.cloud.serverless.eventrouter.v1.ListConnectorsResponse"; + /** List of connectors. */ + connectors: Connector[]; + /** Token for getting the next page of the list of results. */ + nextPageToken: string; +} + +export interface CreateConnectorRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateConnectorRequest"; + /** ID of the bus to create a connector in. */ + busId: string; + /** Name of the connector. */ + name: string; + /** Description of the connector. */ + description: string; + /** Labels for the connector. */ + labels: { [key: string]: string }; + /** Source of the connector. */ + source?: Source; + /** Flag that disallow deletion of the connector. */ + deletionProtection: boolean; +} + +export interface CreateConnectorRequest_LabelsEntry { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateConnectorRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface CreateConnectorMetadata { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateConnectorMetadata"; + /** ID of the connector that is being created. */ + connectorId: string; + /** ID of the bus that the connector is created in. */ + busId: string; +} + +export interface UpdateConnectorRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateConnectorRequest"; + /** ID of the connector to update. */ + connectorId: string; + /** Field mask that specifies which fields of the connector are going to be updated. */ + updateMask?: FieldMask; + /** New name of the connector. */ + name: string; + /** New description of the connector. */ + description: string; + /** New labels of the connector. */ + labels: { [key: string]: string }; + /** New flag that disallow deletion of the connector. */ + deletionProtection: boolean; +} + +export interface UpdateConnectorRequest_LabelsEntry { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateConnectorRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateConnectorMetadata { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateConnectorMetadata"; + /** ID of the connector that is being updated. */ + connectorId: string; +} + +export interface DeleteConnectorRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteConnectorRequest"; + /** ID of the connector to delete. */ + connectorId: string; +} + +export interface DeleteConnectorMetadata { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteConnectorMetadata"; + /** ID of the connector that is being deleted. */ + connectorId: string; +} + +export interface ListConnectorOperationsRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.ListConnectorOperationsRequest"; + /** ID of the connector to list operations for. */ + connectorId: string; + /** The maximum number of results per response. */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * `next_page_token` returned by a previous list request. + */ + pageToken: string; + /** + * Supported attributes for filter: + * description + * created_at + * modified_at + * created_by + * done + */ + filter: string; +} + +export interface ListConnectorOperationsResponse { + $type: "yandex.cloud.serverless.eventrouter.v1.ListConnectorOperationsResponse"; + /** List of operations for the specified connector. */ + operations: Operation[]; + /** Token for getting the next page of the list of results. */ + nextPageToken: string; +} + +export interface StartConnectorRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.StartConnectorRequest"; + /** ID of the connector to start. */ + connectorId: string; +} + +export interface StartConnectorMetadata { + $type: "yandex.cloud.serverless.eventrouter.v1.StartConnectorMetadata"; + /** ID of the connector that is being started. */ + connectorId: string; +} + +export interface StopConnectorRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.StopConnectorRequest"; + /** ID of the connector to stop. */ + connectorId: string; +} + +export interface StopConnectorMetadata { + $type: "yandex.cloud.serverless.eventrouter.v1.StopConnectorMetadata"; + /** ID of the connector that is being stopped. */ + connectorId: string; +} + +const baseGetConnectorRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.GetConnectorRequest", + connectorId: "", +}; + +export const GetConnectorRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.GetConnectorRequest" as const, + + encode( + message: GetConnectorRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.connectorId !== "") { + writer.uint32(10).string(message.connectorId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetConnectorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetConnectorRequest } as GetConnectorRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectorId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetConnectorRequest { + const message = { ...baseGetConnectorRequest } as GetConnectorRequest; + message.connectorId = + object.connectorId !== undefined && object.connectorId !== null + ? String(object.connectorId) + : ""; + return message; + }, + + toJSON(message: GetConnectorRequest): unknown { + const obj: any = {}; + message.connectorId !== undefined && + (obj.connectorId = message.connectorId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetConnectorRequest { + const message = { ...baseGetConnectorRequest } as GetConnectorRequest; + message.connectorId = object.connectorId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetConnectorRequest.$type, GetConnectorRequest); + +const baseListConnectorsRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListConnectorsRequest", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListConnectorsRequest = { + $type: + "yandex.cloud.serverless.eventrouter.v1.ListConnectorsRequest" as const, + + encode( + message: ListConnectorsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.busId !== undefined) { + writer.uint32(10).string(message.busId); + } + if (message.folderId !== undefined) { + writer.uint32(18).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(24).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(34).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(42).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListConnectorsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListConnectorsRequest } as ListConnectorsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.busId = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 4: + message.pageToken = reader.string(); + break; + case 5: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListConnectorsRequest { + const message = { ...baseListConnectorsRequest } as ListConnectorsRequest; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : undefined; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : undefined; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListConnectorsRequest): unknown { + const obj: any = {}; + message.busId !== undefined && (obj.busId = message.busId); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListConnectorsRequest { + const message = { ...baseListConnectorsRequest } as ListConnectorsRequest; + message.busId = object.busId ?? undefined; + message.folderId = object.folderId ?? undefined; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListConnectorsRequest.$type, ListConnectorsRequest); + +const baseListConnectorsResponse: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListConnectorsResponse", + nextPageToken: "", +}; + +export const ListConnectorsResponse = { + $type: + "yandex.cloud.serverless.eventrouter.v1.ListConnectorsResponse" as const, + + encode( + message: ListConnectorsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.connectors) { + Connector.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListConnectorsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListConnectorsResponse } as ListConnectorsResponse; + message.connectors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectors.push(Connector.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListConnectorsResponse { + const message = { ...baseListConnectorsResponse } as ListConnectorsResponse; + message.connectors = (object.connectors ?? []).map((e: any) => + Connector.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListConnectorsResponse): unknown { + const obj: any = {}; + if (message.connectors) { + obj.connectors = message.connectors.map((e) => + e ? Connector.toJSON(e) : undefined + ); + } else { + obj.connectors = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListConnectorsResponse { + const message = { ...baseListConnectorsResponse } as ListConnectorsResponse; + message.connectors = + object.connectors?.map((e) => Connector.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListConnectorsResponse.$type, ListConnectorsResponse); + +const baseCreateConnectorRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateConnectorRequest", + busId: "", + name: "", + description: "", + deletionProtection: false, +}; + +export const CreateConnectorRequest = { + $type: + "yandex.cloud.serverless.eventrouter.v1.CreateConnectorRequest" as const, + + encode( + message: CreateConnectorRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.busId !== "") { + writer.uint32(10).string(message.busId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateConnectorRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.serverless.eventrouter.v1.CreateConnectorRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(34).fork() + ).ldelim(); + }); + if (message.source !== undefined) { + Source.encode(message.source, writer.uint32(42).fork()).ldelim(); + } + if (message.deletionProtection === true) { + writer.uint32(48).bool(message.deletionProtection); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateConnectorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateConnectorRequest } as CreateConnectorRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.busId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + const entry4 = CreateConnectorRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry4.value !== undefined) { + message.labels[entry4.key] = entry4.value; + } + break; + case 5: + message.source = Source.decode(reader, reader.uint32()); + break; + case 6: + message.deletionProtection = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateConnectorRequest { + const message = { ...baseCreateConnectorRequest } as CreateConnectorRequest; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.source = + object.source !== undefined && object.source !== null + ? Source.fromJSON(object.source) + : undefined; + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + return message; + }, + + toJSON(message: CreateConnectorRequest): unknown { + const obj: any = {}; + message.busId !== undefined && (obj.busId = message.busId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.source !== undefined && + (obj.source = message.source ? Source.toJSON(message.source) : undefined); + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateConnectorRequest { + const message = { ...baseCreateConnectorRequest } as CreateConnectorRequest; + message.busId = object.busId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.source = + object.source !== undefined && object.source !== null + ? Source.fromPartial(object.source) + : undefined; + message.deletionProtection = object.deletionProtection ?? false; + return message; + }, +}; + +messageTypeRegistry.set(CreateConnectorRequest.$type, CreateConnectorRequest); + +const baseCreateConnectorRequest_LabelsEntry: object = { + $type: + "yandex.cloud.serverless.eventrouter.v1.CreateConnectorRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateConnectorRequest_LabelsEntry = { + $type: + "yandex.cloud.serverless.eventrouter.v1.CreateConnectorRequest.LabelsEntry" as const, + + encode( + message: CreateConnectorRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateConnectorRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateConnectorRequest_LabelsEntry, + } as CreateConnectorRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateConnectorRequest_LabelsEntry { + const message = { + ...baseCreateConnectorRequest_LabelsEntry, + } as CreateConnectorRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateConnectorRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateConnectorRequest_LabelsEntry { + const message = { + ...baseCreateConnectorRequest_LabelsEntry, + } as CreateConnectorRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateConnectorRequest_LabelsEntry.$type, + CreateConnectorRequest_LabelsEntry +); + +const baseCreateConnectorMetadata: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateConnectorMetadata", + connectorId: "", + busId: "", +}; + +export const CreateConnectorMetadata = { + $type: + "yandex.cloud.serverless.eventrouter.v1.CreateConnectorMetadata" as const, + + encode( + message: CreateConnectorMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.connectorId !== "") { + writer.uint32(10).string(message.connectorId); + } + if (message.busId !== "") { + writer.uint32(18).string(message.busId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateConnectorMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateConnectorMetadata, + } as CreateConnectorMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectorId = reader.string(); + break; + case 2: + message.busId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateConnectorMetadata { + const message = { + ...baseCreateConnectorMetadata, + } as CreateConnectorMetadata; + message.connectorId = + object.connectorId !== undefined && object.connectorId !== null + ? String(object.connectorId) + : ""; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + return message; + }, + + toJSON(message: CreateConnectorMetadata): unknown { + const obj: any = {}; + message.connectorId !== undefined && + (obj.connectorId = message.connectorId); + message.busId !== undefined && (obj.busId = message.busId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateConnectorMetadata { + const message = { + ...baseCreateConnectorMetadata, + } as CreateConnectorMetadata; + message.connectorId = object.connectorId ?? ""; + message.busId = object.busId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateConnectorMetadata.$type, CreateConnectorMetadata); + +const baseUpdateConnectorRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateConnectorRequest", + connectorId: "", + name: "", + description: "", + deletionProtection: false, +}; + +export const UpdateConnectorRequest = { + $type: + "yandex.cloud.serverless.eventrouter.v1.UpdateConnectorRequest" as const, + + encode( + message: UpdateConnectorRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.connectorId !== "") { + writer.uint32(10).string(message.connectorId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateConnectorRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.serverless.eventrouter.v1.UpdateConnectorRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(42).fork() + ).ldelim(); + }); + if (message.deletionProtection === true) { + writer.uint32(48).bool(message.deletionProtection); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateConnectorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateConnectorRequest } as UpdateConnectorRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectorId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + const entry5 = UpdateConnectorRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry5.value !== undefined) { + message.labels[entry5.key] = entry5.value; + } + break; + case 6: + message.deletionProtection = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateConnectorRequest { + const message = { ...baseUpdateConnectorRequest } as UpdateConnectorRequest; + message.connectorId = + object.connectorId !== undefined && object.connectorId !== null + ? String(object.connectorId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + return message; + }, + + toJSON(message: UpdateConnectorRequest): unknown { + const obj: any = {}; + message.connectorId !== undefined && + (obj.connectorId = message.connectorId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateConnectorRequest { + const message = { ...baseUpdateConnectorRequest } as UpdateConnectorRequest; + message.connectorId = object.connectorId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.deletionProtection = object.deletionProtection ?? false; + return message; + }, +}; + +messageTypeRegistry.set(UpdateConnectorRequest.$type, UpdateConnectorRequest); + +const baseUpdateConnectorRequest_LabelsEntry: object = { + $type: + "yandex.cloud.serverless.eventrouter.v1.UpdateConnectorRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateConnectorRequest_LabelsEntry = { + $type: + "yandex.cloud.serverless.eventrouter.v1.UpdateConnectorRequest.LabelsEntry" as const, + + encode( + message: UpdateConnectorRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateConnectorRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateConnectorRequest_LabelsEntry, + } as UpdateConnectorRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateConnectorRequest_LabelsEntry { + const message = { + ...baseUpdateConnectorRequest_LabelsEntry, + } as UpdateConnectorRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateConnectorRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateConnectorRequest_LabelsEntry { + const message = { + ...baseUpdateConnectorRequest_LabelsEntry, + } as UpdateConnectorRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateConnectorRequest_LabelsEntry.$type, + UpdateConnectorRequest_LabelsEntry +); + +const baseUpdateConnectorMetadata: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateConnectorMetadata", + connectorId: "", +}; + +export const UpdateConnectorMetadata = { + $type: + "yandex.cloud.serverless.eventrouter.v1.UpdateConnectorMetadata" as const, + + encode( + message: UpdateConnectorMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.connectorId !== "") { + writer.uint32(10).string(message.connectorId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateConnectorMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateConnectorMetadata, + } as UpdateConnectorMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectorId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateConnectorMetadata { + const message = { + ...baseUpdateConnectorMetadata, + } as UpdateConnectorMetadata; + message.connectorId = + object.connectorId !== undefined && object.connectorId !== null + ? String(object.connectorId) + : ""; + return message; + }, + + toJSON(message: UpdateConnectorMetadata): unknown { + const obj: any = {}; + message.connectorId !== undefined && + (obj.connectorId = message.connectorId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateConnectorMetadata { + const message = { + ...baseUpdateConnectorMetadata, + } as UpdateConnectorMetadata; + message.connectorId = object.connectorId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateConnectorMetadata.$type, UpdateConnectorMetadata); + +const baseDeleteConnectorRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteConnectorRequest", + connectorId: "", +}; + +export const DeleteConnectorRequest = { + $type: + "yandex.cloud.serverless.eventrouter.v1.DeleteConnectorRequest" as const, + + encode( + message: DeleteConnectorRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.connectorId !== "") { + writer.uint32(10).string(message.connectorId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteConnectorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteConnectorRequest } as DeleteConnectorRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectorId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteConnectorRequest { + const message = { ...baseDeleteConnectorRequest } as DeleteConnectorRequest; + message.connectorId = + object.connectorId !== undefined && object.connectorId !== null + ? String(object.connectorId) + : ""; + return message; + }, + + toJSON(message: DeleteConnectorRequest): unknown { + const obj: any = {}; + message.connectorId !== undefined && + (obj.connectorId = message.connectorId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteConnectorRequest { + const message = { ...baseDeleteConnectorRequest } as DeleteConnectorRequest; + message.connectorId = object.connectorId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteConnectorRequest.$type, DeleteConnectorRequest); + +const baseDeleteConnectorMetadata: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteConnectorMetadata", + connectorId: "", +}; + +export const DeleteConnectorMetadata = { + $type: + "yandex.cloud.serverless.eventrouter.v1.DeleteConnectorMetadata" as const, + + encode( + message: DeleteConnectorMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.connectorId !== "") { + writer.uint32(10).string(message.connectorId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteConnectorMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteConnectorMetadata, + } as DeleteConnectorMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectorId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteConnectorMetadata { + const message = { + ...baseDeleteConnectorMetadata, + } as DeleteConnectorMetadata; + message.connectorId = + object.connectorId !== undefined && object.connectorId !== null + ? String(object.connectorId) + : ""; + return message; + }, + + toJSON(message: DeleteConnectorMetadata): unknown { + const obj: any = {}; + message.connectorId !== undefined && + (obj.connectorId = message.connectorId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteConnectorMetadata { + const message = { + ...baseDeleteConnectorMetadata, + } as DeleteConnectorMetadata; + message.connectorId = object.connectorId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteConnectorMetadata.$type, DeleteConnectorMetadata); + +const baseListConnectorOperationsRequest: object = { + $type: + "yandex.cloud.serverless.eventrouter.v1.ListConnectorOperationsRequest", + connectorId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListConnectorOperationsRequest = { + $type: + "yandex.cloud.serverless.eventrouter.v1.ListConnectorOperationsRequest" as const, + + encode( + message: ListConnectorOperationsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.connectorId !== "") { + writer.uint32(10).string(message.connectorId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListConnectorOperationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListConnectorOperationsRequest, + } as ListConnectorOperationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectorId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListConnectorOperationsRequest { + const message = { + ...baseListConnectorOperationsRequest, + } as ListConnectorOperationsRequest; + message.connectorId = + object.connectorId !== undefined && object.connectorId !== null + ? String(object.connectorId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListConnectorOperationsRequest): unknown { + const obj: any = {}; + message.connectorId !== undefined && + (obj.connectorId = message.connectorId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListConnectorOperationsRequest { + const message = { + ...baseListConnectorOperationsRequest, + } as ListConnectorOperationsRequest; + message.connectorId = object.connectorId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListConnectorOperationsRequest.$type, + ListConnectorOperationsRequest +); + +const baseListConnectorOperationsResponse: object = { + $type: + "yandex.cloud.serverless.eventrouter.v1.ListConnectorOperationsResponse", + nextPageToken: "", +}; + +export const ListConnectorOperationsResponse = { + $type: + "yandex.cloud.serverless.eventrouter.v1.ListConnectorOperationsResponse" as const, + + encode( + message: ListConnectorOperationsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.operations) { + Operation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListConnectorOperationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListConnectorOperationsResponse, + } as ListConnectorOperationsResponse; + message.operations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operations.push(Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListConnectorOperationsResponse { + const message = { + ...baseListConnectorOperationsResponse, + } as ListConnectorOperationsResponse; + message.operations = (object.operations ?? []).map((e: any) => + Operation.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListConnectorOperationsResponse): unknown { + const obj: any = {}; + if (message.operations) { + obj.operations = message.operations.map((e) => + e ? Operation.toJSON(e) : undefined + ); + } else { + obj.operations = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListConnectorOperationsResponse { + const message = { + ...baseListConnectorOperationsResponse, + } as ListConnectorOperationsResponse; + message.operations = + object.operations?.map((e) => Operation.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListConnectorOperationsResponse.$type, + ListConnectorOperationsResponse +); + +const baseStartConnectorRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.StartConnectorRequest", + connectorId: "", +}; + +export const StartConnectorRequest = { + $type: + "yandex.cloud.serverless.eventrouter.v1.StartConnectorRequest" as const, + + encode( + message: StartConnectorRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.connectorId !== "") { + writer.uint32(10).string(message.connectorId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): StartConnectorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStartConnectorRequest } as StartConnectorRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectorId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StartConnectorRequest { + const message = { ...baseStartConnectorRequest } as StartConnectorRequest; + message.connectorId = + object.connectorId !== undefined && object.connectorId !== null + ? String(object.connectorId) + : ""; + return message; + }, + + toJSON(message: StartConnectorRequest): unknown { + const obj: any = {}; + message.connectorId !== undefined && + (obj.connectorId = message.connectorId); + return obj; + }, + + fromPartial, I>>( + object: I + ): StartConnectorRequest { + const message = { ...baseStartConnectorRequest } as StartConnectorRequest; + message.connectorId = object.connectorId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StartConnectorRequest.$type, StartConnectorRequest); + +const baseStartConnectorMetadata: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.StartConnectorMetadata", + connectorId: "", +}; + +export const StartConnectorMetadata = { + $type: + "yandex.cloud.serverless.eventrouter.v1.StartConnectorMetadata" as const, + + encode( + message: StartConnectorMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.connectorId !== "") { + writer.uint32(10).string(message.connectorId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): StartConnectorMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStartConnectorMetadata } as StartConnectorMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectorId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StartConnectorMetadata { + const message = { ...baseStartConnectorMetadata } as StartConnectorMetadata; + message.connectorId = + object.connectorId !== undefined && object.connectorId !== null + ? String(object.connectorId) + : ""; + return message; + }, + + toJSON(message: StartConnectorMetadata): unknown { + const obj: any = {}; + message.connectorId !== undefined && + (obj.connectorId = message.connectorId); + return obj; + }, + + fromPartial, I>>( + object: I + ): StartConnectorMetadata { + const message = { ...baseStartConnectorMetadata } as StartConnectorMetadata; + message.connectorId = object.connectorId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StartConnectorMetadata.$type, StartConnectorMetadata); + +const baseStopConnectorRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.StopConnectorRequest", + connectorId: "", +}; + +export const StopConnectorRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.StopConnectorRequest" as const, + + encode( + message: StopConnectorRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.connectorId !== "") { + writer.uint32(10).string(message.connectorId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): StopConnectorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStopConnectorRequest } as StopConnectorRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectorId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StopConnectorRequest { + const message = { ...baseStopConnectorRequest } as StopConnectorRequest; + message.connectorId = + object.connectorId !== undefined && object.connectorId !== null + ? String(object.connectorId) + : ""; + return message; + }, + + toJSON(message: StopConnectorRequest): unknown { + const obj: any = {}; + message.connectorId !== undefined && + (obj.connectorId = message.connectorId); + return obj; + }, + + fromPartial, I>>( + object: I + ): StopConnectorRequest { + const message = { ...baseStopConnectorRequest } as StopConnectorRequest; + message.connectorId = object.connectorId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StopConnectorRequest.$type, StopConnectorRequest); + +const baseStopConnectorMetadata: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.StopConnectorMetadata", + connectorId: "", +}; + +export const StopConnectorMetadata = { + $type: + "yandex.cloud.serverless.eventrouter.v1.StopConnectorMetadata" as const, + + encode( + message: StopConnectorMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.connectorId !== "") { + writer.uint32(10).string(message.connectorId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): StopConnectorMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStopConnectorMetadata } as StopConnectorMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectorId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StopConnectorMetadata { + const message = { ...baseStopConnectorMetadata } as StopConnectorMetadata; + message.connectorId = + object.connectorId !== undefined && object.connectorId !== null + ? String(object.connectorId) + : ""; + return message; + }, + + toJSON(message: StopConnectorMetadata): unknown { + const obj: any = {}; + message.connectorId !== undefined && + (obj.connectorId = message.connectorId); + return obj; + }, + + fromPartial, I>>( + object: I + ): StopConnectorMetadata { + const message = { ...baseStopConnectorMetadata } as StopConnectorMetadata; + message.connectorId = object.connectorId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StopConnectorMetadata.$type, StopConnectorMetadata); + +/** A set of methods for managing connectors for serverless eventrouter. */ +export const ConnectorServiceService = { + /** + * Returns the specified bus. + * To get the list of all available connectors, make a [List] request. + */ + get: { + path: "/yandex.cloud.serverless.eventrouter.v1.ConnectorService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetConnectorRequest) => + Buffer.from(GetConnectorRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetConnectorRequest.decode(value), + responseSerialize: (value: Connector) => + Buffer.from(Connector.encode(value).finish()), + responseDeserialize: (value: Buffer) => Connector.decode(value), + }, + /** Retrieves the list of connectors in the specified folder. */ + list: { + path: "/yandex.cloud.serverless.eventrouter.v1.ConnectorService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListConnectorsRequest) => + Buffer.from(ListConnectorsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListConnectorsRequest.decode(value), + responseSerialize: (value: ListConnectorsResponse) => + Buffer.from(ListConnectorsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListConnectorsResponse.decode(value), + }, + /** Creates a connector in the specified folder. */ + create: { + path: "/yandex.cloud.serverless.eventrouter.v1.ConnectorService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateConnectorRequest) => + Buffer.from(CreateConnectorRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateConnectorRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates the specified connector. */ + update: { + path: "/yandex.cloud.serverless.eventrouter.v1.ConnectorService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateConnectorRequest) => + Buffer.from(UpdateConnectorRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateConnectorRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes the specified connector. */ + delete: { + path: "/yandex.cloud.serverless.eventrouter.v1.ConnectorService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteConnectorRequest) => + Buffer.from(DeleteConnectorRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteConnectorRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Starts the specified connector. */ + start: { + path: "/yandex.cloud.serverless.eventrouter.v1.ConnectorService/Start", + requestStream: false, + responseStream: false, + requestSerialize: (value: StartConnectorRequest) => + Buffer.from(StartConnectorRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => StartConnectorRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Stops the specified connector. */ + stop: { + path: "/yandex.cloud.serverless.eventrouter.v1.ConnectorService/Stop", + requestStream: false, + responseStream: false, + requestSerialize: (value: StopConnectorRequest) => + Buffer.from(StopConnectorRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => StopConnectorRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Lists existing access bindings for the specified bus. */ + listAccessBindings: { + path: "/yandex.cloud.serverless.eventrouter.v1.ConnectorService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the connector. */ + setAccessBindings: { + path: "/yandex.cloud.serverless.eventrouter.v1.ConnectorService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the specified connector. */ + updateAccessBindings: { + path: "/yandex.cloud.serverless.eventrouter.v1.ConnectorService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Lists operations for the specified connector. */ + listOperations: { + path: "/yandex.cloud.serverless.eventrouter.v1.ConnectorService/ListOperations", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListConnectorOperationsRequest) => + Buffer.from(ListConnectorOperationsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListConnectorOperationsRequest.decode(value), + responseSerialize: (value: ListConnectorOperationsResponse) => + Buffer.from(ListConnectorOperationsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListConnectorOperationsResponse.decode(value), + }, +} as const; + +export interface ConnectorServiceServer extends UntypedServiceImplementation { + /** + * Returns the specified bus. + * To get the list of all available connectors, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of connectors in the specified folder. */ + list: handleUnaryCall; + /** Creates a connector in the specified folder. */ + create: handleUnaryCall; + /** Updates the specified connector. */ + update: handleUnaryCall; + /** Deletes the specified connector. */ + delete: handleUnaryCall; + /** Starts the specified connector. */ + start: handleUnaryCall; + /** Stops the specified connector. */ + stop: handleUnaryCall; + /** Lists existing access bindings for the specified bus. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the connector. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the specified connector. */ + updateAccessBindings: handleUnaryCall; + /** Lists operations for the specified connector. */ + listOperations: handleUnaryCall< + ListConnectorOperationsRequest, + ListConnectorOperationsResponse + >; +} + +export interface ConnectorServiceClient extends Client { + /** + * Returns the specified bus. + * To get the list of all available connectors, make a [List] request. + */ + get( + request: GetConnectorRequest, + callback: (error: ServiceError | null, response: Connector) => void + ): ClientUnaryCall; + get( + request: GetConnectorRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Connector) => void + ): ClientUnaryCall; + get( + request: GetConnectorRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Connector) => void + ): ClientUnaryCall; + /** Retrieves the list of connectors in the specified folder. */ + list( + request: ListConnectorsRequest, + callback: ( + error: ServiceError | null, + response: ListConnectorsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListConnectorsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListConnectorsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListConnectorsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListConnectorsResponse + ) => void + ): ClientUnaryCall; + /** Creates a connector in the specified folder. */ + create( + request: CreateConnectorRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateConnectorRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateConnectorRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates the specified connector. */ + update( + request: UpdateConnectorRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateConnectorRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateConnectorRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes the specified connector. */ + delete( + request: DeleteConnectorRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteConnectorRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteConnectorRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Starts the specified connector. */ + start( + request: StartConnectorRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + start( + request: StartConnectorRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + start( + request: StartConnectorRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Stops the specified connector. */ + stop( + request: StopConnectorRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + stop( + request: StopConnectorRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + stop( + request: StopConnectorRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Lists existing access bindings for the specified bus. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the connector. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the specified connector. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Lists operations for the specified connector. */ + listOperations( + request: ListConnectorOperationsRequest, + callback: ( + error: ServiceError | null, + response: ListConnectorOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListConnectorOperationsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListConnectorOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListConnectorOperationsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListConnectorOperationsResponse + ) => void + ): ClientUnaryCall; +} + +export const ConnectorServiceClient = makeGenericClientConstructor( + ConnectorServiceService, + "yandex.cloud.serverless.eventrouter.v1.ConnectorService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ConnectorServiceClient; + service: typeof ConnectorServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/serverless/eventrouter/v1/event_service.ts b/src/generated/yandex/cloud/serverless/eventrouter/v1/event_service.ts new file mode 100644 index 00000000..c5ccc50e --- /dev/null +++ b/src/generated/yandex/cloud/serverless/eventrouter/v1/event_service.ts @@ -0,0 +1,186 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { Empty } from "../../../../../google/protobuf/empty"; + +export const protobufPackage = "yandex.cloud.serverless.eventrouter.v1"; + +export interface PutEventRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.PutEventRequest"; + /** ID of the bus to put event. */ + busId: string; + /** Event body. */ + body: string; +} + +const basePutEventRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.PutEventRequest", + busId: "", + body: "", +}; + +export const PutEventRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.PutEventRequest" as const, + + encode( + message: PutEventRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.busId !== "") { + writer.uint32(10).string(message.busId); + } + if (message.body !== "") { + writer.uint32(18).string(message.body); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PutEventRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePutEventRequest } as PutEventRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.busId = reader.string(); + break; + case 2: + message.body = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PutEventRequest { + const message = { ...basePutEventRequest } as PutEventRequest; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + message.body = + object.body !== undefined && object.body !== null + ? String(object.body) + : ""; + return message; + }, + + toJSON(message: PutEventRequest): unknown { + const obj: any = {}; + message.busId !== undefined && (obj.busId = message.busId); + message.body !== undefined && (obj.body = message.body); + return obj; + }, + + fromPartial, I>>( + object: I + ): PutEventRequest { + const message = { ...basePutEventRequest } as PutEventRequest; + message.busId = object.busId ?? ""; + message.body = object.body ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(PutEventRequest.$type, PutEventRequest); + +/** Service for put events to bus for serverless eventrouter. */ +export const EventServiceService = { + /** Puts event to bus. */ + put: { + path: "/yandex.cloud.serverless.eventrouter.v1.EventService/Put", + requestStream: false, + responseStream: false, + requestSerialize: (value: PutEventRequest) => + Buffer.from(PutEventRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => PutEventRequest.decode(value), + responseSerialize: (value: Empty) => + Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, +} as const; + +export interface EventServiceServer extends UntypedServiceImplementation { + /** Puts event to bus. */ + put: handleUnaryCall; +} + +export interface EventServiceClient extends Client { + /** Puts event to bus. */ + put( + request: PutEventRequest, + callback: (error: ServiceError | null, response: Empty) => void + ): ClientUnaryCall; + put( + request: PutEventRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Empty) => void + ): ClientUnaryCall; + put( + request: PutEventRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Empty) => void + ): ClientUnaryCall; +} + +export const EventServiceClient = makeGenericClientConstructor( + EventServiceService, + "yandex.cloud.serverless.eventrouter.v1.EventService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): EventServiceClient; + service: typeof EventServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/serverless/eventrouter/v1/rule.ts b/src/generated/yandex/cloud/serverless/eventrouter/v1/rule.ts new file mode 100644 index 00000000..c55df7d5 --- /dev/null +++ b/src/generated/yandex/cloud/serverless/eventrouter/v1/rule.ts @@ -0,0 +1,2025 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Duration } from "../../../../../google/protobuf/duration"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.serverless.eventrouter.v1"; + +export interface Rule { + $type: "yandex.cloud.serverless.eventrouter.v1.Rule"; + /** ID of the rule. */ + id: string; + /** ID of the bus that the rule belongs to. */ + busId: string; + /** ID of the folder that the rule resides in. */ + folderId: string; + /** ID of the cloud that the rule resides in. */ + cloudId: string; + /** Creation timestamp. */ + createdAt?: Date; + /** Name of the rule. */ + name: string; + /** Description of the rule. */ + description: string; + /** Resource labels as `key:value` pairs. */ + labels: { [key: string]: string }; + /** Filter for the rule. */ + filter?: Filter; + /** Targets of the rule. */ + targets: Target[]; + /** Flag that disallow deletion of the rule. */ + deletionProtection: boolean; + /** Rule status */ + status: Rule_Status; +} + +export enum Rule_Status { + STATUS_UNSPECIFIED = 0, + /** CREATING - Rule creation in progress, rule is not enabled yet */ + CREATING = 1, + /** ENABLED - Rule is operating */ + ENABLED = 2, + /** UPDATING - Rule update in progress, rule is disabled during update */ + UPDATING = 3, + /** DISABLED - Rule is explicitly disabled by the user */ + DISABLED = 4, + UNRECOGNIZED = -1, +} + +export function rule_StatusFromJSON(object: any): Rule_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return Rule_Status.STATUS_UNSPECIFIED; + case 1: + case "CREATING": + return Rule_Status.CREATING; + case 2: + case "ENABLED": + return Rule_Status.ENABLED; + case 3: + case "UPDATING": + return Rule_Status.UPDATING; + case 4: + case "DISABLED": + return Rule_Status.DISABLED; + case -1: + case "UNRECOGNIZED": + default: + return Rule_Status.UNRECOGNIZED; + } +} + +export function rule_StatusToJSON(object: Rule_Status): string { + switch (object) { + case Rule_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case Rule_Status.CREATING: + return "CREATING"; + case Rule_Status.ENABLED: + return "ENABLED"; + case Rule_Status.UPDATING: + return "UPDATING"; + case Rule_Status.DISABLED: + return "DISABLED"; + default: + return "UNKNOWN"; + } +} + +export interface Rule_LabelsEntry { + $type: "yandex.cloud.serverless.eventrouter.v1.Rule.LabelsEntry"; + key: string; + value: string; +} + +export interface Filter { + $type: "yandex.cloud.serverless.eventrouter.v1.Filter"; + /** JQ filter for matching events. */ + jqFilter: string | undefined; +} + +export interface Transformer { + $type: "yandex.cloud.serverless.eventrouter.v1.Transformer"; + /** JQ string inrerpolation expression for changing event format. */ + jqTransformer: string | undefined; +} + +export interface Target { + $type: "yandex.cloud.serverless.eventrouter.v1.Target"; + yds?: YdsTarget | undefined; + ymq?: YmqTarget | undefined; + function?: FunctionTarget | undefined; + container?: ContainerTarget | undefined; + gatewayWsBroadcast?: GatewayWebsocketBroadcastTarget | undefined; + logging?: LoggingTarget | undefined; + workflow?: WorkflowTarget | undefined; + /** Transformer of the target. */ + transformer?: Transformer; + /** Retry settings of the target. */ + retrySettings?: RetrySettings; + /** Dead letter queue. */ + deadLetterQueue?: PutQueueMessage | undefined; + /** Status of the target. */ + status: Target_Status; +} + +/** Status of the target. */ +export enum Target_Status { + STATUS_UNSPECIFIED = 0, + /** ENABLED - Target is enabled. */ + ENABLED = 1, + /** DISABLED - Target is disabled. */ + DISABLED = 2, + /** RESOURCE_NOT_FOUND - Target does not exist. */ + RESOURCE_NOT_FOUND = 3, + /** PERMISSION_DENIED - Service account does not have read permission on source. */ + PERMISSION_DENIED = 4, + /** SUBJECT_NOT_FOUND - Service account not found. */ + SUBJECT_NOT_FOUND = 5, + UNRECOGNIZED = -1, +} + +export function target_StatusFromJSON(object: any): Target_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return Target_Status.STATUS_UNSPECIFIED; + case 1: + case "ENABLED": + return Target_Status.ENABLED; + case 2: + case "DISABLED": + return Target_Status.DISABLED; + case 3: + case "RESOURCE_NOT_FOUND": + return Target_Status.RESOURCE_NOT_FOUND; + case 4: + case "PERMISSION_DENIED": + return Target_Status.PERMISSION_DENIED; + case 5: + case "SUBJECT_NOT_FOUND": + return Target_Status.SUBJECT_NOT_FOUND; + case -1: + case "UNRECOGNIZED": + default: + return Target_Status.UNRECOGNIZED; + } +} + +export function target_StatusToJSON(object: Target_Status): string { + switch (object) { + case Target_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case Target_Status.ENABLED: + return "ENABLED"; + case Target_Status.DISABLED: + return "DISABLED"; + case Target_Status.RESOURCE_NOT_FOUND: + return "RESOURCE_NOT_FOUND"; + case Target_Status.PERMISSION_DENIED: + return "PERMISSION_DENIED"; + case Target_Status.SUBJECT_NOT_FOUND: + return "SUBJECT_NOT_FOUND"; + default: + return "UNKNOWN"; + } +} + +export interface YdsTarget { + $type: "yandex.cloud.serverless.eventrouter.v1.YdsTarget"; + /** Stream database. */ + database: string; + /** Full stream name, like /ru-central1/aoegtvhtp8ob******** /cc8004q4lbo6******** /test. */ + streamName: string; + /** Service account, which has write permission on the stream. */ + serviceAccountId: string; +} + +export interface YmqTarget { + $type: "yandex.cloud.serverless.eventrouter.v1.YmqTarget"; + /** + * Queue ARN. + * Example: yrn:yc:ymq:ru-central1:aoe***:test + */ + queueArn: string; + /** Service account which has write access to the queue. */ + serviceAccountId: string; +} + +export interface FunctionTarget { + $type: "yandex.cloud.serverless.eventrouter.v1.FunctionTarget"; + /** Function ID. */ + functionId: string; + /** Function tag, optional. */ + functionTag: string; + /** Service account which has call permission on the function, optional. */ + serviceAccountId: string; + /** Batch settings. */ + batchSettings?: BatchSettings; +} + +export interface ContainerTarget { + $type: "yandex.cloud.serverless.eventrouter.v1.ContainerTarget"; + /** Container ID. */ + containerId: string; + /** Container revision ID. */ + containerRevisionId: string; + /** Endpoint HTTP path to invoke. */ + path: string; + /** Service account which should be used to call a container, optional. */ + serviceAccountId: string; + /** Batch settings. */ + batchSettings?: BatchSettings; +} + +export interface GatewayWebsocketBroadcastTarget { + $type: "yandex.cloud.serverless.eventrouter.v1.GatewayWebsocketBroadcastTarget"; + /** Gateway ID. */ + gatewayId: string; + /** Path. */ + path: string; + /** Service account which has permission for writing to websockets. */ + serviceAccountId: string; + /** Batch settings. */ + batchSettings?: BatchSettings; +} + +export interface LoggingTarget { + $type: "yandex.cloud.serverless.eventrouter.v1.LoggingTarget"; + logGroupId: string | undefined; + folderId: string | undefined; + /** Service account which has permission for writing logs. */ + serviceAccountId: string; +} + +export interface WorkflowTarget { + $type: "yandex.cloud.serverless.eventrouter.v1.WorkflowTarget"; + /** Workflow ID. */ + workflowId: string; + /** SA which should be used to start workflow. */ + serviceAccountId: string; + /** Batch settings. */ + batchSettings?: BatchSettings; +} + +export interface RetrySettings { + $type: "yandex.cloud.serverless.eventrouter.v1.RetrySettings"; + /** Maximum number of retries (extra calls) before an action fails. */ + retryAttempts: number; + /** Event goes to dlq when its age exceeds this value. Default is 24h. */ + maximumAge?: Duration; +} + +export interface PutQueueMessage { + $type: "yandex.cloud.serverless.eventrouter.v1.PutQueueMessage"; + /** ID of the queue. */ + queueArn: string; + /** Service account which has write permission on the queue. */ + serviceAccountId: string; +} + +export interface BatchSettings { + $type: "yandex.cloud.serverless.eventrouter.v1.BatchSettings"; + /** Maximum batch size: trigger will send a batch if number of events exceeds this value. */ + maxCount: number; + /** Maximum batch size: trigger will send a batch if total size of events exceeds this value. */ + maxBytes: number; + /** Maximum batch size: trigger will send a batch if its lifetime exceeds this value. */ + cutoff?: Duration; +} + +const baseRule: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.Rule", + id: "", + busId: "", + folderId: "", + cloudId: "", + name: "", + description: "", + deletionProtection: false, + status: 0, +}; + +export const Rule = { + $type: "yandex.cloud.serverless.eventrouter.v1.Rule" as const, + + encode(message: Rule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.busId !== "") { + writer.uint32(18).string(message.busId); + } + if (message.folderId !== "") { + writer.uint32(26).string(message.folderId); + } + if (message.cloudId !== "") { + writer.uint32(34).string(message.cloudId); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.name !== "") { + writer.uint32(50).string(message.name); + } + if (message.description !== "") { + writer.uint32(58).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + Rule_LabelsEntry.encode( + { + $type: "yandex.cloud.serverless.eventrouter.v1.Rule.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(66).fork() + ).ldelim(); + }); + if (message.filter !== undefined) { + Filter.encode(message.filter, writer.uint32(90).fork()).ldelim(); + } + for (const v of message.targets) { + Target.encode(v!, writer.uint32(98).fork()).ldelim(); + } + if (message.deletionProtection === true) { + writer.uint32(104).bool(message.deletionProtection); + } + if (message.status !== 0) { + writer.uint32(112).int32(message.status); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Rule { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRule } as Rule; + message.labels = {}; + message.targets = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.busId = reader.string(); + break; + case 3: + message.folderId = reader.string(); + break; + case 4: + message.cloudId = reader.string(); + break; + case 5: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + message.name = reader.string(); + break; + case 7: + message.description = reader.string(); + break; + case 8: + const entry8 = Rule_LabelsEntry.decode(reader, reader.uint32()); + if (entry8.value !== undefined) { + message.labels[entry8.key] = entry8.value; + } + break; + case 11: + message.filter = Filter.decode(reader, reader.uint32()); + break; + case 12: + message.targets.push(Target.decode(reader, reader.uint32())); + break; + case 13: + message.deletionProtection = reader.bool(); + break; + case 14: + message.status = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Rule { + const message = { ...baseRule } as Rule; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.cloudId = + object.cloudId !== undefined && object.cloudId !== null + ? String(object.cloudId) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.filter = + object.filter !== undefined && object.filter !== null + ? Filter.fromJSON(object.filter) + : undefined; + message.targets = (object.targets ?? []).map((e: any) => + Target.fromJSON(e) + ); + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + message.status = + object.status !== undefined && object.status !== null + ? rule_StatusFromJSON(object.status) + : 0; + return message; + }, + + toJSON(message: Rule): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.busId !== undefined && (obj.busId = message.busId); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.cloudId !== undefined && (obj.cloudId = message.cloudId); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.filter !== undefined && + (obj.filter = message.filter ? Filter.toJSON(message.filter) : undefined); + if (message.targets) { + obj.targets = message.targets.map((e) => + e ? Target.toJSON(e) : undefined + ); + } else { + obj.targets = []; + } + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + message.status !== undefined && + (obj.status = rule_StatusToJSON(message.status)); + return obj; + }, + + fromPartial, I>>(object: I): Rule { + const message = { ...baseRule } as Rule; + message.id = object.id ?? ""; + message.busId = object.busId ?? ""; + message.folderId = object.folderId ?? ""; + message.cloudId = object.cloudId ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.filter = + object.filter !== undefined && object.filter !== null + ? Filter.fromPartial(object.filter) + : undefined; + message.targets = object.targets?.map((e) => Target.fromPartial(e)) || []; + message.deletionProtection = object.deletionProtection ?? false; + message.status = object.status ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Rule.$type, Rule); + +const baseRule_LabelsEntry: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.Rule.LabelsEntry", + key: "", + value: "", +}; + +export const Rule_LabelsEntry = { + $type: "yandex.cloud.serverless.eventrouter.v1.Rule.LabelsEntry" as const, + + encode( + message: Rule_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Rule_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRule_LabelsEntry } as Rule_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Rule_LabelsEntry { + const message = { ...baseRule_LabelsEntry } as Rule_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Rule_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Rule_LabelsEntry { + const message = { ...baseRule_LabelsEntry } as Rule_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Rule_LabelsEntry.$type, Rule_LabelsEntry); + +const baseFilter: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.Filter", +}; + +export const Filter = { + $type: "yandex.cloud.serverless.eventrouter.v1.Filter" as const, + + encode( + message: Filter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jqFilter !== undefined) { + writer.uint32(10).string(message.jqFilter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Filter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFilter } as Filter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jqFilter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Filter { + const message = { ...baseFilter } as Filter; + message.jqFilter = + object.jqFilter !== undefined && object.jqFilter !== null + ? String(object.jqFilter) + : undefined; + return message; + }, + + toJSON(message: Filter): unknown { + const obj: any = {}; + message.jqFilter !== undefined && (obj.jqFilter = message.jqFilter); + return obj; + }, + + fromPartial, I>>(object: I): Filter { + const message = { ...baseFilter } as Filter; + message.jqFilter = object.jqFilter ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Filter.$type, Filter); + +const baseTransformer: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.Transformer", +}; + +export const Transformer = { + $type: "yandex.cloud.serverless.eventrouter.v1.Transformer" as const, + + encode( + message: Transformer, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.jqTransformer !== undefined) { + writer.uint32(10).string(message.jqTransformer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Transformer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTransformer } as Transformer; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.jqTransformer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Transformer { + const message = { ...baseTransformer } as Transformer; + message.jqTransformer = + object.jqTransformer !== undefined && object.jqTransformer !== null + ? String(object.jqTransformer) + : undefined; + return message; + }, + + toJSON(message: Transformer): unknown { + const obj: any = {}; + message.jqTransformer !== undefined && + (obj.jqTransformer = message.jqTransformer); + return obj; + }, + + fromPartial, I>>( + object: I + ): Transformer { + const message = { ...baseTransformer } as Transformer; + message.jqTransformer = object.jqTransformer ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Transformer.$type, Transformer); + +const baseTarget: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.Target", + status: 0, +}; + +export const Target = { + $type: "yandex.cloud.serverless.eventrouter.v1.Target" as const, + + encode( + message: Target, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.yds !== undefined) { + YdsTarget.encode(message.yds, writer.uint32(10).fork()).ldelim(); + } + if (message.ymq !== undefined) { + YmqTarget.encode(message.ymq, writer.uint32(18).fork()).ldelim(); + } + if (message.function !== undefined) { + FunctionTarget.encode( + message.function, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.container !== undefined) { + ContainerTarget.encode( + message.container, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.gatewayWsBroadcast !== undefined) { + GatewayWebsocketBroadcastTarget.encode( + message.gatewayWsBroadcast, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.logging !== undefined) { + LoggingTarget.encode(message.logging, writer.uint32(50).fork()).ldelim(); + } + if (message.workflow !== undefined) { + WorkflowTarget.encode( + message.workflow, + writer.uint32(58).fork() + ).ldelim(); + } + if (message.transformer !== undefined) { + Transformer.encode( + message.transformer, + writer.uint32(402).fork() + ).ldelim(); + } + if (message.retrySettings !== undefined) { + RetrySettings.encode( + message.retrySettings, + writer.uint32(410).fork() + ).ldelim(); + } + if (message.deadLetterQueue !== undefined) { + PutQueueMessage.encode( + message.deadLetterQueue, + writer.uint32(418).fork() + ).ldelim(); + } + if (message.status !== 0) { + writer.uint32(432).int32(message.status); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Target { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTarget } as Target; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.yds = YdsTarget.decode(reader, reader.uint32()); + break; + case 2: + message.ymq = YmqTarget.decode(reader, reader.uint32()); + break; + case 3: + message.function = FunctionTarget.decode(reader, reader.uint32()); + break; + case 4: + message.container = ContainerTarget.decode(reader, reader.uint32()); + break; + case 5: + message.gatewayWsBroadcast = GatewayWebsocketBroadcastTarget.decode( + reader, + reader.uint32() + ); + break; + case 6: + message.logging = LoggingTarget.decode(reader, reader.uint32()); + break; + case 7: + message.workflow = WorkflowTarget.decode(reader, reader.uint32()); + break; + case 50: + message.transformer = Transformer.decode(reader, reader.uint32()); + break; + case 51: + message.retrySettings = RetrySettings.decode(reader, reader.uint32()); + break; + case 52: + message.deadLetterQueue = PutQueueMessage.decode( + reader, + reader.uint32() + ); + break; + case 54: + message.status = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Target { + const message = { ...baseTarget } as Target; + message.yds = + object.yds !== undefined && object.yds !== null + ? YdsTarget.fromJSON(object.yds) + : undefined; + message.ymq = + object.ymq !== undefined && object.ymq !== null + ? YmqTarget.fromJSON(object.ymq) + : undefined; + message.function = + object.function !== undefined && object.function !== null + ? FunctionTarget.fromJSON(object.function) + : undefined; + message.container = + object.container !== undefined && object.container !== null + ? ContainerTarget.fromJSON(object.container) + : undefined; + message.gatewayWsBroadcast = + object.gatewayWsBroadcast !== undefined && + object.gatewayWsBroadcast !== null + ? GatewayWebsocketBroadcastTarget.fromJSON(object.gatewayWsBroadcast) + : undefined; + message.logging = + object.logging !== undefined && object.logging !== null + ? LoggingTarget.fromJSON(object.logging) + : undefined; + message.workflow = + object.workflow !== undefined && object.workflow !== null + ? WorkflowTarget.fromJSON(object.workflow) + : undefined; + message.transformer = + object.transformer !== undefined && object.transformer !== null + ? Transformer.fromJSON(object.transformer) + : undefined; + message.retrySettings = + object.retrySettings !== undefined && object.retrySettings !== null + ? RetrySettings.fromJSON(object.retrySettings) + : undefined; + message.deadLetterQueue = + object.deadLetterQueue !== undefined && object.deadLetterQueue !== null + ? PutQueueMessage.fromJSON(object.deadLetterQueue) + : undefined; + message.status = + object.status !== undefined && object.status !== null + ? target_StatusFromJSON(object.status) + : 0; + return message; + }, + + toJSON(message: Target): unknown { + const obj: any = {}; + message.yds !== undefined && + (obj.yds = message.yds ? YdsTarget.toJSON(message.yds) : undefined); + message.ymq !== undefined && + (obj.ymq = message.ymq ? YmqTarget.toJSON(message.ymq) : undefined); + message.function !== undefined && + (obj.function = message.function + ? FunctionTarget.toJSON(message.function) + : undefined); + message.container !== undefined && + (obj.container = message.container + ? ContainerTarget.toJSON(message.container) + : undefined); + message.gatewayWsBroadcast !== undefined && + (obj.gatewayWsBroadcast = message.gatewayWsBroadcast + ? GatewayWebsocketBroadcastTarget.toJSON(message.gatewayWsBroadcast) + : undefined); + message.logging !== undefined && + (obj.logging = message.logging + ? LoggingTarget.toJSON(message.logging) + : undefined); + message.workflow !== undefined && + (obj.workflow = message.workflow + ? WorkflowTarget.toJSON(message.workflow) + : undefined); + message.transformer !== undefined && + (obj.transformer = message.transformer + ? Transformer.toJSON(message.transformer) + : undefined); + message.retrySettings !== undefined && + (obj.retrySettings = message.retrySettings + ? RetrySettings.toJSON(message.retrySettings) + : undefined); + message.deadLetterQueue !== undefined && + (obj.deadLetterQueue = message.deadLetterQueue + ? PutQueueMessage.toJSON(message.deadLetterQueue) + : undefined); + message.status !== undefined && + (obj.status = target_StatusToJSON(message.status)); + return obj; + }, + + fromPartial, I>>(object: I): Target { + const message = { ...baseTarget } as Target; + message.yds = + object.yds !== undefined && object.yds !== null + ? YdsTarget.fromPartial(object.yds) + : undefined; + message.ymq = + object.ymq !== undefined && object.ymq !== null + ? YmqTarget.fromPartial(object.ymq) + : undefined; + message.function = + object.function !== undefined && object.function !== null + ? FunctionTarget.fromPartial(object.function) + : undefined; + message.container = + object.container !== undefined && object.container !== null + ? ContainerTarget.fromPartial(object.container) + : undefined; + message.gatewayWsBroadcast = + object.gatewayWsBroadcast !== undefined && + object.gatewayWsBroadcast !== null + ? GatewayWebsocketBroadcastTarget.fromPartial(object.gatewayWsBroadcast) + : undefined; + message.logging = + object.logging !== undefined && object.logging !== null + ? LoggingTarget.fromPartial(object.logging) + : undefined; + message.workflow = + object.workflow !== undefined && object.workflow !== null + ? WorkflowTarget.fromPartial(object.workflow) + : undefined; + message.transformer = + object.transformer !== undefined && object.transformer !== null + ? Transformer.fromPartial(object.transformer) + : undefined; + message.retrySettings = + object.retrySettings !== undefined && object.retrySettings !== null + ? RetrySettings.fromPartial(object.retrySettings) + : undefined; + message.deadLetterQueue = + object.deadLetterQueue !== undefined && object.deadLetterQueue !== null + ? PutQueueMessage.fromPartial(object.deadLetterQueue) + : undefined; + message.status = object.status ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Target.$type, Target); + +const baseYdsTarget: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.YdsTarget", + database: "", + streamName: "", + serviceAccountId: "", +}; + +export const YdsTarget = { + $type: "yandex.cloud.serverless.eventrouter.v1.YdsTarget" as const, + + encode( + message: YdsTarget, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.database !== "") { + writer.uint32(10).string(message.database); + } + if (message.streamName !== "") { + writer.uint32(18).string(message.streamName); + } + if (message.serviceAccountId !== "") { + writer.uint32(26).string(message.serviceAccountId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): YdsTarget { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseYdsTarget } as YdsTarget; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.database = reader.string(); + break; + case 2: + message.streamName = reader.string(); + break; + case 3: + message.serviceAccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): YdsTarget { + const message = { ...baseYdsTarget } as YdsTarget; + message.database = + object.database !== undefined && object.database !== null + ? String(object.database) + : ""; + message.streamName = + object.streamName !== undefined && object.streamName !== null + ? String(object.streamName) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + return message; + }, + + toJSON(message: YdsTarget): unknown { + const obj: any = {}; + message.database !== undefined && (obj.database = message.database); + message.streamName !== undefined && (obj.streamName = message.streamName); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + return obj; + }, + + fromPartial, I>>( + object: I + ): YdsTarget { + const message = { ...baseYdsTarget } as YdsTarget; + message.database = object.database ?? ""; + message.streamName = object.streamName ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(YdsTarget.$type, YdsTarget); + +const baseYmqTarget: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.YmqTarget", + queueArn: "", + serviceAccountId: "", +}; + +export const YmqTarget = { + $type: "yandex.cloud.serverless.eventrouter.v1.YmqTarget" as const, + + encode( + message: YmqTarget, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.queueArn !== "") { + writer.uint32(10).string(message.queueArn); + } + if (message.serviceAccountId !== "") { + writer.uint32(18).string(message.serviceAccountId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): YmqTarget { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseYmqTarget } as YmqTarget; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.queueArn = reader.string(); + break; + case 2: + message.serviceAccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): YmqTarget { + const message = { ...baseYmqTarget } as YmqTarget; + message.queueArn = + object.queueArn !== undefined && object.queueArn !== null + ? String(object.queueArn) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + return message; + }, + + toJSON(message: YmqTarget): unknown { + const obj: any = {}; + message.queueArn !== undefined && (obj.queueArn = message.queueArn); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + return obj; + }, + + fromPartial, I>>( + object: I + ): YmqTarget { + const message = { ...baseYmqTarget } as YmqTarget; + message.queueArn = object.queueArn ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(YmqTarget.$type, YmqTarget); + +const baseFunctionTarget: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.FunctionTarget", + functionId: "", + functionTag: "", + serviceAccountId: "", +}; + +export const FunctionTarget = { + $type: "yandex.cloud.serverless.eventrouter.v1.FunctionTarget" as const, + + encode( + message: FunctionTarget, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.functionId !== "") { + writer.uint32(10).string(message.functionId); + } + if (message.functionTag !== "") { + writer.uint32(18).string(message.functionTag); + } + if (message.serviceAccountId !== "") { + writer.uint32(26).string(message.serviceAccountId); + } + if (message.batchSettings !== undefined) { + BatchSettings.encode( + message.batchSettings, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FunctionTarget { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFunctionTarget } as FunctionTarget; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.functionId = reader.string(); + break; + case 2: + message.functionTag = reader.string(); + break; + case 3: + message.serviceAccountId = reader.string(); + break; + case 4: + message.batchSettings = BatchSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FunctionTarget { + const message = { ...baseFunctionTarget } as FunctionTarget; + message.functionId = + object.functionId !== undefined && object.functionId !== null + ? String(object.functionId) + : ""; + message.functionTag = + object.functionTag !== undefined && object.functionTag !== null + ? String(object.functionTag) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.batchSettings = + object.batchSettings !== undefined && object.batchSettings !== null + ? BatchSettings.fromJSON(object.batchSettings) + : undefined; + return message; + }, + + toJSON(message: FunctionTarget): unknown { + const obj: any = {}; + message.functionId !== undefined && (obj.functionId = message.functionId); + message.functionTag !== undefined && + (obj.functionTag = message.functionTag); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.batchSettings !== undefined && + (obj.batchSettings = message.batchSettings + ? BatchSettings.toJSON(message.batchSettings) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): FunctionTarget { + const message = { ...baseFunctionTarget } as FunctionTarget; + message.functionId = object.functionId ?? ""; + message.functionTag = object.functionTag ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.batchSettings = + object.batchSettings !== undefined && object.batchSettings !== null + ? BatchSettings.fromPartial(object.batchSettings) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(FunctionTarget.$type, FunctionTarget); + +const baseContainerTarget: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.ContainerTarget", + containerId: "", + containerRevisionId: "", + path: "", + serviceAccountId: "", +}; + +export const ContainerTarget = { + $type: "yandex.cloud.serverless.eventrouter.v1.ContainerTarget" as const, + + encode( + message: ContainerTarget, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.containerId !== "") { + writer.uint32(10).string(message.containerId); + } + if (message.containerRevisionId !== "") { + writer.uint32(18).string(message.containerRevisionId); + } + if (message.path !== "") { + writer.uint32(26).string(message.path); + } + if (message.serviceAccountId !== "") { + writer.uint32(34).string(message.serviceAccountId); + } + if (message.batchSettings !== undefined) { + BatchSettings.encode( + message.batchSettings, + writer.uint32(42).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ContainerTarget { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseContainerTarget } as ContainerTarget; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.containerId = reader.string(); + break; + case 2: + message.containerRevisionId = reader.string(); + break; + case 3: + message.path = reader.string(); + break; + case 4: + message.serviceAccountId = reader.string(); + break; + case 5: + message.batchSettings = BatchSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ContainerTarget { + const message = { ...baseContainerTarget } as ContainerTarget; + message.containerId = + object.containerId !== undefined && object.containerId !== null + ? String(object.containerId) + : ""; + message.containerRevisionId = + object.containerRevisionId !== undefined && + object.containerRevisionId !== null + ? String(object.containerRevisionId) + : ""; + message.path = + object.path !== undefined && object.path !== null + ? String(object.path) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.batchSettings = + object.batchSettings !== undefined && object.batchSettings !== null + ? BatchSettings.fromJSON(object.batchSettings) + : undefined; + return message; + }, + + toJSON(message: ContainerTarget): unknown { + const obj: any = {}; + message.containerId !== undefined && + (obj.containerId = message.containerId); + message.containerRevisionId !== undefined && + (obj.containerRevisionId = message.containerRevisionId); + message.path !== undefined && (obj.path = message.path); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.batchSettings !== undefined && + (obj.batchSettings = message.batchSettings + ? BatchSettings.toJSON(message.batchSettings) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ContainerTarget { + const message = { ...baseContainerTarget } as ContainerTarget; + message.containerId = object.containerId ?? ""; + message.containerRevisionId = object.containerRevisionId ?? ""; + message.path = object.path ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.batchSettings = + object.batchSettings !== undefined && object.batchSettings !== null + ? BatchSettings.fromPartial(object.batchSettings) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ContainerTarget.$type, ContainerTarget); + +const baseGatewayWebsocketBroadcastTarget: object = { + $type: + "yandex.cloud.serverless.eventrouter.v1.GatewayWebsocketBroadcastTarget", + gatewayId: "", + path: "", + serviceAccountId: "", +}; + +export const GatewayWebsocketBroadcastTarget = { + $type: + "yandex.cloud.serverless.eventrouter.v1.GatewayWebsocketBroadcastTarget" as const, + + encode( + message: GatewayWebsocketBroadcastTarget, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.gatewayId !== "") { + writer.uint32(10).string(message.gatewayId); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + if (message.serviceAccountId !== "") { + writer.uint32(26).string(message.serviceAccountId); + } + if (message.batchSettings !== undefined) { + BatchSettings.encode( + message.batchSettings, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GatewayWebsocketBroadcastTarget { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGatewayWebsocketBroadcastTarget, + } as GatewayWebsocketBroadcastTarget; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gatewayId = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + case 3: + message.serviceAccountId = reader.string(); + break; + case 4: + message.batchSettings = BatchSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GatewayWebsocketBroadcastTarget { + const message = { + ...baseGatewayWebsocketBroadcastTarget, + } as GatewayWebsocketBroadcastTarget; + message.gatewayId = + object.gatewayId !== undefined && object.gatewayId !== null + ? String(object.gatewayId) + : ""; + message.path = + object.path !== undefined && object.path !== null + ? String(object.path) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.batchSettings = + object.batchSettings !== undefined && object.batchSettings !== null + ? BatchSettings.fromJSON(object.batchSettings) + : undefined; + return message; + }, + + toJSON(message: GatewayWebsocketBroadcastTarget): unknown { + const obj: any = {}; + message.gatewayId !== undefined && (obj.gatewayId = message.gatewayId); + message.path !== undefined && (obj.path = message.path); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.batchSettings !== undefined && + (obj.batchSettings = message.batchSettings + ? BatchSettings.toJSON(message.batchSettings) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): GatewayWebsocketBroadcastTarget { + const message = { + ...baseGatewayWebsocketBroadcastTarget, + } as GatewayWebsocketBroadcastTarget; + message.gatewayId = object.gatewayId ?? ""; + message.path = object.path ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.batchSettings = + object.batchSettings !== undefined && object.batchSettings !== null + ? BatchSettings.fromPartial(object.batchSettings) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + GatewayWebsocketBroadcastTarget.$type, + GatewayWebsocketBroadcastTarget +); + +const baseLoggingTarget: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.LoggingTarget", + serviceAccountId: "", +}; + +export const LoggingTarget = { + $type: "yandex.cloud.serverless.eventrouter.v1.LoggingTarget" as const, + + encode( + message: LoggingTarget, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.logGroupId !== undefined) { + writer.uint32(10).string(message.logGroupId); + } + if (message.folderId !== undefined) { + writer.uint32(18).string(message.folderId); + } + if (message.serviceAccountId !== "") { + writer.uint32(26).string(message.serviceAccountId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LoggingTarget { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLoggingTarget } as LoggingTarget; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.logGroupId = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.serviceAccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LoggingTarget { + const message = { ...baseLoggingTarget } as LoggingTarget; + message.logGroupId = + object.logGroupId !== undefined && object.logGroupId !== null + ? String(object.logGroupId) + : undefined; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : undefined; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + return message; + }, + + toJSON(message: LoggingTarget): unknown { + const obj: any = {}; + message.logGroupId !== undefined && (obj.logGroupId = message.logGroupId); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + return obj; + }, + + fromPartial, I>>( + object: I + ): LoggingTarget { + const message = { ...baseLoggingTarget } as LoggingTarget; + message.logGroupId = object.logGroupId ?? undefined; + message.folderId = object.folderId ?? undefined; + message.serviceAccountId = object.serviceAccountId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(LoggingTarget.$type, LoggingTarget); + +const baseWorkflowTarget: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.WorkflowTarget", + workflowId: "", + serviceAccountId: "", +}; + +export const WorkflowTarget = { + $type: "yandex.cloud.serverless.eventrouter.v1.WorkflowTarget" as const, + + encode( + message: WorkflowTarget, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.workflowId !== "") { + writer.uint32(10).string(message.workflowId); + } + if (message.serviceAccountId !== "") { + writer.uint32(34).string(message.serviceAccountId); + } + if (message.batchSettings !== undefined) { + BatchSettings.encode( + message.batchSettings, + writer.uint32(42).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): WorkflowTarget { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWorkflowTarget } as WorkflowTarget; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workflowId = reader.string(); + break; + case 4: + message.serviceAccountId = reader.string(); + break; + case 5: + message.batchSettings = BatchSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WorkflowTarget { + const message = { ...baseWorkflowTarget } as WorkflowTarget; + message.workflowId = + object.workflowId !== undefined && object.workflowId !== null + ? String(object.workflowId) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.batchSettings = + object.batchSettings !== undefined && object.batchSettings !== null + ? BatchSettings.fromJSON(object.batchSettings) + : undefined; + return message; + }, + + toJSON(message: WorkflowTarget): unknown { + const obj: any = {}; + message.workflowId !== undefined && (obj.workflowId = message.workflowId); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.batchSettings !== undefined && + (obj.batchSettings = message.batchSettings + ? BatchSettings.toJSON(message.batchSettings) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): WorkflowTarget { + const message = { ...baseWorkflowTarget } as WorkflowTarget; + message.workflowId = object.workflowId ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.batchSettings = + object.batchSettings !== undefined && object.batchSettings !== null + ? BatchSettings.fromPartial(object.batchSettings) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(WorkflowTarget.$type, WorkflowTarget); + +const baseRetrySettings: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.RetrySettings", + retryAttempts: 0, +}; + +export const RetrySettings = { + $type: "yandex.cloud.serverless.eventrouter.v1.RetrySettings" as const, + + encode( + message: RetrySettings, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.retryAttempts !== 0) { + writer.uint32(8).int64(message.retryAttempts); + } + if (message.maximumAge !== undefined) { + Duration.encode(message.maximumAge, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RetrySettings { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRetrySettings } as RetrySettings; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.retryAttempts = longToNumber(reader.int64() as Long); + break; + case 2: + message.maximumAge = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RetrySettings { + const message = { ...baseRetrySettings } as RetrySettings; + message.retryAttempts = + object.retryAttempts !== undefined && object.retryAttempts !== null + ? Number(object.retryAttempts) + : 0; + message.maximumAge = + object.maximumAge !== undefined && object.maximumAge !== null + ? Duration.fromJSON(object.maximumAge) + : undefined; + return message; + }, + + toJSON(message: RetrySettings): unknown { + const obj: any = {}; + message.retryAttempts !== undefined && + (obj.retryAttempts = Math.round(message.retryAttempts)); + message.maximumAge !== undefined && + (obj.maximumAge = message.maximumAge + ? Duration.toJSON(message.maximumAge) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): RetrySettings { + const message = { ...baseRetrySettings } as RetrySettings; + message.retryAttempts = object.retryAttempts ?? 0; + message.maximumAge = + object.maximumAge !== undefined && object.maximumAge !== null + ? Duration.fromPartial(object.maximumAge) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(RetrySettings.$type, RetrySettings); + +const basePutQueueMessage: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.PutQueueMessage", + queueArn: "", + serviceAccountId: "", +}; + +export const PutQueueMessage = { + $type: "yandex.cloud.serverless.eventrouter.v1.PutQueueMessage" as const, + + encode( + message: PutQueueMessage, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.queueArn !== "") { + writer.uint32(10).string(message.queueArn); + } + if (message.serviceAccountId !== "") { + writer.uint32(18).string(message.serviceAccountId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PutQueueMessage { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePutQueueMessage } as PutQueueMessage; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.queueArn = reader.string(); + break; + case 2: + message.serviceAccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PutQueueMessage { + const message = { ...basePutQueueMessage } as PutQueueMessage; + message.queueArn = + object.queueArn !== undefined && object.queueArn !== null + ? String(object.queueArn) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + return message; + }, + + toJSON(message: PutQueueMessage): unknown { + const obj: any = {}; + message.queueArn !== undefined && (obj.queueArn = message.queueArn); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + return obj; + }, + + fromPartial, I>>( + object: I + ): PutQueueMessage { + const message = { ...basePutQueueMessage } as PutQueueMessage; + message.queueArn = object.queueArn ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(PutQueueMessage.$type, PutQueueMessage); + +const baseBatchSettings: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.BatchSettings", + maxCount: 0, + maxBytes: 0, +}; + +export const BatchSettings = { + $type: "yandex.cloud.serverless.eventrouter.v1.BatchSettings" as const, + + encode( + message: BatchSettings, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.maxCount !== 0) { + writer.uint32(8).int64(message.maxCount); + } + if (message.maxBytes !== 0) { + writer.uint32(16).int64(message.maxBytes); + } + if (message.cutoff !== undefined) { + Duration.encode(message.cutoff, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BatchSettings { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBatchSettings } as BatchSettings; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxCount = longToNumber(reader.int64() as Long); + break; + case 2: + message.maxBytes = longToNumber(reader.int64() as Long); + break; + case 3: + message.cutoff = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BatchSettings { + const message = { ...baseBatchSettings } as BatchSettings; + message.maxCount = + object.maxCount !== undefined && object.maxCount !== null + ? Number(object.maxCount) + : 0; + message.maxBytes = + object.maxBytes !== undefined && object.maxBytes !== null + ? Number(object.maxBytes) + : 0; + message.cutoff = + object.cutoff !== undefined && object.cutoff !== null + ? Duration.fromJSON(object.cutoff) + : undefined; + return message; + }, + + toJSON(message: BatchSettings): unknown { + const obj: any = {}; + message.maxCount !== undefined && + (obj.maxCount = Math.round(message.maxCount)); + message.maxBytes !== undefined && + (obj.maxBytes = Math.round(message.maxBytes)); + message.cutoff !== undefined && + (obj.cutoff = message.cutoff + ? Duration.toJSON(message.cutoff) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): BatchSettings { + const message = { ...baseBatchSettings } as BatchSettings; + message.maxCount = object.maxCount ?? 0; + message.maxBytes = object.maxBytes ?? 0; + message.cutoff = + object.cutoff !== undefined && object.cutoff !== null + ? Duration.fromPartial(object.cutoff) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(BatchSettings.$type, BatchSettings); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/serverless/eventrouter/v1/rule_service.ts b/src/generated/yandex/cloud/serverless/eventrouter/v1/rule_service.ts new file mode 100644 index 00000000..e0681801 --- /dev/null +++ b/src/generated/yandex/cloud/serverless/eventrouter/v1/rule_service.ts @@ -0,0 +1,2156 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + Filter, + Rule, + Target, +} from "../../../../../yandex/cloud/serverless/eventrouter/v1/rule"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; +import { + ListAccessBindingsRequest, + ListAccessBindingsResponse, + SetAccessBindingsRequest, + UpdateAccessBindingsRequest, +} from "../../../../../yandex/cloud/access/access"; + +export const protobufPackage = "yandex.cloud.serverless.eventrouter.v1"; + +export interface GetRuleRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.GetRuleRequest"; + /** ID of the rule to return. */ + ruleId: string; +} + +export interface ListRulesRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.ListRulesRequest"; + /** ID of the bus to list rules in. */ + busId: string | undefined; + /** ID of the folder to list rules in. */ + folderId: string | undefined; + /** The maximum number of results per response. */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * `next_page_token` returned by a previous list request. + */ + pageToken: string; + /** + * Supported fields for filter: + * name + * created_at + */ + filter: string; +} + +export interface ListRulesResponse { + $type: "yandex.cloud.serverless.eventrouter.v1.ListRulesResponse"; + /** List of rules. */ + rules: Rule[]; + /** Token for getting the next page of the list of rules. */ + nextPageToken: string; +} + +export interface CreateRuleRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateRuleRequest"; + /** ID of the bus to create a rule for. */ + busId: string; + /** Name of the rule. */ + name: string; + /** Description of the rule. */ + description: string; + /** Labels for the rule. */ + labels: { [key: string]: string }; + /** Filter for the rule. */ + filter?: Filter; + /** Targets for the rule. */ + targets: Target[]; + /** Flag that disallow deletion of the rule. */ + deletionProtection: boolean; +} + +export interface CreateRuleRequest_LabelsEntry { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateRuleRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface CreateRuleMetadata { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateRuleMetadata"; + /** ID of the rule that is being created. */ + ruleId: string; + /** ID of the bus that the rule belongs to. */ + busId: string; +} + +export interface UpdateRuleRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateRuleRequest"; + /** ID of the rule to update. */ + ruleId: string; + /** Field mask that specifies which fields of the rule are going to be updated. */ + updateMask?: FieldMask; + /** New name of the rule. */ + name: string; + /** New description of the rule. */ + description: string; + /** New labels for the rule. */ + labels: { [key: string]: string }; + /** New filter for the rule. */ + filter?: Filter; + /** New targets for the rule. */ + targets: Target[]; + /** New flag that disallow deletion of the rule. */ + deletionProtection: boolean; +} + +export interface UpdateRuleRequest_LabelsEntry { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateRuleRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateRuleMetadata { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateRuleMetadata"; + /** ID of the rule that is being updated. */ + ruleId: string; +} + +export interface DeleteRuleRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteRuleRequest"; + /** ID of the rule to delete. */ + ruleId: string; +} + +export interface DeleteRuleMetadata { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteRuleMetadata"; + /** ID of the rule that is being deleted. */ + ruleId: string; +} + +export interface ListRuleOperationsRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.ListRuleOperationsRequest"; + /** ID of the rule to list operations for. */ + ruleId: string; + /** The maximum number of results per response. */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * `next_page_token` returned by a previous list request. + */ + pageToken: string; + /** + * Supported attributes for filter: + * description + * created_at + * modified_at + * created_by + * done + */ + filter: string; +} + +export interface ListRuleOperationsResponse { + $type: "yandex.cloud.serverless.eventrouter.v1.ListRuleOperationsResponse"; + /** List of operations for the specified rule. */ + operations: Operation[]; + /** Token for getting the next page of the list of operations. */ + nextPageToken: string; +} + +export interface EnableRuleRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.EnableRuleRequest"; + /** ID of the rule to enable. */ + ruleId: string; +} + +export interface EnableRuleMetadata { + $type: "yandex.cloud.serverless.eventrouter.v1.EnableRuleMetadata"; + /** ID of the rule that is being enabled. */ + ruleId: string; +} + +export interface DisableRuleRequest { + $type: "yandex.cloud.serverless.eventrouter.v1.DisableRuleRequest"; + /** ID of the rule to disable. */ + ruleId: string; +} + +export interface DisableRuleMetadata { + $type: "yandex.cloud.serverless.eventrouter.v1.DisableRuleMetadata"; + /** ID of the rule that is being disabled. */ + ruleId: string; +} + +const baseGetRuleRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.GetRuleRequest", + ruleId: "", +}; + +export const GetRuleRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.GetRuleRequest" as const, + + encode( + message: GetRuleRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ruleId !== "") { + writer.uint32(10).string(message.ruleId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetRuleRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetRuleRequest } as GetRuleRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ruleId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetRuleRequest { + const message = { ...baseGetRuleRequest } as GetRuleRequest; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? String(object.ruleId) + : ""; + return message; + }, + + toJSON(message: GetRuleRequest): unknown { + const obj: any = {}; + message.ruleId !== undefined && (obj.ruleId = message.ruleId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetRuleRequest { + const message = { ...baseGetRuleRequest } as GetRuleRequest; + message.ruleId = object.ruleId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetRuleRequest.$type, GetRuleRequest); + +const baseListRulesRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListRulesRequest", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListRulesRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListRulesRequest" as const, + + encode( + message: ListRulesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.busId !== undefined) { + writer.uint32(10).string(message.busId); + } + if (message.folderId !== undefined) { + writer.uint32(18).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(24).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(34).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(42).string(message.filter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListRulesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListRulesRequest } as ListRulesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.busId = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 4: + message.pageToken = reader.string(); + break; + case 5: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListRulesRequest { + const message = { ...baseListRulesRequest } as ListRulesRequest; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : undefined; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : undefined; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListRulesRequest): unknown { + const obj: any = {}; + message.busId !== undefined && (obj.busId = message.busId); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListRulesRequest { + const message = { ...baseListRulesRequest } as ListRulesRequest; + message.busId = object.busId ?? undefined; + message.folderId = object.folderId ?? undefined; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListRulesRequest.$type, ListRulesRequest); + +const baseListRulesResponse: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListRulesResponse", + nextPageToken: "", +}; + +export const ListRulesResponse = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListRulesResponse" as const, + + encode( + message: ListRulesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.rules) { + Rule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListRulesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListRulesResponse } as ListRulesResponse; + message.rules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(Rule.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListRulesResponse { + const message = { ...baseListRulesResponse } as ListRulesResponse; + message.rules = (object.rules ?? []).map((e: any) => Rule.fromJSON(e)); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListRulesResponse): unknown { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map((e) => (e ? Rule.toJSON(e) : undefined)); + } else { + obj.rules = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListRulesResponse { + const message = { ...baseListRulesResponse } as ListRulesResponse; + message.rules = object.rules?.map((e) => Rule.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListRulesResponse.$type, ListRulesResponse); + +const baseCreateRuleRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateRuleRequest", + busId: "", + name: "", + description: "", + deletionProtection: false, +}; + +export const CreateRuleRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateRuleRequest" as const, + + encode( + message: CreateRuleRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.busId !== "") { + writer.uint32(10).string(message.busId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateRuleRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.serverless.eventrouter.v1.CreateRuleRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(34).fork() + ).ldelim(); + }); + if (message.filter !== undefined) { + Filter.encode(message.filter, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.targets) { + Target.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.deletionProtection === true) { + writer.uint32(56).bool(message.deletionProtection); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateRuleRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateRuleRequest } as CreateRuleRequest; + message.labels = {}; + message.targets = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.busId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + const entry4 = CreateRuleRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry4.value !== undefined) { + message.labels[entry4.key] = entry4.value; + } + break; + case 5: + message.filter = Filter.decode(reader, reader.uint32()); + break; + case 6: + message.targets.push(Target.decode(reader, reader.uint32())); + break; + case 7: + message.deletionProtection = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateRuleRequest { + const message = { ...baseCreateRuleRequest } as CreateRuleRequest; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.filter = + object.filter !== undefined && object.filter !== null + ? Filter.fromJSON(object.filter) + : undefined; + message.targets = (object.targets ?? []).map((e: any) => + Target.fromJSON(e) + ); + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + return message; + }, + + toJSON(message: CreateRuleRequest): unknown { + const obj: any = {}; + message.busId !== undefined && (obj.busId = message.busId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.filter !== undefined && + (obj.filter = message.filter ? Filter.toJSON(message.filter) : undefined); + if (message.targets) { + obj.targets = message.targets.map((e) => + e ? Target.toJSON(e) : undefined + ); + } else { + obj.targets = []; + } + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateRuleRequest { + const message = { ...baseCreateRuleRequest } as CreateRuleRequest; + message.busId = object.busId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.filter = + object.filter !== undefined && object.filter !== null + ? Filter.fromPartial(object.filter) + : undefined; + message.targets = object.targets?.map((e) => Target.fromPartial(e)) || []; + message.deletionProtection = object.deletionProtection ?? false; + return message; + }, +}; + +messageTypeRegistry.set(CreateRuleRequest.$type, CreateRuleRequest); + +const baseCreateRuleRequest_LabelsEntry: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateRuleRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateRuleRequest_LabelsEntry = { + $type: + "yandex.cloud.serverless.eventrouter.v1.CreateRuleRequest.LabelsEntry" as const, + + encode( + message: CreateRuleRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateRuleRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateRuleRequest_LabelsEntry, + } as CreateRuleRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateRuleRequest_LabelsEntry { + const message = { + ...baseCreateRuleRequest_LabelsEntry, + } as CreateRuleRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateRuleRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateRuleRequest_LabelsEntry { + const message = { + ...baseCreateRuleRequest_LabelsEntry, + } as CreateRuleRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateRuleRequest_LabelsEntry.$type, + CreateRuleRequest_LabelsEntry +); + +const baseCreateRuleMetadata: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateRuleMetadata", + ruleId: "", + busId: "", +}; + +export const CreateRuleMetadata = { + $type: "yandex.cloud.serverless.eventrouter.v1.CreateRuleMetadata" as const, + + encode( + message: CreateRuleMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ruleId !== "") { + writer.uint32(10).string(message.ruleId); + } + if (message.busId !== "") { + writer.uint32(18).string(message.busId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateRuleMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateRuleMetadata } as CreateRuleMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ruleId = reader.string(); + break; + case 2: + message.busId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateRuleMetadata { + const message = { ...baseCreateRuleMetadata } as CreateRuleMetadata; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? String(object.ruleId) + : ""; + message.busId = + object.busId !== undefined && object.busId !== null + ? String(object.busId) + : ""; + return message; + }, + + toJSON(message: CreateRuleMetadata): unknown { + const obj: any = {}; + message.ruleId !== undefined && (obj.ruleId = message.ruleId); + message.busId !== undefined && (obj.busId = message.busId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateRuleMetadata { + const message = { ...baseCreateRuleMetadata } as CreateRuleMetadata; + message.ruleId = object.ruleId ?? ""; + message.busId = object.busId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateRuleMetadata.$type, CreateRuleMetadata); + +const baseUpdateRuleRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateRuleRequest", + ruleId: "", + name: "", + description: "", + deletionProtection: false, +}; + +export const UpdateRuleRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateRuleRequest" as const, + + encode( + message: UpdateRuleRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ruleId !== "") { + writer.uint32(10).string(message.ruleId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateRuleRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.serverless.eventrouter.v1.UpdateRuleRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(42).fork() + ).ldelim(); + }); + if (message.filter !== undefined) { + Filter.encode(message.filter, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.targets) { + Target.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.deletionProtection === true) { + writer.uint32(64).bool(message.deletionProtection); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateRuleRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateRuleRequest } as UpdateRuleRequest; + message.labels = {}; + message.targets = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ruleId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + const entry5 = UpdateRuleRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry5.value !== undefined) { + message.labels[entry5.key] = entry5.value; + } + break; + case 6: + message.filter = Filter.decode(reader, reader.uint32()); + break; + case 7: + message.targets.push(Target.decode(reader, reader.uint32())); + break; + case 8: + message.deletionProtection = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateRuleRequest { + const message = { ...baseUpdateRuleRequest } as UpdateRuleRequest; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? String(object.ruleId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.filter = + object.filter !== undefined && object.filter !== null + ? Filter.fromJSON(object.filter) + : undefined; + message.targets = (object.targets ?? []).map((e: any) => + Target.fromJSON(e) + ); + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + return message; + }, + + toJSON(message: UpdateRuleRequest): unknown { + const obj: any = {}; + message.ruleId !== undefined && (obj.ruleId = message.ruleId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.filter !== undefined && + (obj.filter = message.filter ? Filter.toJSON(message.filter) : undefined); + if (message.targets) { + obj.targets = message.targets.map((e) => + e ? Target.toJSON(e) : undefined + ); + } else { + obj.targets = []; + } + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateRuleRequest { + const message = { ...baseUpdateRuleRequest } as UpdateRuleRequest; + message.ruleId = object.ruleId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.filter = + object.filter !== undefined && object.filter !== null + ? Filter.fromPartial(object.filter) + : undefined; + message.targets = object.targets?.map((e) => Target.fromPartial(e)) || []; + message.deletionProtection = object.deletionProtection ?? false; + return message; + }, +}; + +messageTypeRegistry.set(UpdateRuleRequest.$type, UpdateRuleRequest); + +const baseUpdateRuleRequest_LabelsEntry: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateRuleRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateRuleRequest_LabelsEntry = { + $type: + "yandex.cloud.serverless.eventrouter.v1.UpdateRuleRequest.LabelsEntry" as const, + + encode( + message: UpdateRuleRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateRuleRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateRuleRequest_LabelsEntry, + } as UpdateRuleRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateRuleRequest_LabelsEntry { + const message = { + ...baseUpdateRuleRequest_LabelsEntry, + } as UpdateRuleRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateRuleRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateRuleRequest_LabelsEntry { + const message = { + ...baseUpdateRuleRequest_LabelsEntry, + } as UpdateRuleRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateRuleRequest_LabelsEntry.$type, + UpdateRuleRequest_LabelsEntry +); + +const baseUpdateRuleMetadata: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateRuleMetadata", + ruleId: "", +}; + +export const UpdateRuleMetadata = { + $type: "yandex.cloud.serverless.eventrouter.v1.UpdateRuleMetadata" as const, + + encode( + message: UpdateRuleMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ruleId !== "") { + writer.uint32(10).string(message.ruleId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateRuleMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateRuleMetadata } as UpdateRuleMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ruleId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateRuleMetadata { + const message = { ...baseUpdateRuleMetadata } as UpdateRuleMetadata; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? String(object.ruleId) + : ""; + return message; + }, + + toJSON(message: UpdateRuleMetadata): unknown { + const obj: any = {}; + message.ruleId !== undefined && (obj.ruleId = message.ruleId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateRuleMetadata { + const message = { ...baseUpdateRuleMetadata } as UpdateRuleMetadata; + message.ruleId = object.ruleId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateRuleMetadata.$type, UpdateRuleMetadata); + +const baseDeleteRuleRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteRuleRequest", + ruleId: "", +}; + +export const DeleteRuleRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteRuleRequest" as const, + + encode( + message: DeleteRuleRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ruleId !== "") { + writer.uint32(10).string(message.ruleId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteRuleRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteRuleRequest } as DeleteRuleRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ruleId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteRuleRequest { + const message = { ...baseDeleteRuleRequest } as DeleteRuleRequest; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? String(object.ruleId) + : ""; + return message; + }, + + toJSON(message: DeleteRuleRequest): unknown { + const obj: any = {}; + message.ruleId !== undefined && (obj.ruleId = message.ruleId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteRuleRequest { + const message = { ...baseDeleteRuleRequest } as DeleteRuleRequest; + message.ruleId = object.ruleId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteRuleRequest.$type, DeleteRuleRequest); + +const baseDeleteRuleMetadata: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteRuleMetadata", + ruleId: "", +}; + +export const DeleteRuleMetadata = { + $type: "yandex.cloud.serverless.eventrouter.v1.DeleteRuleMetadata" as const, + + encode( + message: DeleteRuleMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ruleId !== "") { + writer.uint32(10).string(message.ruleId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteRuleMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteRuleMetadata } as DeleteRuleMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ruleId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteRuleMetadata { + const message = { ...baseDeleteRuleMetadata } as DeleteRuleMetadata; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? String(object.ruleId) + : ""; + return message; + }, + + toJSON(message: DeleteRuleMetadata): unknown { + const obj: any = {}; + message.ruleId !== undefined && (obj.ruleId = message.ruleId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteRuleMetadata { + const message = { ...baseDeleteRuleMetadata } as DeleteRuleMetadata; + message.ruleId = object.ruleId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteRuleMetadata.$type, DeleteRuleMetadata); + +const baseListRuleOperationsRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListRuleOperationsRequest", + ruleId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListRuleOperationsRequest = { + $type: + "yandex.cloud.serverless.eventrouter.v1.ListRuleOperationsRequest" as const, + + encode( + message: ListRuleOperationsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ruleId !== "") { + writer.uint32(10).string(message.ruleId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListRuleOperationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListRuleOperationsRequest, + } as ListRuleOperationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ruleId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListRuleOperationsRequest { + const message = { + ...baseListRuleOperationsRequest, + } as ListRuleOperationsRequest; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? String(object.ruleId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListRuleOperationsRequest): unknown { + const obj: any = {}; + message.ruleId !== undefined && (obj.ruleId = message.ruleId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListRuleOperationsRequest { + const message = { + ...baseListRuleOperationsRequest, + } as ListRuleOperationsRequest; + message.ruleId = object.ruleId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListRuleOperationsRequest.$type, + ListRuleOperationsRequest +); + +const baseListRuleOperationsResponse: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.ListRuleOperationsResponse", + nextPageToken: "", +}; + +export const ListRuleOperationsResponse = { + $type: + "yandex.cloud.serverless.eventrouter.v1.ListRuleOperationsResponse" as const, + + encode( + message: ListRuleOperationsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.operations) { + Operation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListRuleOperationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListRuleOperationsResponse, + } as ListRuleOperationsResponse; + message.operations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operations.push(Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListRuleOperationsResponse { + const message = { + ...baseListRuleOperationsResponse, + } as ListRuleOperationsResponse; + message.operations = (object.operations ?? []).map((e: any) => + Operation.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListRuleOperationsResponse): unknown { + const obj: any = {}; + if (message.operations) { + obj.operations = message.operations.map((e) => + e ? Operation.toJSON(e) : undefined + ); + } else { + obj.operations = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListRuleOperationsResponse { + const message = { + ...baseListRuleOperationsResponse, + } as ListRuleOperationsResponse; + message.operations = + object.operations?.map((e) => Operation.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListRuleOperationsResponse.$type, + ListRuleOperationsResponse +); + +const baseEnableRuleRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.EnableRuleRequest", + ruleId: "", +}; + +export const EnableRuleRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.EnableRuleRequest" as const, + + encode( + message: EnableRuleRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ruleId !== "") { + writer.uint32(10).string(message.ruleId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnableRuleRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnableRuleRequest } as EnableRuleRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ruleId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnableRuleRequest { + const message = { ...baseEnableRuleRequest } as EnableRuleRequest; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? String(object.ruleId) + : ""; + return message; + }, + + toJSON(message: EnableRuleRequest): unknown { + const obj: any = {}; + message.ruleId !== undefined && (obj.ruleId = message.ruleId); + return obj; + }, + + fromPartial, I>>( + object: I + ): EnableRuleRequest { + const message = { ...baseEnableRuleRequest } as EnableRuleRequest; + message.ruleId = object.ruleId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(EnableRuleRequest.$type, EnableRuleRequest); + +const baseEnableRuleMetadata: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.EnableRuleMetadata", + ruleId: "", +}; + +export const EnableRuleMetadata = { + $type: "yandex.cloud.serverless.eventrouter.v1.EnableRuleMetadata" as const, + + encode( + message: EnableRuleMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ruleId !== "") { + writer.uint32(10).string(message.ruleId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnableRuleMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnableRuleMetadata } as EnableRuleMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ruleId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnableRuleMetadata { + const message = { ...baseEnableRuleMetadata } as EnableRuleMetadata; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? String(object.ruleId) + : ""; + return message; + }, + + toJSON(message: EnableRuleMetadata): unknown { + const obj: any = {}; + message.ruleId !== undefined && (obj.ruleId = message.ruleId); + return obj; + }, + + fromPartial, I>>( + object: I + ): EnableRuleMetadata { + const message = { ...baseEnableRuleMetadata } as EnableRuleMetadata; + message.ruleId = object.ruleId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(EnableRuleMetadata.$type, EnableRuleMetadata); + +const baseDisableRuleRequest: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.DisableRuleRequest", + ruleId: "", +}; + +export const DisableRuleRequest = { + $type: "yandex.cloud.serverless.eventrouter.v1.DisableRuleRequest" as const, + + encode( + message: DisableRuleRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ruleId !== "") { + writer.uint32(10).string(message.ruleId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DisableRuleRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDisableRuleRequest } as DisableRuleRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ruleId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DisableRuleRequest { + const message = { ...baseDisableRuleRequest } as DisableRuleRequest; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? String(object.ruleId) + : ""; + return message; + }, + + toJSON(message: DisableRuleRequest): unknown { + const obj: any = {}; + message.ruleId !== undefined && (obj.ruleId = message.ruleId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DisableRuleRequest { + const message = { ...baseDisableRuleRequest } as DisableRuleRequest; + message.ruleId = object.ruleId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DisableRuleRequest.$type, DisableRuleRequest); + +const baseDisableRuleMetadata: object = { + $type: "yandex.cloud.serverless.eventrouter.v1.DisableRuleMetadata", + ruleId: "", +}; + +export const DisableRuleMetadata = { + $type: "yandex.cloud.serverless.eventrouter.v1.DisableRuleMetadata" as const, + + encode( + message: DisableRuleMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ruleId !== "") { + writer.uint32(10).string(message.ruleId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DisableRuleMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDisableRuleMetadata } as DisableRuleMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ruleId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DisableRuleMetadata { + const message = { ...baseDisableRuleMetadata } as DisableRuleMetadata; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? String(object.ruleId) + : ""; + return message; + }, + + toJSON(message: DisableRuleMetadata): unknown { + const obj: any = {}; + message.ruleId !== undefined && (obj.ruleId = message.ruleId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DisableRuleMetadata { + const message = { ...baseDisableRuleMetadata } as DisableRuleMetadata; + message.ruleId = object.ruleId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DisableRuleMetadata.$type, DisableRuleMetadata); + +/** A set of methods for managing rules for serverless eventrouter. */ +export const RuleServiceService = { + /** + * Returns the specified rules. + * To get the list of all available buses, make a [List] request. + */ + get: { + path: "/yandex.cloud.serverless.eventrouter.v1.RuleService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetRuleRequest) => + Buffer.from(GetRuleRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetRuleRequest.decode(value), + responseSerialize: (value: Rule) => + Buffer.from(Rule.encode(value).finish()), + responseDeserialize: (value: Buffer) => Rule.decode(value), + }, + /** Retrieves the list of rules in the specified folder. */ + list: { + path: "/yandex.cloud.serverless.eventrouter.v1.RuleService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListRulesRequest) => + Buffer.from(ListRulesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListRulesRequest.decode(value), + responseSerialize: (value: ListRulesResponse) => + Buffer.from(ListRulesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListRulesResponse.decode(value), + }, + /** Creates a rule in the specified folder. */ + create: { + path: "/yandex.cloud.serverless.eventrouter.v1.RuleService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateRuleRequest) => + Buffer.from(CreateRuleRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateRuleRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates the specified rule. */ + update: { + path: "/yandex.cloud.serverless.eventrouter.v1.RuleService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateRuleRequest) => + Buffer.from(UpdateRuleRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateRuleRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes the specified rule. */ + delete: { + path: "/yandex.cloud.serverless.eventrouter.v1.RuleService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteRuleRequest) => + Buffer.from(DeleteRuleRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteRuleRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Enables the specified rule. */ + enable: { + path: "/yandex.cloud.serverless.eventrouter.v1.RuleService/Enable", + requestStream: false, + responseStream: false, + requestSerialize: (value: EnableRuleRequest) => + Buffer.from(EnableRuleRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => EnableRuleRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Disables the specified rule. */ + disable: { + path: "/yandex.cloud.serverless.eventrouter.v1.RuleService/Disable", + requestStream: false, + responseStream: false, + requestSerialize: (value: DisableRuleRequest) => + Buffer.from(DisableRuleRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DisableRuleRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Lists existing access bindings for the specified rule. */ + listAccessBindings: { + path: "/yandex.cloud.serverless.eventrouter.v1.RuleService/ListAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAccessBindingsRequest) => + Buffer.from(ListAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListAccessBindingsRequest.decode(value), + responseSerialize: (value: ListAccessBindingsResponse) => + Buffer.from(ListAccessBindingsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListAccessBindingsResponse.decode(value), + }, + /** Sets access bindings for the rule. */ + setAccessBindings: { + path: "/yandex.cloud.serverless.eventrouter.v1.RuleService/SetAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: SetAccessBindingsRequest) => + Buffer.from(SetAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + SetAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates access bindings for the specified rule. */ + updateAccessBindings: { + path: "/yandex.cloud.serverless.eventrouter.v1.RuleService/UpdateAccessBindings", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAccessBindingsRequest) => + Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateAccessBindingsRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Lists operations for the specified rule. */ + listOperations: { + path: "/yandex.cloud.serverless.eventrouter.v1.RuleService/ListOperations", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListRuleOperationsRequest) => + Buffer.from(ListRuleOperationsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListRuleOperationsRequest.decode(value), + responseSerialize: (value: ListRuleOperationsResponse) => + Buffer.from(ListRuleOperationsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListRuleOperationsResponse.decode(value), + }, +} as const; + +export interface RuleServiceServer extends UntypedServiceImplementation { + /** + * Returns the specified rules. + * To get the list of all available buses, make a [List] request. + */ + get: handleUnaryCall; + /** Retrieves the list of rules in the specified folder. */ + list: handleUnaryCall; + /** Creates a rule in the specified folder. */ + create: handleUnaryCall; + /** Updates the specified rule. */ + update: handleUnaryCall; + /** Deletes the specified rule. */ + delete: handleUnaryCall; + /** Enables the specified rule. */ + enable: handleUnaryCall; + /** Disables the specified rule. */ + disable: handleUnaryCall; + /** Lists existing access bindings for the specified rule. */ + listAccessBindings: handleUnaryCall< + ListAccessBindingsRequest, + ListAccessBindingsResponse + >; + /** Sets access bindings for the rule. */ + setAccessBindings: handleUnaryCall; + /** Updates access bindings for the specified rule. */ + updateAccessBindings: handleUnaryCall; + /** Lists operations for the specified rule. */ + listOperations: handleUnaryCall< + ListRuleOperationsRequest, + ListRuleOperationsResponse + >; +} + +export interface RuleServiceClient extends Client { + /** + * Returns the specified rules. + * To get the list of all available buses, make a [List] request. + */ + get( + request: GetRuleRequest, + callback: (error: ServiceError | null, response: Rule) => void + ): ClientUnaryCall; + get( + request: GetRuleRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Rule) => void + ): ClientUnaryCall; + get( + request: GetRuleRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Rule) => void + ): ClientUnaryCall; + /** Retrieves the list of rules in the specified folder. */ + list( + request: ListRulesRequest, + callback: (error: ServiceError | null, response: ListRulesResponse) => void + ): ClientUnaryCall; + list( + request: ListRulesRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: ListRulesResponse) => void + ): ClientUnaryCall; + list( + request: ListRulesRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: ListRulesResponse) => void + ): ClientUnaryCall; + /** Creates a rule in the specified folder. */ + create( + request: CreateRuleRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateRuleRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateRuleRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates the specified rule. */ + update( + request: UpdateRuleRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateRuleRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateRuleRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes the specified rule. */ + delete( + request: DeleteRuleRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteRuleRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteRuleRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Enables the specified rule. */ + enable( + request: EnableRuleRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + enable( + request: EnableRuleRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + enable( + request: EnableRuleRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Disables the specified rule. */ + disable( + request: DisableRuleRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + disable( + request: DisableRuleRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + disable( + request: DisableRuleRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Lists existing access bindings for the specified rule. */ + listAccessBindings( + request: ListAccessBindingsRequest, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + listAccessBindings( + request: ListAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAccessBindingsResponse + ) => void + ): ClientUnaryCall; + /** Sets access bindings for the rule. */ + setAccessBindings( + request: SetAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + setAccessBindings( + request: SetAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates access bindings for the specified rule. */ + updateAccessBindings( + request: UpdateAccessBindingsRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateAccessBindings( + request: UpdateAccessBindingsRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Lists operations for the specified rule. */ + listOperations( + request: ListRuleOperationsRequest, + callback: ( + error: ServiceError | null, + response: ListRuleOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListRuleOperationsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListRuleOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListRuleOperationsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListRuleOperationsResponse + ) => void + ): ClientUnaryCall; +} + +export const RuleServiceClient = makeGenericClientConstructor( + RuleServiceService, + "yandex.cloud.serverless.eventrouter.v1.RuleService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): RuleServiceClient; + service: typeof RuleServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/serverless/functions/v1/function.ts b/src/generated/yandex/cloud/serverless/functions/v1/function.ts index e76b4fd1..3987eb10 100644 --- a/src/generated/yandex/cloud/serverless/functions/v1/function.ts +++ b/src/generated/yandex/cloud/serverless/functions/v1/function.ts @@ -27,8 +27,6 @@ export interface Function { description: string; /** Function labels as `key:value` pairs. */ labels: { [key: string]: string }; - /** ID of the log group for the function. */ - logGroupId: string; /** URL that needs to be requested to invoke the function. */ httpInvokeUrl: string; /** Status of the function. */ @@ -134,8 +132,6 @@ export interface Version { status: Version_Status; /** Version tags. For details, see [Version tag](/docs/functions/concepts/function#tag). */ tags: string[]; - /** ID of the log group for the version. */ - logGroupId: string; /** Environment settings for the version. */ environment: { [key: string]: string }; /** Network access. If specified the version will be attached to specified network/subnet(s). */ @@ -150,6 +146,12 @@ export interface Version { storageMounts: StorageMount[]; /** Config for asynchronous invocations of the version */ asyncInvocationConfig?: AsyncInvocationConfig; + /** Optional size of in-memory mounted /tmp directory in bytes. */ + tmpfsSize: number; + /** The maximum number of requests processed by a function instance at the same time */ + concurrency: number; + /** Mounts to be used by the version. */ + mounts: Mount[]; } export enum Version_Status { @@ -158,6 +160,10 @@ export enum Version_Status { CREATING = 1, /** ACTIVE - Version is ready to use. */ ACTIVE = 2, + /** OBSOLETE - Version will be deleted soon. */ + OBSOLETE = 3, + /** DELETING - Version is being deleted. */ + DELETING = 4, UNRECOGNIZED = -1, } @@ -172,6 +178,12 @@ export function version_StatusFromJSON(object: any): Version_Status { case 2: case "ACTIVE": return Version_Status.ACTIVE; + case 3: + case "OBSOLETE": + return Version_Status.OBSOLETE; + case 4: + case "DELETING": + return Version_Status.DELETING; case -1: case "UNRECOGNIZED": default: @@ -187,6 +199,10 @@ export function version_StatusToJSON(object: Version_Status): string { return "CREATING"; case Version_Status.ACTIVE: return "ACTIVE"; + case Version_Status.OBSOLETE: + return "OBSOLETE"; + case Version_Status.DELETING: + return "DELETING"; default: return "UNKNOWN"; } @@ -293,6 +309,7 @@ export interface LogOptions { minLevel: LogLevel_Level; } +/** @deprecated */ export interface StorageMount { $type: "yandex.cloud.serverless.functions.v1.StorageMount"; /** S3 bucket name for mounting. */ @@ -305,6 +322,75 @@ export interface StorageMount { readOnly: boolean; } +/** Mount contains an information about version's external storage mount */ +export interface Mount { + $type: "yandex.cloud.serverless.functions.v1.Mount"; + /** Unique mount point name. Device will be mounted into /function/storage/ */ + name: string; + /** Mount's mode */ + mode: Mount_Mode; + /** Object storage mounts */ + objectStorage?: Mount_ObjectStorage | undefined; + /** Working disk (worker-local non-shared read-write NBS disk templates) */ + ephemeralDiskSpec?: Mount_DiskSpec | undefined; +} + +export enum Mount_Mode { + MODE_UNSPECIFIED = 0, + READ_ONLY = 1, + READ_WRITE = 2, + UNRECOGNIZED = -1, +} + +export function mount_ModeFromJSON(object: any): Mount_Mode { + switch (object) { + case 0: + case "MODE_UNSPECIFIED": + return Mount_Mode.MODE_UNSPECIFIED; + case 1: + case "READ_ONLY": + return Mount_Mode.READ_ONLY; + case 2: + case "READ_WRITE": + return Mount_Mode.READ_WRITE; + case -1: + case "UNRECOGNIZED": + default: + return Mount_Mode.UNRECOGNIZED; + } +} + +export function mount_ModeToJSON(object: Mount_Mode): string { + switch (object) { + case Mount_Mode.MODE_UNSPECIFIED: + return "MODE_UNSPECIFIED"; + case Mount_Mode.READ_ONLY: + return "READ_ONLY"; + case Mount_Mode.READ_WRITE: + return "READ_WRITE"; + default: + return "UNKNOWN"; + } +} + +/** ObjectStorage as a mount */ +export interface Mount_ObjectStorage { + $type: "yandex.cloud.serverless.functions.v1.Mount.ObjectStorage"; + /** ObjectStorage bucket name for mounting. */ + bucketId: string; + /** ObjectStorage bucket prefix for mounting. */ + prefix: string; +} + +/** Disk as a mount */ +export interface Mount_DiskSpec { + $type: "yandex.cloud.serverless.functions.v1.Mount.DiskSpec"; + /** The size of disk for mount in bytes */ + size: number; + /** Optional block size of disk for mount in bytes */ + blockSize: number; +} + export interface AsyncInvocationConfig { $type: "yandex.cloud.serverless.functions.v1.AsyncInvocationConfig"; /** Number of retries of version invocation */ @@ -344,7 +430,6 @@ const baseFunction: object = { folderId: "", name: "", description: "", - logGroupId: "", httpInvokeUrl: "", status: 0, }; @@ -384,9 +469,6 @@ export const Function = { writer.uint32(50).fork() ).ldelim(); }); - if (message.logGroupId !== "") { - writer.uint32(58).string(message.logGroupId); - } if (message.httpInvokeUrl !== "") { writer.uint32(66).string(message.httpInvokeUrl); } @@ -427,9 +509,6 @@ export const Function = { message.labels[entry6.key] = entry6.value; } break; - case 7: - message.logGroupId = reader.string(); - break; case 8: message.httpInvokeUrl = reader.string(); break; @@ -470,10 +549,6 @@ export const Function = { acc[key] = String(value); return acc; }, {}); - message.logGroupId = - object.logGroupId !== undefined && object.logGroupId !== null - ? String(object.logGroupId) - : ""; message.httpInvokeUrl = object.httpInvokeUrl !== undefined && object.httpInvokeUrl !== null ? String(object.httpInvokeUrl) @@ -500,7 +575,6 @@ export const Function = { obj.labels[k] = v; }); } - message.logGroupId !== undefined && (obj.logGroupId = message.logGroupId); message.httpInvokeUrl !== undefined && (obj.httpInvokeUrl = message.httpInvokeUrl); message.status !== undefined && @@ -523,7 +597,6 @@ export const Function = { } return acc; }, {}); - message.logGroupId = object.logGroupId ?? ""; message.httpInvokeUrl = object.httpInvokeUrl ?? ""; message.status = object.status ?? 0; return message; @@ -619,7 +692,8 @@ const baseVersion: object = { imageSize: 0, status: 0, tags: "", - logGroupId: "", + tmpfsSize: 0, + concurrency: 0, }; export const Version = { @@ -671,9 +745,6 @@ export const Version = { for (const v of message.tags) { writer.uint32(114).string(v!); } - if (message.logGroupId !== "") { - writer.uint32(122).string(message.logGroupId); - } Object.entries(message.environment).forEach(([key, value]) => { Version_EnvironmentEntry.encode( { @@ -717,6 +788,15 @@ export const Version = { writer.uint32(178).fork() ).ldelim(); } + if (message.tmpfsSize !== 0) { + writer.uint32(184).int64(message.tmpfsSize); + } + if (message.concurrency !== 0) { + writer.uint32(192).int64(message.concurrency); + } + for (const v of message.mounts) { + Mount.encode(v!, writer.uint32(202).fork()).ldelim(); + } return writer; }, @@ -729,6 +809,7 @@ export const Version = { message.namedServiceAccounts = {}; message.secrets = []; message.storageMounts = []; + message.mounts = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -770,9 +851,6 @@ export const Version = { case 14: message.tags.push(reader.string()); break; - case 15: - message.logGroupId = reader.string(); - break; case 16: const entry16 = Version_EnvironmentEntry.decode( reader, @@ -811,6 +889,15 @@ export const Version = { reader.uint32() ); break; + case 23: + message.tmpfsSize = longToNumber(reader.int64() as Long); + break; + case 24: + message.concurrency = longToNumber(reader.int64() as Long); + break; + case 25: + message.mounts.push(Mount.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -864,10 +951,6 @@ export const Version = { ? version_StatusFromJSON(object.status) : 0; message.tags = (object.tags ?? []).map((e: any) => String(e)); - message.logGroupId = - object.logGroupId !== undefined && object.logGroupId !== null - ? String(object.logGroupId) - : ""; message.environment = Object.entries(object.environment ?? {}).reduce<{ [key: string]: string; }>((acc, [key, value]) => { @@ -899,6 +982,15 @@ export const Version = { object.asyncInvocationConfig !== null ? AsyncInvocationConfig.fromJSON(object.asyncInvocationConfig) : undefined; + message.tmpfsSize = + object.tmpfsSize !== undefined && object.tmpfsSize !== null + ? Number(object.tmpfsSize) + : 0; + message.concurrency = + object.concurrency !== undefined && object.concurrency !== null + ? Number(object.concurrency) + : 0; + message.mounts = (object.mounts ?? []).map((e: any) => Mount.fromJSON(e)); return message; }, @@ -931,7 +1023,6 @@ export const Version = { } else { obj.tags = []; } - message.logGroupId !== undefined && (obj.logGroupId = message.logGroupId); obj.environment = {}; if (message.environment) { Object.entries(message.environment).forEach(([k, v]) => { @@ -970,6 +1061,15 @@ export const Version = { (obj.asyncInvocationConfig = message.asyncInvocationConfig ? AsyncInvocationConfig.toJSON(message.asyncInvocationConfig) : undefined); + message.tmpfsSize !== undefined && + (obj.tmpfsSize = Math.round(message.tmpfsSize)); + message.concurrency !== undefined && + (obj.concurrency = Math.round(message.concurrency)); + if (message.mounts) { + obj.mounts = message.mounts.map((e) => (e ? Mount.toJSON(e) : undefined)); + } else { + obj.mounts = []; + } return obj; }, @@ -993,7 +1093,6 @@ export const Version = { message.imageSize = object.imageSize ?? 0; message.status = object.status ?? 0; message.tags = object.tags?.map((e) => e) || []; - message.logGroupId = object.logGroupId ?? ""; message.environment = Object.entries(object.environment ?? {}).reduce<{ [key: string]: string; }>((acc, [key, value]) => { @@ -1026,6 +1125,9 @@ export const Version = { object.asyncInvocationConfig !== null ? AsyncInvocationConfig.fromPartial(object.asyncInvocationConfig) : undefined; + message.tmpfsSize = object.tmpfsSize ?? 0; + message.concurrency = object.concurrency ?? 0; + message.mounts = object.mounts?.map((e) => Mount.fromPartial(e)) || []; return message; }, }; @@ -1886,6 +1988,277 @@ export const StorageMount = { messageTypeRegistry.set(StorageMount.$type, StorageMount); +const baseMount: object = { + $type: "yandex.cloud.serverless.functions.v1.Mount", + name: "", + mode: 0, +}; + +export const Mount = { + $type: "yandex.cloud.serverless.functions.v1.Mount" as const, + + encode(message: Mount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.mode !== 0) { + writer.uint32(24).int32(message.mode); + } + if (message.objectStorage !== undefined) { + Mount_ObjectStorage.encode( + message.objectStorage, + writer.uint32(82).fork() + ).ldelim(); + } + if (message.ephemeralDiskSpec !== undefined) { + Mount_DiskSpec.encode( + message.ephemeralDiskSpec, + writer.uint32(90).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Mount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMount } as Mount; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.mode = reader.int32() as any; + break; + case 10: + message.objectStorage = Mount_ObjectStorage.decode( + reader, + reader.uint32() + ); + break; + case 11: + message.ephemeralDiskSpec = Mount_DiskSpec.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mount { + const message = { ...baseMount } as Mount; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.mode = + object.mode !== undefined && object.mode !== null + ? mount_ModeFromJSON(object.mode) + : 0; + message.objectStorage = + object.objectStorage !== undefined && object.objectStorage !== null + ? Mount_ObjectStorage.fromJSON(object.objectStorage) + : undefined; + message.ephemeralDiskSpec = + object.ephemeralDiskSpec !== undefined && + object.ephemeralDiskSpec !== null + ? Mount_DiskSpec.fromJSON(object.ephemeralDiskSpec) + : undefined; + return message; + }, + + toJSON(message: Mount): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.mode !== undefined && (obj.mode = mount_ModeToJSON(message.mode)); + message.objectStorage !== undefined && + (obj.objectStorage = message.objectStorage + ? Mount_ObjectStorage.toJSON(message.objectStorage) + : undefined); + message.ephemeralDiskSpec !== undefined && + (obj.ephemeralDiskSpec = message.ephemeralDiskSpec + ? Mount_DiskSpec.toJSON(message.ephemeralDiskSpec) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Mount { + const message = { ...baseMount } as Mount; + message.name = object.name ?? ""; + message.mode = object.mode ?? 0; + message.objectStorage = + object.objectStorage !== undefined && object.objectStorage !== null + ? Mount_ObjectStorage.fromPartial(object.objectStorage) + : undefined; + message.ephemeralDiskSpec = + object.ephemeralDiskSpec !== undefined && + object.ephemeralDiskSpec !== null + ? Mount_DiskSpec.fromPartial(object.ephemeralDiskSpec) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Mount.$type, Mount); + +const baseMount_ObjectStorage: object = { + $type: "yandex.cloud.serverless.functions.v1.Mount.ObjectStorage", + bucketId: "", + prefix: "", +}; + +export const Mount_ObjectStorage = { + $type: "yandex.cloud.serverless.functions.v1.Mount.ObjectStorage" as const, + + encode( + message: Mount_ObjectStorage, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.bucketId !== "") { + writer.uint32(10).string(message.bucketId); + } + if (message.prefix !== "") { + writer.uint32(18).string(message.prefix); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Mount_ObjectStorage { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMount_ObjectStorage } as Mount_ObjectStorage; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bucketId = reader.string(); + break; + case 2: + message.prefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mount_ObjectStorage { + const message = { ...baseMount_ObjectStorage } as Mount_ObjectStorage; + message.bucketId = + object.bucketId !== undefined && object.bucketId !== null + ? String(object.bucketId) + : ""; + message.prefix = + object.prefix !== undefined && object.prefix !== null + ? String(object.prefix) + : ""; + return message; + }, + + toJSON(message: Mount_ObjectStorage): unknown { + const obj: any = {}; + message.bucketId !== undefined && (obj.bucketId = message.bucketId); + message.prefix !== undefined && (obj.prefix = message.prefix); + return obj; + }, + + fromPartial, I>>( + object: I + ): Mount_ObjectStorage { + const message = { ...baseMount_ObjectStorage } as Mount_ObjectStorage; + message.bucketId = object.bucketId ?? ""; + message.prefix = object.prefix ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Mount_ObjectStorage.$type, Mount_ObjectStorage); + +const baseMount_DiskSpec: object = { + $type: "yandex.cloud.serverless.functions.v1.Mount.DiskSpec", + size: 0, + blockSize: 0, +}; + +export const Mount_DiskSpec = { + $type: "yandex.cloud.serverless.functions.v1.Mount.DiskSpec" as const, + + encode( + message: Mount_DiskSpec, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.size !== 0) { + writer.uint32(8).int64(message.size); + } + if (message.blockSize !== 0) { + writer.uint32(16).int64(message.blockSize); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Mount_DiskSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMount_DiskSpec } as Mount_DiskSpec; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.size = longToNumber(reader.int64() as Long); + break; + case 2: + message.blockSize = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Mount_DiskSpec { + const message = { ...baseMount_DiskSpec } as Mount_DiskSpec; + message.size = + object.size !== undefined && object.size !== null + ? Number(object.size) + : 0; + message.blockSize = + object.blockSize !== undefined && object.blockSize !== null + ? Number(object.blockSize) + : 0; + return message; + }, + + toJSON(message: Mount_DiskSpec): unknown { + const obj: any = {}; + message.size !== undefined && (obj.size = Math.round(message.size)); + message.blockSize !== undefined && + (obj.blockSize = Math.round(message.blockSize)); + return obj; + }, + + fromPartial, I>>( + object: I + ): Mount_DiskSpec { + const message = { ...baseMount_DiskSpec } as Mount_DiskSpec; + message.size = object.size ?? 0; + message.blockSize = object.blockSize ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Mount_DiskSpec.$type, Mount_DiskSpec); + const baseAsyncInvocationConfig: object = { $type: "yandex.cloud.serverless.functions.v1.AsyncInvocationConfig", retriesCount: 0, diff --git a/src/generated/yandex/cloud/serverless/functions/v1/function_service.ts b/src/generated/yandex/cloud/serverless/functions/v1/function_service.ts index c8b4e5cf..7aed4671 100644 --- a/src/generated/yandex/cloud/serverless/functions/v1/function_service.ts +++ b/src/generated/yandex/cloud/serverless/functions/v1/function_service.ts @@ -25,6 +25,7 @@ import { Package, Secret, StorageMount, + Mount, ScalingPolicy, } from "../../../../../yandex/cloud/serverless/functions/v1/function"; import { Duration } from "../../../../../google/protobuf/duration"; @@ -377,6 +378,17 @@ export interface CreateFunctionVersionRequest { storageMounts: StorageMount[]; /** Config for asynchronous invocations of the version */ asyncInvocationConfig?: AsyncInvocationConfig; + /** + * Optional size of in-memory mounted /tmp directory in bytes. + * Available for versions with resources.memory greater or equal to 1024 MiB. + * + * 0 or in range from 512 MiB to 3/4 of resources.memory. + */ + tmpfsSize: number; + /** The maximum number of requests processed by a function instance at the same time */ + concurrency: number; + /** Mounts to be used by the version. */ + mounts: Mount[]; } export interface CreateFunctionVersionRequest_EnvironmentEntry { @@ -2447,6 +2459,8 @@ const baseCreateFunctionVersionRequest: object = { entrypoint: "", serviceAccountId: "", tag: "", + tmpfsSize: 0, + concurrency: 0, }; export const CreateFunctionVersionRequest = { @@ -2536,6 +2550,15 @@ export const CreateFunctionVersionRequest = { writer.uint32(178).fork() ).ldelim(); } + if (message.tmpfsSize !== 0) { + writer.uint32(184).int64(message.tmpfsSize); + } + if (message.concurrency !== 0) { + writer.uint32(192).int64(message.concurrency); + } + for (const v of message.mounts) { + Mount.encode(v!, writer.uint32(202).fork()).ldelim(); + } return writer; }, @@ -2553,6 +2576,7 @@ export const CreateFunctionVersionRequest = { message.namedServiceAccounts = {}; message.secrets = []; message.storageMounts = []; + message.mounts = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2628,6 +2652,15 @@ export const CreateFunctionVersionRequest = { reader.uint32() ); break; + case 23: + message.tmpfsSize = longToNumber(reader.int64() as Long); + break; + case 24: + message.concurrency = longToNumber(reader.int64() as Long); + break; + case 25: + message.mounts.push(Mount.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -2712,6 +2745,15 @@ export const CreateFunctionVersionRequest = { object.asyncInvocationConfig !== null ? AsyncInvocationConfig.fromJSON(object.asyncInvocationConfig) : undefined; + message.tmpfsSize = + object.tmpfsSize !== undefined && object.tmpfsSize !== null + ? Number(object.tmpfsSize) + : 0; + message.concurrency = + object.concurrency !== undefined && object.concurrency !== null + ? Number(object.concurrency) + : 0; + message.mounts = (object.mounts ?? []).map((e: any) => Mount.fromJSON(e)); return message; }, @@ -2785,6 +2827,15 @@ export const CreateFunctionVersionRequest = { (obj.asyncInvocationConfig = message.asyncInvocationConfig ? AsyncInvocationConfig.toJSON(message.asyncInvocationConfig) : undefined); + message.tmpfsSize !== undefined && + (obj.tmpfsSize = Math.round(message.tmpfsSize)); + message.concurrency !== undefined && + (obj.concurrency = Math.round(message.concurrency)); + if (message.mounts) { + obj.mounts = message.mounts.map((e) => (e ? Mount.toJSON(e) : undefined)); + } else { + obj.mounts = []; + } return obj; }, @@ -2846,6 +2897,9 @@ export const CreateFunctionVersionRequest = { object.asyncInvocationConfig !== null ? AsyncInvocationConfig.fromPartial(object.asyncInvocationConfig) : undefined; + message.tmpfsSize = object.tmpfsSize ?? 0; + message.concurrency = object.concurrency ?? 0; + message.mounts = object.mounts?.map((e) => Mount.fromPartial(e)) || []; return message; }, }; diff --git a/src/generated/yandex/cloud/serverless/functions/v1/network_service.ts b/src/generated/yandex/cloud/serverless/functions/v1/network_service.ts new file mode 100644 index 00000000..7589cfed --- /dev/null +++ b/src/generated/yandex/cloud/serverless/functions/v1/network_service.ts @@ -0,0 +1,1417 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.serverless.functions.v1"; + +/** A VPC network used in serverless resources. */ +export interface UsedNetwork { + $type: "yandex.cloud.serverless.functions.v1.UsedNetwork"; + /** ID of the VPC network. */ + networkId: string; + /** ID of the cloud that the network belongs to. */ + cloudId: string; + /** ID of the folder that the network belongs to. */ + folderId: string; + /** Status of the network. */ + status: UsedNetwork_Status; + /** Clean-up timestamp of the obsolete network. */ + willBeCleanedUpAt?: Date; + /** Number of serverless resources connected to the network. */ + connectionsCount: number; +} + +export enum UsedNetwork_Status { + STATUS_UNSPECIFIED = 0, + /** CREATING - Network is connecting to its first serverless resource. */ + CREATING = 1, + /** ACTIVE - Network is already being used by some serverless resources. */ + ACTIVE = 2, + /** + * OBSOLETE - Network is no longer used by any serverless resources. + * It will be cleaned-up after a while. + */ + OBSOLETE = 3, + UNRECOGNIZED = -1, +} + +export function usedNetwork_StatusFromJSON(object: any): UsedNetwork_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return UsedNetwork_Status.STATUS_UNSPECIFIED; + case 1: + case "CREATING": + return UsedNetwork_Status.CREATING; + case 2: + case "ACTIVE": + return UsedNetwork_Status.ACTIVE; + case 3: + case "OBSOLETE": + return UsedNetwork_Status.OBSOLETE; + case -1: + case "UNRECOGNIZED": + default: + return UsedNetwork_Status.UNRECOGNIZED; + } +} + +export function usedNetwork_StatusToJSON(object: UsedNetwork_Status): string { + switch (object) { + case UsedNetwork_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case UsedNetwork_Status.CREATING: + return "CREATING"; + case UsedNetwork_Status.ACTIVE: + return "ACTIVE"; + case UsedNetwork_Status.OBSOLETE: + return "OBSOLETE"; + default: + return "UNKNOWN"; + } +} + +export interface GetUsedNetworkRequest { + $type: "yandex.cloud.serverless.functions.v1.GetUsedNetworkRequest"; + /** ID of the network to return. */ + networkId: string; +} + +export interface ListUsedNetworksRequest { + $type: "yandex.cloud.serverless.functions.v1.ListUsedNetworksRequest"; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than `pageSize`, the service returns a [ListUsedNetworksResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `pageToken` to the + * [ListUsedNetworksResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** ID of the cloud to list used networks in. */ + cloudId: string | undefined; + /** ID of the folder to list used networks in. */ + folderId: string | undefined; +} + +export interface ListUsedNetworksResponse { + $type: "yandex.cloud.serverless.functions.v1.ListUsedNetworksResponse"; + /** List of used networks in the specified scope. */ + networks: UsedNetwork[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListUsedNetworksRequest.page_size], use `nextPageToken` as the value + * for the [ListUsedNetworksRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `nextPageToken` to continue paging through the results. + */ + nextPageToken: string; +} + +export interface ListConnectedResourcesRequest { + $type: "yandex.cloud.serverless.functions.v1.ListConnectedResourcesRequest"; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than `pageSize`, the service returns a [ListConnectedResourcesResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `pageToken` to the + * [ListConnectedResourcesResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** ID of the network to list serverless resources connected to it. */ + networkId: string | undefined; + /** ID of the cloud to list serverless resources connected to any network from it. */ + cloudId: string | undefined; + /** ID of the folder to list serverless resources connected to any network from it. */ + folderId: string | undefined; +} + +export interface ListConnectedResourcesResponse { + $type: "yandex.cloud.serverless.functions.v1.ListConnectedResourcesResponse"; + /** List of serverless resources connected to any network from the specified scope. */ + resources: ListConnectedResourcesResponse_ConnectedResource[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListConnectedResourcesRequest.page_size], use `nextPageToken` as the value + * for the [ListConnectedResourcesRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `nextPageToken` to continue paging through the results. + */ + nextPageToken: string; +} + +/** Serverless resource connected to VPC network. */ +export interface ListConnectedResourcesResponse_ConnectedResource { + $type: "yandex.cloud.serverless.functions.v1.ListConnectedResourcesResponse.ConnectedResource"; + /** ID of the network to which the resource is connected. */ + networkId: string; + /** Type of the serverless resource. */ + resourceType: string; + /** ID of the serverless resource. */ + resourceId: string; + /** Type of the serverless subresource. */ + subresourceType: string; + /** ID of the serverless subresource. */ + subresourceId: string; + /** ID of the cloud that the resource belongs to. */ + resourceCloudId: string; + /** ID of the folder thar the resource belongs to. */ + resourceFolderId: string; +} + +export interface TriggerUsedNetworkCleanupRequest { + $type: "yandex.cloud.serverless.functions.v1.TriggerUsedNetworkCleanupRequest"; + /** ID of the obsolete network to start the cleanup process for. */ + networkId: string; +} + +export interface TriggerUsedNetworkCleanupResponse { + $type: "yandex.cloud.serverless.functions.v1.TriggerUsedNetworkCleanupResponse"; + /** Timestamp when cleanup of the specified network will be started. */ + networkCleanupTime?: Date; +} + +const baseUsedNetwork: object = { + $type: "yandex.cloud.serverless.functions.v1.UsedNetwork", + networkId: "", + cloudId: "", + folderId: "", + status: 0, + connectionsCount: 0, +}; + +export const UsedNetwork = { + $type: "yandex.cloud.serverless.functions.v1.UsedNetwork" as const, + + encode( + message: UsedNetwork, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.networkId !== "") { + writer.uint32(10).string(message.networkId); + } + if (message.cloudId !== "") { + writer.uint32(18).string(message.cloudId); + } + if (message.folderId !== "") { + writer.uint32(26).string(message.folderId); + } + if (message.status !== 0) { + writer.uint32(32).int32(message.status); + } + if (message.willBeCleanedUpAt !== undefined) { + Timestamp.encode( + toTimestamp(message.willBeCleanedUpAt), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.connectionsCount !== 0) { + writer.uint32(48).int64(message.connectionsCount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UsedNetwork { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUsedNetwork } as UsedNetwork; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.networkId = reader.string(); + break; + case 2: + message.cloudId = reader.string(); + break; + case 3: + message.folderId = reader.string(); + break; + case 4: + message.status = reader.int32() as any; + break; + case 5: + message.willBeCleanedUpAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + message.connectionsCount = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UsedNetwork { + const message = { ...baseUsedNetwork } as UsedNetwork; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; + message.cloudId = + object.cloudId !== undefined && object.cloudId !== null + ? String(object.cloudId) + : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.status = + object.status !== undefined && object.status !== null + ? usedNetwork_StatusFromJSON(object.status) + : 0; + message.willBeCleanedUpAt = + object.willBeCleanedUpAt !== undefined && + object.willBeCleanedUpAt !== null + ? fromJsonTimestamp(object.willBeCleanedUpAt) + : undefined; + message.connectionsCount = + object.connectionsCount !== undefined && object.connectionsCount !== null + ? Number(object.connectionsCount) + : 0; + return message; + }, + + toJSON(message: UsedNetwork): unknown { + const obj: any = {}; + message.networkId !== undefined && (obj.networkId = message.networkId); + message.cloudId !== undefined && (obj.cloudId = message.cloudId); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.status !== undefined && + (obj.status = usedNetwork_StatusToJSON(message.status)); + message.willBeCleanedUpAt !== undefined && + (obj.willBeCleanedUpAt = message.willBeCleanedUpAt.toISOString()); + message.connectionsCount !== undefined && + (obj.connectionsCount = Math.round(message.connectionsCount)); + return obj; + }, + + fromPartial, I>>( + object: I + ): UsedNetwork { + const message = { ...baseUsedNetwork } as UsedNetwork; + message.networkId = object.networkId ?? ""; + message.cloudId = object.cloudId ?? ""; + message.folderId = object.folderId ?? ""; + message.status = object.status ?? 0; + message.willBeCleanedUpAt = object.willBeCleanedUpAt ?? undefined; + message.connectionsCount = object.connectionsCount ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(UsedNetwork.$type, UsedNetwork); + +const baseGetUsedNetworkRequest: object = { + $type: "yandex.cloud.serverless.functions.v1.GetUsedNetworkRequest", + networkId: "", +}; + +export const GetUsedNetworkRequest = { + $type: "yandex.cloud.serverless.functions.v1.GetUsedNetworkRequest" as const, + + encode( + message: GetUsedNetworkRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.networkId !== "") { + writer.uint32(10).string(message.networkId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetUsedNetworkRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetUsedNetworkRequest } as GetUsedNetworkRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.networkId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetUsedNetworkRequest { + const message = { ...baseGetUsedNetworkRequest } as GetUsedNetworkRequest; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; + return message; + }, + + toJSON(message: GetUsedNetworkRequest): unknown { + const obj: any = {}; + message.networkId !== undefined && (obj.networkId = message.networkId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetUsedNetworkRequest { + const message = { ...baseGetUsedNetworkRequest } as GetUsedNetworkRequest; + message.networkId = object.networkId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetUsedNetworkRequest.$type, GetUsedNetworkRequest); + +const baseListUsedNetworksRequest: object = { + $type: "yandex.cloud.serverless.functions.v1.ListUsedNetworksRequest", + pageSize: 0, + pageToken: "", +}; + +export const ListUsedNetworksRequest = { + $type: + "yandex.cloud.serverless.functions.v1.ListUsedNetworksRequest" as const, + + encode( + message: ListUsedNetworksRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.pageSize !== 0) { + writer.uint32(8).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(18).string(message.pageToken); + } + if (message.cloudId !== undefined) { + writer.uint32(26).string(message.cloudId); + } + if (message.folderId !== undefined) { + writer.uint32(34).string(message.folderId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListUsedNetworksRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListUsedNetworksRequest, + } as ListUsedNetworksRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 2: + message.pageToken = reader.string(); + break; + case 3: + message.cloudId = reader.string(); + break; + case 4: + message.folderId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListUsedNetworksRequest { + const message = { + ...baseListUsedNetworksRequest, + } as ListUsedNetworksRequest; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.cloudId = + object.cloudId !== undefined && object.cloudId !== null + ? String(object.cloudId) + : undefined; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : undefined; + return message; + }, + + toJSON(message: ListUsedNetworksRequest): unknown { + const obj: any = {}; + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.cloudId !== undefined && (obj.cloudId = message.cloudId); + message.folderId !== undefined && (obj.folderId = message.folderId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListUsedNetworksRequest { + const message = { + ...baseListUsedNetworksRequest, + } as ListUsedNetworksRequest; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.cloudId = object.cloudId ?? undefined; + message.folderId = object.folderId ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(ListUsedNetworksRequest.$type, ListUsedNetworksRequest); + +const baseListUsedNetworksResponse: object = { + $type: "yandex.cloud.serverless.functions.v1.ListUsedNetworksResponse", + nextPageToken: "", +}; + +export const ListUsedNetworksResponse = { + $type: + "yandex.cloud.serverless.functions.v1.ListUsedNetworksResponse" as const, + + encode( + message: ListUsedNetworksResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.networks) { + UsedNetwork.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListUsedNetworksResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListUsedNetworksResponse, + } as ListUsedNetworksResponse; + message.networks = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.networks.push(UsedNetwork.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListUsedNetworksResponse { + const message = { + ...baseListUsedNetworksResponse, + } as ListUsedNetworksResponse; + message.networks = (object.networks ?? []).map((e: any) => + UsedNetwork.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListUsedNetworksResponse): unknown { + const obj: any = {}; + if (message.networks) { + obj.networks = message.networks.map((e) => + e ? UsedNetwork.toJSON(e) : undefined + ); + } else { + obj.networks = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListUsedNetworksResponse { + const message = { + ...baseListUsedNetworksResponse, + } as ListUsedNetworksResponse; + message.networks = + object.networks?.map((e) => UsedNetwork.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListUsedNetworksResponse.$type, + ListUsedNetworksResponse +); + +const baseListConnectedResourcesRequest: object = { + $type: "yandex.cloud.serverless.functions.v1.ListConnectedResourcesRequest", + pageSize: 0, + pageToken: "", +}; + +export const ListConnectedResourcesRequest = { + $type: + "yandex.cloud.serverless.functions.v1.ListConnectedResourcesRequest" as const, + + encode( + message: ListConnectedResourcesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.pageSize !== 0) { + writer.uint32(8).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(18).string(message.pageToken); + } + if (message.networkId !== undefined) { + writer.uint32(26).string(message.networkId); + } + if (message.cloudId !== undefined) { + writer.uint32(34).string(message.cloudId); + } + if (message.folderId !== undefined) { + writer.uint32(42).string(message.folderId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListConnectedResourcesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListConnectedResourcesRequest, + } as ListConnectedResourcesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 2: + message.pageToken = reader.string(); + break; + case 3: + message.networkId = reader.string(); + break; + case 4: + message.cloudId = reader.string(); + break; + case 5: + message.folderId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListConnectedResourcesRequest { + const message = { + ...baseListConnectedResourcesRequest, + } as ListConnectedResourcesRequest; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : undefined; + message.cloudId = + object.cloudId !== undefined && object.cloudId !== null + ? String(object.cloudId) + : undefined; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : undefined; + return message; + }, + + toJSON(message: ListConnectedResourcesRequest): unknown { + const obj: any = {}; + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.networkId !== undefined && (obj.networkId = message.networkId); + message.cloudId !== undefined && (obj.cloudId = message.cloudId); + message.folderId !== undefined && (obj.folderId = message.folderId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListConnectedResourcesRequest { + const message = { + ...baseListConnectedResourcesRequest, + } as ListConnectedResourcesRequest; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.networkId = object.networkId ?? undefined; + message.cloudId = object.cloudId ?? undefined; + message.folderId = object.folderId ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + ListConnectedResourcesRequest.$type, + ListConnectedResourcesRequest +); + +const baseListConnectedResourcesResponse: object = { + $type: "yandex.cloud.serverless.functions.v1.ListConnectedResourcesResponse", + nextPageToken: "", +}; + +export const ListConnectedResourcesResponse = { + $type: + "yandex.cloud.serverless.functions.v1.ListConnectedResourcesResponse" as const, + + encode( + message: ListConnectedResourcesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.resources) { + ListConnectedResourcesResponse_ConnectedResource.encode( + v!, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListConnectedResourcesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListConnectedResourcesResponse, + } as ListConnectedResourcesResponse; + message.resources = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resources.push( + ListConnectedResourcesResponse_ConnectedResource.decode( + reader, + reader.uint32() + ) + ); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListConnectedResourcesResponse { + const message = { + ...baseListConnectedResourcesResponse, + } as ListConnectedResourcesResponse; + message.resources = (object.resources ?? []).map((e: any) => + ListConnectedResourcesResponse_ConnectedResource.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListConnectedResourcesResponse): unknown { + const obj: any = {}; + if (message.resources) { + obj.resources = message.resources.map((e) => + e + ? ListConnectedResourcesResponse_ConnectedResource.toJSON(e) + : undefined + ); + } else { + obj.resources = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListConnectedResourcesResponse { + const message = { + ...baseListConnectedResourcesResponse, + } as ListConnectedResourcesResponse; + message.resources = + object.resources?.map((e) => + ListConnectedResourcesResponse_ConnectedResource.fromPartial(e) + ) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListConnectedResourcesResponse.$type, + ListConnectedResourcesResponse +); + +const baseListConnectedResourcesResponse_ConnectedResource: object = { + $type: + "yandex.cloud.serverless.functions.v1.ListConnectedResourcesResponse.ConnectedResource", + networkId: "", + resourceType: "", + resourceId: "", + subresourceType: "", + subresourceId: "", + resourceCloudId: "", + resourceFolderId: "", +}; + +export const ListConnectedResourcesResponse_ConnectedResource = { + $type: + "yandex.cloud.serverless.functions.v1.ListConnectedResourcesResponse.ConnectedResource" as const, + + encode( + message: ListConnectedResourcesResponse_ConnectedResource, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.networkId !== "") { + writer.uint32(10).string(message.networkId); + } + if (message.resourceType !== "") { + writer.uint32(18).string(message.resourceType); + } + if (message.resourceId !== "") { + writer.uint32(26).string(message.resourceId); + } + if (message.subresourceType !== "") { + writer.uint32(34).string(message.subresourceType); + } + if (message.subresourceId !== "") { + writer.uint32(42).string(message.subresourceId); + } + if (message.resourceCloudId !== "") { + writer.uint32(50).string(message.resourceCloudId); + } + if (message.resourceFolderId !== "") { + writer.uint32(58).string(message.resourceFolderId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListConnectedResourcesResponse_ConnectedResource { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListConnectedResourcesResponse_ConnectedResource, + } as ListConnectedResourcesResponse_ConnectedResource; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.networkId = reader.string(); + break; + case 2: + message.resourceType = reader.string(); + break; + case 3: + message.resourceId = reader.string(); + break; + case 4: + message.subresourceType = reader.string(); + break; + case 5: + message.subresourceId = reader.string(); + break; + case 6: + message.resourceCloudId = reader.string(); + break; + case 7: + message.resourceFolderId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListConnectedResourcesResponse_ConnectedResource { + const message = { + ...baseListConnectedResourcesResponse_ConnectedResource, + } as ListConnectedResourcesResponse_ConnectedResource; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; + message.resourceType = + object.resourceType !== undefined && object.resourceType !== null + ? String(object.resourceType) + : ""; + message.resourceId = + object.resourceId !== undefined && object.resourceId !== null + ? String(object.resourceId) + : ""; + message.subresourceType = + object.subresourceType !== undefined && object.subresourceType !== null + ? String(object.subresourceType) + : ""; + message.subresourceId = + object.subresourceId !== undefined && object.subresourceId !== null + ? String(object.subresourceId) + : ""; + message.resourceCloudId = + object.resourceCloudId !== undefined && object.resourceCloudId !== null + ? String(object.resourceCloudId) + : ""; + message.resourceFolderId = + object.resourceFolderId !== undefined && object.resourceFolderId !== null + ? String(object.resourceFolderId) + : ""; + return message; + }, + + toJSON(message: ListConnectedResourcesResponse_ConnectedResource): unknown { + const obj: any = {}; + message.networkId !== undefined && (obj.networkId = message.networkId); + message.resourceType !== undefined && + (obj.resourceType = message.resourceType); + message.resourceId !== undefined && (obj.resourceId = message.resourceId); + message.subresourceType !== undefined && + (obj.subresourceType = message.subresourceType); + message.subresourceId !== undefined && + (obj.subresourceId = message.subresourceId); + message.resourceCloudId !== undefined && + (obj.resourceCloudId = message.resourceCloudId); + message.resourceFolderId !== undefined && + (obj.resourceFolderId = message.resourceFolderId); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): ListConnectedResourcesResponse_ConnectedResource { + const message = { + ...baseListConnectedResourcesResponse_ConnectedResource, + } as ListConnectedResourcesResponse_ConnectedResource; + message.networkId = object.networkId ?? ""; + message.resourceType = object.resourceType ?? ""; + message.resourceId = object.resourceId ?? ""; + message.subresourceType = object.subresourceType ?? ""; + message.subresourceId = object.subresourceId ?? ""; + message.resourceCloudId = object.resourceCloudId ?? ""; + message.resourceFolderId = object.resourceFolderId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListConnectedResourcesResponse_ConnectedResource.$type, + ListConnectedResourcesResponse_ConnectedResource +); + +const baseTriggerUsedNetworkCleanupRequest: object = { + $type: + "yandex.cloud.serverless.functions.v1.TriggerUsedNetworkCleanupRequest", + networkId: "", +}; + +export const TriggerUsedNetworkCleanupRequest = { + $type: + "yandex.cloud.serverless.functions.v1.TriggerUsedNetworkCleanupRequest" as const, + + encode( + message: TriggerUsedNetworkCleanupRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.networkId !== "") { + writer.uint32(10).string(message.networkId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): TriggerUsedNetworkCleanupRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTriggerUsedNetworkCleanupRequest, + } as TriggerUsedNetworkCleanupRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.networkId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TriggerUsedNetworkCleanupRequest { + const message = { + ...baseTriggerUsedNetworkCleanupRequest, + } as TriggerUsedNetworkCleanupRequest; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; + return message; + }, + + toJSON(message: TriggerUsedNetworkCleanupRequest): unknown { + const obj: any = {}; + message.networkId !== undefined && (obj.networkId = message.networkId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): TriggerUsedNetworkCleanupRequest { + const message = { + ...baseTriggerUsedNetworkCleanupRequest, + } as TriggerUsedNetworkCleanupRequest; + message.networkId = object.networkId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + TriggerUsedNetworkCleanupRequest.$type, + TriggerUsedNetworkCleanupRequest +); + +const baseTriggerUsedNetworkCleanupResponse: object = { + $type: + "yandex.cloud.serverless.functions.v1.TriggerUsedNetworkCleanupResponse", +}; + +export const TriggerUsedNetworkCleanupResponse = { + $type: + "yandex.cloud.serverless.functions.v1.TriggerUsedNetworkCleanupResponse" as const, + + encode( + message: TriggerUsedNetworkCleanupResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.networkCleanupTime !== undefined) { + Timestamp.encode( + toTimestamp(message.networkCleanupTime), + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): TriggerUsedNetworkCleanupResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTriggerUsedNetworkCleanupResponse, + } as TriggerUsedNetworkCleanupResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.networkCleanupTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TriggerUsedNetworkCleanupResponse { + const message = { + ...baseTriggerUsedNetworkCleanupResponse, + } as TriggerUsedNetworkCleanupResponse; + message.networkCleanupTime = + object.networkCleanupTime !== undefined && + object.networkCleanupTime !== null + ? fromJsonTimestamp(object.networkCleanupTime) + : undefined; + return message; + }, + + toJSON(message: TriggerUsedNetworkCleanupResponse): unknown { + const obj: any = {}; + message.networkCleanupTime !== undefined && + (obj.networkCleanupTime = message.networkCleanupTime.toISOString()); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): TriggerUsedNetworkCleanupResponse { + const message = { + ...baseTriggerUsedNetworkCleanupResponse, + } as TriggerUsedNetworkCleanupResponse; + message.networkCleanupTime = object.networkCleanupTime ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + TriggerUsedNetworkCleanupResponse.$type, + TriggerUsedNetworkCleanupResponse +); + +/** A set of methods for managing VPC networks connected to serverless resources. */ +export const NetworkServiceService = { + /** Returns the specified network used in serverless resources. */ + getUsed: { + path: "/yandex.cloud.serverless.functions.v1.NetworkService/GetUsed", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetUsedNetworkRequest) => + Buffer.from(GetUsedNetworkRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetUsedNetworkRequest.decode(value), + responseSerialize: (value: UsedNetwork) => + Buffer.from(UsedNetwork.encode(value).finish()), + responseDeserialize: (value: Buffer) => UsedNetwork.decode(value), + }, + /** Retrieves the list of networks in the specified scope that are used in serverless resources. */ + listUsed: { + path: "/yandex.cloud.serverless.functions.v1.NetworkService/ListUsed", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListUsedNetworksRequest) => + Buffer.from(ListUsedNetworksRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListUsedNetworksRequest.decode(value), + responseSerialize: (value: ListUsedNetworksResponse) => + Buffer.from(ListUsedNetworksResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListUsedNetworksResponse.decode(value), + }, + /** Retrieves the list of serverless resources connected to any network from the specified scope. */ + listConnectedResources: { + path: "/yandex.cloud.serverless.functions.v1.NetworkService/ListConnectedResources", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListConnectedResourcesRequest) => + Buffer.from(ListConnectedResourcesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListConnectedResourcesRequest.decode(value), + responseSerialize: (value: ListConnectedResourcesResponse) => + Buffer.from(ListConnectedResourcesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListConnectedResourcesResponse.decode(value), + }, + /** + * Forces obsolete used network to start cleanup process as soon as possible. + * Invocation does not wait for start or end of the cleanup process. + * Second invocation with the same network does nothing until network is completely cleaned-up. + */ + triggerUsedCleanup: { + path: "/yandex.cloud.serverless.functions.v1.NetworkService/TriggerUsedCleanup", + requestStream: false, + responseStream: false, + requestSerialize: (value: TriggerUsedNetworkCleanupRequest) => + Buffer.from(TriggerUsedNetworkCleanupRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + TriggerUsedNetworkCleanupRequest.decode(value), + responseSerialize: (value: TriggerUsedNetworkCleanupResponse) => + Buffer.from(TriggerUsedNetworkCleanupResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + TriggerUsedNetworkCleanupResponse.decode(value), + }, +} as const; + +export interface NetworkServiceServer extends UntypedServiceImplementation { + /** Returns the specified network used in serverless resources. */ + getUsed: handleUnaryCall; + /** Retrieves the list of networks in the specified scope that are used in serverless resources. */ + listUsed: handleUnaryCall; + /** Retrieves the list of serverless resources connected to any network from the specified scope. */ + listConnectedResources: handleUnaryCall< + ListConnectedResourcesRequest, + ListConnectedResourcesResponse + >; + /** + * Forces obsolete used network to start cleanup process as soon as possible. + * Invocation does not wait for start or end of the cleanup process. + * Second invocation with the same network does nothing until network is completely cleaned-up. + */ + triggerUsedCleanup: handleUnaryCall< + TriggerUsedNetworkCleanupRequest, + TriggerUsedNetworkCleanupResponse + >; +} + +export interface NetworkServiceClient extends Client { + /** Returns the specified network used in serverless resources. */ + getUsed( + request: GetUsedNetworkRequest, + callback: (error: ServiceError | null, response: UsedNetwork) => void + ): ClientUnaryCall; + getUsed( + request: GetUsedNetworkRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: UsedNetwork) => void + ): ClientUnaryCall; + getUsed( + request: GetUsedNetworkRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: UsedNetwork) => void + ): ClientUnaryCall; + /** Retrieves the list of networks in the specified scope that are used in serverless resources. */ + listUsed( + request: ListUsedNetworksRequest, + callback: ( + error: ServiceError | null, + response: ListUsedNetworksResponse + ) => void + ): ClientUnaryCall; + listUsed( + request: ListUsedNetworksRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListUsedNetworksResponse + ) => void + ): ClientUnaryCall; + listUsed( + request: ListUsedNetworksRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListUsedNetworksResponse + ) => void + ): ClientUnaryCall; + /** Retrieves the list of serverless resources connected to any network from the specified scope. */ + listConnectedResources( + request: ListConnectedResourcesRequest, + callback: ( + error: ServiceError | null, + response: ListConnectedResourcesResponse + ) => void + ): ClientUnaryCall; + listConnectedResources( + request: ListConnectedResourcesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListConnectedResourcesResponse + ) => void + ): ClientUnaryCall; + listConnectedResources( + request: ListConnectedResourcesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListConnectedResourcesResponse + ) => void + ): ClientUnaryCall; + /** + * Forces obsolete used network to start cleanup process as soon as possible. + * Invocation does not wait for start or end of the cleanup process. + * Second invocation with the same network does nothing until network is completely cleaned-up. + */ + triggerUsedCleanup( + request: TriggerUsedNetworkCleanupRequest, + callback: ( + error: ServiceError | null, + response: TriggerUsedNetworkCleanupResponse + ) => void + ): ClientUnaryCall; + triggerUsedCleanup( + request: TriggerUsedNetworkCleanupRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: TriggerUsedNetworkCleanupResponse + ) => void + ): ClientUnaryCall; + triggerUsedCleanup( + request: TriggerUsedNetworkCleanupRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: TriggerUsedNetworkCleanupResponse + ) => void + ): ClientUnaryCall; +} + +export const NetworkServiceClient = makeGenericClientConstructor( + NetworkServiceService, + "yandex.cloud.serverless.functions.v1.NetworkService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): NetworkServiceClient; + service: typeof NetworkServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/serverless/index.ts b/src/generated/yandex/cloud/serverless/index.ts index 5ad4989b..40099fc2 100644 --- a/src/generated/yandex/cloud/serverless/index.ts +++ b/src/generated/yandex/cloud/serverless/index.ts @@ -1,13 +1,26 @@ -export * as apigateway from './apigateway/v1/apigateway' -export * as apigateway_service from './apigateway/v1/apigateway_service' -export * as containers_container from './containers/v1/container' -export * as containers_container_service from './containers/v1/container_service' -export * as functions_function from './functions/v1/function' -export * as functions_function_service from './functions/v1/function_service' -export * as mdbproxy_proxy from './mdbproxy/v1/proxy' -export * as mdbproxy_proxy_service from './mdbproxy/v1/proxy_service' -export * as triggers_predicate from './triggers/v1/predicate' -export * as triggers_trigger from './triggers/v1/trigger' -export * as triggers_trigger_service from './triggers/v1/trigger_service' -export * as apigateway_connection from './apigateway/websocket/v1/connection' -export * as apigateway_connection_service from './apigateway/websocket/v1/connection_service' \ No newline at end of file +export * as apigateway_v1_apigateway from './apigateway/v1/apigateway' +export * as apigateway_v1_apigateway_service from './apigateway/v1/apigateway_service' +export * as containers_v1_container from './containers/v1/container' +export * as containers_v1_container_service from './containers/v1/container_service' +export * as eventrouter_v1_bus from './eventrouter/v1/bus' +export * as eventrouter_v1_bus_service from './eventrouter/v1/bus_service' +export * as eventrouter_v1_connector from './eventrouter/v1/connector' +export * as eventrouter_v1_connector_service from './eventrouter/v1/connector_service' +export * as eventrouter_v1_event_service from './eventrouter/v1/event_service' +export * as eventrouter_v1_rule from './eventrouter/v1/rule' +export * as eventrouter_v1_rule_service from './eventrouter/v1/rule_service' +export * as functions_v1_function from './functions/v1/function' +export * as functions_v1_function_service from './functions/v1/function_service' +export * as functions_v1_network_service from './functions/v1/network_service' +export * as mdbproxy_v1_proxy from './mdbproxy/v1/proxy' +export * as mdbproxy_v1_proxy_service from './mdbproxy/v1/proxy_service' +export * as triggers_v1_predicate from './triggers/v1/predicate' +export * as triggers_v1_trigger from './triggers/v1/trigger' +export * as triggers_v1_trigger_service from './triggers/v1/trigger_service' +export * as workflows_v1_execution from './workflows/v1/execution' +export * as workflows_v1_execution_service from './workflows/v1/execution_service' +export * as workflows_v1_history_entry from './workflows/v1/history_entry' +export * as workflows_v1_workflow from './workflows/v1/workflow' +export * as workflows_v1_workflow_service from './workflows/v1/workflow_service' +export * as apigateway_websocket_v1_connection from './apigateway/websocket/v1/connection' +export * as apigateway_websocket_v1_connection_service from './apigateway/websocket/v1/connection_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/serverless/triggers/v1/trigger.ts b/src/generated/yandex/cloud/serverless/triggers/v1/trigger.ts index f198c333..44bfe7a0 100644 --- a/src/generated/yandex/cloud/serverless/triggers/v1/trigger.ts +++ b/src/generated/yandex/cloud/serverless/triggers/v1/trigger.ts @@ -315,6 +315,8 @@ export interface Trigger_Timer { invokeFunctionWithRetry?: InvokeFunctionWithRetry | undefined; /** Instructions for invoking a container with retry. */ invokeContainerWithRetry?: InvokeContainerWithRetry | undefined; + /** Instructions for broadcasting to API gateway websocket once. */ + gatewayWebsocketBroadcast?: GatewayWebsocketBroadcast | undefined; } /** Rule for activating a message queue trigger. */ @@ -332,6 +334,8 @@ export interface Trigger_MessageQueue { invokeFunction?: InvokeFunctionOnce | undefined; /** Instructions for invoking a container once. */ invokeContainer?: InvokeContainerOnce | undefined; + /** Instructions for broadcasting to API gateway websocket once. */ + gatewayWebsocketBroadcast?: GatewayWebsocketBroadcast | undefined; } /** Rule for activating a IoT Core trigger. */ @@ -349,6 +353,8 @@ export interface Trigger_IoTMessage { invokeFunction?: InvokeFunctionWithRetry | undefined; /** Instructions for invoking a container with retries as needed. */ invokeContainer?: InvokeContainerWithRetry | undefined; + /** Instructions for broadcasting to API gateway websocket once. */ + gatewayWebsocketBroadcast?: GatewayWebsocketBroadcast | undefined; } /** Rule for activating a IoT Core Broker trigger. */ @@ -364,6 +370,8 @@ export interface Trigger_IoTBrokerMessage { invokeFunction?: InvokeFunctionWithRetry | undefined; /** Instructions for invoking a container with retries as needed. */ invokeContainer?: InvokeContainerWithRetry | undefined; + /** Instructions for broadcasting to API gateway websocket once. */ + gatewayWebsocketBroadcast?: GatewayWebsocketBroadcast | undefined; } export interface Trigger_ObjectStorage { @@ -382,6 +390,8 @@ export interface Trigger_ObjectStorage { invokeFunction?: InvokeFunctionWithRetry | undefined; /** Instructions for invoking a container with retries as needed. */ invokeContainer?: InvokeContainerWithRetry | undefined; + /** Instructions for broadcasting to API gateway websocket once. */ + gatewayWebsocketBroadcast?: GatewayWebsocketBroadcast | undefined; } export interface Trigger_ContainerRegistry { @@ -400,6 +410,8 @@ export interface Trigger_ContainerRegistry { invokeFunction?: InvokeFunctionWithRetry | undefined; /** Instructions for invoking a container with retries as needed. */ invokeContainer?: InvokeContainerWithRetry | undefined; + /** Instructions for broadcasting to API gateway websocket once. */ + gatewayWebsocketBroadcast?: GatewayWebsocketBroadcast | undefined; } export interface Trigger_CloudLogs { @@ -428,6 +440,8 @@ export interface Trigger_Logging { invokeFunction?: InvokeFunctionWithRetry | undefined; /** Instructions for invoking a container with retries as needed. */ invokeContainer?: InvokeContainerWithRetry | undefined; + /** Instructions for broadcasting to API gateway websocket once. */ + gatewayWebsocketBroadcast?: GatewayWebsocketBroadcast | undefined; } /** A single function invocation. */ @@ -482,6 +496,14 @@ export interface InvokeContainerWithRetry { deadLetterQueue?: PutQueueMessage; } +export interface GatewayWebsocketBroadcast { + $type: "yandex.cloud.serverless.triggers.v1.GatewayWebsocketBroadcast"; + gatewayId: string; + path: string; + /** sa which has permission for writing to websockets */ + serviceAccountId: string; +} + export interface PutQueueMessage { $type: "yandex.cloud.serverless.triggers.v1.PutQueueMessage"; /** ID of the queue. */ @@ -548,6 +570,7 @@ export interface BillingBudget { budgetId: string; invokeFunction?: InvokeFunctionWithRetry | undefined; invokeContainer?: InvokeContainerWithRetry | undefined; + gatewayWebsocketBroadcast?: GatewayWebsocketBroadcast | undefined; } export interface DataStreamBatchSettings { @@ -578,6 +601,7 @@ export interface DataStream { batchSettings?: DataStreamBatchSettings; invokeFunction?: InvokeFunctionWithRetry | undefined; invokeContainer?: InvokeContainerWithRetry | undefined; + gatewayWebsocketBroadcast?: GatewayWebsocketBroadcast | undefined; } export interface ObjectStorageBucketSettings { @@ -601,6 +625,7 @@ export interface Mail { attachmentsBucket?: ObjectStorageBucketSettings; invokeFunction?: InvokeFunctionWithRetry | undefined; invokeContainer?: InvokeContainerWithRetry | undefined; + gatewayWebsocketBroadcast?: GatewayWebsocketBroadcast | undefined; } const baseTrigger: object = { @@ -1182,6 +1207,12 @@ export const Trigger_Timer = { writer.uint32(834).fork() ).ldelim(); } + if (message.gatewayWebsocketBroadcast !== undefined) { + GatewayWebsocketBroadcast.encode( + message.gatewayWebsocketBroadcast, + writer.uint32(842).fork() + ).ldelim(); + } return writer; }, @@ -1216,6 +1247,12 @@ export const Trigger_Timer = { reader.uint32() ); break; + case 105: + message.gatewayWebsocketBroadcast = GatewayWebsocketBroadcast.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1248,6 +1285,11 @@ export const Trigger_Timer = { object.invokeContainerWithRetry !== null ? InvokeContainerWithRetry.fromJSON(object.invokeContainerWithRetry) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromJSON(object.gatewayWebsocketBroadcast) + : undefined; return message; }, @@ -1268,6 +1310,10 @@ export const Trigger_Timer = { (obj.invokeContainerWithRetry = message.invokeContainerWithRetry ? InvokeContainerWithRetry.toJSON(message.invokeContainerWithRetry) : undefined); + message.gatewayWebsocketBroadcast !== undefined && + (obj.gatewayWebsocketBroadcast = message.gatewayWebsocketBroadcast + ? GatewayWebsocketBroadcast.toJSON(message.gatewayWebsocketBroadcast) + : undefined); return obj; }, @@ -1291,6 +1337,13 @@ export const Trigger_Timer = { object.invokeContainerWithRetry !== null ? InvokeContainerWithRetry.fromPartial(object.invokeContainerWithRetry) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromPartial( + object.gatewayWebsocketBroadcast + ) + : undefined; return message; }, }; @@ -1340,6 +1393,12 @@ export const Trigger_MessageQueue = { writer.uint32(818).fork() ).ldelim(); } + if (message.gatewayWebsocketBroadcast !== undefined) { + GatewayWebsocketBroadcast.encode( + message.gatewayWebsocketBroadcast, + writer.uint32(826).fork() + ).ldelim(); + } return writer; }, @@ -1377,6 +1436,12 @@ export const Trigger_MessageQueue = { reader.uint32() ); break; + case 103: + message.gatewayWebsocketBroadcast = GatewayWebsocketBroadcast.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1412,6 +1477,11 @@ export const Trigger_MessageQueue = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerOnce.fromJSON(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromJSON(object.gatewayWebsocketBroadcast) + : undefined; return message; }, @@ -1436,6 +1506,10 @@ export const Trigger_MessageQueue = { (obj.invokeContainer = message.invokeContainer ? InvokeContainerOnce.toJSON(message.invokeContainer) : undefined); + message.gatewayWebsocketBroadcast !== undefined && + (obj.gatewayWebsocketBroadcast = message.gatewayWebsocketBroadcast + ? GatewayWebsocketBroadcast.toJSON(message.gatewayWebsocketBroadcast) + : undefined); return obj; }, @@ -1462,6 +1536,13 @@ export const Trigger_MessageQueue = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerOnce.fromPartial(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromPartial( + object.gatewayWebsocketBroadcast + ) + : undefined; return message; }, }; @@ -1509,6 +1590,12 @@ export const Trigger_IoTMessage = { writer.uint32(818).fork() ).ldelim(); } + if (message.gatewayWebsocketBroadcast !== undefined) { + GatewayWebsocketBroadcast.encode( + message.gatewayWebsocketBroadcast, + writer.uint32(826).fork() + ).ldelim(); + } return writer; }, @@ -1543,6 +1630,12 @@ export const Trigger_IoTMessage = { reader.uint32() ); break; + case 103: + message.gatewayWebsocketBroadcast = GatewayWebsocketBroadcast.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1577,6 +1670,11 @@ export const Trigger_IoTMessage = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromJSON(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromJSON(object.gatewayWebsocketBroadcast) + : undefined; return message; }, @@ -1597,6 +1695,10 @@ export const Trigger_IoTMessage = { (obj.invokeContainer = message.invokeContainer ? InvokeContainerWithRetry.toJSON(message.invokeContainer) : undefined); + message.gatewayWebsocketBroadcast !== undefined && + (obj.gatewayWebsocketBroadcast = message.gatewayWebsocketBroadcast + ? GatewayWebsocketBroadcast.toJSON(message.gatewayWebsocketBroadcast) + : undefined); return obj; }, @@ -1619,6 +1721,13 @@ export const Trigger_IoTMessage = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromPartial(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromPartial( + object.gatewayWebsocketBroadcast + ) + : undefined; return message; }, }; @@ -1663,6 +1772,12 @@ export const Trigger_IoTBrokerMessage = { writer.uint32(818).fork() ).ldelim(); } + if (message.gatewayWebsocketBroadcast !== undefined) { + GatewayWebsocketBroadcast.encode( + message.gatewayWebsocketBroadcast, + writer.uint32(826).fork() + ).ldelim(); + } return writer; }, @@ -1699,6 +1814,12 @@ export const Trigger_IoTBrokerMessage = { reader.uint32() ); break; + case 103: + message.gatewayWebsocketBroadcast = GatewayWebsocketBroadcast.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1731,6 +1852,11 @@ export const Trigger_IoTBrokerMessage = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromJSON(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromJSON(object.gatewayWebsocketBroadcast) + : undefined; return message; }, @@ -1750,6 +1876,10 @@ export const Trigger_IoTBrokerMessage = { (obj.invokeContainer = message.invokeContainer ? InvokeContainerWithRetry.toJSON(message.invokeContainer) : undefined); + message.gatewayWebsocketBroadcast !== undefined && + (obj.gatewayWebsocketBroadcast = message.gatewayWebsocketBroadcast + ? GatewayWebsocketBroadcast.toJSON(message.gatewayWebsocketBroadcast) + : undefined); return obj; }, @@ -1773,6 +1903,13 @@ export const Trigger_IoTBrokerMessage = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromPartial(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromPartial( + object.gatewayWebsocketBroadcast + ) + : undefined; return message; }, }; @@ -1829,6 +1966,12 @@ export const Trigger_ObjectStorage = { writer.uint32(818).fork() ).ldelim(); } + if (message.gatewayWebsocketBroadcast !== undefined) { + GatewayWebsocketBroadcast.encode( + message.gatewayWebsocketBroadcast, + writer.uint32(826).fork() + ).ldelim(); + } return writer; }, @@ -1877,6 +2020,12 @@ export const Trigger_ObjectStorage = { reader.uint32() ); break; + case 103: + message.gatewayWebsocketBroadcast = GatewayWebsocketBroadcast.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -1914,6 +2063,11 @@ export const Trigger_ObjectStorage = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromJSON(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromJSON(object.gatewayWebsocketBroadcast) + : undefined; return message; }, @@ -1941,6 +2095,10 @@ export const Trigger_ObjectStorage = { (obj.invokeContainer = message.invokeContainer ? InvokeContainerWithRetry.toJSON(message.invokeContainer) : undefined); + message.gatewayWebsocketBroadcast !== undefined && + (obj.gatewayWebsocketBroadcast = message.gatewayWebsocketBroadcast + ? GatewayWebsocketBroadcast.toJSON(message.gatewayWebsocketBroadcast) + : undefined); return obj; }, @@ -1964,6 +2122,13 @@ export const Trigger_ObjectStorage = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromPartial(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromPartial( + object.gatewayWebsocketBroadcast + ) + : undefined; return message; }, }; @@ -2018,6 +2183,12 @@ export const Trigger_ContainerRegistry = { writer.uint32(818).fork() ).ldelim(); } + if (message.gatewayWebsocketBroadcast !== undefined) { + GatewayWebsocketBroadcast.encode( + message.gatewayWebsocketBroadcast, + writer.uint32(826).fork() + ).ldelim(); + } return writer; }, @@ -2068,6 +2239,12 @@ export const Trigger_ContainerRegistry = { reader.uint32() ); break; + case 103: + message.gatewayWebsocketBroadcast = GatewayWebsocketBroadcast.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2105,6 +2282,11 @@ export const Trigger_ContainerRegistry = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromJSON(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromJSON(object.gatewayWebsocketBroadcast) + : undefined; return message; }, @@ -2132,6 +2314,10 @@ export const Trigger_ContainerRegistry = { (obj.invokeContainer = message.invokeContainer ? InvokeContainerWithRetry.toJSON(message.invokeContainer) : undefined); + message.gatewayWebsocketBroadcast !== undefined && + (obj.gatewayWebsocketBroadcast = message.gatewayWebsocketBroadcast + ? GatewayWebsocketBroadcast.toJSON(message.gatewayWebsocketBroadcast) + : undefined); return obj; }, @@ -2157,6 +2343,13 @@ export const Trigger_ContainerRegistry = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromPartial(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromPartial( + object.gatewayWebsocketBroadcast + ) + : undefined; return message; }, }; @@ -2353,6 +2546,12 @@ export const Trigger_Logging = { writer.uint32(826).fork() ).ldelim(); } + if (message.gatewayWebsocketBroadcast !== undefined) { + GatewayWebsocketBroadcast.encode( + message.gatewayWebsocketBroadcast, + writer.uint32(834).fork() + ).ldelim(); + } return writer; }, @@ -2407,6 +2606,12 @@ export const Trigger_Logging = { reader.uint32() ); break; + case 104: + message.gatewayWebsocketBroadcast = GatewayWebsocketBroadcast.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2441,6 +2646,11 @@ export const Trigger_Logging = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromJSON(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromJSON(object.gatewayWebsocketBroadcast) + : undefined; return message; }, @@ -2479,6 +2689,10 @@ export const Trigger_Logging = { (obj.invokeContainer = message.invokeContainer ? InvokeContainerWithRetry.toJSON(message.invokeContainer) : undefined); + message.gatewayWebsocketBroadcast !== undefined && + (obj.gatewayWebsocketBroadcast = message.gatewayWebsocketBroadcast + ? GatewayWebsocketBroadcast.toJSON(message.gatewayWebsocketBroadcast) + : undefined); return obj; }, @@ -2503,6 +2717,13 @@ export const Trigger_Logging = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromPartial(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromPartial( + object.gatewayWebsocketBroadcast + ) + : undefined; return message; }, }; @@ -2981,6 +3202,108 @@ messageTypeRegistry.set( InvokeContainerWithRetry ); +const baseGatewayWebsocketBroadcast: object = { + $type: "yandex.cloud.serverless.triggers.v1.GatewayWebsocketBroadcast", + gatewayId: "", + path: "", + serviceAccountId: "", +}; + +export const GatewayWebsocketBroadcast = { + $type: + "yandex.cloud.serverless.triggers.v1.GatewayWebsocketBroadcast" as const, + + encode( + message: GatewayWebsocketBroadcast, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.gatewayId !== "") { + writer.uint32(10).string(message.gatewayId); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + if (message.serviceAccountId !== "") { + writer.uint32(26).string(message.serviceAccountId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GatewayWebsocketBroadcast { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGatewayWebsocketBroadcast, + } as GatewayWebsocketBroadcast; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gatewayId = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + case 3: + message.serviceAccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GatewayWebsocketBroadcast { + const message = { + ...baseGatewayWebsocketBroadcast, + } as GatewayWebsocketBroadcast; + message.gatewayId = + object.gatewayId !== undefined && object.gatewayId !== null + ? String(object.gatewayId) + : ""; + message.path = + object.path !== undefined && object.path !== null + ? String(object.path) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + return message; + }, + + toJSON(message: GatewayWebsocketBroadcast): unknown { + const obj: any = {}; + message.gatewayId !== undefined && (obj.gatewayId = message.gatewayId); + message.path !== undefined && (obj.path = message.path); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GatewayWebsocketBroadcast { + const message = { + ...baseGatewayWebsocketBroadcast, + } as GatewayWebsocketBroadcast; + message.gatewayId = object.gatewayId ?? ""; + message.path = object.path ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GatewayWebsocketBroadcast.$type, + GatewayWebsocketBroadcast +); + const basePutQueueMessage: object = { $type: "yandex.cloud.serverless.triggers.v1.PutQueueMessage", queueId: "", @@ -3415,6 +3738,12 @@ export const BillingBudget = { writer.uint32(826).fork() ).ldelim(); } + if (message.gatewayWebsocketBroadcast !== undefined) { + GatewayWebsocketBroadcast.encode( + message.gatewayWebsocketBroadcast, + writer.uint32(834).fork() + ).ldelim(); + } return writer; }, @@ -3443,6 +3772,12 @@ export const BillingBudget = { reader.uint32() ); break; + case 104: + message.gatewayWebsocketBroadcast = GatewayWebsocketBroadcast.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3469,6 +3804,11 @@ export const BillingBudget = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromJSON(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromJSON(object.gatewayWebsocketBroadcast) + : undefined; return message; }, @@ -3485,6 +3825,10 @@ export const BillingBudget = { (obj.invokeContainer = message.invokeContainer ? InvokeContainerWithRetry.toJSON(message.invokeContainer) : undefined); + message.gatewayWebsocketBroadcast !== undefined && + (obj.gatewayWebsocketBroadcast = message.gatewayWebsocketBroadcast + ? GatewayWebsocketBroadcast.toJSON(message.gatewayWebsocketBroadcast) + : undefined); return obj; }, @@ -3502,6 +3846,13 @@ export const BillingBudget = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromPartial(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromPartial( + object.gatewayWebsocketBroadcast + ) + : undefined; return message; }, }; @@ -3642,6 +3993,12 @@ export const DataStream = { writer.uint32(122).fork() ).ldelim(); } + if (message.gatewayWebsocketBroadcast !== undefined) { + GatewayWebsocketBroadcast.encode( + message.gatewayWebsocketBroadcast, + writer.uint32(130).fork() + ).ldelim(); + } return writer; }, @@ -3682,6 +4039,12 @@ export const DataStream = { reader.uint32() ); break; + case 16: + message.gatewayWebsocketBroadcast = GatewayWebsocketBroadcast.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3720,6 +4083,11 @@ export const DataStream = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromJSON(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromJSON(object.gatewayWebsocketBroadcast) + : undefined; return message; }, @@ -3742,6 +4110,10 @@ export const DataStream = { (obj.invokeContainer = message.invokeContainer ? InvokeContainerWithRetry.toJSON(message.invokeContainer) : undefined); + message.gatewayWebsocketBroadcast !== undefined && + (obj.gatewayWebsocketBroadcast = message.gatewayWebsocketBroadcast + ? GatewayWebsocketBroadcast.toJSON(message.gatewayWebsocketBroadcast) + : undefined); return obj; }, @@ -3765,6 +4137,13 @@ export const DataStream = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromPartial(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromPartial( + object.gatewayWebsocketBroadcast + ) + : undefined; return message; }, }; @@ -3896,6 +4275,12 @@ export const Mail = { writer.uint32(826).fork() ).ldelim(); } + if (message.gatewayWebsocketBroadcast !== undefined) { + GatewayWebsocketBroadcast.encode( + message.gatewayWebsocketBroadcast, + writer.uint32(834).fork() + ).ldelim(); + } return writer; }, @@ -3930,6 +4315,12 @@ export const Mail = { reader.uint32() ); break; + case 104: + message.gatewayWebsocketBroadcast = GatewayWebsocketBroadcast.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3961,6 +4352,11 @@ export const Mail = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromJSON(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromJSON(object.gatewayWebsocketBroadcast) + : undefined; return message; }, @@ -3983,6 +4379,10 @@ export const Mail = { (obj.invokeContainer = message.invokeContainer ? InvokeContainerWithRetry.toJSON(message.invokeContainer) : undefined); + message.gatewayWebsocketBroadcast !== undefined && + (obj.gatewayWebsocketBroadcast = message.gatewayWebsocketBroadcast + ? GatewayWebsocketBroadcast.toJSON(message.gatewayWebsocketBroadcast) + : undefined); return obj; }, @@ -4006,6 +4406,13 @@ export const Mail = { object.invokeContainer !== undefined && object.invokeContainer !== null ? InvokeContainerWithRetry.fromPartial(object.invokeContainer) : undefined; + message.gatewayWebsocketBroadcast = + object.gatewayWebsocketBroadcast !== undefined && + object.gatewayWebsocketBroadcast !== null + ? GatewayWebsocketBroadcast.fromPartial( + object.gatewayWebsocketBroadcast + ) + : undefined; return message; }, }; diff --git a/src/generated/yandex/cloud/serverless/workflows/v1/execution.ts b/src/generated/yandex/cloud/serverless/workflows/v1/execution.ts new file mode 100644 index 00000000..2a0ee6e7 --- /dev/null +++ b/src/generated/yandex/cloud/serverless/workflows/v1/execution.ts @@ -0,0 +1,681 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Duration } from "../../../../../google/protobuf/duration"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.serverless.workflows.v1"; + +export interface Execution { + $type: "yandex.cloud.serverless.workflows.v1.Execution"; + /** ID of the Workflow execution. Generated at creation time. */ + id: string; + /** ID of the Workflow. */ + workflowId: string; + /** Input data for the Workflow execution. */ + input?: ExecutionInput; + /** Result of the Workflow execution. */ + result?: ExecutionResult; + /** Error details, in case Workflow execution failed. */ + error?: ExecutionError; + /** Status of the Workflow execution */ + status: Execution_Status; + /** Start timestamp for the Workflow execution. */ + startedAt?: Date; + /** Duration of the Workflow execution. */ + duration?: Duration; +} + +export enum Execution_Status { + STATUS_UNSPECIFIED = 0, + /** QUEUED - Workflow execution is being queued. */ + QUEUED = 1, + /** RUNNING - Workflow execution is running. */ + RUNNING = 2, + /** PAUSED - Workflow execution is being paused. */ + PAUSED = 3, + /** STOPPED - Workflow execution is stopped. */ + STOPPED = 4, + /** FAILED - Workflow execution is failed. */ + FAILED = 5, + /** FINISHED - Workflow execution is finished. */ + FINISHED = 6, + UNRECOGNIZED = -1, +} + +export function execution_StatusFromJSON(object: any): Execution_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return Execution_Status.STATUS_UNSPECIFIED; + case 1: + case "QUEUED": + return Execution_Status.QUEUED; + case 2: + case "RUNNING": + return Execution_Status.RUNNING; + case 3: + case "PAUSED": + return Execution_Status.PAUSED; + case 4: + case "STOPPED": + return Execution_Status.STOPPED; + case 5: + case "FAILED": + return Execution_Status.FAILED; + case 6: + case "FINISHED": + return Execution_Status.FINISHED; + case -1: + case "UNRECOGNIZED": + default: + return Execution_Status.UNRECOGNIZED; + } +} + +export function execution_StatusToJSON(object: Execution_Status): string { + switch (object) { + case Execution_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case Execution_Status.QUEUED: + return "QUEUED"; + case Execution_Status.RUNNING: + return "RUNNING"; + case Execution_Status.PAUSED: + return "PAUSED"; + case Execution_Status.STOPPED: + return "STOPPED"; + case Execution_Status.FAILED: + return "FAILED"; + case Execution_Status.FINISHED: + return "FINISHED"; + default: + return "UNKNOWN"; + } +} + +export interface ExecutionPreview { + $type: "yandex.cloud.serverless.workflows.v1.ExecutionPreview"; + /** ID of the Workflow execution. Generated at creation time. */ + id: string; + /** ID of the Workflow. */ + workflowId: string; + /** Status of the Workflow execution */ + status: Execution_Status; + /** Start timestamp for the Workflow execution. */ + startedAt?: Date; + /** Duration of the Workflow execution. */ + duration?: Duration; +} + +export interface ExecutionInput { + $type: "yandex.cloud.serverless.workflows.v1.ExecutionInput"; + /** JSON input data for the Workflow execution. */ + inputJson: string | undefined; +} + +export interface ExecutionResult { + $type: "yandex.cloud.serverless.workflows.v1.ExecutionResult"; + /** JSON result of the Workflow execution. */ + resultJson: string | undefined; +} + +export interface ExecutionError { + $type: "yandex.cloud.serverless.workflows.v1.ExecutionError"; + /** Error message of the Workflow execution. */ + message: string; + /** Error code of the Workflow execution. */ + errorCode: string; +} + +const baseExecution: object = { + $type: "yandex.cloud.serverless.workflows.v1.Execution", + id: "", + workflowId: "", + status: 0, +}; + +export const Execution = { + $type: "yandex.cloud.serverless.workflows.v1.Execution" as const, + + encode( + message: Execution, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.workflowId !== "") { + writer.uint32(18).string(message.workflowId); + } + if (message.input !== undefined) { + ExecutionInput.encode(message.input, writer.uint32(34).fork()).ldelim(); + } + if (message.result !== undefined) { + ExecutionResult.encode(message.result, writer.uint32(42).fork()).ldelim(); + } + if (message.error !== undefined) { + ExecutionError.encode(message.error, writer.uint32(50).fork()).ldelim(); + } + if (message.status !== 0) { + writer.uint32(56).int32(message.status); + } + if (message.startedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.startedAt), + writer.uint32(66).fork() + ).ldelim(); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(74).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Execution { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExecution } as Execution; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.workflowId = reader.string(); + break; + case 4: + message.input = ExecutionInput.decode(reader, reader.uint32()); + break; + case 5: + message.result = ExecutionResult.decode(reader, reader.uint32()); + break; + case 6: + message.error = ExecutionError.decode(reader, reader.uint32()); + break; + case 7: + message.status = reader.int32() as any; + break; + case 8: + message.startedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 9: + message.duration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Execution { + const message = { ...baseExecution } as Execution; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.workflowId = + object.workflowId !== undefined && object.workflowId !== null + ? String(object.workflowId) + : ""; + message.input = + object.input !== undefined && object.input !== null + ? ExecutionInput.fromJSON(object.input) + : undefined; + message.result = + object.result !== undefined && object.result !== null + ? ExecutionResult.fromJSON(object.result) + : undefined; + message.error = + object.error !== undefined && object.error !== null + ? ExecutionError.fromJSON(object.error) + : undefined; + message.status = + object.status !== undefined && object.status !== null + ? execution_StatusFromJSON(object.status) + : 0; + message.startedAt = + object.startedAt !== undefined && object.startedAt !== null + ? fromJsonTimestamp(object.startedAt) + : undefined; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromJSON(object.duration) + : undefined; + return message; + }, + + toJSON(message: Execution): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.workflowId !== undefined && (obj.workflowId = message.workflowId); + message.input !== undefined && + (obj.input = message.input + ? ExecutionInput.toJSON(message.input) + : undefined); + message.result !== undefined && + (obj.result = message.result + ? ExecutionResult.toJSON(message.result) + : undefined); + message.error !== undefined && + (obj.error = message.error + ? ExecutionError.toJSON(message.error) + : undefined); + message.status !== undefined && + (obj.status = execution_StatusToJSON(message.status)); + message.startedAt !== undefined && + (obj.startedAt = message.startedAt.toISOString()); + message.duration !== undefined && + (obj.duration = message.duration + ? Duration.toJSON(message.duration) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Execution { + const message = { ...baseExecution } as Execution; + message.id = object.id ?? ""; + message.workflowId = object.workflowId ?? ""; + message.input = + object.input !== undefined && object.input !== null + ? ExecutionInput.fromPartial(object.input) + : undefined; + message.result = + object.result !== undefined && object.result !== null + ? ExecutionResult.fromPartial(object.result) + : undefined; + message.error = + object.error !== undefined && object.error !== null + ? ExecutionError.fromPartial(object.error) + : undefined; + message.status = object.status ?? 0; + message.startedAt = object.startedAt ?? undefined; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Execution.$type, Execution); + +const baseExecutionPreview: object = { + $type: "yandex.cloud.serverless.workflows.v1.ExecutionPreview", + id: "", + workflowId: "", + status: 0, +}; + +export const ExecutionPreview = { + $type: "yandex.cloud.serverless.workflows.v1.ExecutionPreview" as const, + + encode( + message: ExecutionPreview, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.workflowId !== "") { + writer.uint32(18).string(message.workflowId); + } + if (message.status !== 0) { + writer.uint32(32).int32(message.status); + } + if (message.startedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.startedAt), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ExecutionPreview { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExecutionPreview } as ExecutionPreview; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.workflowId = reader.string(); + break; + case 4: + message.status = reader.int32() as any; + break; + case 5: + message.startedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + message.duration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExecutionPreview { + const message = { ...baseExecutionPreview } as ExecutionPreview; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.workflowId = + object.workflowId !== undefined && object.workflowId !== null + ? String(object.workflowId) + : ""; + message.status = + object.status !== undefined && object.status !== null + ? execution_StatusFromJSON(object.status) + : 0; + message.startedAt = + object.startedAt !== undefined && object.startedAt !== null + ? fromJsonTimestamp(object.startedAt) + : undefined; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromJSON(object.duration) + : undefined; + return message; + }, + + toJSON(message: ExecutionPreview): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.workflowId !== undefined && (obj.workflowId = message.workflowId); + message.status !== undefined && + (obj.status = execution_StatusToJSON(message.status)); + message.startedAt !== undefined && + (obj.startedAt = message.startedAt.toISOString()); + message.duration !== undefined && + (obj.duration = message.duration + ? Duration.toJSON(message.duration) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ExecutionPreview { + const message = { ...baseExecutionPreview } as ExecutionPreview; + message.id = object.id ?? ""; + message.workflowId = object.workflowId ?? ""; + message.status = object.status ?? 0; + message.startedAt = object.startedAt ?? undefined; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(ExecutionPreview.$type, ExecutionPreview); + +const baseExecutionInput: object = { + $type: "yandex.cloud.serverless.workflows.v1.ExecutionInput", +}; + +export const ExecutionInput = { + $type: "yandex.cloud.serverless.workflows.v1.ExecutionInput" as const, + + encode( + message: ExecutionInput, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.inputJson !== undefined) { + writer.uint32(10).string(message.inputJson); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ExecutionInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExecutionInput } as ExecutionInput; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExecutionInput { + const message = { ...baseExecutionInput } as ExecutionInput; + message.inputJson = + object.inputJson !== undefined && object.inputJson !== null + ? String(object.inputJson) + : undefined; + return message; + }, + + toJSON(message: ExecutionInput): unknown { + const obj: any = {}; + message.inputJson !== undefined && (obj.inputJson = message.inputJson); + return obj; + }, + + fromPartial, I>>( + object: I + ): ExecutionInput { + const message = { ...baseExecutionInput } as ExecutionInput; + message.inputJson = object.inputJson ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(ExecutionInput.$type, ExecutionInput); + +const baseExecutionResult: object = { + $type: "yandex.cloud.serverless.workflows.v1.ExecutionResult", +}; + +export const ExecutionResult = { + $type: "yandex.cloud.serverless.workflows.v1.ExecutionResult" as const, + + encode( + message: ExecutionResult, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.resultJson !== undefined) { + writer.uint32(10).string(message.resultJson); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ExecutionResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExecutionResult } as ExecutionResult; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resultJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExecutionResult { + const message = { ...baseExecutionResult } as ExecutionResult; + message.resultJson = + object.resultJson !== undefined && object.resultJson !== null + ? String(object.resultJson) + : undefined; + return message; + }, + + toJSON(message: ExecutionResult): unknown { + const obj: any = {}; + message.resultJson !== undefined && (obj.resultJson = message.resultJson); + return obj; + }, + + fromPartial, I>>( + object: I + ): ExecutionResult { + const message = { ...baseExecutionResult } as ExecutionResult; + message.resultJson = object.resultJson ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(ExecutionResult.$type, ExecutionResult); + +const baseExecutionError: object = { + $type: "yandex.cloud.serverless.workflows.v1.ExecutionError", + message: "", + errorCode: "", +}; + +export const ExecutionError = { + $type: "yandex.cloud.serverless.workflows.v1.ExecutionError" as const, + + encode( + message: ExecutionError, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + if (message.errorCode !== "") { + writer.uint32(18).string(message.errorCode); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ExecutionError { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExecutionError } as ExecutionError; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + case 2: + message.errorCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExecutionError { + const message = { ...baseExecutionError } as ExecutionError; + message.message = + object.message !== undefined && object.message !== null + ? String(object.message) + : ""; + message.errorCode = + object.errorCode !== undefined && object.errorCode !== null + ? String(object.errorCode) + : ""; + return message; + }, + + toJSON(message: ExecutionError): unknown { + const obj: any = {}; + message.message !== undefined && (obj.message = message.message); + message.errorCode !== undefined && (obj.errorCode = message.errorCode); + return obj; + }, + + fromPartial, I>>( + object: I + ): ExecutionError { + const message = { ...baseExecutionError } as ExecutionError; + message.message = object.message ?? ""; + message.errorCode = object.errorCode ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ExecutionError.$type, ExecutionError); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/serverless/workflows/v1/execution_service.ts b/src/generated/yandex/cloud/serverless/workflows/v1/execution_service.ts new file mode 100644 index 00000000..12f819de --- /dev/null +++ b/src/generated/yandex/cloud/serverless/workflows/v1/execution_service.ts @@ -0,0 +1,1177 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + ExecutionInput, + Execution, + ExecutionPreview, +} from "../../../../../yandex/cloud/serverless/workflows/v1/execution"; +import { HistoryEntry } from "../../../../../yandex/cloud/serverless/workflows/v1/history_entry"; + +export const protobufPackage = "yandex.cloud.serverless.workflows.v1"; + +export interface StartExecutionRequest { + $type: "yandex.cloud.serverless.workflows.v1.StartExecutionRequest"; + /** ID of the Workflow. */ + workflowId: string; + /** Input for the Workflow execution */ + input?: ExecutionInput; +} + +export interface StartExecutionResponse { + $type: "yandex.cloud.serverless.workflows.v1.StartExecutionResponse"; + /** ID of the Workflow execution. */ + executionId: string; +} + +export interface StopExecutionRequest { + $type: "yandex.cloud.serverless.workflows.v1.StopExecutionRequest"; + /** ID of the Workflow execution. */ + executionId: string; +} + +export interface StopExecutionResponse { + $type: "yandex.cloud.serverless.workflows.v1.StopExecutionResponse"; + /** ID of the Workflow execution. */ + executionId: string; +} + +export interface GetExecutionRequest { + $type: "yandex.cloud.serverless.workflows.v1.GetExecutionRequest"; + /** ID of the Workflow execution. */ + executionId: string; +} + +export interface GetExecutionResponse { + $type: "yandex.cloud.serverless.workflows.v1.GetExecutionResponse"; + /** Workflow execution details. */ + execution?: Execution; +} + +export interface GetExecutionHistoryRequest { + $type: "yandex.cloud.serverless.workflows.v1.GetExecutionHistoryRequest"; + /** ID of the Workflow execution. */ + executionId: string; +} + +export interface GetExecutionHistoryResponse { + $type: "yandex.cloud.serverless.workflows.v1.GetExecutionHistoryResponse"; + /** Workflow execution details. */ + execution?: ExecutionPreview; + /** Workflow execution detailed history items. */ + entries: HistoryEntry[]; +} + +export interface ListExecutionsRequest { + $type: "yandex.cloud.serverless.workflows.v1.ListExecutionsRequest"; + /** ID of the Workflow. */ + workflowId: string; + /** + * The maximum number of results per page that should be returned. If the number of available + * results is larger than `pageSize`, the service returns a [ListExecutionsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `pageToken` to the + * [ListExecutionsResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters resources listed in the response. + * + * The expression must specify: + * 1. The field name. Currently filtering can be applied to the following fields: status, started_at, finished_at. + * 2. Operator: `=`, `<` or `>`. + * 3. The value. Must be sting and match the regular expression `[+:\.-a-z0-9]`. + * Examples of a filter: `status=ERROR`, `created_by=John.Doe`. + */ + filter: string; +} + +export interface ListExecutionsResponse { + $type: "yandex.cloud.serverless.workflows.v1.ListExecutionsResponse"; + /** List of Workflow executions. */ + executions: ExecutionPreview[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListExecutionsRequest.page_size], use `next_page_token` as the value + * for the [ListExecutionsRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `next_page_token` to continue paging through the results. + */ + nextPageToken: string; +} + +const baseStartExecutionRequest: object = { + $type: "yandex.cloud.serverless.workflows.v1.StartExecutionRequest", + workflowId: "", +}; + +export const StartExecutionRequest = { + $type: "yandex.cloud.serverless.workflows.v1.StartExecutionRequest" as const, + + encode( + message: StartExecutionRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.workflowId !== "") { + writer.uint32(10).string(message.workflowId); + } + if (message.input !== undefined) { + ExecutionInput.encode(message.input, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): StartExecutionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStartExecutionRequest } as StartExecutionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workflowId = reader.string(); + break; + case 3: + message.input = ExecutionInput.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StartExecutionRequest { + const message = { ...baseStartExecutionRequest } as StartExecutionRequest; + message.workflowId = + object.workflowId !== undefined && object.workflowId !== null + ? String(object.workflowId) + : ""; + message.input = + object.input !== undefined && object.input !== null + ? ExecutionInput.fromJSON(object.input) + : undefined; + return message; + }, + + toJSON(message: StartExecutionRequest): unknown { + const obj: any = {}; + message.workflowId !== undefined && (obj.workflowId = message.workflowId); + message.input !== undefined && + (obj.input = message.input + ? ExecutionInput.toJSON(message.input) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): StartExecutionRequest { + const message = { ...baseStartExecutionRequest } as StartExecutionRequest; + message.workflowId = object.workflowId ?? ""; + message.input = + object.input !== undefined && object.input !== null + ? ExecutionInput.fromPartial(object.input) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(StartExecutionRequest.$type, StartExecutionRequest); + +const baseStartExecutionResponse: object = { + $type: "yandex.cloud.serverless.workflows.v1.StartExecutionResponse", + executionId: "", +}; + +export const StartExecutionResponse = { + $type: "yandex.cloud.serverless.workflows.v1.StartExecutionResponse" as const, + + encode( + message: StartExecutionResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.executionId !== "") { + writer.uint32(10).string(message.executionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): StartExecutionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStartExecutionResponse } as StartExecutionResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.executionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StartExecutionResponse { + const message = { ...baseStartExecutionResponse } as StartExecutionResponse; + message.executionId = + object.executionId !== undefined && object.executionId !== null + ? String(object.executionId) + : ""; + return message; + }, + + toJSON(message: StartExecutionResponse): unknown { + const obj: any = {}; + message.executionId !== undefined && + (obj.executionId = message.executionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): StartExecutionResponse { + const message = { ...baseStartExecutionResponse } as StartExecutionResponse; + message.executionId = object.executionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StartExecutionResponse.$type, StartExecutionResponse); + +const baseStopExecutionRequest: object = { + $type: "yandex.cloud.serverless.workflows.v1.StopExecutionRequest", + executionId: "", +}; + +export const StopExecutionRequest = { + $type: "yandex.cloud.serverless.workflows.v1.StopExecutionRequest" as const, + + encode( + message: StopExecutionRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.executionId !== "") { + writer.uint32(10).string(message.executionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): StopExecutionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStopExecutionRequest } as StopExecutionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.executionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StopExecutionRequest { + const message = { ...baseStopExecutionRequest } as StopExecutionRequest; + message.executionId = + object.executionId !== undefined && object.executionId !== null + ? String(object.executionId) + : ""; + return message; + }, + + toJSON(message: StopExecutionRequest): unknown { + const obj: any = {}; + message.executionId !== undefined && + (obj.executionId = message.executionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): StopExecutionRequest { + const message = { ...baseStopExecutionRequest } as StopExecutionRequest; + message.executionId = object.executionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StopExecutionRequest.$type, StopExecutionRequest); + +const baseStopExecutionResponse: object = { + $type: "yandex.cloud.serverless.workflows.v1.StopExecutionResponse", + executionId: "", +}; + +export const StopExecutionResponse = { + $type: "yandex.cloud.serverless.workflows.v1.StopExecutionResponse" as const, + + encode( + message: StopExecutionResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.executionId !== "") { + writer.uint32(10).string(message.executionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): StopExecutionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStopExecutionResponse } as StopExecutionResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.executionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StopExecutionResponse { + const message = { ...baseStopExecutionResponse } as StopExecutionResponse; + message.executionId = + object.executionId !== undefined && object.executionId !== null + ? String(object.executionId) + : ""; + return message; + }, + + toJSON(message: StopExecutionResponse): unknown { + const obj: any = {}; + message.executionId !== undefined && + (obj.executionId = message.executionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): StopExecutionResponse { + const message = { ...baseStopExecutionResponse } as StopExecutionResponse; + message.executionId = object.executionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StopExecutionResponse.$type, StopExecutionResponse); + +const baseGetExecutionRequest: object = { + $type: "yandex.cloud.serverless.workflows.v1.GetExecutionRequest", + executionId: "", +}; + +export const GetExecutionRequest = { + $type: "yandex.cloud.serverless.workflows.v1.GetExecutionRequest" as const, + + encode( + message: GetExecutionRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.executionId !== "") { + writer.uint32(10).string(message.executionId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetExecutionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetExecutionRequest } as GetExecutionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.executionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetExecutionRequest { + const message = { ...baseGetExecutionRequest } as GetExecutionRequest; + message.executionId = + object.executionId !== undefined && object.executionId !== null + ? String(object.executionId) + : ""; + return message; + }, + + toJSON(message: GetExecutionRequest): unknown { + const obj: any = {}; + message.executionId !== undefined && + (obj.executionId = message.executionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetExecutionRequest { + const message = { ...baseGetExecutionRequest } as GetExecutionRequest; + message.executionId = object.executionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetExecutionRequest.$type, GetExecutionRequest); + +const baseGetExecutionResponse: object = { + $type: "yandex.cloud.serverless.workflows.v1.GetExecutionResponse", +}; + +export const GetExecutionResponse = { + $type: "yandex.cloud.serverless.workflows.v1.GetExecutionResponse" as const, + + encode( + message: GetExecutionResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.execution !== undefined) { + Execution.encode(message.execution, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetExecutionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetExecutionResponse } as GetExecutionResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.execution = Execution.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetExecutionResponse { + const message = { ...baseGetExecutionResponse } as GetExecutionResponse; + message.execution = + object.execution !== undefined && object.execution !== null + ? Execution.fromJSON(object.execution) + : undefined; + return message; + }, + + toJSON(message: GetExecutionResponse): unknown { + const obj: any = {}; + message.execution !== undefined && + (obj.execution = message.execution + ? Execution.toJSON(message.execution) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetExecutionResponse { + const message = { ...baseGetExecutionResponse } as GetExecutionResponse; + message.execution = + object.execution !== undefined && object.execution !== null + ? Execution.fromPartial(object.execution) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GetExecutionResponse.$type, GetExecutionResponse); + +const baseGetExecutionHistoryRequest: object = { + $type: "yandex.cloud.serverless.workflows.v1.GetExecutionHistoryRequest", + executionId: "", +}; + +export const GetExecutionHistoryRequest = { + $type: + "yandex.cloud.serverless.workflows.v1.GetExecutionHistoryRequest" as const, + + encode( + message: GetExecutionHistoryRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.executionId !== "") { + writer.uint32(10).string(message.executionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetExecutionHistoryRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetExecutionHistoryRequest, + } as GetExecutionHistoryRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.executionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetExecutionHistoryRequest { + const message = { + ...baseGetExecutionHistoryRequest, + } as GetExecutionHistoryRequest; + message.executionId = + object.executionId !== undefined && object.executionId !== null + ? String(object.executionId) + : ""; + return message; + }, + + toJSON(message: GetExecutionHistoryRequest): unknown { + const obj: any = {}; + message.executionId !== undefined && + (obj.executionId = message.executionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetExecutionHistoryRequest { + const message = { + ...baseGetExecutionHistoryRequest, + } as GetExecutionHistoryRequest; + message.executionId = object.executionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetExecutionHistoryRequest.$type, + GetExecutionHistoryRequest +); + +const baseGetExecutionHistoryResponse: object = { + $type: "yandex.cloud.serverless.workflows.v1.GetExecutionHistoryResponse", +}; + +export const GetExecutionHistoryResponse = { + $type: + "yandex.cloud.serverless.workflows.v1.GetExecutionHistoryResponse" as const, + + encode( + message: GetExecutionHistoryResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.execution !== undefined) { + ExecutionPreview.encode( + message.execution, + writer.uint32(10).fork() + ).ldelim(); + } + for (const v of message.entries) { + HistoryEntry.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetExecutionHistoryResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetExecutionHistoryResponse, + } as GetExecutionHistoryResponse; + message.entries = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.execution = ExecutionPreview.decode(reader, reader.uint32()); + break; + case 2: + message.entries.push(HistoryEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetExecutionHistoryResponse { + const message = { + ...baseGetExecutionHistoryResponse, + } as GetExecutionHistoryResponse; + message.execution = + object.execution !== undefined && object.execution !== null + ? ExecutionPreview.fromJSON(object.execution) + : undefined; + message.entries = (object.entries ?? []).map((e: any) => + HistoryEntry.fromJSON(e) + ); + return message; + }, + + toJSON(message: GetExecutionHistoryResponse): unknown { + const obj: any = {}; + message.execution !== undefined && + (obj.execution = message.execution + ? ExecutionPreview.toJSON(message.execution) + : undefined); + if (message.entries) { + obj.entries = message.entries.map((e) => + e ? HistoryEntry.toJSON(e) : undefined + ); + } else { + obj.entries = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): GetExecutionHistoryResponse { + const message = { + ...baseGetExecutionHistoryResponse, + } as GetExecutionHistoryResponse; + message.execution = + object.execution !== undefined && object.execution !== null + ? ExecutionPreview.fromPartial(object.execution) + : undefined; + message.entries = + object.entries?.map((e) => HistoryEntry.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + GetExecutionHistoryResponse.$type, + GetExecutionHistoryResponse +); + +const baseListExecutionsRequest: object = { + $type: "yandex.cloud.serverless.workflows.v1.ListExecutionsRequest", + workflowId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListExecutionsRequest = { + $type: "yandex.cloud.serverless.workflows.v1.ListExecutionsRequest" as const, + + encode( + message: ListExecutionsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.workflowId !== "") { + writer.uint32(10).string(message.workflowId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListExecutionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListExecutionsRequest } as ListExecutionsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workflowId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListExecutionsRequest { + const message = { ...baseListExecutionsRequest } as ListExecutionsRequest; + message.workflowId = + object.workflowId !== undefined && object.workflowId !== null + ? String(object.workflowId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListExecutionsRequest): unknown { + const obj: any = {}; + message.workflowId !== undefined && (obj.workflowId = message.workflowId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListExecutionsRequest { + const message = { ...baseListExecutionsRequest } as ListExecutionsRequest; + message.workflowId = object.workflowId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListExecutionsRequest.$type, ListExecutionsRequest); + +const baseListExecutionsResponse: object = { + $type: "yandex.cloud.serverless.workflows.v1.ListExecutionsResponse", + nextPageToken: "", +}; + +export const ListExecutionsResponse = { + $type: "yandex.cloud.serverless.workflows.v1.ListExecutionsResponse" as const, + + encode( + message: ListExecutionsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.executions) { + ExecutionPreview.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListExecutionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListExecutionsResponse } as ListExecutionsResponse; + message.executions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.executions.push( + ExecutionPreview.decode(reader, reader.uint32()) + ); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListExecutionsResponse { + const message = { ...baseListExecutionsResponse } as ListExecutionsResponse; + message.executions = (object.executions ?? []).map((e: any) => + ExecutionPreview.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListExecutionsResponse): unknown { + const obj: any = {}; + if (message.executions) { + obj.executions = message.executions.map((e) => + e ? ExecutionPreview.toJSON(e) : undefined + ); + } else { + obj.executions = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListExecutionsResponse { + const message = { ...baseListExecutionsResponse } as ListExecutionsResponse; + message.executions = + object.executions?.map((e) => ExecutionPreview.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListExecutionsResponse.$type, ListExecutionsResponse); + +/** Set of methods for managing Workflows Executions. */ +export const ExecutionServiceService = { + /** Starts new Workflow execution. */ + start: { + path: "/yandex.cloud.serverless.workflows.v1.ExecutionService/Start", + requestStream: false, + responseStream: false, + requestSerialize: (value: StartExecutionRequest) => + Buffer.from(StartExecutionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => StartExecutionRequest.decode(value), + responseSerialize: (value: StartExecutionResponse) => + Buffer.from(StartExecutionResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + StartExecutionResponse.decode(value), + }, + /** Stops specified Workflow execution. */ + stop: { + path: "/yandex.cloud.serverless.workflows.v1.ExecutionService/Stop", + requestStream: false, + responseStream: false, + requestSerialize: (value: StopExecutionRequest) => + Buffer.from(StopExecutionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => StopExecutionRequest.decode(value), + responseSerialize: (value: StopExecutionResponse) => + Buffer.from(StopExecutionResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => StopExecutionResponse.decode(value), + }, + /** Retrieves specified Workflow execution. */ + get: { + path: "/yandex.cloud.serverless.workflows.v1.ExecutionService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetExecutionRequest) => + Buffer.from(GetExecutionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetExecutionRequest.decode(value), + responseSerialize: (value: GetExecutionResponse) => + Buffer.from(GetExecutionResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => GetExecutionResponse.decode(value), + }, + /** Retrieves detailed history of specified Workflow execution. */ + getHistory: { + path: "/yandex.cloud.serverless.workflows.v1.ExecutionService/GetHistory", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetExecutionHistoryRequest) => + Buffer.from(GetExecutionHistoryRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetExecutionHistoryRequest.decode(value), + responseSerialize: (value: GetExecutionHistoryResponse) => + Buffer.from(GetExecutionHistoryResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + GetExecutionHistoryResponse.decode(value), + }, + /** Retrieves list of Workflow executions. */ + list: { + path: "/yandex.cloud.serverless.workflows.v1.ExecutionService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListExecutionsRequest) => + Buffer.from(ListExecutionsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListExecutionsRequest.decode(value), + responseSerialize: (value: ListExecutionsResponse) => + Buffer.from(ListExecutionsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListExecutionsResponse.decode(value), + }, +} as const; + +export interface ExecutionServiceServer extends UntypedServiceImplementation { + /** Starts new Workflow execution. */ + start: handleUnaryCall; + /** Stops specified Workflow execution. */ + stop: handleUnaryCall; + /** Retrieves specified Workflow execution. */ + get: handleUnaryCall; + /** Retrieves detailed history of specified Workflow execution. */ + getHistory: handleUnaryCall< + GetExecutionHistoryRequest, + GetExecutionHistoryResponse + >; + /** Retrieves list of Workflow executions. */ + list: handleUnaryCall; +} + +export interface ExecutionServiceClient extends Client { + /** Starts new Workflow execution. */ + start( + request: StartExecutionRequest, + callback: ( + error: ServiceError | null, + response: StartExecutionResponse + ) => void + ): ClientUnaryCall; + start( + request: StartExecutionRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: StartExecutionResponse + ) => void + ): ClientUnaryCall; + start( + request: StartExecutionRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: StartExecutionResponse + ) => void + ): ClientUnaryCall; + /** Stops specified Workflow execution. */ + stop( + request: StopExecutionRequest, + callback: ( + error: ServiceError | null, + response: StopExecutionResponse + ) => void + ): ClientUnaryCall; + stop( + request: StopExecutionRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: StopExecutionResponse + ) => void + ): ClientUnaryCall; + stop( + request: StopExecutionRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: StopExecutionResponse + ) => void + ): ClientUnaryCall; + /** Retrieves specified Workflow execution. */ + get( + request: GetExecutionRequest, + callback: ( + error: ServiceError | null, + response: GetExecutionResponse + ) => void + ): ClientUnaryCall; + get( + request: GetExecutionRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: GetExecutionResponse + ) => void + ): ClientUnaryCall; + get( + request: GetExecutionRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: GetExecutionResponse + ) => void + ): ClientUnaryCall; + /** Retrieves detailed history of specified Workflow execution. */ + getHistory( + request: GetExecutionHistoryRequest, + callback: ( + error: ServiceError | null, + response: GetExecutionHistoryResponse + ) => void + ): ClientUnaryCall; + getHistory( + request: GetExecutionHistoryRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: GetExecutionHistoryResponse + ) => void + ): ClientUnaryCall; + getHistory( + request: GetExecutionHistoryRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: GetExecutionHistoryResponse + ) => void + ): ClientUnaryCall; + /** Retrieves list of Workflow executions. */ + list( + request: ListExecutionsRequest, + callback: ( + error: ServiceError | null, + response: ListExecutionsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListExecutionsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListExecutionsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListExecutionsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListExecutionsResponse + ) => void + ): ClientUnaryCall; +} + +export const ExecutionServiceClient = makeGenericClientConstructor( + ExecutionServiceService, + "yandex.cloud.serverless.workflows.v1.ExecutionService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ExecutionServiceClient; + service: typeof ExecutionServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/serverless/workflows/v1/history_entry.ts b/src/generated/yandex/cloud/serverless/workflows/v1/history_entry.ts new file mode 100644 index 00000000..c10e0f83 --- /dev/null +++ b/src/generated/yandex/cloud/serverless/workflows/v1/history_entry.ts @@ -0,0 +1,770 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Duration } from "../../../../../google/protobuf/duration"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.serverless.workflows.v1"; + +export interface HistoryEntry { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntry"; + /** ID of the Workflow step. */ + id: string; + /** Title of the Workflow step. */ + title: string; + /** Description of the Workflow step. */ + description: string; + /** Start timestamp for the Workflow step. */ + startedAt?: Date; + /** Duration of the Workflow step. */ + duration?: Duration; + /** Input data for the Workflow step. */ + input?: HistoryEntryInput; + /** Result of the Workflow step. */ + output?: HistoryEntryOutput; + /** Error details, in case Workflow step failed. */ + error?: HistoryEntryError; + /** Status of the Workflow step. */ + status: HistoryEntry_Status; + /** Type of the Workflow step (for example, FunctionCall or HttpCall). */ + type: string; + /** Number of attempts (including all retries of unsuccessful attempts). Value "1" means there were no retries. */ + attempts: number; + /** Last received error details in case of retries. */ + lastError?: HistoryEntryError; +} + +export enum HistoryEntry_Status { + STATUS_UNSPECIFIED = 0, + /** SCHEDULED - Step execution is being scheduled. */ + SCHEDULED = 1, + /** STARTED - Step execution is started. */ + STARTED = 2, + /** COMPLETED - Step execution is completed. */ + COMPLETED = 3, + /** FAILED - Step execution is failed. */ + FAILED = 4, + /** CANCEL_REQUESTED - Step execution is requested to be cancelled. */ + CANCEL_REQUESTED = 5, + /** CANCELLED - Step execution is canceled. */ + CANCELLED = 6, + UNRECOGNIZED = -1, +} + +export function historyEntry_StatusFromJSON(object: any): HistoryEntry_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return HistoryEntry_Status.STATUS_UNSPECIFIED; + case 1: + case "SCHEDULED": + return HistoryEntry_Status.SCHEDULED; + case 2: + case "STARTED": + return HistoryEntry_Status.STARTED; + case 3: + case "COMPLETED": + return HistoryEntry_Status.COMPLETED; + case 4: + case "FAILED": + return HistoryEntry_Status.FAILED; + case 5: + case "CANCEL_REQUESTED": + return HistoryEntry_Status.CANCEL_REQUESTED; + case 6: + case "CANCELLED": + return HistoryEntry_Status.CANCELLED; + case -1: + case "UNRECOGNIZED": + default: + return HistoryEntry_Status.UNRECOGNIZED; + } +} + +export function historyEntry_StatusToJSON(object: HistoryEntry_Status): string { + switch (object) { + case HistoryEntry_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case HistoryEntry_Status.SCHEDULED: + return "SCHEDULED"; + case HistoryEntry_Status.STARTED: + return "STARTED"; + case HistoryEntry_Status.COMPLETED: + return "COMPLETED"; + case HistoryEntry_Status.FAILED: + return "FAILED"; + case HistoryEntry_Status.CANCEL_REQUESTED: + return "CANCEL_REQUESTED"; + case HistoryEntry_Status.CANCELLED: + return "CANCELLED"; + default: + return "UNKNOWN"; + } +} + +export interface HistoryEntry_FailedAttempt { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntry.FailedAttempt"; + /** Start timestamp for the attempt. */ + startedAt?: Date; + /** Duration of the attempt. */ + duration?: Duration; + /** Error details. */ + error?: HistoryEntryError; +} + +export interface HistoryEntryInput { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntryInput"; + /** JSON input data for the Workflow step. */ + inputJson: string | undefined; +} + +export interface HistoryEntryOutput { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntryOutput"; + /** JSON result for the Workflow step. */ + outputJson: string | undefined; +} + +export interface HistoryEntryError { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntryError"; + /** Error message of the Workflow step. */ + message: string; + /** Error code of the Workflow step. */ + errorCode: string; +} + +const baseHistoryEntry: object = { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntry", + id: "", + title: "", + description: "", + status: 0, + type: "", + attempts: 0, +}; + +export const HistoryEntry = { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntry" as const, + + encode( + message: HistoryEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.title !== "") { + writer.uint32(18).string(message.title); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.startedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.startedAt), + writer.uint32(34).fork() + ).ldelim(); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(42).fork()).ldelim(); + } + if (message.input !== undefined) { + HistoryEntryInput.encode( + message.input, + writer.uint32(50).fork() + ).ldelim(); + } + if (message.output !== undefined) { + HistoryEntryOutput.encode( + message.output, + writer.uint32(58).fork() + ).ldelim(); + } + if (message.error !== undefined) { + HistoryEntryError.encode( + message.error, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.status !== 0) { + writer.uint32(72).int32(message.status); + } + if (message.type !== "") { + writer.uint32(82).string(message.type); + } + if (message.attempts !== 0) { + writer.uint32(96).int64(message.attempts); + } + if (message.lastError !== undefined) { + HistoryEntryError.encode( + message.lastError, + writer.uint32(106).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HistoryEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHistoryEntry } as HistoryEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.startedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 5: + message.duration = Duration.decode(reader, reader.uint32()); + break; + case 6: + message.input = HistoryEntryInput.decode(reader, reader.uint32()); + break; + case 7: + message.output = HistoryEntryOutput.decode(reader, reader.uint32()); + break; + case 8: + message.error = HistoryEntryError.decode(reader, reader.uint32()); + break; + case 9: + message.status = reader.int32() as any; + break; + case 10: + message.type = reader.string(); + break; + case 12: + message.attempts = longToNumber(reader.int64() as Long); + break; + case 13: + message.lastError = HistoryEntryError.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HistoryEntry { + const message = { ...baseHistoryEntry } as HistoryEntry; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.startedAt = + object.startedAt !== undefined && object.startedAt !== null + ? fromJsonTimestamp(object.startedAt) + : undefined; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromJSON(object.duration) + : undefined; + message.input = + object.input !== undefined && object.input !== null + ? HistoryEntryInput.fromJSON(object.input) + : undefined; + message.output = + object.output !== undefined && object.output !== null + ? HistoryEntryOutput.fromJSON(object.output) + : undefined; + message.error = + object.error !== undefined && object.error !== null + ? HistoryEntryError.fromJSON(object.error) + : undefined; + message.status = + object.status !== undefined && object.status !== null + ? historyEntry_StatusFromJSON(object.status) + : 0; + message.type = + object.type !== undefined && object.type !== null + ? String(object.type) + : ""; + message.attempts = + object.attempts !== undefined && object.attempts !== null + ? Number(object.attempts) + : 0; + message.lastError = + object.lastError !== undefined && object.lastError !== null + ? HistoryEntryError.fromJSON(object.lastError) + : undefined; + return message; + }, + + toJSON(message: HistoryEntry): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.startedAt !== undefined && + (obj.startedAt = message.startedAt.toISOString()); + message.duration !== undefined && + (obj.duration = message.duration + ? Duration.toJSON(message.duration) + : undefined); + message.input !== undefined && + (obj.input = message.input + ? HistoryEntryInput.toJSON(message.input) + : undefined); + message.output !== undefined && + (obj.output = message.output + ? HistoryEntryOutput.toJSON(message.output) + : undefined); + message.error !== undefined && + (obj.error = message.error + ? HistoryEntryError.toJSON(message.error) + : undefined); + message.status !== undefined && + (obj.status = historyEntry_StatusToJSON(message.status)); + message.type !== undefined && (obj.type = message.type); + message.attempts !== undefined && + (obj.attempts = Math.round(message.attempts)); + message.lastError !== undefined && + (obj.lastError = message.lastError + ? HistoryEntryError.toJSON(message.lastError) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): HistoryEntry { + const message = { ...baseHistoryEntry } as HistoryEntry; + message.id = object.id ?? ""; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.startedAt = object.startedAt ?? undefined; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + message.input = + object.input !== undefined && object.input !== null + ? HistoryEntryInput.fromPartial(object.input) + : undefined; + message.output = + object.output !== undefined && object.output !== null + ? HistoryEntryOutput.fromPartial(object.output) + : undefined; + message.error = + object.error !== undefined && object.error !== null + ? HistoryEntryError.fromPartial(object.error) + : undefined; + message.status = object.status ?? 0; + message.type = object.type ?? ""; + message.attempts = object.attempts ?? 0; + message.lastError = + object.lastError !== undefined && object.lastError !== null + ? HistoryEntryError.fromPartial(object.lastError) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(HistoryEntry.$type, HistoryEntry); + +const baseHistoryEntry_FailedAttempt: object = { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntry.FailedAttempt", +}; + +export const HistoryEntry_FailedAttempt = { + $type: + "yandex.cloud.serverless.workflows.v1.HistoryEntry.FailedAttempt" as const, + + encode( + message: HistoryEntry_FailedAttempt, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.startedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.startedAt), + writer.uint32(10).fork() + ).ldelim(); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(18).fork()).ldelim(); + } + if (message.error !== undefined) { + HistoryEntryError.encode( + message.error, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): HistoryEntry_FailedAttempt { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseHistoryEntry_FailedAttempt, + } as HistoryEntry_FailedAttempt; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 2: + message.duration = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.error = HistoryEntryError.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HistoryEntry_FailedAttempt { + const message = { + ...baseHistoryEntry_FailedAttempt, + } as HistoryEntry_FailedAttempt; + message.startedAt = + object.startedAt !== undefined && object.startedAt !== null + ? fromJsonTimestamp(object.startedAt) + : undefined; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromJSON(object.duration) + : undefined; + message.error = + object.error !== undefined && object.error !== null + ? HistoryEntryError.fromJSON(object.error) + : undefined; + return message; + }, + + toJSON(message: HistoryEntry_FailedAttempt): unknown { + const obj: any = {}; + message.startedAt !== undefined && + (obj.startedAt = message.startedAt.toISOString()); + message.duration !== undefined && + (obj.duration = message.duration + ? Duration.toJSON(message.duration) + : undefined); + message.error !== undefined && + (obj.error = message.error + ? HistoryEntryError.toJSON(message.error) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): HistoryEntry_FailedAttempt { + const message = { + ...baseHistoryEntry_FailedAttempt, + } as HistoryEntry_FailedAttempt; + message.startedAt = object.startedAt ?? undefined; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + message.error = + object.error !== undefined && object.error !== null + ? HistoryEntryError.fromPartial(object.error) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + HistoryEntry_FailedAttempt.$type, + HistoryEntry_FailedAttempt +); + +const baseHistoryEntryInput: object = { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntryInput", +}; + +export const HistoryEntryInput = { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntryInput" as const, + + encode( + message: HistoryEntryInput, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.inputJson !== undefined) { + writer.uint32(10).string(message.inputJson); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HistoryEntryInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHistoryEntryInput } as HistoryEntryInput; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HistoryEntryInput { + const message = { ...baseHistoryEntryInput } as HistoryEntryInput; + message.inputJson = + object.inputJson !== undefined && object.inputJson !== null + ? String(object.inputJson) + : undefined; + return message; + }, + + toJSON(message: HistoryEntryInput): unknown { + const obj: any = {}; + message.inputJson !== undefined && (obj.inputJson = message.inputJson); + return obj; + }, + + fromPartial, I>>( + object: I + ): HistoryEntryInput { + const message = { ...baseHistoryEntryInput } as HistoryEntryInput; + message.inputJson = object.inputJson ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(HistoryEntryInput.$type, HistoryEntryInput); + +const baseHistoryEntryOutput: object = { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntryOutput", +}; + +export const HistoryEntryOutput = { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntryOutput" as const, + + encode( + message: HistoryEntryOutput, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.outputJson !== undefined) { + writer.uint32(10).string(message.outputJson); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HistoryEntryOutput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHistoryEntryOutput } as HistoryEntryOutput; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HistoryEntryOutput { + const message = { ...baseHistoryEntryOutput } as HistoryEntryOutput; + message.outputJson = + object.outputJson !== undefined && object.outputJson !== null + ? String(object.outputJson) + : undefined; + return message; + }, + + toJSON(message: HistoryEntryOutput): unknown { + const obj: any = {}; + message.outputJson !== undefined && (obj.outputJson = message.outputJson); + return obj; + }, + + fromPartial, I>>( + object: I + ): HistoryEntryOutput { + const message = { ...baseHistoryEntryOutput } as HistoryEntryOutput; + message.outputJson = object.outputJson ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(HistoryEntryOutput.$type, HistoryEntryOutput); + +const baseHistoryEntryError: object = { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntryError", + message: "", + errorCode: "", +}; + +export const HistoryEntryError = { + $type: "yandex.cloud.serverless.workflows.v1.HistoryEntryError" as const, + + encode( + message: HistoryEntryError, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + if (message.errorCode !== "") { + writer.uint32(18).string(message.errorCode); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HistoryEntryError { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHistoryEntryError } as HistoryEntryError; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + case 2: + message.errorCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HistoryEntryError { + const message = { ...baseHistoryEntryError } as HistoryEntryError; + message.message = + object.message !== undefined && object.message !== null + ? String(object.message) + : ""; + message.errorCode = + object.errorCode !== undefined && object.errorCode !== null + ? String(object.errorCode) + : ""; + return message; + }, + + toJSON(message: HistoryEntryError): unknown { + const obj: any = {}; + message.message !== undefined && (obj.message = message.message); + message.errorCode !== undefined && (obj.errorCode = message.errorCode); + return obj; + }, + + fromPartial, I>>( + object: I + ): HistoryEntryError { + const message = { ...baseHistoryEntryError } as HistoryEntryError; + message.message = object.message ?? ""; + message.errorCode = object.errorCode ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(HistoryEntryError.$type, HistoryEntryError); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/serverless/workflows/v1/workflow.ts b/src/generated/yandex/cloud/serverless/workflows/v1/workflow.ts new file mode 100644 index 00000000..35980057 --- /dev/null +++ b/src/generated/yandex/cloud/serverless/workflows/v1/workflow.ts @@ -0,0 +1,991 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + LogLevel_Level, + logLevel_LevelFromJSON, + logLevel_LevelToJSON, +} from "../../../../../yandex/cloud/logging/v1/log_entry"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.serverless.workflows.v1"; + +export interface Workflow { + $type: "yandex.cloud.serverless.workflows.v1.Workflow"; + /** ID of the Workflow. Generated at creation time. */ + id: string; + /** ID of the folder that the Workflow belongs to. */ + folderId: string; + /** Specification of the Workflow */ + specification?: WorkflowSpecification; + /** Creation timestamp for the Workflow. */ + createdAt?: Date; + /** Name of the Workflow. The name is unique within the folder. */ + name: string; + /** Description of the Workflow. */ + description: string; + /** Workflow labels as `key:value` pairs. */ + labels: { [key: string]: string }; + /** Status of the Workflow. */ + status: Workflow_Status; + /** Options for logging from the Workflow. */ + logOptions?: LogOptions; + /** ID of the VPC network Workflow will be executed in, in order to access private resources. */ + networkId: string; + /** ID of the Service Account which will be used for resource access in Workflow execution. */ + serviceAccountId: string; +} + +export enum Workflow_Status { + STATUS_UNSPECIFIED = 0, + /** CREATING - Workflow is being created. */ + CREATING = 1, + /** ACTIVE - Workflow is ready for use. */ + ACTIVE = 2, + /** UPDATING - Workflow is being updated. */ + UPDATING = 3, + /** DELETING - Workflow is being deleted. */ + DELETING = 4, + /** ERROR - Workflow failed. The only allowed action is delete. */ + ERROR = 5, + UNRECOGNIZED = -1, +} + +export function workflow_StatusFromJSON(object: any): Workflow_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return Workflow_Status.STATUS_UNSPECIFIED; + case 1: + case "CREATING": + return Workflow_Status.CREATING; + case 2: + case "ACTIVE": + return Workflow_Status.ACTIVE; + case 3: + case "UPDATING": + return Workflow_Status.UPDATING; + case 4: + case "DELETING": + return Workflow_Status.DELETING; + case 5: + case "ERROR": + return Workflow_Status.ERROR; + case -1: + case "UNRECOGNIZED": + default: + return Workflow_Status.UNRECOGNIZED; + } +} + +export function workflow_StatusToJSON(object: Workflow_Status): string { + switch (object) { + case Workflow_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case Workflow_Status.CREATING: + return "CREATING"; + case Workflow_Status.ACTIVE: + return "ACTIVE"; + case Workflow_Status.UPDATING: + return "UPDATING"; + case Workflow_Status.DELETING: + return "DELETING"; + case Workflow_Status.ERROR: + return "ERROR"; + default: + return "UNKNOWN"; + } +} + +export interface Workflow_LabelsEntry { + $type: "yandex.cloud.serverless.workflows.v1.Workflow.LabelsEntry"; + key: string; + value: string; +} + +export interface WorkflowPreview { + $type: "yandex.cloud.serverless.workflows.v1.WorkflowPreview"; + /** ID of the Workflow. Generated at creation time. */ + id: string; + /** ID of the folder that the Workflow belongs to. */ + folderId: string; + /** Creation timestamp for the Workflow. */ + createdAt?: Date; + /** Name of the Workflow. The name is unique within the folder. */ + name: string; + /** Description of the Workflow. */ + description: string; + /** Workflow labels as `key:value` pairs. */ + labels: { [key: string]: string }; + /** Status of the Workflow. */ + status: Workflow_Status; + /** Options for logging from the Workflow. */ + logOptions?: LogOptions; + /** ID of the VPC network Workflow will be executed in, in order to access private resources. */ + networkId: string; + /** ID of the Service Account which will be used for resources access in Workflow execution. */ + serviceAccountId: string; +} + +export interface WorkflowPreview_LabelsEntry { + $type: "yandex.cloud.serverless.workflows.v1.WorkflowPreview.LabelsEntry"; + key: string; + value: string; +} + +export interface WorkflowSpecification { + $type: "yandex.cloud.serverless.workflows.v1.WorkflowSpecification"; + /** Workflow specification in YAML format. */ + specYaml: string | undefined; +} + +export interface LogOptions { + $type: "yandex.cloud.serverless.workflows.v1.LogOptions"; + /** Is logging from Workflow disabled. */ + disabled: boolean; + /** ID of the logging group which should be used for Workflows logs. */ + logGroupId: string | undefined; + /** ID of the folder which default logging group should be used for Workflows. */ + folderId: string | undefined; + /** + * Minimum logs level. + * + * See [LogLevel.Level] for details. + */ + minLevel: LogLevel_Level; +} + +const baseWorkflow: object = { + $type: "yandex.cloud.serverless.workflows.v1.Workflow", + id: "", + folderId: "", + name: "", + description: "", + status: 0, + networkId: "", + serviceAccountId: "", +}; + +export const Workflow = { + $type: "yandex.cloud.serverless.workflows.v1.Workflow" as const, + + encode( + message: Workflow, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.specification !== undefined) { + WorkflowSpecification.encode( + message.specification, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(34).fork() + ).ldelim(); + } + if (message.name !== "") { + writer.uint32(42).string(message.name); + } + if (message.description !== "") { + writer.uint32(50).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + Workflow_LabelsEntry.encode( + { + $type: "yandex.cloud.serverless.workflows.v1.Workflow.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(58).fork() + ).ldelim(); + }); + if (message.status !== 0) { + writer.uint32(64).int32(message.status); + } + if (message.logOptions !== undefined) { + LogOptions.encode(message.logOptions, writer.uint32(74).fork()).ldelim(); + } + if (message.networkId !== "") { + writer.uint32(82).string(message.networkId); + } + if (message.serviceAccountId !== "") { + writer.uint32(90).string(message.serviceAccountId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Workflow { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWorkflow } as Workflow; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.specification = WorkflowSpecification.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 5: + message.name = reader.string(); + break; + case 6: + message.description = reader.string(); + break; + case 7: + const entry7 = Workflow_LabelsEntry.decode(reader, reader.uint32()); + if (entry7.value !== undefined) { + message.labels[entry7.key] = entry7.value; + } + break; + case 8: + message.status = reader.int32() as any; + break; + case 9: + message.logOptions = LogOptions.decode(reader, reader.uint32()); + break; + case 10: + message.networkId = reader.string(); + break; + case 11: + message.serviceAccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Workflow { + const message = { ...baseWorkflow } as Workflow; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.specification = + object.specification !== undefined && object.specification !== null + ? WorkflowSpecification.fromJSON(object.specification) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.status = + object.status !== undefined && object.status !== null + ? workflow_StatusFromJSON(object.status) + : 0; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromJSON(object.logOptions) + : undefined; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + return message; + }, + + toJSON(message: Workflow): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.specification !== undefined && + (obj.specification = message.specification + ? WorkflowSpecification.toJSON(message.specification) + : undefined); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.status !== undefined && + (obj.status = workflow_StatusToJSON(message.status)); + message.logOptions !== undefined && + (obj.logOptions = message.logOptions + ? LogOptions.toJSON(message.logOptions) + : undefined); + message.networkId !== undefined && (obj.networkId = message.networkId); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + return obj; + }, + + fromPartial, I>>(object: I): Workflow { + const message = { ...baseWorkflow } as Workflow; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.specification = + object.specification !== undefined && object.specification !== null + ? WorkflowSpecification.fromPartial(object.specification) + : undefined; + message.createdAt = object.createdAt ?? undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.status = object.status ?? 0; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromPartial(object.logOptions) + : undefined; + message.networkId = object.networkId ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Workflow.$type, Workflow); + +const baseWorkflow_LabelsEntry: object = { + $type: "yandex.cloud.serverless.workflows.v1.Workflow.LabelsEntry", + key: "", + value: "", +}; + +export const Workflow_LabelsEntry = { + $type: "yandex.cloud.serverless.workflows.v1.Workflow.LabelsEntry" as const, + + encode( + message: Workflow_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Workflow_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWorkflow_LabelsEntry } as Workflow_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Workflow_LabelsEntry { + const message = { ...baseWorkflow_LabelsEntry } as Workflow_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Workflow_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Workflow_LabelsEntry { + const message = { ...baseWorkflow_LabelsEntry } as Workflow_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Workflow_LabelsEntry.$type, Workflow_LabelsEntry); + +const baseWorkflowPreview: object = { + $type: "yandex.cloud.serverless.workflows.v1.WorkflowPreview", + id: "", + folderId: "", + name: "", + description: "", + status: 0, + networkId: "", + serviceAccountId: "", +}; + +export const WorkflowPreview = { + $type: "yandex.cloud.serverless.workflows.v1.WorkflowPreview" as const, + + encode( + message: WorkflowPreview, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(26).fork() + ).ldelim(); + } + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + WorkflowPreview_LabelsEntry.encode( + { + $type: + "yandex.cloud.serverless.workflows.v1.WorkflowPreview.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + if (message.status !== 0) { + writer.uint32(56).int32(message.status); + } + if (message.logOptions !== undefined) { + LogOptions.encode(message.logOptions, writer.uint32(66).fork()).ldelim(); + } + if (message.networkId !== "") { + writer.uint32(74).string(message.networkId); + } + if (message.serviceAccountId !== "") { + writer.uint32(82).string(message.serviceAccountId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): WorkflowPreview { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWorkflowPreview } as WorkflowPreview; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 4: + message.name = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + const entry6 = WorkflowPreview_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + case 7: + message.status = reader.int32() as any; + break; + case 8: + message.logOptions = LogOptions.decode(reader, reader.uint32()); + break; + case 9: + message.networkId = reader.string(); + break; + case 10: + message.serviceAccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WorkflowPreview { + const message = { ...baseWorkflowPreview } as WorkflowPreview; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.status = + object.status !== undefined && object.status !== null + ? workflow_StatusFromJSON(object.status) + : 0; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromJSON(object.logOptions) + : undefined; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + return message; + }, + + toJSON(message: WorkflowPreview): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.status !== undefined && + (obj.status = workflow_StatusToJSON(message.status)); + message.logOptions !== undefined && + (obj.logOptions = message.logOptions + ? LogOptions.toJSON(message.logOptions) + : undefined); + message.networkId !== undefined && (obj.networkId = message.networkId); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + return obj; + }, + + fromPartial, I>>( + object: I + ): WorkflowPreview { + const message = { ...baseWorkflowPreview } as WorkflowPreview; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.status = object.status ?? 0; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromPartial(object.logOptions) + : undefined; + message.networkId = object.networkId ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(WorkflowPreview.$type, WorkflowPreview); + +const baseWorkflowPreview_LabelsEntry: object = { + $type: "yandex.cloud.serverless.workflows.v1.WorkflowPreview.LabelsEntry", + key: "", + value: "", +}; + +export const WorkflowPreview_LabelsEntry = { + $type: + "yandex.cloud.serverless.workflows.v1.WorkflowPreview.LabelsEntry" as const, + + encode( + message: WorkflowPreview_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): WorkflowPreview_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseWorkflowPreview_LabelsEntry, + } as WorkflowPreview_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WorkflowPreview_LabelsEntry { + const message = { + ...baseWorkflowPreview_LabelsEntry, + } as WorkflowPreview_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: WorkflowPreview_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): WorkflowPreview_LabelsEntry { + const message = { + ...baseWorkflowPreview_LabelsEntry, + } as WorkflowPreview_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + WorkflowPreview_LabelsEntry.$type, + WorkflowPreview_LabelsEntry +); + +const baseWorkflowSpecification: object = { + $type: "yandex.cloud.serverless.workflows.v1.WorkflowSpecification", +}; + +export const WorkflowSpecification = { + $type: "yandex.cloud.serverless.workflows.v1.WorkflowSpecification" as const, + + encode( + message: WorkflowSpecification, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.specYaml !== undefined) { + writer.uint32(10).string(message.specYaml); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): WorkflowSpecification { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWorkflowSpecification } as WorkflowSpecification; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.specYaml = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WorkflowSpecification { + const message = { ...baseWorkflowSpecification } as WorkflowSpecification; + message.specYaml = + object.specYaml !== undefined && object.specYaml !== null + ? String(object.specYaml) + : undefined; + return message; + }, + + toJSON(message: WorkflowSpecification): unknown { + const obj: any = {}; + message.specYaml !== undefined && (obj.specYaml = message.specYaml); + return obj; + }, + + fromPartial, I>>( + object: I + ): WorkflowSpecification { + const message = { ...baseWorkflowSpecification } as WorkflowSpecification; + message.specYaml = object.specYaml ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(WorkflowSpecification.$type, WorkflowSpecification); + +const baseLogOptions: object = { + $type: "yandex.cloud.serverless.workflows.v1.LogOptions", + disabled: false, + minLevel: 0, +}; + +export const LogOptions = { + $type: "yandex.cloud.serverless.workflows.v1.LogOptions" as const, + + encode( + message: LogOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.disabled === true) { + writer.uint32(8).bool(message.disabled); + } + if (message.logGroupId !== undefined) { + writer.uint32(18).string(message.logGroupId); + } + if (message.folderId !== undefined) { + writer.uint32(26).string(message.folderId); + } + if (message.minLevel !== 0) { + writer.uint32(32).int32(message.minLevel); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LogOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLogOptions } as LogOptions; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.disabled = reader.bool(); + break; + case 2: + message.logGroupId = reader.string(); + break; + case 3: + message.folderId = reader.string(); + break; + case 4: + message.minLevel = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LogOptions { + const message = { ...baseLogOptions } as LogOptions; + message.disabled = + object.disabled !== undefined && object.disabled !== null + ? Boolean(object.disabled) + : false; + message.logGroupId = + object.logGroupId !== undefined && object.logGroupId !== null + ? String(object.logGroupId) + : undefined; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : undefined; + message.minLevel = + object.minLevel !== undefined && object.minLevel !== null + ? logLevel_LevelFromJSON(object.minLevel) + : 0; + return message; + }, + + toJSON(message: LogOptions): unknown { + const obj: any = {}; + message.disabled !== undefined && (obj.disabled = message.disabled); + message.logGroupId !== undefined && (obj.logGroupId = message.logGroupId); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.minLevel !== undefined && + (obj.minLevel = logLevel_LevelToJSON(message.minLevel)); + return obj; + }, + + fromPartial, I>>( + object: I + ): LogOptions { + const message = { ...baseLogOptions } as LogOptions; + message.disabled = object.disabled ?? false; + message.logGroupId = object.logGroupId ?? undefined; + message.folderId = object.folderId ?? undefined; + message.minLevel = object.minLevel ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(LogOptions.$type, LogOptions); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/serverless/workflows/v1/workflow_service.ts b/src/generated/yandex/cloud/serverless/workflows/v1/workflow_service.ts new file mode 100644 index 00000000..cf20947d --- /dev/null +++ b/src/generated/yandex/cloud/serverless/workflows/v1/workflow_service.ts @@ -0,0 +1,1855 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + WorkflowSpecification, + LogOptions, + Workflow, + WorkflowPreview, +} from "../../../../../yandex/cloud/serverless/workflows/v1/workflow"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.serverless.workflows.v1"; + +export interface CreateWorkflowRequest { + $type: "yandex.cloud.serverless.workflows.v1.CreateWorkflowRequest"; + /** ID of the folder to create Workflow in. */ + folderId: string; + /** + * Name of Workflow. + * The name must be unique within the folder. + */ + name: string; + /** Description of Workflow. */ + description: string; + /** Workflow labels as `key:value` pairs. */ + labels: { [key: string]: string }; + /** Specification of Workflow */ + specification?: WorkflowSpecification; + /** Options for logging from Workflow. */ + logOptions?: LogOptions; + /** ID of the VPC network Workflow will be executed in, in order to access private resources. */ + networkId: string; + /** ID of the Service Account which will be used for resources access in Workflow execution. */ + serviceAccountId: string; +} + +export interface CreateWorkflowRequest_LabelsEntry { + $type: "yandex.cloud.serverless.workflows.v1.CreateWorkflowRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface CreateWorkflowMetadata { + $type: "yandex.cloud.serverless.workflows.v1.CreateWorkflowMetadata"; + /** ID of the Workflow. */ + workflowId: string; +} + +export interface UpdateWorkflowRequest { + $type: "yandex.cloud.serverless.workflows.v1.UpdateWorkflowRequest"; + /** ID of the Workflow. */ + workflowId: string; + /** Name of the Workflow. The name is unique within the folder. */ + name: string; + /** Description of the Workflow. */ + description: string; + /** Workflow labels as `key:value` pairs. */ + labels: { [key: string]: string }; + /** Specification of the Workflow. */ + specification?: WorkflowSpecification; + /** Options for logging from the Workflow. */ + logOptions?: LogOptions; + /** ID of the VPC network Workflow will be executed in, in order to access private resources. */ + networkId: string; + /** ID of the Service Account which will be used for resources access in Workflow execution. */ + serviceAccountId: string; + /** Field mask that specifies which fields of the Workflow should be updated. */ + updateMask?: FieldMask; +} + +export interface UpdateWorkflowRequest_LabelsEntry { + $type: "yandex.cloud.serverless.workflows.v1.UpdateWorkflowRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateWorkflowMetadata { + $type: "yandex.cloud.serverless.workflows.v1.UpdateWorkflowMetadata"; + /** ID of the Workflow. */ + workflowId: string; +} + +export interface GetWorkflowRequest { + $type: "yandex.cloud.serverless.workflows.v1.GetWorkflowRequest"; + /** ID of the Workflow. */ + workflowId: string; +} + +export interface GetWorkflowResponse { + $type: "yandex.cloud.serverless.workflows.v1.GetWorkflowResponse"; + /** Workflow properties. */ + workflow?: Workflow; +} + +export interface DeleteWorkflowRequest { + $type: "yandex.cloud.serverless.workflows.v1.DeleteWorkflowRequest"; + /** ID of the Workflow. */ + workflowId: string; +} + +export interface DeleteWorkflowMetadata { + $type: "yandex.cloud.serverless.workflows.v1.DeleteWorkflowMetadata"; + /** ID of the Workflow. */ + workflowId: string; +} + +export interface ListWorkflowsRequest { + $type: "yandex.cloud.serverless.workflows.v1.ListWorkflowsRequest"; + /** ID of the folder to list Workflows in. */ + folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than `pageSize`, the service returns a [ListWorkflowsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `pageToken` to the + * [ListWorkflowsResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters functions listed in the response. + * + * The expression must specify: + * 1. The field name. Currently filtering can only be applied to following fields: name, created_at. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z]([-a-z0-9]{0,61}[a-z0-9])?`. + * Example of a filter: `name=my-workflow`. + */ + filter: string; +} + +export interface ListWorkflowsResponse { + $type: "yandex.cloud.serverless.workflows.v1.ListWorkflowsResponse"; + /** List of Workflows. */ + workflows: WorkflowPreview[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListWorkflowsRequest.page_size], use `next_page_token` as the value + * for the [ListWorkflowsRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `next_page_token` to continue paging through the results. + */ + nextPageToken: string; +} + +export interface ListOperationsRequest { + $type: "yandex.cloud.serverless.workflows.v1.ListOperationsRequest"; + /** ID of the Workflow to list operations for. */ + workflowId: string; + /** + * The maximum number of results per page that should be returned. If the number of available + * results is larger than `pageSize`, the service returns a [ListOperationsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * + * Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `pageToken` to the + * [ListOperationsResponse.next_page_token] returned by a previous list request. + */ + pageToken: string; + /** + * A filter expression that filters resources listed in the response. + * + * The expression must specify: + * 1. The field name. Currently filtering can be applied to the [operation.Operation.done], [operation.Operation.created_by] field. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. + * Examples of a filter: `done=false`, `created_by='John.Doe'`. + */ + filter: string; +} + +export interface ListOperationsResponse { + $type: "yandex.cloud.serverless.workflows.v1.ListOperationsResponse"; + /** List of operations for the specified Workflow. */ + operations: Operation[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListOperationsRequest.page_size], use `next_page_token` as the value + * for the [ListOperationsRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `next_page_token` to continue paging through the results. + */ + nextPageToken: string; +} + +const baseCreateWorkflowRequest: object = { + $type: "yandex.cloud.serverless.workflows.v1.CreateWorkflowRequest", + folderId: "", + name: "", + description: "", + networkId: "", + serviceAccountId: "", +}; + +export const CreateWorkflowRequest = { + $type: "yandex.cloud.serverless.workflows.v1.CreateWorkflowRequest" as const, + + encode( + message: CreateWorkflowRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateWorkflowRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.serverless.workflows.v1.CreateWorkflowRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(34).fork() + ).ldelim(); + }); + if (message.specification !== undefined) { + WorkflowSpecification.encode( + message.specification, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.logOptions !== undefined) { + LogOptions.encode(message.logOptions, writer.uint32(50).fork()).ldelim(); + } + if (message.networkId !== "") { + writer.uint32(58).string(message.networkId); + } + if (message.serviceAccountId !== "") { + writer.uint32(66).string(message.serviceAccountId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateWorkflowRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateWorkflowRequest } as CreateWorkflowRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + const entry4 = CreateWorkflowRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry4.value !== undefined) { + message.labels[entry4.key] = entry4.value; + } + break; + case 5: + message.specification = WorkflowSpecification.decode( + reader, + reader.uint32() + ); + break; + case 6: + message.logOptions = LogOptions.decode(reader, reader.uint32()); + break; + case 7: + message.networkId = reader.string(); + break; + case 8: + message.serviceAccountId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateWorkflowRequest { + const message = { ...baseCreateWorkflowRequest } as CreateWorkflowRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.specification = + object.specification !== undefined && object.specification !== null + ? WorkflowSpecification.fromJSON(object.specification) + : undefined; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromJSON(object.logOptions) + : undefined; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + return message; + }, + + toJSON(message: CreateWorkflowRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.specification !== undefined && + (obj.specification = message.specification + ? WorkflowSpecification.toJSON(message.specification) + : undefined); + message.logOptions !== undefined && + (obj.logOptions = message.logOptions + ? LogOptions.toJSON(message.logOptions) + : undefined); + message.networkId !== undefined && (obj.networkId = message.networkId); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateWorkflowRequest { + const message = { ...baseCreateWorkflowRequest } as CreateWorkflowRequest; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.specification = + object.specification !== undefined && object.specification !== null + ? WorkflowSpecification.fromPartial(object.specification) + : undefined; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromPartial(object.logOptions) + : undefined; + message.networkId = object.networkId ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateWorkflowRequest.$type, CreateWorkflowRequest); + +const baseCreateWorkflowRequest_LabelsEntry: object = { + $type: + "yandex.cloud.serverless.workflows.v1.CreateWorkflowRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateWorkflowRequest_LabelsEntry = { + $type: + "yandex.cloud.serverless.workflows.v1.CreateWorkflowRequest.LabelsEntry" as const, + + encode( + message: CreateWorkflowRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateWorkflowRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateWorkflowRequest_LabelsEntry, + } as CreateWorkflowRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateWorkflowRequest_LabelsEntry { + const message = { + ...baseCreateWorkflowRequest_LabelsEntry, + } as CreateWorkflowRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateWorkflowRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateWorkflowRequest_LabelsEntry { + const message = { + ...baseCreateWorkflowRequest_LabelsEntry, + } as CreateWorkflowRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateWorkflowRequest_LabelsEntry.$type, + CreateWorkflowRequest_LabelsEntry +); + +const baseCreateWorkflowMetadata: object = { + $type: "yandex.cloud.serverless.workflows.v1.CreateWorkflowMetadata", + workflowId: "", +}; + +export const CreateWorkflowMetadata = { + $type: "yandex.cloud.serverless.workflows.v1.CreateWorkflowMetadata" as const, + + encode( + message: CreateWorkflowMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.workflowId !== "") { + writer.uint32(10).string(message.workflowId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateWorkflowMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateWorkflowMetadata } as CreateWorkflowMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workflowId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateWorkflowMetadata { + const message = { ...baseCreateWorkflowMetadata } as CreateWorkflowMetadata; + message.workflowId = + object.workflowId !== undefined && object.workflowId !== null + ? String(object.workflowId) + : ""; + return message; + }, + + toJSON(message: CreateWorkflowMetadata): unknown { + const obj: any = {}; + message.workflowId !== undefined && (obj.workflowId = message.workflowId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateWorkflowMetadata { + const message = { ...baseCreateWorkflowMetadata } as CreateWorkflowMetadata; + message.workflowId = object.workflowId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateWorkflowMetadata.$type, CreateWorkflowMetadata); + +const baseUpdateWorkflowRequest: object = { + $type: "yandex.cloud.serverless.workflows.v1.UpdateWorkflowRequest", + workflowId: "", + name: "", + description: "", + networkId: "", + serviceAccountId: "", +}; + +export const UpdateWorkflowRequest = { + $type: "yandex.cloud.serverless.workflows.v1.UpdateWorkflowRequest" as const, + + encode( + message: UpdateWorkflowRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.workflowId !== "") { + writer.uint32(10).string(message.workflowId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateWorkflowRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.serverless.workflows.v1.UpdateWorkflowRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(34).fork() + ).ldelim(); + }); + if (message.specification !== undefined) { + WorkflowSpecification.encode( + message.specification, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.logOptions !== undefined) { + LogOptions.encode(message.logOptions, writer.uint32(50).fork()).ldelim(); + } + if (message.networkId !== "") { + writer.uint32(58).string(message.networkId); + } + if (message.serviceAccountId !== "") { + writer.uint32(66).string(message.serviceAccountId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(74).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateWorkflowRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateWorkflowRequest } as UpdateWorkflowRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workflowId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + const entry4 = UpdateWorkflowRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry4.value !== undefined) { + message.labels[entry4.key] = entry4.value; + } + break; + case 5: + message.specification = WorkflowSpecification.decode( + reader, + reader.uint32() + ); + break; + case 6: + message.logOptions = LogOptions.decode(reader, reader.uint32()); + break; + case 7: + message.networkId = reader.string(); + break; + case 8: + message.serviceAccountId = reader.string(); + break; + case 9: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateWorkflowRequest { + const message = { ...baseUpdateWorkflowRequest } as UpdateWorkflowRequest; + message.workflowId = + object.workflowId !== undefined && object.workflowId !== null + ? String(object.workflowId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.specification = + object.specification !== undefined && object.specification !== null + ? WorkflowSpecification.fromJSON(object.specification) + : undefined; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromJSON(object.logOptions) + : undefined; + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; + message.serviceAccountId = + object.serviceAccountId !== undefined && object.serviceAccountId !== null + ? String(object.serviceAccountId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + return message; + }, + + toJSON(message: UpdateWorkflowRequest): unknown { + const obj: any = {}; + message.workflowId !== undefined && (obj.workflowId = message.workflowId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.specification !== undefined && + (obj.specification = message.specification + ? WorkflowSpecification.toJSON(message.specification) + : undefined); + message.logOptions !== undefined && + (obj.logOptions = message.logOptions + ? LogOptions.toJSON(message.logOptions) + : undefined); + message.networkId !== undefined && (obj.networkId = message.networkId); + message.serviceAccountId !== undefined && + (obj.serviceAccountId = message.serviceAccountId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateWorkflowRequest { + const message = { ...baseUpdateWorkflowRequest } as UpdateWorkflowRequest; + message.workflowId = object.workflowId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.specification = + object.specification !== undefined && object.specification !== null + ? WorkflowSpecification.fromPartial(object.specification) + : undefined; + message.logOptions = + object.logOptions !== undefined && object.logOptions !== null + ? LogOptions.fromPartial(object.logOptions) + : undefined; + message.networkId = object.networkId ?? ""; + message.serviceAccountId = object.serviceAccountId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UpdateWorkflowRequest.$type, UpdateWorkflowRequest); + +const baseUpdateWorkflowRequest_LabelsEntry: object = { + $type: + "yandex.cloud.serverless.workflows.v1.UpdateWorkflowRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateWorkflowRequest_LabelsEntry = { + $type: + "yandex.cloud.serverless.workflows.v1.UpdateWorkflowRequest.LabelsEntry" as const, + + encode( + message: UpdateWorkflowRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateWorkflowRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateWorkflowRequest_LabelsEntry, + } as UpdateWorkflowRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateWorkflowRequest_LabelsEntry { + const message = { + ...baseUpdateWorkflowRequest_LabelsEntry, + } as UpdateWorkflowRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateWorkflowRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateWorkflowRequest_LabelsEntry { + const message = { + ...baseUpdateWorkflowRequest_LabelsEntry, + } as UpdateWorkflowRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateWorkflowRequest_LabelsEntry.$type, + UpdateWorkflowRequest_LabelsEntry +); + +const baseUpdateWorkflowMetadata: object = { + $type: "yandex.cloud.serverless.workflows.v1.UpdateWorkflowMetadata", + workflowId: "", +}; + +export const UpdateWorkflowMetadata = { + $type: "yandex.cloud.serverless.workflows.v1.UpdateWorkflowMetadata" as const, + + encode( + message: UpdateWorkflowMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.workflowId !== "") { + writer.uint32(10).string(message.workflowId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateWorkflowMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateWorkflowMetadata } as UpdateWorkflowMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workflowId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateWorkflowMetadata { + const message = { ...baseUpdateWorkflowMetadata } as UpdateWorkflowMetadata; + message.workflowId = + object.workflowId !== undefined && object.workflowId !== null + ? String(object.workflowId) + : ""; + return message; + }, + + toJSON(message: UpdateWorkflowMetadata): unknown { + const obj: any = {}; + message.workflowId !== undefined && (obj.workflowId = message.workflowId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateWorkflowMetadata { + const message = { ...baseUpdateWorkflowMetadata } as UpdateWorkflowMetadata; + message.workflowId = object.workflowId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateWorkflowMetadata.$type, UpdateWorkflowMetadata); + +const baseGetWorkflowRequest: object = { + $type: "yandex.cloud.serverless.workflows.v1.GetWorkflowRequest", + workflowId: "", +}; + +export const GetWorkflowRequest = { + $type: "yandex.cloud.serverless.workflows.v1.GetWorkflowRequest" as const, + + encode( + message: GetWorkflowRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.workflowId !== "") { + writer.uint32(10).string(message.workflowId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetWorkflowRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetWorkflowRequest } as GetWorkflowRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workflowId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetWorkflowRequest { + const message = { ...baseGetWorkflowRequest } as GetWorkflowRequest; + message.workflowId = + object.workflowId !== undefined && object.workflowId !== null + ? String(object.workflowId) + : ""; + return message; + }, + + toJSON(message: GetWorkflowRequest): unknown { + const obj: any = {}; + message.workflowId !== undefined && (obj.workflowId = message.workflowId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetWorkflowRequest { + const message = { ...baseGetWorkflowRequest } as GetWorkflowRequest; + message.workflowId = object.workflowId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetWorkflowRequest.$type, GetWorkflowRequest); + +const baseGetWorkflowResponse: object = { + $type: "yandex.cloud.serverless.workflows.v1.GetWorkflowResponse", +}; + +export const GetWorkflowResponse = { + $type: "yandex.cloud.serverless.workflows.v1.GetWorkflowResponse" as const, + + encode( + message: GetWorkflowResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.workflow !== undefined) { + Workflow.encode(message.workflow, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetWorkflowResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetWorkflowResponse } as GetWorkflowResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workflow = Workflow.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetWorkflowResponse { + const message = { ...baseGetWorkflowResponse } as GetWorkflowResponse; + message.workflow = + object.workflow !== undefined && object.workflow !== null + ? Workflow.fromJSON(object.workflow) + : undefined; + return message; + }, + + toJSON(message: GetWorkflowResponse): unknown { + const obj: any = {}; + message.workflow !== undefined && + (obj.workflow = message.workflow + ? Workflow.toJSON(message.workflow) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetWorkflowResponse { + const message = { ...baseGetWorkflowResponse } as GetWorkflowResponse; + message.workflow = + object.workflow !== undefined && object.workflow !== null + ? Workflow.fromPartial(object.workflow) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GetWorkflowResponse.$type, GetWorkflowResponse); + +const baseDeleteWorkflowRequest: object = { + $type: "yandex.cloud.serverless.workflows.v1.DeleteWorkflowRequest", + workflowId: "", +}; + +export const DeleteWorkflowRequest = { + $type: "yandex.cloud.serverless.workflows.v1.DeleteWorkflowRequest" as const, + + encode( + message: DeleteWorkflowRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.workflowId !== "") { + writer.uint32(10).string(message.workflowId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteWorkflowRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteWorkflowRequest } as DeleteWorkflowRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workflowId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteWorkflowRequest { + const message = { ...baseDeleteWorkflowRequest } as DeleteWorkflowRequest; + message.workflowId = + object.workflowId !== undefined && object.workflowId !== null + ? String(object.workflowId) + : ""; + return message; + }, + + toJSON(message: DeleteWorkflowRequest): unknown { + const obj: any = {}; + message.workflowId !== undefined && (obj.workflowId = message.workflowId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteWorkflowRequest { + const message = { ...baseDeleteWorkflowRequest } as DeleteWorkflowRequest; + message.workflowId = object.workflowId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteWorkflowRequest.$type, DeleteWorkflowRequest); + +const baseDeleteWorkflowMetadata: object = { + $type: "yandex.cloud.serverless.workflows.v1.DeleteWorkflowMetadata", + workflowId: "", +}; + +export const DeleteWorkflowMetadata = { + $type: "yandex.cloud.serverless.workflows.v1.DeleteWorkflowMetadata" as const, + + encode( + message: DeleteWorkflowMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.workflowId !== "") { + writer.uint32(10).string(message.workflowId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteWorkflowMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteWorkflowMetadata } as DeleteWorkflowMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workflowId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteWorkflowMetadata { + const message = { ...baseDeleteWorkflowMetadata } as DeleteWorkflowMetadata; + message.workflowId = + object.workflowId !== undefined && object.workflowId !== null + ? String(object.workflowId) + : ""; + return message; + }, + + toJSON(message: DeleteWorkflowMetadata): unknown { + const obj: any = {}; + message.workflowId !== undefined && (obj.workflowId = message.workflowId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteWorkflowMetadata { + const message = { ...baseDeleteWorkflowMetadata } as DeleteWorkflowMetadata; + message.workflowId = object.workflowId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteWorkflowMetadata.$type, DeleteWorkflowMetadata); + +const baseListWorkflowsRequest: object = { + $type: "yandex.cloud.serverless.workflows.v1.ListWorkflowsRequest", + folderId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListWorkflowsRequest = { + $type: "yandex.cloud.serverless.workflows.v1.ListWorkflowsRequest" as const, + + encode( + message: ListWorkflowsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListWorkflowsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListWorkflowsRequest } as ListWorkflowsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListWorkflowsRequest { + const message = { ...baseListWorkflowsRequest } as ListWorkflowsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListWorkflowsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListWorkflowsRequest { + const message = { ...baseListWorkflowsRequest } as ListWorkflowsRequest; + message.folderId = object.folderId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListWorkflowsRequest.$type, ListWorkflowsRequest); + +const baseListWorkflowsResponse: object = { + $type: "yandex.cloud.serverless.workflows.v1.ListWorkflowsResponse", + nextPageToken: "", +}; + +export const ListWorkflowsResponse = { + $type: "yandex.cloud.serverless.workflows.v1.ListWorkflowsResponse" as const, + + encode( + message: ListWorkflowsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.workflows) { + WorkflowPreview.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListWorkflowsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListWorkflowsResponse } as ListWorkflowsResponse; + message.workflows = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workflows.push( + WorkflowPreview.decode(reader, reader.uint32()) + ); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListWorkflowsResponse { + const message = { ...baseListWorkflowsResponse } as ListWorkflowsResponse; + message.workflows = (object.workflows ?? []).map((e: any) => + WorkflowPreview.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListWorkflowsResponse): unknown { + const obj: any = {}; + if (message.workflows) { + obj.workflows = message.workflows.map((e) => + e ? WorkflowPreview.toJSON(e) : undefined + ); + } else { + obj.workflows = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListWorkflowsResponse { + const message = { ...baseListWorkflowsResponse } as ListWorkflowsResponse; + message.workflows = + object.workflows?.map((e) => WorkflowPreview.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListWorkflowsResponse.$type, ListWorkflowsResponse); + +const baseListOperationsRequest: object = { + $type: "yandex.cloud.serverless.workflows.v1.ListOperationsRequest", + workflowId: "", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListOperationsRequest = { + $type: "yandex.cloud.serverless.workflows.v1.ListOperationsRequest" as const, + + encode( + message: ListOperationsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.workflowId !== "") { + writer.uint32(10).string(message.workflowId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(34).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListOperationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListOperationsRequest } as ListOperationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workflowId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListOperationsRequest { + const message = { ...baseListOperationsRequest } as ListOperationsRequest; + message.workflowId = + object.workflowId !== undefined && object.workflowId !== null + ? String(object.workflowId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListOperationsRequest): unknown { + const obj: any = {}; + message.workflowId !== undefined && (obj.workflowId = message.workflowId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListOperationsRequest { + const message = { ...baseListOperationsRequest } as ListOperationsRequest; + message.workflowId = object.workflowId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListOperationsRequest.$type, ListOperationsRequest); + +const baseListOperationsResponse: object = { + $type: "yandex.cloud.serverless.workflows.v1.ListOperationsResponse", + nextPageToken: "", +}; + +export const ListOperationsResponse = { + $type: "yandex.cloud.serverless.workflows.v1.ListOperationsResponse" as const, + + encode( + message: ListOperationsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.operations) { + Operation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListOperationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListOperationsResponse } as ListOperationsResponse; + message.operations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operations.push(Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListOperationsResponse { + const message = { ...baseListOperationsResponse } as ListOperationsResponse; + message.operations = (object.operations ?? []).map((e: any) => + Operation.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListOperationsResponse): unknown { + const obj: any = {}; + if (message.operations) { + obj.operations = message.operations.map((e) => + e ? Operation.toJSON(e) : undefined + ); + } else { + obj.operations = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListOperationsResponse { + const message = { ...baseListOperationsResponse } as ListOperationsResponse; + message.operations = + object.operations?.map((e) => Operation.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListOperationsResponse.$type, ListOperationsResponse); + +/** Set of methods for managing Workflows. */ +export const WorkflowServiceService = { + /** Creates Workflow in specified folder. */ + create: { + path: "/yandex.cloud.serverless.workflows.v1.WorkflowService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateWorkflowRequest) => + Buffer.from(CreateWorkflowRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateWorkflowRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates specified Workflow. */ + update: { + path: "/yandex.cloud.serverless.workflows.v1.WorkflowService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateWorkflowRequest) => + Buffer.from(UpdateWorkflowRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateWorkflowRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Retrieves specified Workflow. */ + get: { + path: "/yandex.cloud.serverless.workflows.v1.WorkflowService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetWorkflowRequest) => + Buffer.from(GetWorkflowRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetWorkflowRequest.decode(value), + responseSerialize: (value: GetWorkflowResponse) => + Buffer.from(GetWorkflowResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => GetWorkflowResponse.decode(value), + }, + /** Deletes specified Workflow. */ + delete: { + path: "/yandex.cloud.serverless.workflows.v1.WorkflowService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteWorkflowRequest) => + Buffer.from(DeleteWorkflowRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteWorkflowRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Retrieves list of Workflows in specified folder. */ + list: { + path: "/yandex.cloud.serverless.workflows.v1.WorkflowService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListWorkflowsRequest) => + Buffer.from(ListWorkflowsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListWorkflowsRequest.decode(value), + responseSerialize: (value: ListWorkflowsResponse) => + Buffer.from(ListWorkflowsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListWorkflowsResponse.decode(value), + }, + /** Lists operations for specified Workflow. */ + listOperations: { + path: "/yandex.cloud.serverless.workflows.v1.WorkflowService/ListOperations", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListOperationsRequest) => + Buffer.from(ListOperationsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListOperationsRequest.decode(value), + responseSerialize: (value: ListOperationsResponse) => + Buffer.from(ListOperationsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListOperationsResponse.decode(value), + }, +} as const; + +export interface WorkflowServiceServer extends UntypedServiceImplementation { + /** Creates Workflow in specified folder. */ + create: handleUnaryCall; + /** Updates specified Workflow. */ + update: handleUnaryCall; + /** Retrieves specified Workflow. */ + get: handleUnaryCall; + /** Deletes specified Workflow. */ + delete: handleUnaryCall; + /** Retrieves list of Workflows in specified folder. */ + list: handleUnaryCall; + /** Lists operations for specified Workflow. */ + listOperations: handleUnaryCall< + ListOperationsRequest, + ListOperationsResponse + >; +} + +export interface WorkflowServiceClient extends Client { + /** Creates Workflow in specified folder. */ + create( + request: CreateWorkflowRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateWorkflowRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateWorkflowRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates specified Workflow. */ + update( + request: UpdateWorkflowRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateWorkflowRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateWorkflowRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Retrieves specified Workflow. */ + get( + request: GetWorkflowRequest, + callback: ( + error: ServiceError | null, + response: GetWorkflowResponse + ) => void + ): ClientUnaryCall; + get( + request: GetWorkflowRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: GetWorkflowResponse + ) => void + ): ClientUnaryCall; + get( + request: GetWorkflowRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: GetWorkflowResponse + ) => void + ): ClientUnaryCall; + /** Deletes specified Workflow. */ + delete( + request: DeleteWorkflowRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteWorkflowRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteWorkflowRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Retrieves list of Workflows in specified folder. */ + list( + request: ListWorkflowsRequest, + callback: ( + error: ServiceError | null, + response: ListWorkflowsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListWorkflowsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListWorkflowsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListWorkflowsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListWorkflowsResponse + ) => void + ): ClientUnaryCall; + /** Lists operations for specified Workflow. */ + listOperations( + request: ListOperationsRequest, + callback: ( + error: ServiceError | null, + response: ListOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListOperationsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListOperationsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListOperationsResponse + ) => void + ): ClientUnaryCall; +} + +export const WorkflowServiceClient = makeGenericClientConstructor( + WorkflowServiceService, + "yandex.cloud.serverless.workflows.v1.WorkflowService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): WorkflowServiceClient; + service: typeof WorkflowServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/service_clients.ts b/src/generated/yandex/cloud/service_clients.ts index 9df95ca0..97124705 100644 --- a/src/generated/yandex/cloud/service_clients.ts +++ b/src/generated/yandex/cloud/service_clients.ts @@ -1,186 +1,189 @@ import * as cloudApi from '.' -export const TextRecognitionServiceClient = cloudApi.ai.ocr_service.TextRecognitionServiceClient; -export const SttServiceClient = cloudApi.ai.stt_service.SttServiceClient; -export const TranslationServiceClient = cloudApi.ai.translate_translation_service.TranslationServiceClient; -export const SynthesizerClient = cloudApi.ai.tts_service.SynthesizerClient; -export const VisionServiceClient = cloudApi.ai.vision_service.VisionServiceClient; -export const ImageClassifierServiceClient = cloudApi.ai.vision_image_classifier_service.ImageClassifierServiceClient; -export const BackendGroupServiceClient = cloudApi.apploadbalancer.backend_group_service.BackendGroupServiceClient; -export const HttpRouterServiceClient = cloudApi.apploadbalancer.http_router_service.HttpRouterServiceClient; -export const LoadBalancerServiceClient = cloudApi.apploadbalancer.load_balancer_service.LoadBalancerServiceClient; -export const AlbTargetGroupServiceClient = cloudApi.apploadbalancer.target_group_service.TargetGroupServiceClient; -export const VirtualHostServiceClient = cloudApi.apploadbalancer.virtual_host_service.VirtualHostServiceClient; -export const BackupBackupServiceClient = cloudApi.backup.backup_service.BackupServiceClient; -export const BackupPolicyServiceClient = cloudApi.backup.policy_service.PolicyServiceClient; -export const BackupProviderServiceClient = cloudApi.backup.provider_service.ProviderServiceClient; -export const BackupResourceServiceClient = cloudApi.backup.resource_service.ResourceServiceClient; -export const BillingAccountServiceClient = cloudApi.billing.billing_account_service.BillingAccountServiceClient; -export const BudgetServiceClient = cloudApi.billing.budget_service.BudgetServiceClient; -export const CustomerServiceClient = cloudApi.billing.customer_service.CustomerServiceClient; -export const ServiceServiceClient = cloudApi.billing.service_service.ServiceServiceClient; -export const SkuServiceClient = cloudApi.billing.sku_service.SkuServiceClient; -export const CDNCacheServiceClient = cloudApi.cdn.cache_service.CacheServiceClient; -export const CDNOriginGroupServiceClient = cloudApi.cdn.origin_group_service.OriginGroupServiceClient; -export const CDNOriginServiceClient = cloudApi.cdn.origin_service.OriginServiceClient; -export const CDNProviderServiceClient = cloudApi.cdn.provider_service.ProviderServiceClient; -export const CDNRawLogsServiceClient = cloudApi.cdn.raw_logs_service.RawLogsServiceClient; -export const CDNResourceServiceClient = cloudApi.cdn.resource_service.ResourceServiceClient; -export const CertificateContentServiceClient = cloudApi.certificatemanager.certificate_content_service.CertificateContentServiceClient; -export const CertificateServiceClient = cloudApi.certificatemanager.certificate_service.CertificateServiceClient; -export const DiskPlacementGroupServiceClient = cloudApi.compute.disk_placement_group_service.DiskPlacementGroupServiceClient; -export const DiskServiceClient = cloudApi.compute.disk_service.DiskServiceClient; -export const DiskTypeServiceClient = cloudApi.compute.disk_type_service.DiskTypeServiceClient; -export const FilesystemServiceClient = cloudApi.compute.filesystem_service.FilesystemServiceClient; -export const GpuClusterServiceClient = cloudApi.compute.gpu_cluster_service.GpuClusterServiceClient; -export const HostGroupServiceClient = cloudApi.compute.host_group_service.HostGroupServiceClient; -export const HostTypeServiceClient = cloudApi.compute.host_type_service.HostTypeServiceClient; -export const ComputeImageServiceClient = cloudApi.compute.image_service.ImageServiceClient; -export const InstanceServiceClient = cloudApi.compute.instance_service.InstanceServiceClient; -export const PlacementGroupServiceClient = cloudApi.compute.placement_group_service.PlacementGroupServiceClient; -export const SnapshotScheduleServiceClient = cloudApi.compute.snapshot_schedule_service.SnapshotScheduleServiceClient; -export const SnapshotServiceClient = cloudApi.compute.snapshot_service.SnapshotServiceClient; -export const ZoneServiceClient = cloudApi.compute.zone_service.ZoneServiceClient; -export const InstanceGroupServiceClient = cloudApi.compute.instance_group_service.InstanceGroupServiceClient; -export const CrImageServiceClient = cloudApi.containerregistry.image_service.ImageServiceClient; -export const LifecyclePolicyServiceClient = cloudApi.containerregistry.lifecycle_policy_service.LifecyclePolicyServiceClient; -export const RegistryServiceClient = cloudApi.containerregistry.registry_service.RegistryServiceClient; -export const RepositoryServiceClient = cloudApi.containerregistry.repository_service.RepositoryServiceClient; -export const ScanPolicyServiceClient = cloudApi.containerregistry.scan_policy_service.ScanPolicyServiceClient; -export const ScannerServiceClient = cloudApi.containerregistry.scanner_service.ScannerServiceClient; -export const DataProcClusterServiceClient = cloudApi.dataproc.cluster_service.ClusterServiceClient; -export const JobServiceClient = cloudApi.dataproc.job_service.JobServiceClient; -export const ResourcePresetServiceClient = cloudApi.dataproc.resource_preset_service.ResourcePresetServiceClient; -export const SubclusterServiceClient = cloudApi.dataproc.subcluster_service.SubclusterServiceClient; -export const ManagerJobServiceClient = cloudApi.dataproc.manager_job_service.JobServiceClient; -export const DataprocManagerServiceClient = cloudApi.dataproc.manager_service.DataprocManagerServiceClient; -export const AppTokenServiceClient = cloudApi.datasphere.app_token_service.AppTokenServiceClient; -export const FolderBudgetServiceClient = cloudApi.datasphere.folder_budget_service.FolderBudgetServiceClient; -export const NodeServiceClient = cloudApi.datasphere.node_service.NodeServiceClient; -export const ProjectDataServiceClient = cloudApi.datasphere.project_data_service.ProjectDataServiceClient; -export const ProjectServiceClient = cloudApi.datasphere.project_service.ProjectServiceClient; -export const CommunityServiceClient = cloudApi.datasphere.community_service.CommunityServiceClient; -export const EndpointServiceClient = cloudApi.datatransfer.endpoint_service.EndpointServiceClient; -export const TransferServiceClient = cloudApi.datatransfer.transfer_service.TransferServiceClient; -export const DnsZoneServiceClient = cloudApi.dns.dns_zone_service.DnsZoneServiceClient; -export const ApiEndpointServiceClient = cloudApi.endpoint.api_endpoint_service.ApiEndpointServiceClient; -export const ApiKeyServiceClient = cloudApi.iam.api_key_service.ApiKeyServiceClient; -export const IamTokenServiceClient = cloudApi.iam.iam_token_service.IamTokenServiceClient; -export const KeyServiceClient = cloudApi.iam.key_service.KeyServiceClient; -export const RoleServiceClient = cloudApi.iam.role_service.RoleServiceClient; -export const ServiceAccountServiceClient = cloudApi.iam.service_account_service.ServiceAccountServiceClient; -export const UserAccountServiceClient = cloudApi.iam.user_account_service.UserAccountServiceClient; -export const YandexPassportUserAccountServiceClient = cloudApi.iam.yandex_passport_user_account_service.YandexPassportUserAccountServiceClient; -export const AccessKeyServiceClient = cloudApi.iam.access_key_service.AccessKeyServiceClient; -export const BrokerDataServiceClient = cloudApi.iot.broker_broker_data_service.BrokerDataServiceClient; -export const BrokerServiceClient = cloudApi.iot.broker_service.BrokerServiceClient; -export const DeviceDataServiceClient = cloudApi.iot.devices_device_data_service.DeviceDataServiceClient; -export const DeviceServiceClient = cloudApi.iot.devices_device_service.DeviceServiceClient; -export const RegistryDataServiceClient = cloudApi.iot.devices_registry_data_service.RegistryDataServiceClient; -export const IotRegistryServiceClient = cloudApi.iot.devices_registry_service.RegistryServiceClient; -export const K8sClusterServiceClient = cloudApi.k8s.cluster_service.ClusterServiceClient; -export const NodeGroupServiceClient = cloudApi.k8s.node_group_service.NodeGroupServiceClient; -export const VersionServiceClient = cloudApi.k8s.version_service.VersionServiceClient; -export const SymmetricCryptoServiceClient = cloudApi.kms.symmetric_crypto_service.SymmetricCryptoServiceClient; -export const SymmetricKeyServiceClient = cloudApi.kms.symmetric_key_service.SymmetricKeyServiceClient; -export const AsymmetricEncryptionCryptoServiceClient = cloudApi.kms.asymmetric_encryption_crypto_service.AsymmetricEncryptionCryptoServiceClient; -export const AsymmetricEncryptionKeyServiceClient = cloudApi.kms.asymmetric_encryption_key_service.AsymmetricEncryptionKeyServiceClient; -export const AsymmetricSignatureCryptoServiceClient = cloudApi.kms.asymmetric_signature_crypto_service.AsymmetricSignatureCryptoServiceClient; -export const AsymmetricSignatureKeyServiceClient = cloudApi.kms.asymmetric_signature_key_service.AsymmetricSignatureKeyServiceClient; -export const NetworkLoadBalancerServiceClient = cloudApi.loadbalancer.network_load_balancer_service.NetworkLoadBalancerServiceClient; -export const TargetGroupServiceClient = cloudApi.loadbalancer.target_group_service.TargetGroupServiceClient; -export const LoadTestingAgentRegistrationServiceClient = cloudApi.loadtesting.agent_agent_registration_service.AgentRegistrationServiceClient; -export const LoadTestingAgentServiceClient = cloudApi.loadtesting.agent_service.AgentServiceClient; -export const LoadTestingJobServiceClient = cloudApi.loadtesting.agent_job_service.JobServiceClient; -export const LoadTestingMonitoringServiceClient = cloudApi.loadtesting.agent_monitoring_service.MonitoringServiceClient; -export const LoadTestingTestServiceClient = cloudApi.loadtesting.agent_test_service.TestServiceClient; -export const LoadTestingTrailServiceClient = cloudApi.loadtesting.agent_trail_service.TrailServiceClient; -export const LoadTestingApiAgentServiceClient = cloudApi.loadtesting.api_agent_service.AgentServiceClient; -export const PayloadServiceClient = cloudApi.lockbox.payload_service.PayloadServiceClient; -export const SecretServiceClient = cloudApi.lockbox.secret_service.SecretServiceClient; -export const ExportServiceClient = cloudApi.logging.export_service.ExportServiceClient; -export const LogGroupServiceClient = cloudApi.logging.log_group_service.LogGroupServiceClient; -export const LogIngestionServiceClient = cloudApi.logging.log_ingestion_service.LogIngestionServiceClient; -export const LogReadingServiceClient = cloudApi.logging.log_reading_service.LogReadingServiceClient; -export const SinkServiceClient = cloudApi.logging.sink_service.SinkServiceClient; -export const MarketplaceInstanceServiceClient = cloudApi.marketplace.licensemanager_instance_service.InstanceServiceClient; -export const MarketplaceLockServiceClient = cloudApi.marketplace.licensemanager_lock_service.LockServiceClient; -export const MarketplaceMeteringImageProductUsageServiceClient = cloudApi.marketplace.metering_image_product_usage_service.ImageProductUsageServiceClient; -export const MarketplaceImageProductUsageServiceClient = cloudApi.marketplace.image_product_usage_service.ImageProductUsageServiceClient; -export const ClickHouseBackupServiceClient = cloudApi.mdb.clickhouse_backup_service.BackupServiceClient; -export const ClickHouseClusterServiceClient = cloudApi.mdb.clickhouse_cluster_service.ClusterServiceClient; -export const DatabaseServiceClient = cloudApi.mdb.clickhouse_database_service.DatabaseServiceClient; -export const FormatSchemaServiceClient = cloudApi.mdb.clickhouse_format_schema_service.FormatSchemaServiceClient; -export const MlModelServiceClient = cloudApi.mdb.clickhouse_ml_model_service.MlModelServiceClient; -export const ClickHouseResourcePresetServiceClient = cloudApi.mdb.clickhouse_resource_preset_service.ResourcePresetServiceClient; -export const ClickHouseUserServiceClient = cloudApi.mdb.clickhouse_user_service.UserServiceClient; -export const VersionsServiceClient = cloudApi.mdb.clickhouse_versions_service.VersionsServiceClient; -export const AuthServiceClient = cloudApi.mdb.elasticsearch_auth_service.AuthServiceClient; -export const ElasticBackupServiceClient = cloudApi.mdb.elasticsearch_backup_service.BackupServiceClient; -export const ElasticClusterServiceClient = cloudApi.mdb.elasticsearch_cluster_service.ClusterServiceClient; -export const ElasticExtensionServiceClient = cloudApi.mdb.elasticsearch_extension_service.ExtensionServiceClient; -export const ElasticResourcePresetServiceClient = cloudApi.mdb.elasticsearch_resource_preset_service.ResourcePresetServiceClient; -export const ElasticUserServiceClient = cloudApi.mdb.elasticsearch_user_service.UserServiceClient; -export const GreenplumBackupServiceClient = cloudApi.mdb.greenplum_backup_service.BackupServiceClient; -export const GreenplumClusterServiceClient = cloudApi.mdb.greenplum_cluster_service.ClusterServiceClient; -export const GreenplumResourcePresetServiceClient = cloudApi.mdb.greenplum_resource_preset_service.ResourcePresetServiceClient; -export const KafkaClusterServiceClient = cloudApi.mdb.kafka_cluster_service.ClusterServiceClient; -export const ConnectorServiceClient = cloudApi.mdb.kafka_connector_service.ConnectorServiceClient; -export const KafkaResourcePresetServiceClient = cloudApi.mdb.kafka_resource_preset_service.ResourcePresetServiceClient; -export const TopicServiceClient = cloudApi.mdb.kafka_topic_service.TopicServiceClient; -export const KafkaUserServiceClient = cloudApi.mdb.kafka_user_service.UserServiceClient; -export const MongoBackupServiceClient = cloudApi.mdb.mongodb_backup_service.BackupServiceClient; -export const MongoClusterServiceClient = cloudApi.mdb.mongodb_cluster_service.ClusterServiceClient; -export const MongoDatabaseServiceClient = cloudApi.mdb.mongodb_database_service.DatabaseServiceClient; -export const MongoResourcePresetServiceClient = cloudApi.mdb.mongodb_resource_preset_service.ResourcePresetServiceClient; -export const MongoUserServiceClient = cloudApi.mdb.mongodb_user_service.UserServiceClient; -export const MysqlBackupServiceClient = cloudApi.mdb.mysql_backup_service.BackupServiceClient; -export const MysqlClusterServiceClient = cloudApi.mdb.mysql_cluster_service.ClusterServiceClient; -export const MysqlDatabaseServiceClient = cloudApi.mdb.mysql_database_service.DatabaseServiceClient; -export const MysqlResourcePresetServiceClient = cloudApi.mdb.mysql_resource_preset_service.ResourcePresetServiceClient; -export const MysqlUserServiceClient = cloudApi.mdb.mysql_user_service.UserServiceClient; -export const OpenSearchBackupServiceClient = cloudApi.mdb.opensearch_backup_service.BackupServiceClient; -export const OpenSearchClusterServiceClient = cloudApi.mdb.opensearch_cluster_service.ClusterServiceClient; -export const OpenSearchResourcePresetServiceClient = cloudApi.mdb.opensearch_resource_preset_service.ResourcePresetServiceClient; -export const PgsqlBackupServiceClient = cloudApi.mdb.postgresql_backup_service.BackupServiceClient; -export const PgsqlClusterServiceClient = cloudApi.mdb.postgresql_cluster_service.ClusterServiceClient; -export const PgsqlDatabaseServiceClient = cloudApi.mdb.postgresql_database_service.DatabaseServiceClient; -export const PgsqlPerformanceDiagnosticsServiceClient = cloudApi.mdb.postgresql_perf_diag_service.PerformanceDiagnosticsServiceClient; -export const PgsqlResourcePresetServiceClient = cloudApi.mdb.postgresql_resource_preset_service.ResourcePresetServiceClient; -export const PgsqlUserServiceClient = cloudApi.mdb.postgresql_user_service.UserServiceClient; -export const RedisBackupServiceClient = cloudApi.mdb.redis_backup_service.BackupServiceClient; -export const RedisClusterServiceClient = cloudApi.mdb.redis_cluster_service.ClusterServiceClient; -export const RedisResourcePresetServiceClient = cloudApi.mdb.redis_resource_preset_service.ResourcePresetServiceClient; -export const SqlServerBackupServiceClient = cloudApi.mdb.sqlserver_backup_service.BackupServiceClient; -export const SqlServerClusterServiceClient = cloudApi.mdb.sqlserver_cluster_service.ClusterServiceClient; -export const SqlServerDatabaseServiceClient = cloudApi.mdb.sqlserver_database_service.DatabaseServiceClient; -export const SqlServerResourcePresetServiceClient = cloudApi.mdb.sqlserver_resource_preset_service.ResourcePresetServiceClient; -export const SqlServerUserServiceClient = cloudApi.mdb.sqlserver_user_service.UserServiceClient; -export const DashboardServiceClient = cloudApi.monitoring.dashboard_service.DashboardServiceClient; +export const AssistantServiceClient = cloudApi.ai.assistants_v1_assistant_service.AssistantServiceClient; +export const TextRecognitionServiceClient = cloudApi.ai.ocr_v1_ocr_service.TextRecognitionServiceClient; +export const SttServiceClient = cloudApi.ai.stt_v2_stt_service.SttServiceClient; +export const TranslationServiceClient = cloudApi.ai.translate_v2_translation_service.TranslationServiceClient; +export const SynthesizerClient = cloudApi.ai.tts_v3_tts_service.SynthesizerClient; +export const VisionServiceClient = cloudApi.ai.vision_v1_vision_service.VisionServiceClient; +export const ImageClassifierServiceClient = cloudApi.ai.vision_v2_image_classifier_service.ImageClassifierServiceClient; +export const AssistantRunServiceClient = cloudApi.ai.assistants_v1_runs_run_service.RunServiceClient; +export const AssistantMessageServiceClient = cloudApi.ai.assistants_v1_threads_message_service.MessageServiceClient; +export const AssistantThreadServiceClient = cloudApi.ai.assistants_v1_threads_thread_service.ThreadServiceClient; +export const BackendGroupServiceClient = cloudApi.apploadbalancer.v1_backend_group_service.BackendGroupServiceClient; +export const HttpRouterServiceClient = cloudApi.apploadbalancer.v1_http_router_service.HttpRouterServiceClient; +export const LoadBalancerServiceClient = cloudApi.apploadbalancer.v1_load_balancer_service.LoadBalancerServiceClient; +export const AlbTargetGroupServiceClient = cloudApi.apploadbalancer.v1_target_group_service.TargetGroupServiceClient; +export const VirtualHostServiceClient = cloudApi.apploadbalancer.v1_virtual_host_service.VirtualHostServiceClient; +export const BackupBackupServiceClient = cloudApi.backup.v1_backup_service.BackupServiceClient; +export const BackupPolicyServiceClient = cloudApi.backup.v1_policy_service.PolicyServiceClient; +export const BackupProviderServiceClient = cloudApi.backup.v1_provider_service.ProviderServiceClient; +export const BackupResourceServiceClient = cloudApi.backup.v1_resource_service.ResourceServiceClient; +export const BillingAccountServiceClient = cloudApi.billing.v1_billing_account_service.BillingAccountServiceClient; +export const BudgetServiceClient = cloudApi.billing.v1_budget_service.BudgetServiceClient; +export const CustomerServiceClient = cloudApi.billing.v1_customer_service.CustomerServiceClient; +export const ServiceServiceClient = cloudApi.billing.v1_service_service.ServiceServiceClient; +export const SkuServiceClient = cloudApi.billing.v1_sku_service.SkuServiceClient; +export const CDNCacheServiceClient = cloudApi.cdn.v1_cache_service.CacheServiceClient; +export const CDNOriginGroupServiceClient = cloudApi.cdn.v1_origin_group_service.OriginGroupServiceClient; +export const CDNOriginServiceClient = cloudApi.cdn.v1_origin_service.OriginServiceClient; +export const CDNProviderServiceClient = cloudApi.cdn.v1_provider_service.ProviderServiceClient; +export const CDNRawLogsServiceClient = cloudApi.cdn.v1_raw_logs_service.RawLogsServiceClient; +export const CDNResourceServiceClient = cloudApi.cdn.v1_resource_service.ResourceServiceClient; +export const CertificateContentServiceClient = cloudApi.certificatemanager.v1_certificate_content_service.CertificateContentServiceClient; +export const CertificateServiceClient = cloudApi.certificatemanager.v1_certificate_service.CertificateServiceClient; +export const DiskPlacementGroupServiceClient = cloudApi.compute.v1_disk_placement_group_service.DiskPlacementGroupServiceClient; +export const DiskServiceClient = cloudApi.compute.v1_disk_service.DiskServiceClient; +export const DiskTypeServiceClient = cloudApi.compute.v1_disk_type_service.DiskTypeServiceClient; +export const FilesystemServiceClient = cloudApi.compute.v1_filesystem_service.FilesystemServiceClient; +export const GpuClusterServiceClient = cloudApi.compute.v1_gpu_cluster_service.GpuClusterServiceClient; +export const HostGroupServiceClient = cloudApi.compute.v1_host_group_service.HostGroupServiceClient; +export const HostTypeServiceClient = cloudApi.compute.v1_host_type_service.HostTypeServiceClient; +export const ComputeImageServiceClient = cloudApi.compute.v1_image_service.ImageServiceClient; +export const InstanceServiceClient = cloudApi.compute.v1_instance_service.InstanceServiceClient; +export const PlacementGroupServiceClient = cloudApi.compute.v1_placement_group_service.PlacementGroupServiceClient; +export const SnapshotScheduleServiceClient = cloudApi.compute.v1_snapshot_schedule_service.SnapshotScheduleServiceClient; +export const SnapshotServiceClient = cloudApi.compute.v1_snapshot_service.SnapshotServiceClient; +export const ZoneServiceClient = cloudApi.compute.v1_zone_service.ZoneServiceClient; +export const InstanceGroupServiceClient = cloudApi.compute.v1_instancegroup_instance_group_service.InstanceGroupServiceClient; +export const CrImageServiceClient = cloudApi.containerregistry.v1_image_service.ImageServiceClient; +export const LifecyclePolicyServiceClient = cloudApi.containerregistry.v1_lifecycle_policy_service.LifecyclePolicyServiceClient; +export const RegistryServiceClient = cloudApi.containerregistry.v1_registry_service.RegistryServiceClient; +export const RepositoryServiceClient = cloudApi.containerregistry.v1_repository_service.RepositoryServiceClient; +export const ScanPolicyServiceClient = cloudApi.containerregistry.v1_scan_policy_service.ScanPolicyServiceClient; +export const ScannerServiceClient = cloudApi.containerregistry.v1_scanner_service.ScannerServiceClient; +export const DataProcClusterServiceClient = cloudApi.dataproc.v1_cluster_service.ClusterServiceClient; +export const JobServiceClient = cloudApi.dataproc.v1_job_service.JobServiceClient; +export const ResourcePresetServiceClient = cloudApi.dataproc.v1_resource_preset_service.ResourcePresetServiceClient; +export const SubclusterServiceClient = cloudApi.dataproc.v1_subcluster_service.SubclusterServiceClient; +export const ManagerJobServiceClient = cloudApi.dataproc.manager_v1_job_service.JobServiceClient; +export const DataprocManagerServiceClient = cloudApi.dataproc.manager_v1_manager_service.DataprocManagerServiceClient; +export const AppTokenServiceClient = cloudApi.datasphere.v1_app_token_service.AppTokenServiceClient; +export const FolderBudgetServiceClient = cloudApi.datasphere.v1_folder_budget_service.FolderBudgetServiceClient; +export const NodeServiceClient = cloudApi.datasphere.v1_node_service.NodeServiceClient; +export const ProjectDataServiceClient = cloudApi.datasphere.v1_project_data_service.ProjectDataServiceClient; +export const ProjectServiceClient = cloudApi.datasphere.v1_project_service.ProjectServiceClient; +export const CommunityServiceClient = cloudApi.datasphere.v2_community_service.CommunityServiceClient; +export const EndpointServiceClient = cloudApi.datatransfer.v1_endpoint_service.EndpointServiceClient; +export const TransferServiceClient = cloudApi.datatransfer.v1_transfer_service.TransferServiceClient; +export const DnsZoneServiceClient = cloudApi.dns.v1_dns_zone_service.DnsZoneServiceClient; +export const ApiKeyServiceClient = cloudApi.iam.v1_api_key_service.ApiKeyServiceClient; +export const IamTokenServiceClient = cloudApi.iam.v1_iam_token_service.IamTokenServiceClient; +export const KeyServiceClient = cloudApi.iam.v1_key_service.KeyServiceClient; +export const RoleServiceClient = cloudApi.iam.v1_role_service.RoleServiceClient; +export const ServiceAccountServiceClient = cloudApi.iam.v1_service_account_service.ServiceAccountServiceClient; +export const UserAccountServiceClient = cloudApi.iam.v1_user_account_service.UserAccountServiceClient; +export const YandexPassportUserAccountServiceClient = cloudApi.iam.v1_yandex_passport_user_account_service.YandexPassportUserAccountServiceClient; +export const AccessKeyServiceClient = cloudApi.iam.v1_awscompatibility_access_key_service.AccessKeyServiceClient; +export const BrokerDataServiceClient = cloudApi.iot.broker_v1_broker_data_service.BrokerDataServiceClient; +export const BrokerServiceClient = cloudApi.iot.broker_v1_broker_service.BrokerServiceClient; +export const DeviceDataServiceClient = cloudApi.iot.devices_v1_device_data_service.DeviceDataServiceClient; +export const DeviceServiceClient = cloudApi.iot.devices_v1_device_service.DeviceServiceClient; +export const RegistryDataServiceClient = cloudApi.iot.devices_v1_registry_data_service.RegistryDataServiceClient; +export const IotRegistryServiceClient = cloudApi.iot.devices_v1_registry_service.RegistryServiceClient; +export const K8sClusterServiceClient = cloudApi.k8s.v1_cluster_service.ClusterServiceClient; +export const NodeGroupServiceClient = cloudApi.k8s.v1_node_group_service.NodeGroupServiceClient; +export const VersionServiceClient = cloudApi.k8s.v1_version_service.VersionServiceClient; +export const SymmetricCryptoServiceClient = cloudApi.kms.v1_symmetric_crypto_service.SymmetricCryptoServiceClient; +export const SymmetricKeyServiceClient = cloudApi.kms.v1_symmetric_key_service.SymmetricKeyServiceClient; +export const AsymmetricEncryptionCryptoServiceClient = cloudApi.kms.v1_asymmetricencryption_asymmetric_encryption_crypto_service.AsymmetricEncryptionCryptoServiceClient; +export const AsymmetricEncryptionKeyServiceClient = cloudApi.kms.v1_asymmetricencryption_asymmetric_encryption_key_service.AsymmetricEncryptionKeyServiceClient; +export const AsymmetricSignatureCryptoServiceClient = cloudApi.kms.v1_asymmetricsignature_asymmetric_signature_crypto_service.AsymmetricSignatureCryptoServiceClient; +export const AsymmetricSignatureKeyServiceClient = cloudApi.kms.v1_asymmetricsignature_asymmetric_signature_key_service.AsymmetricSignatureKeyServiceClient; +export const NetworkLoadBalancerServiceClient = cloudApi.loadbalancer.v1_network_load_balancer_service.NetworkLoadBalancerServiceClient; +export const TargetGroupServiceClient = cloudApi.loadbalancer.v1_target_group_service.TargetGroupServiceClient; +export const LoadTestingAgentRegistrationServiceClient = cloudApi.loadtesting.agent_v1_agent_registration_service.AgentRegistrationServiceClient; +export const LoadTestingAgentServiceClient = cloudApi.loadtesting.agent_v1_agent_service.AgentServiceClient; +export const LoadTestingJobServiceClient = cloudApi.loadtesting.agent_v1_job_service.JobServiceClient; +export const LoadTestingMonitoringServiceClient = cloudApi.loadtesting.agent_v1_monitoring_service.MonitoringServiceClient; +export const LoadTestingTestServiceClient = cloudApi.loadtesting.agent_v1_test_service.TestServiceClient; +export const LoadTestingTrailServiceClient = cloudApi.loadtesting.agent_v1_trail_service.TrailServiceClient; +export const LoadTestingApiAgentServiceClient = cloudApi.loadtesting.api_v1_agent_service.AgentServiceClient; +export const PayloadServiceClient = cloudApi.lockbox.v1_payload_service.PayloadServiceClient; +export const SecretServiceClient = cloudApi.lockbox.v1_secret_service.SecretServiceClient; +export const ExportServiceClient = cloudApi.logging.v1_export_service.ExportServiceClient; +export const LogGroupServiceClient = cloudApi.logging.v1_log_group_service.LogGroupServiceClient; +export const LogIngestionServiceClient = cloudApi.logging.v1_log_ingestion_service.LogIngestionServiceClient; +export const LogReadingServiceClient = cloudApi.logging.v1_log_reading_service.LogReadingServiceClient; +export const SinkServiceClient = cloudApi.logging.v1_sink_service.SinkServiceClient; +export const MarketplaceInstanceServiceClient = cloudApi.marketplace.licensemanager_v1_instance_service.InstanceServiceClient; +export const MarketplaceLockServiceClient = cloudApi.marketplace.licensemanager_v1_lock_service.LockServiceClient; +export const MarketplaceImageProductUsageServiceClient = cloudApi.marketplace.metering_v1_image_product_usage_service.ImageProductUsageServiceClient; +export const MarketplaceMeteringImageProductUsageServiceClient = cloudApi.marketplace.v1_metering_image_product_usage_service.ImageProductUsageServiceClient; +export const ClickHouseBackupServiceClient = cloudApi.mdb.clickhouse_v1_backup_service.BackupServiceClient; +export const ClickHouseClusterServiceClient = cloudApi.mdb.clickhouse_v1_cluster_service.ClusterServiceClient; +export const DatabaseServiceClient = cloudApi.mdb.clickhouse_v1_database_service.DatabaseServiceClient; +export const FormatSchemaServiceClient = cloudApi.mdb.clickhouse_v1_format_schema_service.FormatSchemaServiceClient; +export const MlModelServiceClient = cloudApi.mdb.clickhouse_v1_ml_model_service.MlModelServiceClient; +export const ClickHouseResourcePresetServiceClient = cloudApi.mdb.clickhouse_v1_resource_preset_service.ResourcePresetServiceClient; +export const ClickHouseUserServiceClient = cloudApi.mdb.clickhouse_v1_user_service.UserServiceClient; +export const VersionsServiceClient = cloudApi.mdb.clickhouse_v1_versions_service.VersionsServiceClient; +export const AuthServiceClient = cloudApi.mdb.elasticsearch_v1_auth_service.AuthServiceClient; +export const ElasticBackupServiceClient = cloudApi.mdb.elasticsearch_v1_backup_service.BackupServiceClient; +export const ElasticClusterServiceClient = cloudApi.mdb.elasticsearch_v1_cluster_service.ClusterServiceClient; +export const ElasticExtensionServiceClient = cloudApi.mdb.elasticsearch_v1_extension_service.ExtensionServiceClient; +export const ElasticResourcePresetServiceClient = cloudApi.mdb.elasticsearch_v1_resource_preset_service.ResourcePresetServiceClient; +export const ElasticUserServiceClient = cloudApi.mdb.elasticsearch_v1_user_service.UserServiceClient; +export const GreenplumBackupServiceClient = cloudApi.mdb.greenplum_v1_backup_service.BackupServiceClient; +export const GreenplumClusterServiceClient = cloudApi.mdb.greenplum_v1_cluster_service.ClusterServiceClient; +export const GreenplumResourcePresetServiceClient = cloudApi.mdb.greenplum_v1_resource_preset_service.ResourcePresetServiceClient; +export const KafkaClusterServiceClient = cloudApi.mdb.kafka_v1_cluster_service.ClusterServiceClient; +export const ConnectorServiceClient = cloudApi.mdb.kafka_v1_connector_service.ConnectorServiceClient; +export const KafkaResourcePresetServiceClient = cloudApi.mdb.kafka_v1_resource_preset_service.ResourcePresetServiceClient; +export const TopicServiceClient = cloudApi.mdb.kafka_v1_topic_service.TopicServiceClient; +export const KafkaUserServiceClient = cloudApi.mdb.kafka_v1_user_service.UserServiceClient; +export const MongoBackupServiceClient = cloudApi.mdb.mongodb_v1_backup_service.BackupServiceClient; +export const MongoClusterServiceClient = cloudApi.mdb.mongodb_v1_cluster_service.ClusterServiceClient; +export const MongoDatabaseServiceClient = cloudApi.mdb.mongodb_v1_database_service.DatabaseServiceClient; +export const MongoResourcePresetServiceClient = cloudApi.mdb.mongodb_v1_resource_preset_service.ResourcePresetServiceClient; +export const MongoUserServiceClient = cloudApi.mdb.mongodb_v1_user_service.UserServiceClient; +export const MysqlBackupServiceClient = cloudApi.mdb.mysql_v1_backup_service.BackupServiceClient; +export const MysqlClusterServiceClient = cloudApi.mdb.mysql_v1_cluster_service.ClusterServiceClient; +export const MysqlDatabaseServiceClient = cloudApi.mdb.mysql_v1_database_service.DatabaseServiceClient; +export const MysqlResourcePresetServiceClient = cloudApi.mdb.mysql_v1_resource_preset_service.ResourcePresetServiceClient; +export const MysqlUserServiceClient = cloudApi.mdb.mysql_v1_user_service.UserServiceClient; +export const OpenSearchBackupServiceClient = cloudApi.mdb.opensearch_v1_backup_service.BackupServiceClient; +export const OpenSearchClusterServiceClient = cloudApi.mdb.opensearch_v1_cluster_service.ClusterServiceClient; +export const OpenSearchResourcePresetServiceClient = cloudApi.mdb.opensearch_v1_resource_preset_service.ResourcePresetServiceClient; +export const PgsqlBackupServiceClient = cloudApi.mdb.postgresql_v1_backup_service.BackupServiceClient; +export const PgsqlClusterServiceClient = cloudApi.mdb.postgresql_v1_cluster_service.ClusterServiceClient; +export const PgsqlDatabaseServiceClient = cloudApi.mdb.postgresql_v1_database_service.DatabaseServiceClient; +export const PgsqlPerformanceDiagnosticsServiceClient = cloudApi.mdb.postgresql_v1_perf_diag_service.PerformanceDiagnosticsServiceClient; +export const PgsqlResourcePresetServiceClient = cloudApi.mdb.postgresql_v1_resource_preset_service.ResourcePresetServiceClient; +export const PgsqlUserServiceClient = cloudApi.mdb.postgresql_v1_user_service.UserServiceClient; +export const RedisBackupServiceClient = cloudApi.mdb.redis_v1_backup_service.BackupServiceClient; +export const RedisClusterServiceClient = cloudApi.mdb.redis_v1_cluster_service.ClusterServiceClient; +export const RedisResourcePresetServiceClient = cloudApi.mdb.redis_v1_resource_preset_service.ResourcePresetServiceClient; +export const SqlServerBackupServiceClient = cloudApi.mdb.sqlserver_v1_backup_service.BackupServiceClient; +export const SqlServerClusterServiceClient = cloudApi.mdb.sqlserver_v1_cluster_service.ClusterServiceClient; +export const SqlServerDatabaseServiceClient = cloudApi.mdb.sqlserver_v1_database_service.DatabaseServiceClient; +export const SqlServerResourcePresetServiceClient = cloudApi.mdb.sqlserver_v1_resource_preset_service.ResourcePresetServiceClient; +export const SqlServerUserServiceClient = cloudApi.mdb.sqlserver_v1_user_service.UserServiceClient; +export const DashboardServiceClient = cloudApi.monitoring.v3_dashboard_service.DashboardServiceClient; export const OperationServiceClient = cloudApi.operation.operation_service.OperationServiceClient; -export const GroupMappingServiceClient = cloudApi.organizationmanager.group_mapping_service.GroupMappingServiceClient; -export const GroupServiceClient = cloudApi.organizationmanager.group_service.GroupServiceClient; -export const OrganizationServiceClient = cloudApi.organizationmanager.organization_service.OrganizationServiceClient; -export const SshCertificateServiceClient = cloudApi.organizationmanager.ssh_certificate_service.SshCertificateServiceClient; -export const UserServiceClient = cloudApi.organizationmanager.user_service.UserServiceClient; -export const OmCertificateServiceClient = cloudApi.organizationmanager.certificate_service.CertificateServiceClient; -export const FederationServiceClient = cloudApi.organizationmanager.federation_service.FederationServiceClient; -export const CloudServiceClient = cloudApi.resourcemanager.cloud_service.CloudServiceClient; -export const FolderServiceClient = cloudApi.resourcemanager.folder_service.FolderServiceClient; -export const ApiGatewayServiceClient = cloudApi.serverless.apigateway_service.ApiGatewayServiceClient; -export const ContainerServiceClient = cloudApi.serverless.containers_container_service.ContainerServiceClient; -export const FunctionServiceClient = cloudApi.serverless.functions_function_service.FunctionServiceClient; -export const ProxyServiceClient = cloudApi.serverless.mdbproxy_proxy_service.ProxyServiceClient; -export const TriggerServiceClient = cloudApi.serverless.triggers_trigger_service.TriggerServiceClient; -export const WebSocketConnectionServiceClient = cloudApi.serverless.apigateway_connection_service.ConnectionServiceClient; -export const BucketServiceClient = cloudApi.storage.bucket_service.BucketServiceClient; -export const AddressServiceClient = cloudApi.vpc.address_service.AddressServiceClient; -export const GatewayServiceClient = cloudApi.vpc.gateway_service.GatewayServiceClient; -export const NetworkServiceClient = cloudApi.vpc.network_service.NetworkServiceClient; -export const RouteTableServiceClient = cloudApi.vpc.route_table_service.RouteTableServiceClient; -export const SecurityGroupServiceClient = cloudApi.vpc.security_group_service.SecurityGroupServiceClient; -export const SubnetServiceClient = cloudApi.vpc.subnet_service.SubnetServiceClient; -export const YdbBackupServiceClient = cloudApi.ydb.backup_service.BackupServiceClient; -export const YdbDatabaseServiceClient = cloudApi.ydb.database_service.DatabaseServiceClient; -export const LocationServiceClient = cloudApi.ydb.location_service.LocationServiceClient; -export const YdbResourcePresetServiceClient = cloudApi.ydb.resource_preset_service.ResourcePresetServiceClient; -export const StorageTypeServiceClient = cloudApi.ydb.storage_type_service.StorageTypeServiceClient; +export const GroupMappingServiceClient = cloudApi.organizationmanager.v1_group_mapping_service.GroupMappingServiceClient; +export const GroupServiceClient = cloudApi.organizationmanager.v1_group_service.GroupServiceClient; +export const OrganizationServiceClient = cloudApi.organizationmanager.v1_organization_service.OrganizationServiceClient; +export const SshCertificateServiceClient = cloudApi.organizationmanager.v1_ssh_certificate_service.SshCertificateServiceClient; +export const UserServiceClient = cloudApi.organizationmanager.v1_user_service.UserServiceClient; +export const OmCertificateServiceClient = cloudApi.organizationmanager.v1_saml_certificate_service.CertificateServiceClient; +export const FederationServiceClient = cloudApi.organizationmanager.v1_saml_federation_service.FederationServiceClient; +export const CloudServiceClient = cloudApi.resourcemanager.v1_cloud_service.CloudServiceClient; +export const FolderServiceClient = cloudApi.resourcemanager.v1_folder_service.FolderServiceClient; +export const ApiGatewayServiceClient = cloudApi.serverless.apigateway_v1_apigateway_service.ApiGatewayServiceClient; +export const ContainerServiceClient = cloudApi.serverless.containers_v1_container_service.ContainerServiceClient; +export const FunctionServiceClient = cloudApi.serverless.functions_v1_function_service.FunctionServiceClient; +export const ProxyServiceClient = cloudApi.serverless.mdbproxy_v1_proxy_service.ProxyServiceClient; +export const TriggerServiceClient = cloudApi.serverless.triggers_v1_trigger_service.TriggerServiceClient; +export const WebSocketConnectionServiceClient = cloudApi.serverless.apigateway_websocket_v1_connection_service.ConnectionServiceClient; +export const BucketServiceClient = cloudApi.storage.v1_bucket_service.BucketServiceClient; +export const AddressServiceClient = cloudApi.vpc.v1_address_service.AddressServiceClient; +export const GatewayServiceClient = cloudApi.vpc.v1_gateway_service.GatewayServiceClient; +export const NetworkServiceClient = cloudApi.vpc.v1_network_service.NetworkServiceClient; +export const RouteTableServiceClient = cloudApi.vpc.v1_route_table_service.RouteTableServiceClient; +export const SecurityGroupServiceClient = cloudApi.vpc.v1_security_group_service.SecurityGroupServiceClient; +export const SubnetServiceClient = cloudApi.vpc.v1_subnet_service.SubnetServiceClient; +export const YdbBackupServiceClient = cloudApi.ydb.v1_backup_service.BackupServiceClient; +export const YdbDatabaseServiceClient = cloudApi.ydb.v1_database_service.DatabaseServiceClient; +export const LocationServiceClient = cloudApi.ydb.v1_location_service.LocationServiceClient; +export const YdbResourcePresetServiceClient = cloudApi.ydb.v1_resource_preset_service.ResourcePresetServiceClient; +export const StorageTypeServiceClient = cloudApi.ydb.v1_storage_type_service.StorageTypeServiceClient; \ No newline at end of file diff --git a/src/generated/yandex/cloud/smartcaptcha/index.ts b/src/generated/yandex/cloud/smartcaptcha/index.ts new file mode 100644 index 00000000..de59b877 --- /dev/null +++ b/src/generated/yandex/cloud/smartcaptcha/index.ts @@ -0,0 +1,2 @@ +export * as v1_captcha from './v1/captcha' +export * as v1_captcha_service from './v1/captcha_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/smartcaptcha/v1/captcha.ts b/src/generated/yandex/cloud/smartcaptcha/v1/captcha.ts new file mode 100644 index 00000000..5b282555 --- /dev/null +++ b/src/generated/yandex/cloud/smartcaptcha/v1/captcha.ts @@ -0,0 +1,1882 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.smartcaptcha.v1"; + +/** Captcha's complexity. */ +export enum CaptchaComplexity { + CAPTCHA_COMPLEXITY_UNSPECIFIED = 0, + /** EASY - High chance to pass pre-check and easy advanced challenge. */ + EASY = 1, + /** MEDIUM - Medium chance to pass pre-check and normal advanced challenge. */ + MEDIUM = 2, + /** HARD - Little chance to pass pre-check and hard advanced challenge. */ + HARD = 3, + /** FORCE_HARD - Impossible to pass pre-check and hard advanced challenge. */ + FORCE_HARD = 4, + UNRECOGNIZED = -1, +} + +export function captchaComplexityFromJSON(object: any): CaptchaComplexity { + switch (object) { + case 0: + case "CAPTCHA_COMPLEXITY_UNSPECIFIED": + return CaptchaComplexity.CAPTCHA_COMPLEXITY_UNSPECIFIED; + case 1: + case "EASY": + return CaptchaComplexity.EASY; + case 2: + case "MEDIUM": + return CaptchaComplexity.MEDIUM; + case 3: + case "HARD": + return CaptchaComplexity.HARD; + case 4: + case "FORCE_HARD": + return CaptchaComplexity.FORCE_HARD; + case -1: + case "UNRECOGNIZED": + default: + return CaptchaComplexity.UNRECOGNIZED; + } +} + +export function captchaComplexityToJSON(object: CaptchaComplexity): string { + switch (object) { + case CaptchaComplexity.CAPTCHA_COMPLEXITY_UNSPECIFIED: + return "CAPTCHA_COMPLEXITY_UNSPECIFIED"; + case CaptchaComplexity.EASY: + return "EASY"; + case CaptchaComplexity.MEDIUM: + return "MEDIUM"; + case CaptchaComplexity.HARD: + return "HARD"; + case CaptchaComplexity.FORCE_HARD: + return "FORCE_HARD"; + default: + return "UNKNOWN"; + } +} + +/** Captcha's basic check type, see [Task types / Main task](/docs/smartcaptcha/concepts/tasks#main-task). */ +export enum CaptchaPreCheckType { + CAPTCHA_PRE_CHECK_TYPE_UNSPECIFIED = 0, + /** CHECKBOX - User must click the "I am not a robot" button. */ + CHECKBOX = 1, + /** SLIDER - User must move the slider from left to right. */ + SLIDER = 2, + UNRECOGNIZED = -1, +} + +export function captchaPreCheckTypeFromJSON(object: any): CaptchaPreCheckType { + switch (object) { + case 0: + case "CAPTCHA_PRE_CHECK_TYPE_UNSPECIFIED": + return CaptchaPreCheckType.CAPTCHA_PRE_CHECK_TYPE_UNSPECIFIED; + case 1: + case "CHECKBOX": + return CaptchaPreCheckType.CHECKBOX; + case 2: + case "SLIDER": + return CaptchaPreCheckType.SLIDER; + case -1: + case "UNRECOGNIZED": + default: + return CaptchaPreCheckType.UNRECOGNIZED; + } +} + +export function captchaPreCheckTypeToJSON(object: CaptchaPreCheckType): string { + switch (object) { + case CaptchaPreCheckType.CAPTCHA_PRE_CHECK_TYPE_UNSPECIFIED: + return "CAPTCHA_PRE_CHECK_TYPE_UNSPECIFIED"; + case CaptchaPreCheckType.CHECKBOX: + return "CHECKBOX"; + case CaptchaPreCheckType.SLIDER: + return "SLIDER"; + default: + return "UNKNOWN"; + } +} + +/** Additional task, see [Task types / Additional task](/docs/smartcaptcha/concepts/tasks#additional-task). */ +export enum CaptchaChallengeType { + CAPTCHA_CHALLENGE_TYPE_UNSPECIFIED = 0, + /** IMAGE_TEXT - Text recognition: The user has to type a distorted text from the picture into a special field. */ + IMAGE_TEXT = 1, + /** SILHOUETTES - Silhouettes: The user has to mark several icons from the picture in a particular order. */ + SILHOUETTES = 2, + /** KALEIDOSCOPE - Kaleidoscope: The user has to build a picture from individual parts by shuffling them using a slider. */ + KALEIDOSCOPE = 3, + UNRECOGNIZED = -1, +} + +export function captchaChallengeTypeFromJSON( + object: any +): CaptchaChallengeType { + switch (object) { + case 0: + case "CAPTCHA_CHALLENGE_TYPE_UNSPECIFIED": + return CaptchaChallengeType.CAPTCHA_CHALLENGE_TYPE_UNSPECIFIED; + case 1: + case "IMAGE_TEXT": + return CaptchaChallengeType.IMAGE_TEXT; + case 2: + case "SILHOUETTES": + return CaptchaChallengeType.SILHOUETTES; + case 3: + case "KALEIDOSCOPE": + return CaptchaChallengeType.KALEIDOSCOPE; + case -1: + case "UNRECOGNIZED": + default: + return CaptchaChallengeType.UNRECOGNIZED; + } +} + +export function captchaChallengeTypeToJSON( + object: CaptchaChallengeType +): string { + switch (object) { + case CaptchaChallengeType.CAPTCHA_CHALLENGE_TYPE_UNSPECIFIED: + return "CAPTCHA_CHALLENGE_TYPE_UNSPECIFIED"; + case CaptchaChallengeType.IMAGE_TEXT: + return "IMAGE_TEXT"; + case CaptchaChallengeType.SILHOUETTES: + return "SILHOUETTES"; + case CaptchaChallengeType.KALEIDOSCOPE: + return "KALEIDOSCOPE"; + default: + return "UNKNOWN"; + } +} + +/** A Captcha resource. */ +export interface Captcha { + $type: "yandex.cloud.smartcaptcha.v1.Captcha"; + /** ID of the captcha. */ + id: string; + /** ID of the folder that the captcha belongs to. */ + folderId: string; + /** ID of the cloud that the captcha belongs to. */ + cloudId: string; + /** Client key of the captcha, see [CAPTCHA keys](/docs/smartcaptcha/concepts/keys). */ + clientKey: string; + /** Creation timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. */ + createdAt?: Date; + /** Name of the captcha. The name is unique within the folder. 3-63 characters long. */ + name: string; + /** List of allowed host names, see [Domain validation](/docs/smartcaptcha/concepts/domain-validation). */ + allowedSites: string[]; + /** Complexity of the captcha. */ + complexity: CaptchaComplexity; + /** JSON with variables to define the captcha appearance. For more details see generated JSON in cloud console. */ + styleJson: string; + /** Determines that the captcha is currently in restricted mode, see [SmartCaptcha restricted mode](/docs/smartcaptcha/concepts/restricted-mode). */ + suspend: boolean; + /** Turn off host name check, see [Domain validation](/docs/smartcaptcha/concepts/domain-validation). */ + turnOffHostnameCheck: boolean; + /** Basic check type of the captcha. */ + preCheckType: CaptchaPreCheckType; + /** Additional task type of the captcha. */ + challengeType: CaptchaChallengeType; + /** List of security rules. */ + securityRules: SecurityRule[]; + /** Determines whether captcha is protected from being deleted. */ + deletionProtection: boolean; + /** List of variants to use in security_rules */ + overrideVariants: OverrideVariant[]; +} + +/** OverrideVariant object. Contains the settings to override. */ +export interface OverrideVariant { + $type: "yandex.cloud.smartcaptcha.v1.OverrideVariant"; + /** Unique identifier of the variant. */ + uuid: string; + /** Optional description of the rule. 0-512 characters long. */ + description: string; + /** Complexity of the captcha. */ + complexity: CaptchaComplexity; + /** Basic check type of the captcha. */ + preCheckType: CaptchaPreCheckType; + /** Additional task type of the captcha. */ + challengeType: CaptchaChallengeType; +} + +/** CaptchaSecretKey object. Contains captcha data that need to keep in secret. */ +export interface CaptchaSecretKey { + $type: "yandex.cloud.smartcaptcha.v1.CaptchaSecretKey"; + /** Server key of the captcha, see [CAPTCHA keys](/docs/smartcaptcha/concepts/keys). */ + serverKey: string; +} + +/** SecurityRule object. Defines the condition and action: when and which variant to show. */ +export interface SecurityRule { + $type: "yandex.cloud.smartcaptcha.v1.SecurityRule"; + /** Name of the rule. The name is unique within the captcha. 1-50 characters long. */ + name: string; + /** Priority of the rule. Lower value means higher priority. */ + priority: number; + /** Optional description of the rule. 0-512 characters long. */ + description: string; + /** The condition for matching the rule. */ + condition?: Condition; + /** Variant UUID to show in case of match the rule. Keep empty to use defaults. */ + overrideVariantUuid: string; +} + +/** Condition object. AND semantics implied. */ +export interface Condition { + $type: "yandex.cloud.smartcaptcha.v1.Condition"; + /** Host where captcha placed. */ + host?: Condition_HostMatcher; + /** URI where captcha placed. */ + uri?: Condition_UriMatcher; + /** Captcha request headers. */ + headers: Condition_HeaderMatcher[]; + /** The IP address of the requester. */ + sourceIp?: Condition_IpMatcher; +} + +/** StringMatcher object. */ +export interface Condition_StringMatcher { + $type: "yandex.cloud.smartcaptcha.v1.Condition.StringMatcher"; + exactMatch: string | undefined; + exactNotMatch: string | undefined; + prefixMatch: string | undefined; + prefixNotMatch: string | undefined; + pireRegexMatch: string | undefined; + pireRegexNotMatch: string | undefined; +} + +/** HostMatcher object. */ +export interface Condition_HostMatcher { + $type: "yandex.cloud.smartcaptcha.v1.Condition.HostMatcher"; + /** List of hosts. OR semantics implied. */ + hosts: Condition_StringMatcher[]; +} + +/** UriMatcher object. AND semantics implied. */ +export interface Condition_UriMatcher { + $type: "yandex.cloud.smartcaptcha.v1.Condition.UriMatcher"; + /** Path of the URI [RFC3986](https://datatracker.ietf.org/doc/html/rfc3986#section-3.3). */ + path?: Condition_StringMatcher; + /** List of query matchers. AND semantics implied. */ + queries: Condition_QueryMatcher[]; +} + +/** QueryMatcher object. */ +export interface Condition_QueryMatcher { + $type: "yandex.cloud.smartcaptcha.v1.Condition.QueryMatcher"; + /** Key of the query parameter. */ + key: string; + /** Value of the query parameter. */ + value?: Condition_StringMatcher; +} + +/** HeaderMatcher object. */ +export interface Condition_HeaderMatcher { + $type: "yandex.cloud.smartcaptcha.v1.Condition.HeaderMatcher"; + /** Name of header (case insensitive). */ + name: string; + /** Value of the header. */ + value?: Condition_StringMatcher; +} + +/** IpMatcher object. AND semantics implied. */ +export interface Condition_IpMatcher { + $type: "yandex.cloud.smartcaptcha.v1.Condition.IpMatcher"; + ipRangesMatch?: Condition_IpRangesMatcher; + ipRangesNotMatch?: Condition_IpRangesMatcher; + geoIpMatch?: Condition_GeoIpMatcher; + geoIpNotMatch?: Condition_GeoIpMatcher; +} + +/** IpRangesMatcher object. */ +export interface Condition_IpRangesMatcher { + $type: "yandex.cloud.smartcaptcha.v1.Condition.IpRangesMatcher"; + /** List of IP ranges. OR semantics implied. */ + ipRanges: string[]; +} + +/** GeoIpMatcher object. */ +export interface Condition_GeoIpMatcher { + $type: "yandex.cloud.smartcaptcha.v1.Condition.GeoIpMatcher"; + /** ISO 3166-1 alpha 2. OR semantics implied. */ + locations: string[]; +} + +const baseCaptcha: object = { + $type: "yandex.cloud.smartcaptcha.v1.Captcha", + id: "", + folderId: "", + cloudId: "", + clientKey: "", + name: "", + allowedSites: "", + complexity: 0, + styleJson: "", + suspend: false, + turnOffHostnameCheck: false, + preCheckType: 0, + challengeType: 0, + deletionProtection: false, +}; + +export const Captcha = { + $type: "yandex.cloud.smartcaptcha.v1.Captcha" as const, + + encode( + message: Captcha, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(170).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.cloudId !== "") { + writer.uint32(98).string(message.cloudId); + } + if (message.clientKey !== "") { + writer.uint32(26).string(message.clientKey); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.name !== "") { + writer.uint32(58).string(message.name); + } + for (const v of message.allowedSites) { + writer.uint32(66).string(v!); + } + if (message.complexity !== 0) { + writer.uint32(72).int32(message.complexity); + } + if (message.styleJson !== "") { + writer.uint32(82).string(message.styleJson); + } + if (message.suspend === true) { + writer.uint32(104).bool(message.suspend); + } + if (message.turnOffHostnameCheck === true) { + writer.uint32(112).bool(message.turnOffHostnameCheck); + } + if (message.preCheckType !== 0) { + writer.uint32(128).int32(message.preCheckType); + } + if (message.challengeType !== 0) { + writer.uint32(136).int32(message.challengeType); + } + for (const v of message.securityRules) { + SecurityRule.encode(v!, writer.uint32(154).fork()).ldelim(); + } + if (message.deletionProtection === true) { + writer.uint32(176).bool(message.deletionProtection); + } + for (const v of message.overrideVariants) { + OverrideVariant.encode(v!, writer.uint32(186).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Captcha { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCaptcha } as Captcha; + message.allowedSites = []; + message.securityRules = []; + message.overrideVariants = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 21: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 12: + message.cloudId = reader.string(); + break; + case 3: + message.clientKey = reader.string(); + break; + case 5: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 7: + message.name = reader.string(); + break; + case 8: + message.allowedSites.push(reader.string()); + break; + case 9: + message.complexity = reader.int32() as any; + break; + case 10: + message.styleJson = reader.string(); + break; + case 13: + message.suspend = reader.bool(); + break; + case 14: + message.turnOffHostnameCheck = reader.bool(); + break; + case 16: + message.preCheckType = reader.int32() as any; + break; + case 17: + message.challengeType = reader.int32() as any; + break; + case 19: + message.securityRules.push( + SecurityRule.decode(reader, reader.uint32()) + ); + break; + case 22: + message.deletionProtection = reader.bool(); + break; + case 23: + message.overrideVariants.push( + OverrideVariant.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Captcha { + const message = { ...baseCaptcha } as Captcha; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.cloudId = + object.cloudId !== undefined && object.cloudId !== null + ? String(object.cloudId) + : ""; + message.clientKey = + object.clientKey !== undefined && object.clientKey !== null + ? String(object.clientKey) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.allowedSites = (object.allowedSites ?? []).map((e: any) => + String(e) + ); + message.complexity = + object.complexity !== undefined && object.complexity !== null + ? captchaComplexityFromJSON(object.complexity) + : 0; + message.styleJson = + object.styleJson !== undefined && object.styleJson !== null + ? String(object.styleJson) + : ""; + message.suspend = + object.suspend !== undefined && object.suspend !== null + ? Boolean(object.suspend) + : false; + message.turnOffHostnameCheck = + object.turnOffHostnameCheck !== undefined && + object.turnOffHostnameCheck !== null + ? Boolean(object.turnOffHostnameCheck) + : false; + message.preCheckType = + object.preCheckType !== undefined && object.preCheckType !== null + ? captchaPreCheckTypeFromJSON(object.preCheckType) + : 0; + message.challengeType = + object.challengeType !== undefined && object.challengeType !== null + ? captchaChallengeTypeFromJSON(object.challengeType) + : 0; + message.securityRules = (object.securityRules ?? []).map((e: any) => + SecurityRule.fromJSON(e) + ); + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + message.overrideVariants = (object.overrideVariants ?? []).map((e: any) => + OverrideVariant.fromJSON(e) + ); + return message; + }, + + toJSON(message: Captcha): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.cloudId !== undefined && (obj.cloudId = message.cloudId); + message.clientKey !== undefined && (obj.clientKey = message.clientKey); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.name !== undefined && (obj.name = message.name); + if (message.allowedSites) { + obj.allowedSites = message.allowedSites.map((e) => e); + } else { + obj.allowedSites = []; + } + message.complexity !== undefined && + (obj.complexity = captchaComplexityToJSON(message.complexity)); + message.styleJson !== undefined && (obj.styleJson = message.styleJson); + message.suspend !== undefined && (obj.suspend = message.suspend); + message.turnOffHostnameCheck !== undefined && + (obj.turnOffHostnameCheck = message.turnOffHostnameCheck); + message.preCheckType !== undefined && + (obj.preCheckType = captchaPreCheckTypeToJSON(message.preCheckType)); + message.challengeType !== undefined && + (obj.challengeType = captchaChallengeTypeToJSON(message.challengeType)); + if (message.securityRules) { + obj.securityRules = message.securityRules.map((e) => + e ? SecurityRule.toJSON(e) : undefined + ); + } else { + obj.securityRules = []; + } + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + if (message.overrideVariants) { + obj.overrideVariants = message.overrideVariants.map((e) => + e ? OverrideVariant.toJSON(e) : undefined + ); + } else { + obj.overrideVariants = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Captcha { + const message = { ...baseCaptcha } as Captcha; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.cloudId = object.cloudId ?? ""; + message.clientKey = object.clientKey ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.name = object.name ?? ""; + message.allowedSites = object.allowedSites?.map((e) => e) || []; + message.complexity = object.complexity ?? 0; + message.styleJson = object.styleJson ?? ""; + message.suspend = object.suspend ?? false; + message.turnOffHostnameCheck = object.turnOffHostnameCheck ?? false; + message.preCheckType = object.preCheckType ?? 0; + message.challengeType = object.challengeType ?? 0; + message.securityRules = + object.securityRules?.map((e) => SecurityRule.fromPartial(e)) || []; + message.deletionProtection = object.deletionProtection ?? false; + message.overrideVariants = + object.overrideVariants?.map((e) => OverrideVariant.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Captcha.$type, Captcha); + +const baseOverrideVariant: object = { + $type: "yandex.cloud.smartcaptcha.v1.OverrideVariant", + uuid: "", + description: "", + complexity: 0, + preCheckType: 0, + challengeType: 0, +}; + +export const OverrideVariant = { + $type: "yandex.cloud.smartcaptcha.v1.OverrideVariant" as const, + + encode( + message: OverrideVariant, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.uuid !== "") { + writer.uint32(10).string(message.uuid); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.complexity !== 0) { + writer.uint32(24).int32(message.complexity); + } + if (message.preCheckType !== 0) { + writer.uint32(32).int32(message.preCheckType); + } + if (message.challengeType !== 0) { + writer.uint32(40).int32(message.challengeType); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OverrideVariant { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOverrideVariant } as OverrideVariant; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uuid = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.complexity = reader.int32() as any; + break; + case 4: + message.preCheckType = reader.int32() as any; + break; + case 5: + message.challengeType = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OverrideVariant { + const message = { ...baseOverrideVariant } as OverrideVariant; + message.uuid = + object.uuid !== undefined && object.uuid !== null + ? String(object.uuid) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.complexity = + object.complexity !== undefined && object.complexity !== null + ? captchaComplexityFromJSON(object.complexity) + : 0; + message.preCheckType = + object.preCheckType !== undefined && object.preCheckType !== null + ? captchaPreCheckTypeFromJSON(object.preCheckType) + : 0; + message.challengeType = + object.challengeType !== undefined && object.challengeType !== null + ? captchaChallengeTypeFromJSON(object.challengeType) + : 0; + return message; + }, + + toJSON(message: OverrideVariant): unknown { + const obj: any = {}; + message.uuid !== undefined && (obj.uuid = message.uuid); + message.description !== undefined && + (obj.description = message.description); + message.complexity !== undefined && + (obj.complexity = captchaComplexityToJSON(message.complexity)); + message.preCheckType !== undefined && + (obj.preCheckType = captchaPreCheckTypeToJSON(message.preCheckType)); + message.challengeType !== undefined && + (obj.challengeType = captchaChallengeTypeToJSON(message.challengeType)); + return obj; + }, + + fromPartial, I>>( + object: I + ): OverrideVariant { + const message = { ...baseOverrideVariant } as OverrideVariant; + message.uuid = object.uuid ?? ""; + message.description = object.description ?? ""; + message.complexity = object.complexity ?? 0; + message.preCheckType = object.preCheckType ?? 0; + message.challengeType = object.challengeType ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(OverrideVariant.$type, OverrideVariant); + +const baseCaptchaSecretKey: object = { + $type: "yandex.cloud.smartcaptcha.v1.CaptchaSecretKey", + serverKey: "", +}; + +export const CaptchaSecretKey = { + $type: "yandex.cloud.smartcaptcha.v1.CaptchaSecretKey" as const, + + encode( + message: CaptchaSecretKey, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.serverKey !== "") { + writer.uint32(10).string(message.serverKey); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CaptchaSecretKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCaptchaSecretKey } as CaptchaSecretKey; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serverKey = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CaptchaSecretKey { + const message = { ...baseCaptchaSecretKey } as CaptchaSecretKey; + message.serverKey = + object.serverKey !== undefined && object.serverKey !== null + ? String(object.serverKey) + : ""; + return message; + }, + + toJSON(message: CaptchaSecretKey): unknown { + const obj: any = {}; + message.serverKey !== undefined && (obj.serverKey = message.serverKey); + return obj; + }, + + fromPartial, I>>( + object: I + ): CaptchaSecretKey { + const message = { ...baseCaptchaSecretKey } as CaptchaSecretKey; + message.serverKey = object.serverKey ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CaptchaSecretKey.$type, CaptchaSecretKey); + +const baseSecurityRule: object = { + $type: "yandex.cloud.smartcaptcha.v1.SecurityRule", + name: "", + priority: 0, + description: "", + overrideVariantUuid: "", +}; + +export const SecurityRule = { + $type: "yandex.cloud.smartcaptcha.v1.SecurityRule" as const, + + encode( + message: SecurityRule, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.priority !== 0) { + writer.uint32(16).int64(message.priority); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.condition !== undefined) { + Condition.encode(message.condition, writer.uint32(34).fork()).ldelim(); + } + if (message.overrideVariantUuid !== "") { + writer.uint32(50).string(message.overrideVariantUuid); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SecurityRule { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSecurityRule } as SecurityRule; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.priority = longToNumber(reader.int64() as Long); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.condition = Condition.decode(reader, reader.uint32()); + break; + case 6: + message.overrideVariantUuid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SecurityRule { + const message = { ...baseSecurityRule } as SecurityRule; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.priority = + object.priority !== undefined && object.priority !== null + ? Number(object.priority) + : 0; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromJSON(object.condition) + : undefined; + message.overrideVariantUuid = + object.overrideVariantUuid !== undefined && + object.overrideVariantUuid !== null + ? String(object.overrideVariantUuid) + : ""; + return message; + }, + + toJSON(message: SecurityRule): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.priority !== undefined && + (obj.priority = Math.round(message.priority)); + message.description !== undefined && + (obj.description = message.description); + message.condition !== undefined && + (obj.condition = message.condition + ? Condition.toJSON(message.condition) + : undefined); + message.overrideVariantUuid !== undefined && + (obj.overrideVariantUuid = message.overrideVariantUuid); + return obj; + }, + + fromPartial, I>>( + object: I + ): SecurityRule { + const message = { ...baseSecurityRule } as SecurityRule; + message.name = object.name ?? ""; + message.priority = object.priority ?? 0; + message.description = object.description ?? ""; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromPartial(object.condition) + : undefined; + message.overrideVariantUuid = object.overrideVariantUuid ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(SecurityRule.$type, SecurityRule); + +const baseCondition: object = { + $type: "yandex.cloud.smartcaptcha.v1.Condition", +}; + +export const Condition = { + $type: "yandex.cloud.smartcaptcha.v1.Condition" as const, + + encode( + message: Condition, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.host !== undefined) { + Condition_HostMatcher.encode( + message.host, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.uri !== undefined) { + Condition_UriMatcher.encode( + message.uri, + writer.uint32(18).fork() + ).ldelim(); + } + for (const v of message.headers) { + Condition_HeaderMatcher.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.sourceIp !== undefined) { + Condition_IpMatcher.encode( + message.sourceIp, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Condition { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCondition } as Condition; + message.headers = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.host = Condition_HostMatcher.decode(reader, reader.uint32()); + break; + case 2: + message.uri = Condition_UriMatcher.decode(reader, reader.uint32()); + break; + case 3: + message.headers.push( + Condition_HeaderMatcher.decode(reader, reader.uint32()) + ); + break; + case 4: + message.sourceIp = Condition_IpMatcher.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition { + const message = { ...baseCondition } as Condition; + message.host = + object.host !== undefined && object.host !== null + ? Condition_HostMatcher.fromJSON(object.host) + : undefined; + message.uri = + object.uri !== undefined && object.uri !== null + ? Condition_UriMatcher.fromJSON(object.uri) + : undefined; + message.headers = (object.headers ?? []).map((e: any) => + Condition_HeaderMatcher.fromJSON(e) + ); + message.sourceIp = + object.sourceIp !== undefined && object.sourceIp !== null + ? Condition_IpMatcher.fromJSON(object.sourceIp) + : undefined; + return message; + }, + + toJSON(message: Condition): unknown { + const obj: any = {}; + message.host !== undefined && + (obj.host = message.host + ? Condition_HostMatcher.toJSON(message.host) + : undefined); + message.uri !== undefined && + (obj.uri = message.uri + ? Condition_UriMatcher.toJSON(message.uri) + : undefined); + if (message.headers) { + obj.headers = message.headers.map((e) => + e ? Condition_HeaderMatcher.toJSON(e) : undefined + ); + } else { + obj.headers = []; + } + message.sourceIp !== undefined && + (obj.sourceIp = message.sourceIp + ? Condition_IpMatcher.toJSON(message.sourceIp) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition { + const message = { ...baseCondition } as Condition; + message.host = + object.host !== undefined && object.host !== null + ? Condition_HostMatcher.fromPartial(object.host) + : undefined; + message.uri = + object.uri !== undefined && object.uri !== null + ? Condition_UriMatcher.fromPartial(object.uri) + : undefined; + message.headers = + object.headers?.map((e) => Condition_HeaderMatcher.fromPartial(e)) || []; + message.sourceIp = + object.sourceIp !== undefined && object.sourceIp !== null + ? Condition_IpMatcher.fromPartial(object.sourceIp) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Condition.$type, Condition); + +const baseCondition_StringMatcher: object = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.StringMatcher", +}; + +export const Condition_StringMatcher = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.StringMatcher" as const, + + encode( + message: Condition_StringMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.exactMatch !== undefined) { + writer.uint32(10).string(message.exactMatch); + } + if (message.exactNotMatch !== undefined) { + writer.uint32(18).string(message.exactNotMatch); + } + if (message.prefixMatch !== undefined) { + writer.uint32(26).string(message.prefixMatch); + } + if (message.prefixNotMatch !== undefined) { + writer.uint32(34).string(message.prefixNotMatch); + } + if (message.pireRegexMatch !== undefined) { + writer.uint32(42).string(message.pireRegexMatch); + } + if (message.pireRegexNotMatch !== undefined) { + writer.uint32(50).string(message.pireRegexNotMatch); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_StringMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCondition_StringMatcher, + } as Condition_StringMatcher; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exactMatch = reader.string(); + break; + case 2: + message.exactNotMatch = reader.string(); + break; + case 3: + message.prefixMatch = reader.string(); + break; + case 4: + message.prefixNotMatch = reader.string(); + break; + case 5: + message.pireRegexMatch = reader.string(); + break; + case 6: + message.pireRegexNotMatch = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_StringMatcher { + const message = { + ...baseCondition_StringMatcher, + } as Condition_StringMatcher; + message.exactMatch = + object.exactMatch !== undefined && object.exactMatch !== null + ? String(object.exactMatch) + : undefined; + message.exactNotMatch = + object.exactNotMatch !== undefined && object.exactNotMatch !== null + ? String(object.exactNotMatch) + : undefined; + message.prefixMatch = + object.prefixMatch !== undefined && object.prefixMatch !== null + ? String(object.prefixMatch) + : undefined; + message.prefixNotMatch = + object.prefixNotMatch !== undefined && object.prefixNotMatch !== null + ? String(object.prefixNotMatch) + : undefined; + message.pireRegexMatch = + object.pireRegexMatch !== undefined && object.pireRegexMatch !== null + ? String(object.pireRegexMatch) + : undefined; + message.pireRegexNotMatch = + object.pireRegexNotMatch !== undefined && + object.pireRegexNotMatch !== null + ? String(object.pireRegexNotMatch) + : undefined; + return message; + }, + + toJSON(message: Condition_StringMatcher): unknown { + const obj: any = {}; + message.exactMatch !== undefined && (obj.exactMatch = message.exactMatch); + message.exactNotMatch !== undefined && + (obj.exactNotMatch = message.exactNotMatch); + message.prefixMatch !== undefined && + (obj.prefixMatch = message.prefixMatch); + message.prefixNotMatch !== undefined && + (obj.prefixNotMatch = message.prefixNotMatch); + message.pireRegexMatch !== undefined && + (obj.pireRegexMatch = message.pireRegexMatch); + message.pireRegexNotMatch !== undefined && + (obj.pireRegexNotMatch = message.pireRegexNotMatch); + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_StringMatcher { + const message = { + ...baseCondition_StringMatcher, + } as Condition_StringMatcher; + message.exactMatch = object.exactMatch ?? undefined; + message.exactNotMatch = object.exactNotMatch ?? undefined; + message.prefixMatch = object.prefixMatch ?? undefined; + message.prefixNotMatch = object.prefixNotMatch ?? undefined; + message.pireRegexMatch = object.pireRegexMatch ?? undefined; + message.pireRegexNotMatch = object.pireRegexNotMatch ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Condition_StringMatcher.$type, Condition_StringMatcher); + +const baseCondition_HostMatcher: object = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.HostMatcher", +}; + +export const Condition_HostMatcher = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.HostMatcher" as const, + + encode( + message: Condition_HostMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.hosts) { + Condition_StringMatcher.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_HostMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCondition_HostMatcher } as Condition_HostMatcher; + message.hosts = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hosts.push( + Condition_StringMatcher.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_HostMatcher { + const message = { ...baseCondition_HostMatcher } as Condition_HostMatcher; + message.hosts = (object.hosts ?? []).map((e: any) => + Condition_StringMatcher.fromJSON(e) + ); + return message; + }, + + toJSON(message: Condition_HostMatcher): unknown { + const obj: any = {}; + if (message.hosts) { + obj.hosts = message.hosts.map((e) => + e ? Condition_StringMatcher.toJSON(e) : undefined + ); + } else { + obj.hosts = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_HostMatcher { + const message = { ...baseCondition_HostMatcher } as Condition_HostMatcher; + message.hosts = + object.hosts?.map((e) => Condition_StringMatcher.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Condition_HostMatcher.$type, Condition_HostMatcher); + +const baseCondition_UriMatcher: object = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.UriMatcher", +}; + +export const Condition_UriMatcher = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.UriMatcher" as const, + + encode( + message: Condition_UriMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.path !== undefined) { + Condition_StringMatcher.encode( + message.path, + writer.uint32(10).fork() + ).ldelim(); + } + for (const v of message.queries) { + Condition_QueryMatcher.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_UriMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCondition_UriMatcher } as Condition_UriMatcher; + message.queries = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = Condition_StringMatcher.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.queries.push( + Condition_QueryMatcher.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_UriMatcher { + const message = { ...baseCondition_UriMatcher } as Condition_UriMatcher; + message.path = + object.path !== undefined && object.path !== null + ? Condition_StringMatcher.fromJSON(object.path) + : undefined; + message.queries = (object.queries ?? []).map((e: any) => + Condition_QueryMatcher.fromJSON(e) + ); + return message; + }, + + toJSON(message: Condition_UriMatcher): unknown { + const obj: any = {}; + message.path !== undefined && + (obj.path = message.path + ? Condition_StringMatcher.toJSON(message.path) + : undefined); + if (message.queries) { + obj.queries = message.queries.map((e) => + e ? Condition_QueryMatcher.toJSON(e) : undefined + ); + } else { + obj.queries = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_UriMatcher { + const message = { ...baseCondition_UriMatcher } as Condition_UriMatcher; + message.path = + object.path !== undefined && object.path !== null + ? Condition_StringMatcher.fromPartial(object.path) + : undefined; + message.queries = + object.queries?.map((e) => Condition_QueryMatcher.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Condition_UriMatcher.$type, Condition_UriMatcher); + +const baseCondition_QueryMatcher: object = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.QueryMatcher", + key: "", +}; + +export const Condition_QueryMatcher = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.QueryMatcher" as const, + + encode( + message: Condition_QueryMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Condition_StringMatcher.encode( + message.value, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_QueryMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCondition_QueryMatcher } as Condition_QueryMatcher; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = Condition_StringMatcher.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_QueryMatcher { + const message = { ...baseCondition_QueryMatcher } as Condition_QueryMatcher; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? Condition_StringMatcher.fromJSON(object.value) + : undefined; + return message; + }, + + toJSON(message: Condition_QueryMatcher): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && + (obj.value = message.value + ? Condition_StringMatcher.toJSON(message.value) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_QueryMatcher { + const message = { ...baseCondition_QueryMatcher } as Condition_QueryMatcher; + message.key = object.key ?? ""; + message.value = + object.value !== undefined && object.value !== null + ? Condition_StringMatcher.fromPartial(object.value) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Condition_QueryMatcher.$type, Condition_QueryMatcher); + +const baseCondition_HeaderMatcher: object = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.HeaderMatcher", + name: "", +}; + +export const Condition_HeaderMatcher = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.HeaderMatcher" as const, + + encode( + message: Condition_HeaderMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.value !== undefined) { + Condition_StringMatcher.encode( + message.value, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_HeaderMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCondition_HeaderMatcher, + } as Condition_HeaderMatcher; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value = Condition_StringMatcher.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_HeaderMatcher { + const message = { + ...baseCondition_HeaderMatcher, + } as Condition_HeaderMatcher; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.value = + object.value !== undefined && object.value !== null + ? Condition_StringMatcher.fromJSON(object.value) + : undefined; + return message; + }, + + toJSON(message: Condition_HeaderMatcher): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.value !== undefined && + (obj.value = message.value + ? Condition_StringMatcher.toJSON(message.value) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_HeaderMatcher { + const message = { + ...baseCondition_HeaderMatcher, + } as Condition_HeaderMatcher; + message.name = object.name ?? ""; + message.value = + object.value !== undefined && object.value !== null + ? Condition_StringMatcher.fromPartial(object.value) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Condition_HeaderMatcher.$type, Condition_HeaderMatcher); + +const baseCondition_IpMatcher: object = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.IpMatcher", +}; + +export const Condition_IpMatcher = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.IpMatcher" as const, + + encode( + message: Condition_IpMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ipRangesMatch !== undefined) { + Condition_IpRangesMatcher.encode( + message.ipRangesMatch, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.ipRangesNotMatch !== undefined) { + Condition_IpRangesMatcher.encode( + message.ipRangesNotMatch, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.geoIpMatch !== undefined) { + Condition_GeoIpMatcher.encode( + message.geoIpMatch, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.geoIpNotMatch !== undefined) { + Condition_GeoIpMatcher.encode( + message.geoIpNotMatch, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Condition_IpMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCondition_IpMatcher } as Condition_IpMatcher; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ipRangesMatch = Condition_IpRangesMatcher.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.ipRangesNotMatch = Condition_IpRangesMatcher.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.geoIpMatch = Condition_GeoIpMatcher.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.geoIpNotMatch = Condition_GeoIpMatcher.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_IpMatcher { + const message = { ...baseCondition_IpMatcher } as Condition_IpMatcher; + message.ipRangesMatch = + object.ipRangesMatch !== undefined && object.ipRangesMatch !== null + ? Condition_IpRangesMatcher.fromJSON(object.ipRangesMatch) + : undefined; + message.ipRangesNotMatch = + object.ipRangesNotMatch !== undefined && object.ipRangesNotMatch !== null + ? Condition_IpRangesMatcher.fromJSON(object.ipRangesNotMatch) + : undefined; + message.geoIpMatch = + object.geoIpMatch !== undefined && object.geoIpMatch !== null + ? Condition_GeoIpMatcher.fromJSON(object.geoIpMatch) + : undefined; + message.geoIpNotMatch = + object.geoIpNotMatch !== undefined && object.geoIpNotMatch !== null + ? Condition_GeoIpMatcher.fromJSON(object.geoIpNotMatch) + : undefined; + return message; + }, + + toJSON(message: Condition_IpMatcher): unknown { + const obj: any = {}; + message.ipRangesMatch !== undefined && + (obj.ipRangesMatch = message.ipRangesMatch + ? Condition_IpRangesMatcher.toJSON(message.ipRangesMatch) + : undefined); + message.ipRangesNotMatch !== undefined && + (obj.ipRangesNotMatch = message.ipRangesNotMatch + ? Condition_IpRangesMatcher.toJSON(message.ipRangesNotMatch) + : undefined); + message.geoIpMatch !== undefined && + (obj.geoIpMatch = message.geoIpMatch + ? Condition_GeoIpMatcher.toJSON(message.geoIpMatch) + : undefined); + message.geoIpNotMatch !== undefined && + (obj.geoIpNotMatch = message.geoIpNotMatch + ? Condition_GeoIpMatcher.toJSON(message.geoIpNotMatch) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_IpMatcher { + const message = { ...baseCondition_IpMatcher } as Condition_IpMatcher; + message.ipRangesMatch = + object.ipRangesMatch !== undefined && object.ipRangesMatch !== null + ? Condition_IpRangesMatcher.fromPartial(object.ipRangesMatch) + : undefined; + message.ipRangesNotMatch = + object.ipRangesNotMatch !== undefined && object.ipRangesNotMatch !== null + ? Condition_IpRangesMatcher.fromPartial(object.ipRangesNotMatch) + : undefined; + message.geoIpMatch = + object.geoIpMatch !== undefined && object.geoIpMatch !== null + ? Condition_GeoIpMatcher.fromPartial(object.geoIpMatch) + : undefined; + message.geoIpNotMatch = + object.geoIpNotMatch !== undefined && object.geoIpNotMatch !== null + ? Condition_GeoIpMatcher.fromPartial(object.geoIpNotMatch) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Condition_IpMatcher.$type, Condition_IpMatcher); + +const baseCondition_IpRangesMatcher: object = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.IpRangesMatcher", + ipRanges: "", +}; + +export const Condition_IpRangesMatcher = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.IpRangesMatcher" as const, + + encode( + message: Condition_IpRangesMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.ipRanges) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_IpRangesMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCondition_IpRangesMatcher, + } as Condition_IpRangesMatcher; + message.ipRanges = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ipRanges.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_IpRangesMatcher { + const message = { + ...baseCondition_IpRangesMatcher, + } as Condition_IpRangesMatcher; + message.ipRanges = (object.ipRanges ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: Condition_IpRangesMatcher): unknown { + const obj: any = {}; + if (message.ipRanges) { + obj.ipRanges = message.ipRanges.map((e) => e); + } else { + obj.ipRanges = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_IpRangesMatcher { + const message = { + ...baseCondition_IpRangesMatcher, + } as Condition_IpRangesMatcher; + message.ipRanges = object.ipRanges?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Condition_IpRangesMatcher.$type, + Condition_IpRangesMatcher +); + +const baseCondition_GeoIpMatcher: object = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.GeoIpMatcher", + locations: "", +}; + +export const Condition_GeoIpMatcher = { + $type: "yandex.cloud.smartcaptcha.v1.Condition.GeoIpMatcher" as const, + + encode( + message: Condition_GeoIpMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.locations) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_GeoIpMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCondition_GeoIpMatcher } as Condition_GeoIpMatcher; + message.locations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.locations.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_GeoIpMatcher { + const message = { ...baseCondition_GeoIpMatcher } as Condition_GeoIpMatcher; + message.locations = (object.locations ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: Condition_GeoIpMatcher): unknown { + const obj: any = {}; + if (message.locations) { + obj.locations = message.locations.map((e) => e); + } else { + obj.locations = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_GeoIpMatcher { + const message = { ...baseCondition_GeoIpMatcher } as Condition_GeoIpMatcher; + message.locations = object.locations?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(Condition_GeoIpMatcher.$type, Condition_GeoIpMatcher); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/smartcaptcha/v1/captcha_service.ts b/src/generated/yandex/cloud/smartcaptcha/v1/captcha_service.ts new file mode 100644 index 00000000..ee555137 --- /dev/null +++ b/src/generated/yandex/cloud/smartcaptcha/v1/captcha_service.ts @@ -0,0 +1,1303 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + CaptchaComplexity, + CaptchaPreCheckType, + CaptchaChallengeType, + Captcha, + SecurityRule, + OverrideVariant, + CaptchaSecretKey, + captchaComplexityFromJSON, + captchaPreCheckTypeFromJSON, + captchaChallengeTypeFromJSON, + captchaComplexityToJSON, + captchaPreCheckTypeToJSON, + captchaChallengeTypeToJSON, +} from "../../../../yandex/cloud/smartcaptcha/v1/captcha"; +import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.smartcaptcha.v1"; + +export interface GetCaptchaRequest { + $type: "yandex.cloud.smartcaptcha.v1.GetCaptchaRequest"; + /** ID of the Captcha resource to return. */ + captchaId: string; +} + +export interface ListCaptchasRequest { + $type: "yandex.cloud.smartcaptcha.v1.ListCaptchasRequest"; + /** + * ID of the folder that the captcha belongs to. + * Currently page_size, page_token, filter and order_by are not supported and List method will return all captchas in the folder. + */ + folderId: string; +} + +export interface ListCaptchasResponse { + $type: "yandex.cloud.smartcaptcha.v1.ListCaptchasResponse"; + /** + * List of Captcha resources. + * Currently next_page_token is not supported and List method will return all captchas in the folder. + */ + resources: Captcha[]; +} + +export interface CreateCaptchaRequest { + $type: "yandex.cloud.smartcaptcha.v1.CreateCaptchaRequest"; + /** ID of the folder to create a captcha in. */ + folderId: string; + /** + * Name of the captcha. + * The name must be unique within the folder. + */ + name: string; + /** List of allowed host names, see [Domain validation](/docs/smartcaptcha/concepts/domain-validation). */ + allowedSites: string[]; + /** Complexity of the captcha. */ + complexity: CaptchaComplexity; + /** JSON with variables to define the captcha appearance. For more details see generated JSON in cloud console. */ + styleJson: string; + /** Turn off host name check, see [Domain validation](/docs/smartcaptcha/concepts/domain-validation). */ + turnOffHostnameCheck: boolean; + /** Basic check type of the captcha. */ + preCheckType: CaptchaPreCheckType; + /** Additional task type of the captcha. */ + challengeType: CaptchaChallengeType; + /** List of security rules. */ + securityRules: SecurityRule[]; + /** Determines whether captcha is protected from being deleted. */ + deletionProtection: boolean; + /** List of variants to use in security_rules */ + overrideVariants: OverrideVariant[]; +} + +export interface CreateCaptchaMetadata { + $type: "yandex.cloud.smartcaptcha.v1.CreateCaptchaMetadata"; + /** ID of the captcha that is being created. */ + captchaId: string; +} + +export interface DeleteCaptchaRequest { + $type: "yandex.cloud.smartcaptcha.v1.DeleteCaptchaRequest"; + /** ID of the captcha to delete. */ + captchaId: string; +} + +export interface DeleteCaptchaMetadata { + $type: "yandex.cloud.smartcaptcha.v1.DeleteCaptchaMetadata"; + /** ID of the Captcha resource that is being deleted. */ + captchaId: string; +} + +export interface UpdateCaptchaRequest { + $type: "yandex.cloud.smartcaptcha.v1.UpdateCaptchaRequest"; + /** ID of the captcha to update. */ + captchaId: string; + /** Field mask that specifies which fields of the Captcha resource are going to be updated. */ + updateMask?: FieldMask; + /** + * Name of the captcha. + * The name must be unique within the folder. + */ + name: string; + /** List of allowed host names, see [Domain validation](/docs/smartcaptcha/concepts/domain-validation). */ + allowedSites: string[]; + /** Complexity of the captcha. */ + complexity: CaptchaComplexity; + /** JSON with variables to define the captcha appearance. For more details see generated JSON in cloud console. */ + styleJson: string; + /** Turn off host name check, see [Domain validation](/docs/smartcaptcha/concepts/domain-validation). */ + turnOffHostnameCheck: boolean; + /** Basic check type of the captcha. */ + preCheckType: CaptchaPreCheckType; + /** Additional task type of the captcha. */ + challengeType: CaptchaChallengeType; + /** List of security rules. */ + securityRules: SecurityRule[]; + /** Determines whether captcha is protected from being deleted. */ + deletionProtection: boolean; + /** List of variants to use in security_rules */ + overrideVariants: OverrideVariant[]; +} + +export interface UpdateCaptchaMetadata { + $type: "yandex.cloud.smartcaptcha.v1.UpdateCaptchaMetadata"; + /** ID of the Captcha resource that is being updated. */ + captchaId: string; +} + +const baseGetCaptchaRequest: object = { + $type: "yandex.cloud.smartcaptcha.v1.GetCaptchaRequest", + captchaId: "", +}; + +export const GetCaptchaRequest = { + $type: "yandex.cloud.smartcaptcha.v1.GetCaptchaRequest" as const, + + encode( + message: GetCaptchaRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.captchaId !== "") { + writer.uint32(10).string(message.captchaId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetCaptchaRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetCaptchaRequest } as GetCaptchaRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.captchaId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetCaptchaRequest { + const message = { ...baseGetCaptchaRequest } as GetCaptchaRequest; + message.captchaId = + object.captchaId !== undefined && object.captchaId !== null + ? String(object.captchaId) + : ""; + return message; + }, + + toJSON(message: GetCaptchaRequest): unknown { + const obj: any = {}; + message.captchaId !== undefined && (obj.captchaId = message.captchaId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetCaptchaRequest { + const message = { ...baseGetCaptchaRequest } as GetCaptchaRequest; + message.captchaId = object.captchaId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetCaptchaRequest.$type, GetCaptchaRequest); + +const baseListCaptchasRequest: object = { + $type: "yandex.cloud.smartcaptcha.v1.ListCaptchasRequest", + folderId: "", +}; + +export const ListCaptchasRequest = { + $type: "yandex.cloud.smartcaptcha.v1.ListCaptchasRequest" as const, + + encode( + message: ListCaptchasRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListCaptchasRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListCaptchasRequest } as ListCaptchasRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListCaptchasRequest { + const message = { ...baseListCaptchasRequest } as ListCaptchasRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + return message; + }, + + toJSON(message: ListCaptchasRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListCaptchasRequest { + const message = { ...baseListCaptchasRequest } as ListCaptchasRequest; + message.folderId = object.folderId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListCaptchasRequest.$type, ListCaptchasRequest); + +const baseListCaptchasResponse: object = { + $type: "yandex.cloud.smartcaptcha.v1.ListCaptchasResponse", +}; + +export const ListCaptchasResponse = { + $type: "yandex.cloud.smartcaptcha.v1.ListCaptchasResponse" as const, + + encode( + message: ListCaptchasResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.resources) { + Captcha.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListCaptchasResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListCaptchasResponse } as ListCaptchasResponse; + message.resources = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.resources.push(Captcha.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListCaptchasResponse { + const message = { ...baseListCaptchasResponse } as ListCaptchasResponse; + message.resources = (object.resources ?? []).map((e: any) => + Captcha.fromJSON(e) + ); + return message; + }, + + toJSON(message: ListCaptchasResponse): unknown { + const obj: any = {}; + if (message.resources) { + obj.resources = message.resources.map((e) => + e ? Captcha.toJSON(e) : undefined + ); + } else { + obj.resources = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ListCaptchasResponse { + const message = { ...baseListCaptchasResponse } as ListCaptchasResponse; + message.resources = + object.resources?.map((e) => Captcha.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ListCaptchasResponse.$type, ListCaptchasResponse); + +const baseCreateCaptchaRequest: object = { + $type: "yandex.cloud.smartcaptcha.v1.CreateCaptchaRequest", + folderId: "", + name: "", + allowedSites: "", + complexity: 0, + styleJson: "", + turnOffHostnameCheck: false, + preCheckType: 0, + challengeType: 0, + deletionProtection: false, +}; + +export const CreateCaptchaRequest = { + $type: "yandex.cloud.smartcaptcha.v1.CreateCaptchaRequest" as const, + + encode( + message: CreateCaptchaRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + for (const v of message.allowedSites) { + writer.uint32(26).string(v!); + } + if (message.complexity !== 0) { + writer.uint32(32).int32(message.complexity); + } + if (message.styleJson !== "") { + writer.uint32(42).string(message.styleJson); + } + if (message.turnOffHostnameCheck === true) { + writer.uint32(48).bool(message.turnOffHostnameCheck); + } + if (message.preCheckType !== 0) { + writer.uint32(64).int32(message.preCheckType); + } + if (message.challengeType !== 0) { + writer.uint32(72).int32(message.challengeType); + } + for (const v of message.securityRules) { + SecurityRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + if (message.deletionProtection === true) { + writer.uint32(96).bool(message.deletionProtection); + } + for (const v of message.overrideVariants) { + OverrideVariant.encode(v!, writer.uint32(106).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateCaptchaRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateCaptchaRequest } as CreateCaptchaRequest; + message.allowedSites = []; + message.securityRules = []; + message.overrideVariants = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.allowedSites.push(reader.string()); + break; + case 4: + message.complexity = reader.int32() as any; + break; + case 5: + message.styleJson = reader.string(); + break; + case 6: + message.turnOffHostnameCheck = reader.bool(); + break; + case 8: + message.preCheckType = reader.int32() as any; + break; + case 9: + message.challengeType = reader.int32() as any; + break; + case 11: + message.securityRules.push( + SecurityRule.decode(reader, reader.uint32()) + ); + break; + case 12: + message.deletionProtection = reader.bool(); + break; + case 13: + message.overrideVariants.push( + OverrideVariant.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateCaptchaRequest { + const message = { ...baseCreateCaptchaRequest } as CreateCaptchaRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.allowedSites = (object.allowedSites ?? []).map((e: any) => + String(e) + ); + message.complexity = + object.complexity !== undefined && object.complexity !== null + ? captchaComplexityFromJSON(object.complexity) + : 0; + message.styleJson = + object.styleJson !== undefined && object.styleJson !== null + ? String(object.styleJson) + : ""; + message.turnOffHostnameCheck = + object.turnOffHostnameCheck !== undefined && + object.turnOffHostnameCheck !== null + ? Boolean(object.turnOffHostnameCheck) + : false; + message.preCheckType = + object.preCheckType !== undefined && object.preCheckType !== null + ? captchaPreCheckTypeFromJSON(object.preCheckType) + : 0; + message.challengeType = + object.challengeType !== undefined && object.challengeType !== null + ? captchaChallengeTypeFromJSON(object.challengeType) + : 0; + message.securityRules = (object.securityRules ?? []).map((e: any) => + SecurityRule.fromJSON(e) + ); + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + message.overrideVariants = (object.overrideVariants ?? []).map((e: any) => + OverrideVariant.fromJSON(e) + ); + return message; + }, + + toJSON(message: CreateCaptchaRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + if (message.allowedSites) { + obj.allowedSites = message.allowedSites.map((e) => e); + } else { + obj.allowedSites = []; + } + message.complexity !== undefined && + (obj.complexity = captchaComplexityToJSON(message.complexity)); + message.styleJson !== undefined && (obj.styleJson = message.styleJson); + message.turnOffHostnameCheck !== undefined && + (obj.turnOffHostnameCheck = message.turnOffHostnameCheck); + message.preCheckType !== undefined && + (obj.preCheckType = captchaPreCheckTypeToJSON(message.preCheckType)); + message.challengeType !== undefined && + (obj.challengeType = captchaChallengeTypeToJSON(message.challengeType)); + if (message.securityRules) { + obj.securityRules = message.securityRules.map((e) => + e ? SecurityRule.toJSON(e) : undefined + ); + } else { + obj.securityRules = []; + } + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + if (message.overrideVariants) { + obj.overrideVariants = message.overrideVariants.map((e) => + e ? OverrideVariant.toJSON(e) : undefined + ); + } else { + obj.overrideVariants = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateCaptchaRequest { + const message = { ...baseCreateCaptchaRequest } as CreateCaptchaRequest; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.allowedSites = object.allowedSites?.map((e) => e) || []; + message.complexity = object.complexity ?? 0; + message.styleJson = object.styleJson ?? ""; + message.turnOffHostnameCheck = object.turnOffHostnameCheck ?? false; + message.preCheckType = object.preCheckType ?? 0; + message.challengeType = object.challengeType ?? 0; + message.securityRules = + object.securityRules?.map((e) => SecurityRule.fromPartial(e)) || []; + message.deletionProtection = object.deletionProtection ?? false; + message.overrideVariants = + object.overrideVariants?.map((e) => OverrideVariant.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(CreateCaptchaRequest.$type, CreateCaptchaRequest); + +const baseCreateCaptchaMetadata: object = { + $type: "yandex.cloud.smartcaptcha.v1.CreateCaptchaMetadata", + captchaId: "", +}; + +export const CreateCaptchaMetadata = { + $type: "yandex.cloud.smartcaptcha.v1.CreateCaptchaMetadata" as const, + + encode( + message: CreateCaptchaMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.captchaId !== "") { + writer.uint32(10).string(message.captchaId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateCaptchaMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateCaptchaMetadata } as CreateCaptchaMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.captchaId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateCaptchaMetadata { + const message = { ...baseCreateCaptchaMetadata } as CreateCaptchaMetadata; + message.captchaId = + object.captchaId !== undefined && object.captchaId !== null + ? String(object.captchaId) + : ""; + return message; + }, + + toJSON(message: CreateCaptchaMetadata): unknown { + const obj: any = {}; + message.captchaId !== undefined && (obj.captchaId = message.captchaId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateCaptchaMetadata { + const message = { ...baseCreateCaptchaMetadata } as CreateCaptchaMetadata; + message.captchaId = object.captchaId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateCaptchaMetadata.$type, CreateCaptchaMetadata); + +const baseDeleteCaptchaRequest: object = { + $type: "yandex.cloud.smartcaptcha.v1.DeleteCaptchaRequest", + captchaId: "", +}; + +export const DeleteCaptchaRequest = { + $type: "yandex.cloud.smartcaptcha.v1.DeleteCaptchaRequest" as const, + + encode( + message: DeleteCaptchaRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.captchaId !== "") { + writer.uint32(10).string(message.captchaId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteCaptchaRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteCaptchaRequest } as DeleteCaptchaRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.captchaId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteCaptchaRequest { + const message = { ...baseDeleteCaptchaRequest } as DeleteCaptchaRequest; + message.captchaId = + object.captchaId !== undefined && object.captchaId !== null + ? String(object.captchaId) + : ""; + return message; + }, + + toJSON(message: DeleteCaptchaRequest): unknown { + const obj: any = {}; + message.captchaId !== undefined && (obj.captchaId = message.captchaId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteCaptchaRequest { + const message = { ...baseDeleteCaptchaRequest } as DeleteCaptchaRequest; + message.captchaId = object.captchaId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteCaptchaRequest.$type, DeleteCaptchaRequest); + +const baseDeleteCaptchaMetadata: object = { + $type: "yandex.cloud.smartcaptcha.v1.DeleteCaptchaMetadata", + captchaId: "", +}; + +export const DeleteCaptchaMetadata = { + $type: "yandex.cloud.smartcaptcha.v1.DeleteCaptchaMetadata" as const, + + encode( + message: DeleteCaptchaMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.captchaId !== "") { + writer.uint32(10).string(message.captchaId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteCaptchaMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteCaptchaMetadata } as DeleteCaptchaMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.captchaId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteCaptchaMetadata { + const message = { ...baseDeleteCaptchaMetadata } as DeleteCaptchaMetadata; + message.captchaId = + object.captchaId !== undefined && object.captchaId !== null + ? String(object.captchaId) + : ""; + return message; + }, + + toJSON(message: DeleteCaptchaMetadata): unknown { + const obj: any = {}; + message.captchaId !== undefined && (obj.captchaId = message.captchaId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteCaptchaMetadata { + const message = { ...baseDeleteCaptchaMetadata } as DeleteCaptchaMetadata; + message.captchaId = object.captchaId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteCaptchaMetadata.$type, DeleteCaptchaMetadata); + +const baseUpdateCaptchaRequest: object = { + $type: "yandex.cloud.smartcaptcha.v1.UpdateCaptchaRequest", + captchaId: "", + name: "", + allowedSites: "", + complexity: 0, + styleJson: "", + turnOffHostnameCheck: false, + preCheckType: 0, + challengeType: 0, + deletionProtection: false, +}; + +export const UpdateCaptchaRequest = { + $type: "yandex.cloud.smartcaptcha.v1.UpdateCaptchaRequest" as const, + + encode( + message: UpdateCaptchaRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.captchaId !== "") { + writer.uint32(10).string(message.captchaId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + for (const v of message.allowedSites) { + writer.uint32(34).string(v!); + } + if (message.complexity !== 0) { + writer.uint32(40).int32(message.complexity); + } + if (message.styleJson !== "") { + writer.uint32(50).string(message.styleJson); + } + if (message.turnOffHostnameCheck === true) { + writer.uint32(56).bool(message.turnOffHostnameCheck); + } + if (message.preCheckType !== 0) { + writer.uint32(72).int32(message.preCheckType); + } + if (message.challengeType !== 0) { + writer.uint32(80).int32(message.challengeType); + } + for (const v of message.securityRules) { + SecurityRule.encode(v!, writer.uint32(98).fork()).ldelim(); + } + if (message.deletionProtection === true) { + writer.uint32(104).bool(message.deletionProtection); + } + for (const v of message.overrideVariants) { + OverrideVariant.encode(v!, writer.uint32(114).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateCaptchaRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateCaptchaRequest } as UpdateCaptchaRequest; + message.allowedSites = []; + message.securityRules = []; + message.overrideVariants = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.captchaId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.allowedSites.push(reader.string()); + break; + case 5: + message.complexity = reader.int32() as any; + break; + case 6: + message.styleJson = reader.string(); + break; + case 7: + message.turnOffHostnameCheck = reader.bool(); + break; + case 9: + message.preCheckType = reader.int32() as any; + break; + case 10: + message.challengeType = reader.int32() as any; + break; + case 12: + message.securityRules.push( + SecurityRule.decode(reader, reader.uint32()) + ); + break; + case 13: + message.deletionProtection = reader.bool(); + break; + case 14: + message.overrideVariants.push( + OverrideVariant.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateCaptchaRequest { + const message = { ...baseUpdateCaptchaRequest } as UpdateCaptchaRequest; + message.captchaId = + object.captchaId !== undefined && object.captchaId !== null + ? String(object.captchaId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.allowedSites = (object.allowedSites ?? []).map((e: any) => + String(e) + ); + message.complexity = + object.complexity !== undefined && object.complexity !== null + ? captchaComplexityFromJSON(object.complexity) + : 0; + message.styleJson = + object.styleJson !== undefined && object.styleJson !== null + ? String(object.styleJson) + : ""; + message.turnOffHostnameCheck = + object.turnOffHostnameCheck !== undefined && + object.turnOffHostnameCheck !== null + ? Boolean(object.turnOffHostnameCheck) + : false; + message.preCheckType = + object.preCheckType !== undefined && object.preCheckType !== null + ? captchaPreCheckTypeFromJSON(object.preCheckType) + : 0; + message.challengeType = + object.challengeType !== undefined && object.challengeType !== null + ? captchaChallengeTypeFromJSON(object.challengeType) + : 0; + message.securityRules = (object.securityRules ?? []).map((e: any) => + SecurityRule.fromJSON(e) + ); + message.deletionProtection = + object.deletionProtection !== undefined && + object.deletionProtection !== null + ? Boolean(object.deletionProtection) + : false; + message.overrideVariants = (object.overrideVariants ?? []).map((e: any) => + OverrideVariant.fromJSON(e) + ); + return message; + }, + + toJSON(message: UpdateCaptchaRequest): unknown { + const obj: any = {}; + message.captchaId !== undefined && (obj.captchaId = message.captchaId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + if (message.allowedSites) { + obj.allowedSites = message.allowedSites.map((e) => e); + } else { + obj.allowedSites = []; + } + message.complexity !== undefined && + (obj.complexity = captchaComplexityToJSON(message.complexity)); + message.styleJson !== undefined && (obj.styleJson = message.styleJson); + message.turnOffHostnameCheck !== undefined && + (obj.turnOffHostnameCheck = message.turnOffHostnameCheck); + message.preCheckType !== undefined && + (obj.preCheckType = captchaPreCheckTypeToJSON(message.preCheckType)); + message.challengeType !== undefined && + (obj.challengeType = captchaChallengeTypeToJSON(message.challengeType)); + if (message.securityRules) { + obj.securityRules = message.securityRules.map((e) => + e ? SecurityRule.toJSON(e) : undefined + ); + } else { + obj.securityRules = []; + } + message.deletionProtection !== undefined && + (obj.deletionProtection = message.deletionProtection); + if (message.overrideVariants) { + obj.overrideVariants = message.overrideVariants.map((e) => + e ? OverrideVariant.toJSON(e) : undefined + ); + } else { + obj.overrideVariants = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateCaptchaRequest { + const message = { ...baseUpdateCaptchaRequest } as UpdateCaptchaRequest; + message.captchaId = object.captchaId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.allowedSites = object.allowedSites?.map((e) => e) || []; + message.complexity = object.complexity ?? 0; + message.styleJson = object.styleJson ?? ""; + message.turnOffHostnameCheck = object.turnOffHostnameCheck ?? false; + message.preCheckType = object.preCheckType ?? 0; + message.challengeType = object.challengeType ?? 0; + message.securityRules = + object.securityRules?.map((e) => SecurityRule.fromPartial(e)) || []; + message.deletionProtection = object.deletionProtection ?? false; + message.overrideVariants = + object.overrideVariants?.map((e) => OverrideVariant.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(UpdateCaptchaRequest.$type, UpdateCaptchaRequest); + +const baseUpdateCaptchaMetadata: object = { + $type: "yandex.cloud.smartcaptcha.v1.UpdateCaptchaMetadata", + captchaId: "", +}; + +export const UpdateCaptchaMetadata = { + $type: "yandex.cloud.smartcaptcha.v1.UpdateCaptchaMetadata" as const, + + encode( + message: UpdateCaptchaMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.captchaId !== "") { + writer.uint32(10).string(message.captchaId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateCaptchaMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateCaptchaMetadata } as UpdateCaptchaMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.captchaId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateCaptchaMetadata { + const message = { ...baseUpdateCaptchaMetadata } as UpdateCaptchaMetadata; + message.captchaId = + object.captchaId !== undefined && object.captchaId !== null + ? String(object.captchaId) + : ""; + return message; + }, + + toJSON(message: UpdateCaptchaMetadata): unknown { + const obj: any = {}; + message.captchaId !== undefined && (obj.captchaId = message.captchaId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateCaptchaMetadata { + const message = { ...baseUpdateCaptchaMetadata } as UpdateCaptchaMetadata; + message.captchaId = object.captchaId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateCaptchaMetadata.$type, UpdateCaptchaMetadata); + +/** A set of methods for managing Captcha resources. */ +export const CaptchaServiceService = { + /** Returns the specified Captcha resource. */ + get: { + path: "/yandex.cloud.smartcaptcha.v1.CaptchaService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetCaptchaRequest) => + Buffer.from(GetCaptchaRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetCaptchaRequest.decode(value), + responseSerialize: (value: Captcha) => + Buffer.from(Captcha.encode(value).finish()), + responseDeserialize: (value: Buffer) => Captcha.decode(value), + }, + /** Returns the secret data of specified Captcha resource. */ + getSecretKey: { + path: "/yandex.cloud.smartcaptcha.v1.CaptchaService/GetSecretKey", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetCaptchaRequest) => + Buffer.from(GetCaptchaRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetCaptchaRequest.decode(value), + responseSerialize: (value: CaptchaSecretKey) => + Buffer.from(CaptchaSecretKey.encode(value).finish()), + responseDeserialize: (value: Buffer) => CaptchaSecretKey.decode(value), + }, + /** Retrieves the list of Captcha resources in the specified folder. */ + list: { + path: "/yandex.cloud.smartcaptcha.v1.CaptchaService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListCaptchasRequest) => + Buffer.from(ListCaptchasRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListCaptchasRequest.decode(value), + responseSerialize: (value: ListCaptchasResponse) => + Buffer.from(ListCaptchasResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListCaptchasResponse.decode(value), + }, + /** Creates a captcha in the specified folder using the data specified in the request. */ + create: { + path: "/yandex.cloud.smartcaptcha.v1.CaptchaService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateCaptchaRequest) => + Buffer.from(CreateCaptchaRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateCaptchaRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates the specified captcha. */ + update: { + path: "/yandex.cloud.smartcaptcha.v1.CaptchaService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateCaptchaRequest) => + Buffer.from(UpdateCaptchaRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateCaptchaRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes the specified captcha. */ + delete: { + path: "/yandex.cloud.smartcaptcha.v1.CaptchaService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteCaptchaRequest) => + Buffer.from(DeleteCaptchaRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteCaptchaRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface CaptchaServiceServer extends UntypedServiceImplementation { + /** Returns the specified Captcha resource. */ + get: handleUnaryCall; + /** Returns the secret data of specified Captcha resource. */ + getSecretKey: handleUnaryCall; + /** Retrieves the list of Captcha resources in the specified folder. */ + list: handleUnaryCall; + /** Creates a captcha in the specified folder using the data specified in the request. */ + create: handleUnaryCall; + /** Updates the specified captcha. */ + update: handleUnaryCall; + /** Deletes the specified captcha. */ + delete: handleUnaryCall; +} + +export interface CaptchaServiceClient extends Client { + /** Returns the specified Captcha resource. */ + get( + request: GetCaptchaRequest, + callback: (error: ServiceError | null, response: Captcha) => void + ): ClientUnaryCall; + get( + request: GetCaptchaRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Captcha) => void + ): ClientUnaryCall; + get( + request: GetCaptchaRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Captcha) => void + ): ClientUnaryCall; + /** Returns the secret data of specified Captcha resource. */ + getSecretKey( + request: GetCaptchaRequest, + callback: (error: ServiceError | null, response: CaptchaSecretKey) => void + ): ClientUnaryCall; + getSecretKey( + request: GetCaptchaRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: CaptchaSecretKey) => void + ): ClientUnaryCall; + getSecretKey( + request: GetCaptchaRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: CaptchaSecretKey) => void + ): ClientUnaryCall; + /** Retrieves the list of Captcha resources in the specified folder. */ + list( + request: ListCaptchasRequest, + callback: ( + error: ServiceError | null, + response: ListCaptchasResponse + ) => void + ): ClientUnaryCall; + list( + request: ListCaptchasRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListCaptchasResponse + ) => void + ): ClientUnaryCall; + list( + request: ListCaptchasRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListCaptchasResponse + ) => void + ): ClientUnaryCall; + /** Creates a captcha in the specified folder using the data specified in the request. */ + create( + request: CreateCaptchaRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateCaptchaRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateCaptchaRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates the specified captcha. */ + update( + request: UpdateCaptchaRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateCaptchaRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateCaptchaRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes the specified captcha. */ + delete( + request: DeleteCaptchaRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteCaptchaRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteCaptchaRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const CaptchaServiceClient = makeGenericClientConstructor( + CaptchaServiceService, + "yandex.cloud.smartcaptcha.v1.CaptchaService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): CaptchaServiceClient; + service: typeof CaptchaServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/smartwebsecurity/index.ts b/src/generated/yandex/cloud/smartwebsecurity/index.ts new file mode 100644 index 00000000..d675c034 --- /dev/null +++ b/src/generated/yandex/cloud/smartwebsecurity/index.ts @@ -0,0 +1,8 @@ +export * as v1_security_profile from './v1/security_profile' +export * as v1_security_profile_service from './v1/security_profile_service' +export * as v1_advanced_rate_limiter_advanced_rate_limiter_profile from './v1/advanced_rate_limiter/advanced_rate_limiter_profile' +export * as v1_advanced_rate_limiter_advanced_rate_limiter_profile_service from './v1/advanced_rate_limiter/advanced_rate_limiter_profile_service' +export * as v1_waf_rule_set_descriptor from './v1/waf/rule_set_descriptor' +export * as v1_waf_rule_set_descriptor_service from './v1/waf/rule_set_descriptor_service' +export * as v1_waf_waf_profile from './v1/waf/waf_profile' +export * as v1_waf_waf_profile_service from './v1/waf/waf_profile_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/smartwebsecurity/v1/advanced_rate_limiter/advanced_rate_limiter_profile.ts b/src/generated/yandex/cloud/smartwebsecurity/v1/advanced_rate_limiter/advanced_rate_limiter_profile.ts new file mode 100644 index 00000000..168bd3a4 --- /dev/null +++ b/src/generated/yandex/cloud/smartwebsecurity/v1/advanced_rate_limiter/advanced_rate_limiter_profile.ts @@ -0,0 +1,1437 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Condition } from "../../../../../yandex/cloud/smartwebsecurity/v1/security_profile"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter"; + +/** A AdvancedRateLimiterProfile (ARL) resource. */ +export interface AdvancedRateLimiterProfile { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterProfile"; + /** ID of the ARL profile. */ + id: string; + /** ID of the folder that the ARL profile belongs to. */ + folderId: string; + /** Labels as `` key:value `` pairs. Maximum of 64 per resource. */ + labels: { [key: string]: string }; + /** Name of the ARL profile. The name is unique within the folder. 1-50 characters long. */ + name: string; + /** Optional description of the ARL profile. */ + description: string; + /** List of rules. */ + advancedRateLimiterRules: AdvancedRateLimiterRule[]; + /** Creation timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. */ + createdAt?: Date; + /** ID of the cloud that the ARL profile belongs to. */ + cloudId: string; +} + +export interface AdvancedRateLimiterProfile_LabelsEntry { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterProfile.LabelsEntry"; + key: string; + value: string; +} + +/** A AdvancedRateLimiterRule object, see [Rules](/docs/smartwebsecurity/concepts/arl#traffic-conditions). */ +export interface AdvancedRateLimiterRule { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule"; + /** Name of the rule. The name is unique within the ARL profile. 1-50 characters long. */ + name: string; + /** + * Determines the priority in case there are several matched rules. + * Enter an integer within the range of 1 and 999999. + * The rule priority must be unique within the entire ARL profile. + * A lower numeric value means a higher priority. + */ + priority: number; + /** Optional description of the rule. 0-512 characters long. */ + description: string; + /** + * This allows you to evaluate backend capabilities and find the optimum limit values. + * Requests will not be blocked in this mode. + */ + dryRun: boolean; + /** Static quota. Counting each request individually. */ + staticQuota?: AdvancedRateLimiterRule_StaticQuota | undefined; + /** Dynamic quota. Grouping requests by a certain attribute and limiting the number of groups. */ + dynamicQuota?: AdvancedRateLimiterRule_DynamicQuota | undefined; +} + +/** Type of action to perform if this rule matched. */ +export enum AdvancedRateLimiterRule_Action { + ACTION_UNSPECIFIED = 0, + /** DENY - Deny request. */ + DENY = 1, + UNRECOGNIZED = -1, +} + +export function advancedRateLimiterRule_ActionFromJSON( + object: any +): AdvancedRateLimiterRule_Action { + switch (object) { + case 0: + case "ACTION_UNSPECIFIED": + return AdvancedRateLimiterRule_Action.ACTION_UNSPECIFIED; + case 1: + case "DENY": + return AdvancedRateLimiterRule_Action.DENY; + case -1: + case "UNRECOGNIZED": + default: + return AdvancedRateLimiterRule_Action.UNRECOGNIZED; + } +} + +export function advancedRateLimiterRule_ActionToJSON( + object: AdvancedRateLimiterRule_Action +): string { + switch (object) { + case AdvancedRateLimiterRule_Action.ACTION_UNSPECIFIED: + return "ACTION_UNSPECIFIED"; + case AdvancedRateLimiterRule_Action.DENY: + return "DENY"; + default: + return "UNKNOWN"; + } +} + +/** StaticQuota object. */ +export interface AdvancedRateLimiterRule_StaticQuota { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.StaticQuota"; + /** Action in case of exceeding this quota. */ + action: AdvancedRateLimiterRule_Action; + /** The condition for matching the quota. */ + condition?: Condition; + /** + * Desired maximum number of requests per period. + * Enter an integer within the range of 1 and 9999999999999. + */ + limit: number; + /** Period of time in seconds. */ + period: number; +} + +/** DynamicQuota object. */ +export interface AdvancedRateLimiterRule_DynamicQuota { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.DynamicQuota"; + /** Action in case of exceeding this quota. */ + action: AdvancedRateLimiterRule_Action; + /** The condition for matching the quota. */ + condition?: Condition; + /** + * Desired maximum number of requests per period. + * Enter an integer within the range of 1 and 9999999999999. + */ + limit: number; + /** Period of time in seconds. */ + period: number; + /** List of characteristics. */ + characteristics: AdvancedRateLimiterRule_DynamicQuota_Characteristic[]; +} + +export interface AdvancedRateLimiterRule_DynamicQuota_Characteristic { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.DynamicQuota.Characteristic"; + /** + * Characteristic automatically based on the Request path, HTTP method, IP address, Region, and Host attributes. + * See [Rules](/docs/smartwebsecurity/concepts/arl#requests-counting) for more details. + */ + simpleCharacteristic?: + | AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic + | undefined; + /** + * Characteristic based on key match in the Query params, HTTP header, and HTTP cookie attributes. + * See [Rules](/docs/smartwebsecurity/concepts/arl#requests-counting) for more details. + */ + keyCharacteristic?: + | AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic + | undefined; + /** Determines case-sensitive or case-insensitive keys matching. */ + caseInsensitive: boolean; +} + +export interface AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.DynamicQuota.Characteristic.SimpleCharacteristic"; + /** Type of simple characteristic. */ + type: AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type; +} + +/** Type of simple characteristic. */ +export enum AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type { + TYPE_UNSPECIFIED = 0, + /** REQUEST_PATH - HTTP Request path. */ + REQUEST_PATH = 1, + /** HTTP_METHOD - HTTP Method. */ + HTTP_METHOD = 2, + /** IP - IP address. */ + IP = 3, + /** GEO - Region. */ + GEO = 4, + /** HOST - Host. */ + HOST = 5, + UNRECOGNIZED = -1, +} + +export function advancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_TypeFromJSON( + object: any +): AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type { + switch (object) { + case 0: + case "TYPE_UNSPECIFIED": + return AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type.TYPE_UNSPECIFIED; + case 1: + case "REQUEST_PATH": + return AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type.REQUEST_PATH; + case 2: + case "HTTP_METHOD": + return AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type.HTTP_METHOD; + case 3: + case "IP": + return AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type.IP; + case 4: + case "GEO": + return AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type.GEO; + case 5: + case "HOST": + return AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type.HOST; + case -1: + case "UNRECOGNIZED": + default: + return AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type.UNRECOGNIZED; + } +} + +export function advancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_TypeToJSON( + object: AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type +): string { + switch (object) { + case AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type.TYPE_UNSPECIFIED: + return "TYPE_UNSPECIFIED"; + case AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type.REQUEST_PATH: + return "REQUEST_PATH"; + case AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type.HTTP_METHOD: + return "HTTP_METHOD"; + case AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type.IP: + return "IP"; + case AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type.GEO: + return "GEO"; + case AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_Type.HOST: + return "HOST"; + default: + return "UNKNOWN"; + } +} + +export interface AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.DynamicQuota.Characteristic.KeyCharacteristic"; + /** Type of key characteristic. */ + type: AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_Type; + /** String value of the key. */ + value: string; +} + +/** Type of key characteristic. */ +export enum AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_Type { + TYPE_UNSPECIFIED = 0, + /** COOKIE_KEY - HTTP cookie key. */ + COOKIE_KEY = 1, + /** HEADER_KEY - HTTP header key. */ + HEADER_KEY = 2, + /** QUERY_KEY - Query params key. */ + QUERY_KEY = 3, + UNRECOGNIZED = -1, +} + +export function advancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_TypeFromJSON( + object: any +): AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_Type { + switch (object) { + case 0: + case "TYPE_UNSPECIFIED": + return AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_Type.TYPE_UNSPECIFIED; + case 1: + case "COOKIE_KEY": + return AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_Type.COOKIE_KEY; + case 2: + case "HEADER_KEY": + return AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_Type.HEADER_KEY; + case 3: + case "QUERY_KEY": + return AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_Type.QUERY_KEY; + case -1: + case "UNRECOGNIZED": + default: + return AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_Type.UNRECOGNIZED; + } +} + +export function advancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_TypeToJSON( + object: AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_Type +): string { + switch (object) { + case AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_Type.TYPE_UNSPECIFIED: + return "TYPE_UNSPECIFIED"; + case AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_Type.COOKIE_KEY: + return "COOKIE_KEY"; + case AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_Type.HEADER_KEY: + return "HEADER_KEY"; + case AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_Type.QUERY_KEY: + return "QUERY_KEY"; + default: + return "UNKNOWN"; + } +} + +const baseAdvancedRateLimiterProfile: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterProfile", + id: "", + folderId: "", + name: "", + description: "", + cloudId: "", +}; + +export const AdvancedRateLimiterProfile = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterProfile" as const, + + encode( + message: AdvancedRateLimiterProfile, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + Object.entries(message.labels).forEach(([key, value]) => { + AdvancedRateLimiterProfile_LabelsEntry.encode( + { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterProfile.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(26).fork() + ).ldelim(); + }); + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + for (const v of message.advancedRateLimiterRules) { + AdvancedRateLimiterRule.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(58).fork() + ).ldelim(); + } + if (message.cloudId !== "") { + writer.uint32(74).string(message.cloudId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AdvancedRateLimiterProfile { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAdvancedRateLimiterProfile, + } as AdvancedRateLimiterProfile; + message.labels = {}; + message.advancedRateLimiterRules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + const entry3 = AdvancedRateLimiterProfile_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry3.value !== undefined) { + message.labels[entry3.key] = entry3.value; + } + break; + case 4: + message.name = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.advancedRateLimiterRules.push( + AdvancedRateLimiterRule.decode(reader, reader.uint32()) + ); + break; + case 7: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 9: + message.cloudId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AdvancedRateLimiterProfile { + const message = { + ...baseAdvancedRateLimiterProfile, + } as AdvancedRateLimiterProfile; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.advancedRateLimiterRules = ( + object.advancedRateLimiterRules ?? [] + ).map((e: any) => AdvancedRateLimiterRule.fromJSON(e)); + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.cloudId = + object.cloudId !== undefined && object.cloudId !== null + ? String(object.cloudId) + : ""; + return message; + }, + + toJSON(message: AdvancedRateLimiterProfile): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + if (message.advancedRateLimiterRules) { + obj.advancedRateLimiterRules = message.advancedRateLimiterRules.map((e) => + e ? AdvancedRateLimiterRule.toJSON(e) : undefined + ); + } else { + obj.advancedRateLimiterRules = []; + } + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.cloudId !== undefined && (obj.cloudId = message.cloudId); + return obj; + }, + + fromPartial, I>>( + object: I + ): AdvancedRateLimiterProfile { + const message = { + ...baseAdvancedRateLimiterProfile, + } as AdvancedRateLimiterProfile; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.advancedRateLimiterRules = + object.advancedRateLimiterRules?.map((e) => + AdvancedRateLimiterRule.fromPartial(e) + ) || []; + message.createdAt = object.createdAt ?? undefined; + message.cloudId = object.cloudId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + AdvancedRateLimiterProfile.$type, + AdvancedRateLimiterProfile +); + +const baseAdvancedRateLimiterProfile_LabelsEntry: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterProfile.LabelsEntry", + key: "", + value: "", +}; + +export const AdvancedRateLimiterProfile_LabelsEntry = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterProfile.LabelsEntry" as const, + + encode( + message: AdvancedRateLimiterProfile_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AdvancedRateLimiterProfile_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAdvancedRateLimiterProfile_LabelsEntry, + } as AdvancedRateLimiterProfile_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AdvancedRateLimiterProfile_LabelsEntry { + const message = { + ...baseAdvancedRateLimiterProfile_LabelsEntry, + } as AdvancedRateLimiterProfile_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: AdvancedRateLimiterProfile_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): AdvancedRateLimiterProfile_LabelsEntry { + const message = { + ...baseAdvancedRateLimiterProfile_LabelsEntry, + } as AdvancedRateLimiterProfile_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + AdvancedRateLimiterProfile_LabelsEntry.$type, + AdvancedRateLimiterProfile_LabelsEntry +); + +const baseAdvancedRateLimiterRule: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule", + name: "", + priority: 0, + description: "", + dryRun: false, +}; + +export const AdvancedRateLimiterRule = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule" as const, + + encode( + message: AdvancedRateLimiterRule, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.priority !== 0) { + writer.uint32(16).int64(message.priority); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.dryRun === true) { + writer.uint32(32).bool(message.dryRun); + } + if (message.staticQuota !== undefined) { + AdvancedRateLimiterRule_StaticQuota.encode( + message.staticQuota, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.dynamicQuota !== undefined) { + AdvancedRateLimiterRule_DynamicQuota.encode( + message.dynamicQuota, + writer.uint32(50).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AdvancedRateLimiterRule { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAdvancedRateLimiterRule, + } as AdvancedRateLimiterRule; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.priority = longToNumber(reader.int64() as Long); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.dryRun = reader.bool(); + break; + case 5: + message.staticQuota = AdvancedRateLimiterRule_StaticQuota.decode( + reader, + reader.uint32() + ); + break; + case 6: + message.dynamicQuota = AdvancedRateLimiterRule_DynamicQuota.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AdvancedRateLimiterRule { + const message = { + ...baseAdvancedRateLimiterRule, + } as AdvancedRateLimiterRule; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.priority = + object.priority !== undefined && object.priority !== null + ? Number(object.priority) + : 0; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.dryRun = + object.dryRun !== undefined && object.dryRun !== null + ? Boolean(object.dryRun) + : false; + message.staticQuota = + object.staticQuota !== undefined && object.staticQuota !== null + ? AdvancedRateLimiterRule_StaticQuota.fromJSON(object.staticQuota) + : undefined; + message.dynamicQuota = + object.dynamicQuota !== undefined && object.dynamicQuota !== null + ? AdvancedRateLimiterRule_DynamicQuota.fromJSON(object.dynamicQuota) + : undefined; + return message; + }, + + toJSON(message: AdvancedRateLimiterRule): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.priority !== undefined && + (obj.priority = Math.round(message.priority)); + message.description !== undefined && + (obj.description = message.description); + message.dryRun !== undefined && (obj.dryRun = message.dryRun); + message.staticQuota !== undefined && + (obj.staticQuota = message.staticQuota + ? AdvancedRateLimiterRule_StaticQuota.toJSON(message.staticQuota) + : undefined); + message.dynamicQuota !== undefined && + (obj.dynamicQuota = message.dynamicQuota + ? AdvancedRateLimiterRule_DynamicQuota.toJSON(message.dynamicQuota) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): AdvancedRateLimiterRule { + const message = { + ...baseAdvancedRateLimiterRule, + } as AdvancedRateLimiterRule; + message.name = object.name ?? ""; + message.priority = object.priority ?? 0; + message.description = object.description ?? ""; + message.dryRun = object.dryRun ?? false; + message.staticQuota = + object.staticQuota !== undefined && object.staticQuota !== null + ? AdvancedRateLimiterRule_StaticQuota.fromPartial(object.staticQuota) + : undefined; + message.dynamicQuota = + object.dynamicQuota !== undefined && object.dynamicQuota !== null + ? AdvancedRateLimiterRule_DynamicQuota.fromPartial(object.dynamicQuota) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(AdvancedRateLimiterRule.$type, AdvancedRateLimiterRule); + +const baseAdvancedRateLimiterRule_StaticQuota: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.StaticQuota", + action: 0, + limit: 0, + period: 0, +}; + +export const AdvancedRateLimiterRule_StaticQuota = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.StaticQuota" as const, + + encode( + message: AdvancedRateLimiterRule_StaticQuota, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.action !== 0) { + writer.uint32(8).int32(message.action); + } + if (message.condition !== undefined) { + Condition.encode(message.condition, writer.uint32(18).fork()).ldelim(); + } + if (message.limit !== 0) { + writer.uint32(24).int64(message.limit); + } + if (message.period !== 0) { + writer.uint32(32).int64(message.period); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AdvancedRateLimiterRule_StaticQuota { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAdvancedRateLimiterRule_StaticQuota, + } as AdvancedRateLimiterRule_StaticQuota; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32() as any; + break; + case 2: + message.condition = Condition.decode(reader, reader.uint32()); + break; + case 3: + message.limit = longToNumber(reader.int64() as Long); + break; + case 4: + message.period = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AdvancedRateLimiterRule_StaticQuota { + const message = { + ...baseAdvancedRateLimiterRule_StaticQuota, + } as AdvancedRateLimiterRule_StaticQuota; + message.action = + object.action !== undefined && object.action !== null + ? advancedRateLimiterRule_ActionFromJSON(object.action) + : 0; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromJSON(object.condition) + : undefined; + message.limit = + object.limit !== undefined && object.limit !== null + ? Number(object.limit) + : 0; + message.period = + object.period !== undefined && object.period !== null + ? Number(object.period) + : 0; + return message; + }, + + toJSON(message: AdvancedRateLimiterRule_StaticQuota): unknown { + const obj: any = {}; + message.action !== undefined && + (obj.action = advancedRateLimiterRule_ActionToJSON(message.action)); + message.condition !== undefined && + (obj.condition = message.condition + ? Condition.toJSON(message.condition) + : undefined); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + message.period !== undefined && (obj.period = Math.round(message.period)); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): AdvancedRateLimiterRule_StaticQuota { + const message = { + ...baseAdvancedRateLimiterRule_StaticQuota, + } as AdvancedRateLimiterRule_StaticQuota; + message.action = object.action ?? 0; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromPartial(object.condition) + : undefined; + message.limit = object.limit ?? 0; + message.period = object.period ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + AdvancedRateLimiterRule_StaticQuota.$type, + AdvancedRateLimiterRule_StaticQuota +); + +const baseAdvancedRateLimiterRule_DynamicQuota: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.DynamicQuota", + action: 0, + limit: 0, + period: 0, +}; + +export const AdvancedRateLimiterRule_DynamicQuota = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.DynamicQuota" as const, + + encode( + message: AdvancedRateLimiterRule_DynamicQuota, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.action !== 0) { + writer.uint32(8).int32(message.action); + } + if (message.condition !== undefined) { + Condition.encode(message.condition, writer.uint32(18).fork()).ldelim(); + } + if (message.limit !== 0) { + writer.uint32(24).int64(message.limit); + } + if (message.period !== 0) { + writer.uint32(32).int64(message.period); + } + for (const v of message.characteristics) { + AdvancedRateLimiterRule_DynamicQuota_Characteristic.encode( + v!, + writer.uint32(42).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AdvancedRateLimiterRule_DynamicQuota { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAdvancedRateLimiterRule_DynamicQuota, + } as AdvancedRateLimiterRule_DynamicQuota; + message.characteristics = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32() as any; + break; + case 2: + message.condition = Condition.decode(reader, reader.uint32()); + break; + case 3: + message.limit = longToNumber(reader.int64() as Long); + break; + case 4: + message.period = longToNumber(reader.int64() as Long); + break; + case 5: + message.characteristics.push( + AdvancedRateLimiterRule_DynamicQuota_Characteristic.decode( + reader, + reader.uint32() + ) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AdvancedRateLimiterRule_DynamicQuota { + const message = { + ...baseAdvancedRateLimiterRule_DynamicQuota, + } as AdvancedRateLimiterRule_DynamicQuota; + message.action = + object.action !== undefined && object.action !== null + ? advancedRateLimiterRule_ActionFromJSON(object.action) + : 0; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromJSON(object.condition) + : undefined; + message.limit = + object.limit !== undefined && object.limit !== null + ? Number(object.limit) + : 0; + message.period = + object.period !== undefined && object.period !== null + ? Number(object.period) + : 0; + message.characteristics = (object.characteristics ?? []).map((e: any) => + AdvancedRateLimiterRule_DynamicQuota_Characteristic.fromJSON(e) + ); + return message; + }, + + toJSON(message: AdvancedRateLimiterRule_DynamicQuota): unknown { + const obj: any = {}; + message.action !== undefined && + (obj.action = advancedRateLimiterRule_ActionToJSON(message.action)); + message.condition !== undefined && + (obj.condition = message.condition + ? Condition.toJSON(message.condition) + : undefined); + message.limit !== undefined && (obj.limit = Math.round(message.limit)); + message.period !== undefined && (obj.period = Math.round(message.period)); + if (message.characteristics) { + obj.characteristics = message.characteristics.map((e) => + e + ? AdvancedRateLimiterRule_DynamicQuota_Characteristic.toJSON(e) + : undefined + ); + } else { + obj.characteristics = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): AdvancedRateLimiterRule_DynamicQuota { + const message = { + ...baseAdvancedRateLimiterRule_DynamicQuota, + } as AdvancedRateLimiterRule_DynamicQuota; + message.action = object.action ?? 0; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromPartial(object.condition) + : undefined; + message.limit = object.limit ?? 0; + message.period = object.period ?? 0; + message.characteristics = + object.characteristics?.map((e) => + AdvancedRateLimiterRule_DynamicQuota_Characteristic.fromPartial(e) + ) || []; + return message; + }, +}; + +messageTypeRegistry.set( + AdvancedRateLimiterRule_DynamicQuota.$type, + AdvancedRateLimiterRule_DynamicQuota +); + +const baseAdvancedRateLimiterRule_DynamicQuota_Characteristic: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.DynamicQuota.Characteristic", + caseInsensitive: false, +}; + +export const AdvancedRateLimiterRule_DynamicQuota_Characteristic = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.DynamicQuota.Characteristic" as const, + + encode( + message: AdvancedRateLimiterRule_DynamicQuota_Characteristic, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.simpleCharacteristic !== undefined) { + AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic.encode( + message.simpleCharacteristic, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.keyCharacteristic !== undefined) { + AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic.encode( + message.keyCharacteristic, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.caseInsensitive === true) { + writer.uint32(80).bool(message.caseInsensitive); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AdvancedRateLimiterRule_DynamicQuota_Characteristic { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAdvancedRateLimiterRule_DynamicQuota_Characteristic, + } as AdvancedRateLimiterRule_DynamicQuota_Characteristic; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.simpleCharacteristic = + AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.keyCharacteristic = + AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic.decode( + reader, + reader.uint32() + ); + break; + case 10: + message.caseInsensitive = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AdvancedRateLimiterRule_DynamicQuota_Characteristic { + const message = { + ...baseAdvancedRateLimiterRule_DynamicQuota_Characteristic, + } as AdvancedRateLimiterRule_DynamicQuota_Characteristic; + message.simpleCharacteristic = + object.simpleCharacteristic !== undefined && + object.simpleCharacteristic !== null + ? AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic.fromJSON( + object.simpleCharacteristic + ) + : undefined; + message.keyCharacteristic = + object.keyCharacteristic !== undefined && + object.keyCharacteristic !== null + ? AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic.fromJSON( + object.keyCharacteristic + ) + : undefined; + message.caseInsensitive = + object.caseInsensitive !== undefined && object.caseInsensitive !== null + ? Boolean(object.caseInsensitive) + : false; + return message; + }, + + toJSON( + message: AdvancedRateLimiterRule_DynamicQuota_Characteristic + ): unknown { + const obj: any = {}; + message.simpleCharacteristic !== undefined && + (obj.simpleCharacteristic = message.simpleCharacteristic + ? AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic.toJSON( + message.simpleCharacteristic + ) + : undefined); + message.keyCharacteristic !== undefined && + (obj.keyCharacteristic = message.keyCharacteristic + ? AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic.toJSON( + message.keyCharacteristic + ) + : undefined); + message.caseInsensitive !== undefined && + (obj.caseInsensitive = message.caseInsensitive); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): AdvancedRateLimiterRule_DynamicQuota_Characteristic { + const message = { + ...baseAdvancedRateLimiterRule_DynamicQuota_Characteristic, + } as AdvancedRateLimiterRule_DynamicQuota_Characteristic; + message.simpleCharacteristic = + object.simpleCharacteristic !== undefined && + object.simpleCharacteristic !== null + ? AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic.fromPartial( + object.simpleCharacteristic + ) + : undefined; + message.keyCharacteristic = + object.keyCharacteristic !== undefined && + object.keyCharacteristic !== null + ? AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic.fromPartial( + object.keyCharacteristic + ) + : undefined; + message.caseInsensitive = object.caseInsensitive ?? false; + return message; + }, +}; + +messageTypeRegistry.set( + AdvancedRateLimiterRule_DynamicQuota_Characteristic.$type, + AdvancedRateLimiterRule_DynamicQuota_Characteristic +); + +const baseAdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic: object = + { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.DynamicQuota.Characteristic.SimpleCharacteristic", + type: 0, + }; + +export const AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic = + { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.DynamicQuota.Characteristic.SimpleCharacteristic" as const, + + encode( + message: AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic { + const reader = + input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic, + } as AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON( + object: any + ): AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic { + const message = { + ...baseAdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic, + } as AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic; + message.type = + object.type !== undefined && object.type !== null + ? advancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_TypeFromJSON( + object.type + ) + : 0; + return message; + }, + + toJSON( + message: AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic + ): unknown { + const obj: any = {}; + message.type !== undefined && + (obj.type = + advancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic_TypeToJSON( + message.type + )); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >( + object: I + ): AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic { + const message = { + ...baseAdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic, + } as AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic; + message.type = object.type ?? 0; + return message; + }, + }; + +messageTypeRegistry.set( + AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic.$type, + AdvancedRateLimiterRule_DynamicQuota_Characteristic_SimpleCharacteristic +); + +const baseAdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic: object = + { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.DynamicQuota.Characteristic.KeyCharacteristic", + type: 0, + value: "", + }; + +export const AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic = + { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterRule.DynamicQuota.Characteristic.KeyCharacteristic" as const, + + encode( + message: AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic { + const reader = + input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseAdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic, + } as AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON( + object: any + ): AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic { + const message = { + ...baseAdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic, + } as AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic; + message.type = + object.type !== undefined && object.type !== null + ? advancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_TypeFromJSON( + object.type + ) + : 0; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON( + message: AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic + ): unknown { + const obj: any = {}; + message.type !== undefined && + (obj.type = + advancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic_TypeToJSON( + message.type + )); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >( + object: I + ): AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic { + const message = { + ...baseAdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic, + } as AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic; + message.type = object.type ?? 0; + message.value = object.value ?? ""; + return message; + }, + }; + +messageTypeRegistry.set( + AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic.$type, + AdvancedRateLimiterRule_DynamicQuota_Characteristic_KeyCharacteristic +); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/smartwebsecurity/v1/advanced_rate_limiter/advanced_rate_limiter_profile_service.ts b/src/generated/yandex/cloud/smartwebsecurity/v1/advanced_rate_limiter/advanced_rate_limiter_profile_service.ts new file mode 100644 index 00000000..a736cb1b --- /dev/null +++ b/src/generated/yandex/cloud/smartwebsecurity/v1/advanced_rate_limiter/advanced_rate_limiter_profile_service.ts @@ -0,0 +1,1460 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; +import { + AdvancedRateLimiterProfile, + AdvancedRateLimiterRule, +} from "../../../../../yandex/cloud/smartwebsecurity/v1/advanced_rate_limiter/advanced_rate_limiter_profile"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter"; + +export interface GetAdvancedRateLimiterProfileRequest { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.GetAdvancedRateLimiterProfileRequest"; + /** ID of the AdvancedRateLimiterProfile resource to return. */ + advancedRateLimiterProfileId: string; +} + +export interface ListAdvancedRateLimiterProfilesRequest { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.ListAdvancedRateLimiterProfilesRequest"; + /** + * ID of the folder that the ARL profile belongs to. + * Currently page_size, page_token, filter and order_by are not supported and List method will return all ARL profiles in the folder. + */ + folderId: string; +} + +export interface ListAdvancedRateLimiterProfilesResponse { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.ListAdvancedRateLimiterProfilesResponse"; + /** + * List of AdvancedRateLimiterProfile resources. + * Currently next_page_token is not supported and List method will return all ARL profiles in the folder. + */ + advancedRateLimiterProfiles: AdvancedRateLimiterProfile[]; +} + +export interface CreateAdvancedRateLimiterProfileRequest { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.CreateAdvancedRateLimiterProfileRequest"; + /** ID of the folder to create a ARL profile in. */ + folderId: string; + /** Labels as `` key:value `` pairs. Maximum of 64 per resource. */ + labels: { [key: string]: string }; + /** Name of the ARL profile. The name is unique within the folder. 1-50 characters long. */ + name: string; + /** Optional description of the ARL profile. */ + description: string; + /** List of rules. */ + advancedRateLimiterRules: AdvancedRateLimiterRule[]; +} + +export interface CreateAdvancedRateLimiterProfileRequest_LabelsEntry { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.CreateAdvancedRateLimiterProfileRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface CreateAdvancedRateLimiterProfileMetadata { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.CreateAdvancedRateLimiterProfileMetadata"; + /** ID of the ARL profile that is being created. */ + advancedRateLimiterProfileId: string; +} + +export interface UpdateAdvancedRateLimiterProfileRequest { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.UpdateAdvancedRateLimiterProfileRequest"; + /** ID of the ARL profile to update. */ + advancedRateLimiterProfileId: string; + /** Field mask that specifies which fields of the AdvancedRateLimiterProfile resource are going to be updated. */ + updateMask?: FieldMask; + /** Labels as `` key:value `` pairs. Maximum of 64 per resource. */ + labels: { [key: string]: string }; + /** Name of the ARL profile. The name is unique within the folder. 1-50 characters long. */ + name: string; + /** Optional description of the ARL profile. */ + description: string; + /** List of rules. */ + advancedRateLimiterRules: AdvancedRateLimiterRule[]; +} + +export interface UpdateAdvancedRateLimiterProfileRequest_LabelsEntry { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.UpdateAdvancedRateLimiterProfileRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateAdvancedRateLimiterProfileMetadata { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.UpdateAdvancedRateLimiterProfileMetadata"; + /** ID of the AdvancedRateLimiterProfile resource that is being updated. */ + advancedRateLimiterProfileId: string; +} + +export interface DeleteAdvancedRateLimiterProfileRequest { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.DeleteAdvancedRateLimiterProfileRequest"; + /** ID of the ARL profile to delete. */ + advancedRateLimiterProfileId: string; +} + +export interface DeleteAdvancedRateLimiterProfileMetadata { + $type: "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.DeleteAdvancedRateLimiterProfileMetadata"; + /** ID of the AdvancedRateLimiterProfile resource that is being deleted. */ + advancedRateLimiterProfileId: string; +} + +const baseGetAdvancedRateLimiterProfileRequest: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.GetAdvancedRateLimiterProfileRequest", + advancedRateLimiterProfileId: "", +}; + +export const GetAdvancedRateLimiterProfileRequest = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.GetAdvancedRateLimiterProfileRequest" as const, + + encode( + message: GetAdvancedRateLimiterProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.advancedRateLimiterProfileId !== "") { + writer.uint32(10).string(message.advancedRateLimiterProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetAdvancedRateLimiterProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetAdvancedRateLimiterProfileRequest, + } as GetAdvancedRateLimiterProfileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.advancedRateLimiterProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetAdvancedRateLimiterProfileRequest { + const message = { + ...baseGetAdvancedRateLimiterProfileRequest, + } as GetAdvancedRateLimiterProfileRequest; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId !== undefined && + object.advancedRateLimiterProfileId !== null + ? String(object.advancedRateLimiterProfileId) + : ""; + return message; + }, + + toJSON(message: GetAdvancedRateLimiterProfileRequest): unknown { + const obj: any = {}; + message.advancedRateLimiterProfileId !== undefined && + (obj.advancedRateLimiterProfileId = message.advancedRateLimiterProfileId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): GetAdvancedRateLimiterProfileRequest { + const message = { + ...baseGetAdvancedRateLimiterProfileRequest, + } as GetAdvancedRateLimiterProfileRequest; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetAdvancedRateLimiterProfileRequest.$type, + GetAdvancedRateLimiterProfileRequest +); + +const baseListAdvancedRateLimiterProfilesRequest: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.ListAdvancedRateLimiterProfilesRequest", + folderId: "", +}; + +export const ListAdvancedRateLimiterProfilesRequest = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.ListAdvancedRateLimiterProfilesRequest" as const, + + encode( + message: ListAdvancedRateLimiterProfilesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListAdvancedRateLimiterProfilesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListAdvancedRateLimiterProfilesRequest, + } as ListAdvancedRateLimiterProfilesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListAdvancedRateLimiterProfilesRequest { + const message = { + ...baseListAdvancedRateLimiterProfilesRequest, + } as ListAdvancedRateLimiterProfilesRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + return message; + }, + + toJSON(message: ListAdvancedRateLimiterProfilesRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): ListAdvancedRateLimiterProfilesRequest { + const message = { + ...baseListAdvancedRateLimiterProfilesRequest, + } as ListAdvancedRateLimiterProfilesRequest; + message.folderId = object.folderId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListAdvancedRateLimiterProfilesRequest.$type, + ListAdvancedRateLimiterProfilesRequest +); + +const baseListAdvancedRateLimiterProfilesResponse: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.ListAdvancedRateLimiterProfilesResponse", +}; + +export const ListAdvancedRateLimiterProfilesResponse = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.ListAdvancedRateLimiterProfilesResponse" as const, + + encode( + message: ListAdvancedRateLimiterProfilesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.advancedRateLimiterProfiles) { + AdvancedRateLimiterProfile.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListAdvancedRateLimiterProfilesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListAdvancedRateLimiterProfilesResponse, + } as ListAdvancedRateLimiterProfilesResponse; + message.advancedRateLimiterProfiles = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.advancedRateLimiterProfiles.push( + AdvancedRateLimiterProfile.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListAdvancedRateLimiterProfilesResponse { + const message = { + ...baseListAdvancedRateLimiterProfilesResponse, + } as ListAdvancedRateLimiterProfilesResponse; + message.advancedRateLimiterProfiles = ( + object.advancedRateLimiterProfiles ?? [] + ).map((e: any) => AdvancedRateLimiterProfile.fromJSON(e)); + return message; + }, + + toJSON(message: ListAdvancedRateLimiterProfilesResponse): unknown { + const obj: any = {}; + if (message.advancedRateLimiterProfiles) { + obj.advancedRateLimiterProfiles = message.advancedRateLimiterProfiles.map( + (e) => (e ? AdvancedRateLimiterProfile.toJSON(e) : undefined) + ); + } else { + obj.advancedRateLimiterProfiles = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): ListAdvancedRateLimiterProfilesResponse { + const message = { + ...baseListAdvancedRateLimiterProfilesResponse, + } as ListAdvancedRateLimiterProfilesResponse; + message.advancedRateLimiterProfiles = + object.advancedRateLimiterProfiles?.map((e) => + AdvancedRateLimiterProfile.fromPartial(e) + ) || []; + return message; + }, +}; + +messageTypeRegistry.set( + ListAdvancedRateLimiterProfilesResponse.$type, + ListAdvancedRateLimiterProfilesResponse +); + +const baseCreateAdvancedRateLimiterProfileRequest: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.CreateAdvancedRateLimiterProfileRequest", + folderId: "", + name: "", + description: "", +}; + +export const CreateAdvancedRateLimiterProfileRequest = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.CreateAdvancedRateLimiterProfileRequest" as const, + + encode( + message: CreateAdvancedRateLimiterProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateAdvancedRateLimiterProfileRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.CreateAdvancedRateLimiterProfileRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(18).fork() + ).ldelim(); + }); + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + for (const v of message.advancedRateLimiterRules) { + AdvancedRateLimiterRule.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateAdvancedRateLimiterProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateAdvancedRateLimiterProfileRequest, + } as CreateAdvancedRateLimiterProfileRequest; + message.labels = {}; + message.advancedRateLimiterRules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + const entry2 = + CreateAdvancedRateLimiterProfileRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry2.value !== undefined) { + message.labels[entry2.key] = entry2.value; + } + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.advancedRateLimiterRules.push( + AdvancedRateLimiterRule.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateAdvancedRateLimiterProfileRequest { + const message = { + ...baseCreateAdvancedRateLimiterProfileRequest, + } as CreateAdvancedRateLimiterProfileRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.advancedRateLimiterRules = ( + object.advancedRateLimiterRules ?? [] + ).map((e: any) => AdvancedRateLimiterRule.fromJSON(e)); + return message; + }, + + toJSON(message: CreateAdvancedRateLimiterProfileRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + if (message.advancedRateLimiterRules) { + obj.advancedRateLimiterRules = message.advancedRateLimiterRules.map((e) => + e ? AdvancedRateLimiterRule.toJSON(e) : undefined + ); + } else { + obj.advancedRateLimiterRules = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateAdvancedRateLimiterProfileRequest { + const message = { + ...baseCreateAdvancedRateLimiterProfileRequest, + } as CreateAdvancedRateLimiterProfileRequest; + message.folderId = object.folderId ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.advancedRateLimiterRules = + object.advancedRateLimiterRules?.map((e) => + AdvancedRateLimiterRule.fromPartial(e) + ) || []; + return message; + }, +}; + +messageTypeRegistry.set( + CreateAdvancedRateLimiterProfileRequest.$type, + CreateAdvancedRateLimiterProfileRequest +); + +const baseCreateAdvancedRateLimiterProfileRequest_LabelsEntry: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.CreateAdvancedRateLimiterProfileRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateAdvancedRateLimiterProfileRequest_LabelsEntry = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.CreateAdvancedRateLimiterProfileRequest.LabelsEntry" as const, + + encode( + message: CreateAdvancedRateLimiterProfileRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateAdvancedRateLimiterProfileRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateAdvancedRateLimiterProfileRequest_LabelsEntry, + } as CreateAdvancedRateLimiterProfileRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateAdvancedRateLimiterProfileRequest_LabelsEntry { + const message = { + ...baseCreateAdvancedRateLimiterProfileRequest_LabelsEntry, + } as CreateAdvancedRateLimiterProfileRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON( + message: CreateAdvancedRateLimiterProfileRequest_LabelsEntry + ): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): CreateAdvancedRateLimiterProfileRequest_LabelsEntry { + const message = { + ...baseCreateAdvancedRateLimiterProfileRequest_LabelsEntry, + } as CreateAdvancedRateLimiterProfileRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateAdvancedRateLimiterProfileRequest_LabelsEntry.$type, + CreateAdvancedRateLimiterProfileRequest_LabelsEntry +); + +const baseCreateAdvancedRateLimiterProfileMetadata: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.CreateAdvancedRateLimiterProfileMetadata", + advancedRateLimiterProfileId: "", +}; + +export const CreateAdvancedRateLimiterProfileMetadata = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.CreateAdvancedRateLimiterProfileMetadata" as const, + + encode( + message: CreateAdvancedRateLimiterProfileMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.advancedRateLimiterProfileId !== "") { + writer.uint32(10).string(message.advancedRateLimiterProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateAdvancedRateLimiterProfileMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateAdvancedRateLimiterProfileMetadata, + } as CreateAdvancedRateLimiterProfileMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.advancedRateLimiterProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateAdvancedRateLimiterProfileMetadata { + const message = { + ...baseCreateAdvancedRateLimiterProfileMetadata, + } as CreateAdvancedRateLimiterProfileMetadata; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId !== undefined && + object.advancedRateLimiterProfileId !== null + ? String(object.advancedRateLimiterProfileId) + : ""; + return message; + }, + + toJSON(message: CreateAdvancedRateLimiterProfileMetadata): unknown { + const obj: any = {}; + message.advancedRateLimiterProfileId !== undefined && + (obj.advancedRateLimiterProfileId = message.advancedRateLimiterProfileId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateAdvancedRateLimiterProfileMetadata { + const message = { + ...baseCreateAdvancedRateLimiterProfileMetadata, + } as CreateAdvancedRateLimiterProfileMetadata; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateAdvancedRateLimiterProfileMetadata.$type, + CreateAdvancedRateLimiterProfileMetadata +); + +const baseUpdateAdvancedRateLimiterProfileRequest: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.UpdateAdvancedRateLimiterProfileRequest", + advancedRateLimiterProfileId: "", + name: "", + description: "", +}; + +export const UpdateAdvancedRateLimiterProfileRequest = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.UpdateAdvancedRateLimiterProfileRequest" as const, + + encode( + message: UpdateAdvancedRateLimiterProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.advancedRateLimiterProfileId !== "") { + writer.uint32(10).string(message.advancedRateLimiterProfileId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateAdvancedRateLimiterProfileRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.UpdateAdvancedRateLimiterProfileRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(26).fork() + ).ldelim(); + }); + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + for (const v of message.advancedRateLimiterRules) { + AdvancedRateLimiterRule.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateAdvancedRateLimiterProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateAdvancedRateLimiterProfileRequest, + } as UpdateAdvancedRateLimiterProfileRequest; + message.labels = {}; + message.advancedRateLimiterRules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.advancedRateLimiterProfileId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + const entry3 = + UpdateAdvancedRateLimiterProfileRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry3.value !== undefined) { + message.labels[entry3.key] = entry3.value; + } + break; + case 4: + message.name = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.advancedRateLimiterRules.push( + AdvancedRateLimiterRule.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateAdvancedRateLimiterProfileRequest { + const message = { + ...baseUpdateAdvancedRateLimiterProfileRequest, + } as UpdateAdvancedRateLimiterProfileRequest; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId !== undefined && + object.advancedRateLimiterProfileId !== null + ? String(object.advancedRateLimiterProfileId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.advancedRateLimiterRules = ( + object.advancedRateLimiterRules ?? [] + ).map((e: any) => AdvancedRateLimiterRule.fromJSON(e)); + return message; + }, + + toJSON(message: UpdateAdvancedRateLimiterProfileRequest): unknown { + const obj: any = {}; + message.advancedRateLimiterProfileId !== undefined && + (obj.advancedRateLimiterProfileId = message.advancedRateLimiterProfileId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + if (message.advancedRateLimiterRules) { + obj.advancedRateLimiterRules = message.advancedRateLimiterRules.map((e) => + e ? AdvancedRateLimiterRule.toJSON(e) : undefined + ); + } else { + obj.advancedRateLimiterRules = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateAdvancedRateLimiterProfileRequest { + const message = { + ...baseUpdateAdvancedRateLimiterProfileRequest, + } as UpdateAdvancedRateLimiterProfileRequest; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.advancedRateLimiterRules = + object.advancedRateLimiterRules?.map((e) => + AdvancedRateLimiterRule.fromPartial(e) + ) || []; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateAdvancedRateLimiterProfileRequest.$type, + UpdateAdvancedRateLimiterProfileRequest +); + +const baseUpdateAdvancedRateLimiterProfileRequest_LabelsEntry: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.UpdateAdvancedRateLimiterProfileRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateAdvancedRateLimiterProfileRequest_LabelsEntry = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.UpdateAdvancedRateLimiterProfileRequest.LabelsEntry" as const, + + encode( + message: UpdateAdvancedRateLimiterProfileRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateAdvancedRateLimiterProfileRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateAdvancedRateLimiterProfileRequest_LabelsEntry, + } as UpdateAdvancedRateLimiterProfileRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateAdvancedRateLimiterProfileRequest_LabelsEntry { + const message = { + ...baseUpdateAdvancedRateLimiterProfileRequest_LabelsEntry, + } as UpdateAdvancedRateLimiterProfileRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON( + message: UpdateAdvancedRateLimiterProfileRequest_LabelsEntry + ): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact< + DeepPartial, + I + > + >(object: I): UpdateAdvancedRateLimiterProfileRequest_LabelsEntry { + const message = { + ...baseUpdateAdvancedRateLimiterProfileRequest_LabelsEntry, + } as UpdateAdvancedRateLimiterProfileRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateAdvancedRateLimiterProfileRequest_LabelsEntry.$type, + UpdateAdvancedRateLimiterProfileRequest_LabelsEntry +); + +const baseUpdateAdvancedRateLimiterProfileMetadata: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.UpdateAdvancedRateLimiterProfileMetadata", + advancedRateLimiterProfileId: "", +}; + +export const UpdateAdvancedRateLimiterProfileMetadata = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.UpdateAdvancedRateLimiterProfileMetadata" as const, + + encode( + message: UpdateAdvancedRateLimiterProfileMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.advancedRateLimiterProfileId !== "") { + writer.uint32(10).string(message.advancedRateLimiterProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateAdvancedRateLimiterProfileMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateAdvancedRateLimiterProfileMetadata, + } as UpdateAdvancedRateLimiterProfileMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.advancedRateLimiterProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateAdvancedRateLimiterProfileMetadata { + const message = { + ...baseUpdateAdvancedRateLimiterProfileMetadata, + } as UpdateAdvancedRateLimiterProfileMetadata; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId !== undefined && + object.advancedRateLimiterProfileId !== null + ? String(object.advancedRateLimiterProfileId) + : ""; + return message; + }, + + toJSON(message: UpdateAdvancedRateLimiterProfileMetadata): unknown { + const obj: any = {}; + message.advancedRateLimiterProfileId !== undefined && + (obj.advancedRateLimiterProfileId = message.advancedRateLimiterProfileId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateAdvancedRateLimiterProfileMetadata { + const message = { + ...baseUpdateAdvancedRateLimiterProfileMetadata, + } as UpdateAdvancedRateLimiterProfileMetadata; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateAdvancedRateLimiterProfileMetadata.$type, + UpdateAdvancedRateLimiterProfileMetadata +); + +const baseDeleteAdvancedRateLimiterProfileRequest: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.DeleteAdvancedRateLimiterProfileRequest", + advancedRateLimiterProfileId: "", +}; + +export const DeleteAdvancedRateLimiterProfileRequest = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.DeleteAdvancedRateLimiterProfileRequest" as const, + + encode( + message: DeleteAdvancedRateLimiterProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.advancedRateLimiterProfileId !== "") { + writer.uint32(10).string(message.advancedRateLimiterProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteAdvancedRateLimiterProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteAdvancedRateLimiterProfileRequest, + } as DeleteAdvancedRateLimiterProfileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.advancedRateLimiterProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteAdvancedRateLimiterProfileRequest { + const message = { + ...baseDeleteAdvancedRateLimiterProfileRequest, + } as DeleteAdvancedRateLimiterProfileRequest; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId !== undefined && + object.advancedRateLimiterProfileId !== null + ? String(object.advancedRateLimiterProfileId) + : ""; + return message; + }, + + toJSON(message: DeleteAdvancedRateLimiterProfileRequest): unknown { + const obj: any = {}; + message.advancedRateLimiterProfileId !== undefined && + (obj.advancedRateLimiterProfileId = message.advancedRateLimiterProfileId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): DeleteAdvancedRateLimiterProfileRequest { + const message = { + ...baseDeleteAdvancedRateLimiterProfileRequest, + } as DeleteAdvancedRateLimiterProfileRequest; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteAdvancedRateLimiterProfileRequest.$type, + DeleteAdvancedRateLimiterProfileRequest +); + +const baseDeleteAdvancedRateLimiterProfileMetadata: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.DeleteAdvancedRateLimiterProfileMetadata", + advancedRateLimiterProfileId: "", +}; + +export const DeleteAdvancedRateLimiterProfileMetadata = { + $type: + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.DeleteAdvancedRateLimiterProfileMetadata" as const, + + encode( + message: DeleteAdvancedRateLimiterProfileMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.advancedRateLimiterProfileId !== "") { + writer.uint32(10).string(message.advancedRateLimiterProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteAdvancedRateLimiterProfileMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteAdvancedRateLimiterProfileMetadata, + } as DeleteAdvancedRateLimiterProfileMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.advancedRateLimiterProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteAdvancedRateLimiterProfileMetadata { + const message = { + ...baseDeleteAdvancedRateLimiterProfileMetadata, + } as DeleteAdvancedRateLimiterProfileMetadata; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId !== undefined && + object.advancedRateLimiterProfileId !== null + ? String(object.advancedRateLimiterProfileId) + : ""; + return message; + }, + + toJSON(message: DeleteAdvancedRateLimiterProfileMetadata): unknown { + const obj: any = {}; + message.advancedRateLimiterProfileId !== undefined && + (obj.advancedRateLimiterProfileId = message.advancedRateLimiterProfileId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): DeleteAdvancedRateLimiterProfileMetadata { + const message = { + ...baseDeleteAdvancedRateLimiterProfileMetadata, + } as DeleteAdvancedRateLimiterProfileMetadata; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteAdvancedRateLimiterProfileMetadata.$type, + DeleteAdvancedRateLimiterProfileMetadata +); + +/** A set of methods for managing AdvancedRateLimiterProfile resources. */ +export const AdvancedRateLimiterProfileServiceService = { + /** Returns the specified AdvancedRateLimiterProfile resource. */ + get: { + path: "/yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterProfileService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetAdvancedRateLimiterProfileRequest) => + Buffer.from(GetAdvancedRateLimiterProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetAdvancedRateLimiterProfileRequest.decode(value), + responseSerialize: (value: AdvancedRateLimiterProfile) => + Buffer.from(AdvancedRateLimiterProfile.encode(value).finish()), + responseDeserialize: (value: Buffer) => + AdvancedRateLimiterProfile.decode(value), + }, + /** Retrieves the list of AdvancedRateLimiterProfile resources in the specified folder. */ + list: { + path: "/yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterProfileService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListAdvancedRateLimiterProfilesRequest) => + Buffer.from( + ListAdvancedRateLimiterProfilesRequest.encode(value).finish() + ), + requestDeserialize: (value: Buffer) => + ListAdvancedRateLimiterProfilesRequest.decode(value), + responseSerialize: (value: ListAdvancedRateLimiterProfilesResponse) => + Buffer.from( + ListAdvancedRateLimiterProfilesResponse.encode(value).finish() + ), + responseDeserialize: (value: Buffer) => + ListAdvancedRateLimiterProfilesResponse.decode(value), + }, + /** Creates a ARL profile in the specified folder using the data specified in the request. */ + create: { + path: "/yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterProfileService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateAdvancedRateLimiterProfileRequest) => + Buffer.from( + CreateAdvancedRateLimiterProfileRequest.encode(value).finish() + ), + requestDeserialize: (value: Buffer) => + CreateAdvancedRateLimiterProfileRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates the specified ARL profile. */ + update: { + path: "/yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterProfileService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateAdvancedRateLimiterProfileRequest) => + Buffer.from( + UpdateAdvancedRateLimiterProfileRequest.encode(value).finish() + ), + requestDeserialize: (value: Buffer) => + UpdateAdvancedRateLimiterProfileRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes the specified ARL profile. */ + delete: { + path: "/yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterProfileService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteAdvancedRateLimiterProfileRequest) => + Buffer.from( + DeleteAdvancedRateLimiterProfileRequest.encode(value).finish() + ), + requestDeserialize: (value: Buffer) => + DeleteAdvancedRateLimiterProfileRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface AdvancedRateLimiterProfileServiceServer + extends UntypedServiceImplementation { + /** Returns the specified AdvancedRateLimiterProfile resource. */ + get: handleUnaryCall< + GetAdvancedRateLimiterProfileRequest, + AdvancedRateLimiterProfile + >; + /** Retrieves the list of AdvancedRateLimiterProfile resources in the specified folder. */ + list: handleUnaryCall< + ListAdvancedRateLimiterProfilesRequest, + ListAdvancedRateLimiterProfilesResponse + >; + /** Creates a ARL profile in the specified folder using the data specified in the request. */ + create: handleUnaryCall; + /** Updates the specified ARL profile. */ + update: handleUnaryCall; + /** Deletes the specified ARL profile. */ + delete: handleUnaryCall; +} + +export interface AdvancedRateLimiterProfileServiceClient extends Client { + /** Returns the specified AdvancedRateLimiterProfile resource. */ + get( + request: GetAdvancedRateLimiterProfileRequest, + callback: ( + error: ServiceError | null, + response: AdvancedRateLimiterProfile + ) => void + ): ClientUnaryCall; + get( + request: GetAdvancedRateLimiterProfileRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: AdvancedRateLimiterProfile + ) => void + ): ClientUnaryCall; + get( + request: GetAdvancedRateLimiterProfileRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: AdvancedRateLimiterProfile + ) => void + ): ClientUnaryCall; + /** Retrieves the list of AdvancedRateLimiterProfile resources in the specified folder. */ + list( + request: ListAdvancedRateLimiterProfilesRequest, + callback: ( + error: ServiceError | null, + response: ListAdvancedRateLimiterProfilesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListAdvancedRateLimiterProfilesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListAdvancedRateLimiterProfilesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListAdvancedRateLimiterProfilesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListAdvancedRateLimiterProfilesResponse + ) => void + ): ClientUnaryCall; + /** Creates a ARL profile in the specified folder using the data specified in the request. */ + create( + request: CreateAdvancedRateLimiterProfileRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateAdvancedRateLimiterProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateAdvancedRateLimiterProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates the specified ARL profile. */ + update( + request: UpdateAdvancedRateLimiterProfileRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateAdvancedRateLimiterProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateAdvancedRateLimiterProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes the specified ARL profile. */ + delete( + request: DeleteAdvancedRateLimiterProfileRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteAdvancedRateLimiterProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteAdvancedRateLimiterProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const AdvancedRateLimiterProfileServiceClient = + makeGenericClientConstructor( + AdvancedRateLimiterProfileServiceService, + "yandex.cloud.smartwebsecurity.v1.advanced_rate_limiter.AdvancedRateLimiterProfileService" + ) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): AdvancedRateLimiterProfileServiceClient; + service: typeof AdvancedRateLimiterProfileServiceService; + }; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/smartwebsecurity/v1/security_profile.ts b/src/generated/yandex/cloud/smartwebsecurity/v1/security_profile.ts new file mode 100644 index 00000000..edee307d --- /dev/null +++ b/src/generated/yandex/cloud/smartwebsecurity/v1/security_profile.ts @@ -0,0 +1,2275 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.smartwebsecurity.v1"; + +/** A SecurityProfile resource. */ +export interface SecurityProfile { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityProfile"; + /** ID of the security profile. */ + id: string; + /** ID of the folder that the security profile belongs to. */ + folderId: string; + /** Labels as `` key:value `` pairs. Maximum of 64 per resource. */ + labels: { [key: string]: string }; + /** Name of the security profile. The name is unique within the folder. 1-50 characters long. */ + name: string; + /** Optional description of the security profile. */ + description: string; + /** Action to perform if none of rules matched. */ + defaultAction: SecurityProfile_DefaultAction; + /** List of security rules. */ + securityRules: SecurityRule[]; + /** Creation timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. */ + createdAt?: Date; + /** ID of the cloud that the security profile belongs to. */ + cloudId: string; + /** Captcha ID to use with this security profile. Set empty to use default. */ + captchaId: string; + /** Advanced rate limiter profile ID to use with this security profile. Set empty to use default. */ + advancedRateLimiterProfileId: string; +} + +/** Action to perform if none of rules matched. */ +export enum SecurityProfile_DefaultAction { + DEFAULT_ACTION_UNSPECIFIED = 0, + /** ALLOW - Pass request to service. */ + ALLOW = 1, + /** DENY - Deny request. */ + DENY = 2, + UNRECOGNIZED = -1, +} + +export function securityProfile_DefaultActionFromJSON( + object: any +): SecurityProfile_DefaultAction { + switch (object) { + case 0: + case "DEFAULT_ACTION_UNSPECIFIED": + return SecurityProfile_DefaultAction.DEFAULT_ACTION_UNSPECIFIED; + case 1: + case "ALLOW": + return SecurityProfile_DefaultAction.ALLOW; + case 2: + case "DENY": + return SecurityProfile_DefaultAction.DENY; + case -1: + case "UNRECOGNIZED": + default: + return SecurityProfile_DefaultAction.UNRECOGNIZED; + } +} + +export function securityProfile_DefaultActionToJSON( + object: SecurityProfile_DefaultAction +): string { + switch (object) { + case SecurityProfile_DefaultAction.DEFAULT_ACTION_UNSPECIFIED: + return "DEFAULT_ACTION_UNSPECIFIED"; + case SecurityProfile_DefaultAction.ALLOW: + return "ALLOW"; + case SecurityProfile_DefaultAction.DENY: + return "DENY"; + default: + return "UNKNOWN"; + } +} + +export interface SecurityProfile_LabelsEntry { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityProfile.LabelsEntry"; + key: string; + value: string; +} + +/** A SecurityRule object, see [Rules](/docs/smartwebsecurity/concepts/rules). */ +export interface SecurityRule { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityRule"; + /** Name of the rule. The name is unique within the security profile. 1-50 characters long. */ + name: string; + /** + * Determines the priority for checking the incoming traffic. + * Enter an integer within the range of 1 and 999999. + * The rule priority must be unique within the entire security profile. + * A lower numeric value means a higher priority. + * The default_action has the lowest priority. + */ + priority: number; + /** + * This mode allows you to test your security profile or a single rule. + * For example, you can have the number of alarms for a specific rule displayed. + * Note: if this option is true, no real action affecting your traffic regarding this rule will be taken. + */ + dryRun: boolean; + /** Rule actions, see [Rule actions](/docs/smartwebsecurity/concepts/rules#rule-action). */ + ruleCondition?: SecurityRule_RuleCondition | undefined; + /** Smart Protection rule, see [Smart Protection rules](/docs/smartwebsecurity/concepts/rules#smart-protection-rules). */ + smartProtection?: SecurityRule_SmartProtection | undefined; + /** Web Application Firewall (WAF) rule, see [WAF rules](/docs/smartwebsecurity/concepts/rules#waf-rules). */ + waf?: SecurityRule_Waf | undefined; + /** Optional description of the rule. 0-512 characters long. */ + description: string; +} + +/** RuleCondition object. */ +export interface SecurityRule_RuleCondition { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityRule.RuleCondition"; + /** Action to perform if this rule matched. */ + action: SecurityRule_RuleCondition_Action; + /** The condition for matching the rule. */ + condition?: Condition; +} + +/** Type of action to perform if this rule matched. */ +export enum SecurityRule_RuleCondition_Action { + ACTION_UNSPECIFIED = 0, + /** ALLOW - Pass request to service. */ + ALLOW = 1, + /** DENY - Deny request. */ + DENY = 2, + UNRECOGNIZED = -1, +} + +export function securityRule_RuleCondition_ActionFromJSON( + object: any +): SecurityRule_RuleCondition_Action { + switch (object) { + case 0: + case "ACTION_UNSPECIFIED": + return SecurityRule_RuleCondition_Action.ACTION_UNSPECIFIED; + case 1: + case "ALLOW": + return SecurityRule_RuleCondition_Action.ALLOW; + case 2: + case "DENY": + return SecurityRule_RuleCondition_Action.DENY; + case -1: + case "UNRECOGNIZED": + default: + return SecurityRule_RuleCondition_Action.UNRECOGNIZED; + } +} + +export function securityRule_RuleCondition_ActionToJSON( + object: SecurityRule_RuleCondition_Action +): string { + switch (object) { + case SecurityRule_RuleCondition_Action.ACTION_UNSPECIFIED: + return "ACTION_UNSPECIFIED"; + case SecurityRule_RuleCondition_Action.ALLOW: + return "ALLOW"; + case SecurityRule_RuleCondition_Action.DENY: + return "DENY"; + default: + return "UNKNOWN"; + } +} + +/** SmartProtection object. */ +export interface SecurityRule_SmartProtection { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityRule.SmartProtection"; + /** Mode of protection. */ + mode: SecurityRule_SmartProtection_Mode; + /** The condition for matching the rule. */ + condition?: Condition; +} + +/** Mode of protection. */ +export enum SecurityRule_SmartProtection_Mode { + MODE_UNSPECIFIED = 0, + /** + * FULL - Full protection means that the traffic will be checked based on ML models and behavioral analysis, + * with suspicious requests being sent to SmartCaptcha. + */ + FULL = 1, + /** + * API - API protection means checking the traffic based on ML models and behavioral analysis without sending suspicious + * requests to SmartCaptcha. The suspicious requests will be blocked. + */ + API = 2, + UNRECOGNIZED = -1, +} + +export function securityRule_SmartProtection_ModeFromJSON( + object: any +): SecurityRule_SmartProtection_Mode { + switch (object) { + case 0: + case "MODE_UNSPECIFIED": + return SecurityRule_SmartProtection_Mode.MODE_UNSPECIFIED; + case 1: + case "FULL": + return SecurityRule_SmartProtection_Mode.FULL; + case 2: + case "API": + return SecurityRule_SmartProtection_Mode.API; + case -1: + case "UNRECOGNIZED": + default: + return SecurityRule_SmartProtection_Mode.UNRECOGNIZED; + } +} + +export function securityRule_SmartProtection_ModeToJSON( + object: SecurityRule_SmartProtection_Mode +): string { + switch (object) { + case SecurityRule_SmartProtection_Mode.MODE_UNSPECIFIED: + return "MODE_UNSPECIFIED"; + case SecurityRule_SmartProtection_Mode.FULL: + return "FULL"; + case SecurityRule_SmartProtection_Mode.API: + return "API"; + default: + return "UNKNOWN"; + } +} + +/** Waf object. */ +export interface SecurityRule_Waf { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityRule.Waf"; + /** Mode of protection. */ + mode: SecurityRule_Waf_Mode; + /** The condition for matching the rule. */ + condition?: Condition; + /** ID of WAF profile to use in this rule. */ + wafProfileId: string; +} + +/** Mode of protection. */ +export enum SecurityRule_Waf_Mode { + MODE_UNSPECIFIED = 0, + /** + * FULL - Full protection means that the traffic will be checked based on ML models and behavioral analysis, + * with suspicious requests being sent to SmartCaptcha. + */ + FULL = 1, + /** + * API - API protection means checking the traffic based on ML models and behavioral analysis without sending suspicious + * requests to SmartCaptcha. The suspicious requests will be blocked. + */ + API = 2, + UNRECOGNIZED = -1, +} + +export function securityRule_Waf_ModeFromJSON( + object: any +): SecurityRule_Waf_Mode { + switch (object) { + case 0: + case "MODE_UNSPECIFIED": + return SecurityRule_Waf_Mode.MODE_UNSPECIFIED; + case 1: + case "FULL": + return SecurityRule_Waf_Mode.FULL; + case 2: + case "API": + return SecurityRule_Waf_Mode.API; + case -1: + case "UNRECOGNIZED": + default: + return SecurityRule_Waf_Mode.UNRECOGNIZED; + } +} + +export function securityRule_Waf_ModeToJSON( + object: SecurityRule_Waf_Mode +): string { + switch (object) { + case SecurityRule_Waf_Mode.MODE_UNSPECIFIED: + return "MODE_UNSPECIFIED"; + case SecurityRule_Waf_Mode.FULL: + return "FULL"; + case SecurityRule_Waf_Mode.API: + return "API"; + default: + return "UNKNOWN"; + } +} + +/** + * Condition object. AND semantics implied. + * See [documentation](/docs/smartwebsecurity/concepts/conditions) for matchers description. + */ +export interface Condition { + $type: "yandex.cloud.smartwebsecurity.v1.Condition"; + /** Match authority (Host header). */ + authority?: Condition_AuthorityMatcher; + /** Match HTTP method. */ + httpMethod?: Condition_HttpMethodMatcher; + /** Match Request URI. */ + requestUri?: Condition_RequestUriMatcher; + /** Match HTTP headers. */ + headers: Condition_HeaderMatcher[]; + /** Match IP. */ + sourceIp?: Condition_IpMatcher; +} + +/** StringMatcher object. */ +export interface Condition_StringMatcher { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.StringMatcher"; + exactMatch: string | undefined; + exactNotMatch: string | undefined; + prefixMatch: string | undefined; + prefixNotMatch: string | undefined; + pireRegexMatch: string | undefined; + pireRegexNotMatch: string | undefined; +} + +/** HttpMethodMatcher object. */ +export interface Condition_HttpMethodMatcher { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.HttpMethodMatcher"; + /** List of HTTP methods. OR semantics implied. */ + httpMethods: Condition_StringMatcher[]; +} + +/** AuthorityMatcher object. */ +export interface Condition_AuthorityMatcher { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.AuthorityMatcher"; + /** List of authorities. OR semantics implied. */ + authorities: Condition_StringMatcher[]; +} + +/** RequestUriMatcher object. AND semantics implied. */ +export interface Condition_RequestUriMatcher { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.RequestUriMatcher"; + /** Path of the URI [RFC3986](https://datatracker.ietf.org/doc/html/rfc3986#section-3.3). */ + path?: Condition_StringMatcher; + /** List of query matchers. AND semantics implied. */ + queries: Condition_QueryMatcher[]; +} + +/** QueryMatcher object. */ +export interface Condition_QueryMatcher { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.QueryMatcher"; + /** Key of the query parameter. */ + key: string; + /** Value of the query parameter. */ + value?: Condition_StringMatcher; +} + +/** HeaderMatcher object. */ +export interface Condition_HeaderMatcher { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.HeaderMatcher"; + /** Name of header (case insensitive). */ + name: string; + /** Value of the header. */ + value?: Condition_StringMatcher; +} + +/** IpMatcher object. AND semantics implied. */ +export interface Condition_IpMatcher { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.IpMatcher"; + ipRangesMatch?: Condition_IpRangesMatcher; + ipRangesNotMatch?: Condition_IpRangesMatcher; + geoIpMatch?: Condition_GeoIpMatcher; + geoIpNotMatch?: Condition_GeoIpMatcher; +} + +/** IpRangesMatcher object. */ +export interface Condition_IpRangesMatcher { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.IpRangesMatcher"; + /** List of IP ranges. OR semantics implied. */ + ipRanges: string[]; +} + +/** GeoIpMatcher object. */ +export interface Condition_GeoIpMatcher { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.GeoIpMatcher"; + /** ISO 3166-1 alpha 2. OR semantics implied. */ + locations: string[]; +} + +const baseSecurityProfile: object = { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityProfile", + id: "", + folderId: "", + name: "", + description: "", + defaultAction: 0, + cloudId: "", + captchaId: "", + advancedRateLimiterProfileId: "", +}; + +export const SecurityProfile = { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityProfile" as const, + + encode( + message: SecurityProfile, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + Object.entries(message.labels).forEach(([key, value]) => { + SecurityProfile_LabelsEntry.encode( + { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityProfile.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(26).fork() + ).ldelim(); + }); + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + if (message.defaultAction !== 0) { + writer.uint32(48).int32(message.defaultAction); + } + for (const v of message.securityRules) { + SecurityRule.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(66).fork() + ).ldelim(); + } + if (message.cloudId !== "") { + writer.uint32(82).string(message.cloudId); + } + if (message.captchaId !== "") { + writer.uint32(90).string(message.captchaId); + } + if (message.advancedRateLimiterProfileId !== "") { + writer.uint32(98).string(message.advancedRateLimiterProfileId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SecurityProfile { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSecurityProfile } as SecurityProfile; + message.labels = {}; + message.securityRules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + const entry3 = SecurityProfile_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry3.value !== undefined) { + message.labels[entry3.key] = entry3.value; + } + break; + case 4: + message.name = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.defaultAction = reader.int32() as any; + break; + case 7: + message.securityRules.push( + SecurityRule.decode(reader, reader.uint32()) + ); + break; + case 8: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 10: + message.cloudId = reader.string(); + break; + case 11: + message.captchaId = reader.string(); + break; + case 12: + message.advancedRateLimiterProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SecurityProfile { + const message = { ...baseSecurityProfile } as SecurityProfile; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.defaultAction = + object.defaultAction !== undefined && object.defaultAction !== null + ? securityProfile_DefaultActionFromJSON(object.defaultAction) + : 0; + message.securityRules = (object.securityRules ?? []).map((e: any) => + SecurityRule.fromJSON(e) + ); + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.cloudId = + object.cloudId !== undefined && object.cloudId !== null + ? String(object.cloudId) + : ""; + message.captchaId = + object.captchaId !== undefined && object.captchaId !== null + ? String(object.captchaId) + : ""; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId !== undefined && + object.advancedRateLimiterProfileId !== null + ? String(object.advancedRateLimiterProfileId) + : ""; + return message; + }, + + toJSON(message: SecurityProfile): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.defaultAction !== undefined && + (obj.defaultAction = securityProfile_DefaultActionToJSON( + message.defaultAction + )); + if (message.securityRules) { + obj.securityRules = message.securityRules.map((e) => + e ? SecurityRule.toJSON(e) : undefined + ); + } else { + obj.securityRules = []; + } + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.cloudId !== undefined && (obj.cloudId = message.cloudId); + message.captchaId !== undefined && (obj.captchaId = message.captchaId); + message.advancedRateLimiterProfileId !== undefined && + (obj.advancedRateLimiterProfileId = message.advancedRateLimiterProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): SecurityProfile { + const message = { ...baseSecurityProfile } as SecurityProfile; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.defaultAction = object.defaultAction ?? 0; + message.securityRules = + object.securityRules?.map((e) => SecurityRule.fromPartial(e)) || []; + message.createdAt = object.createdAt ?? undefined; + message.cloudId = object.cloudId ?? ""; + message.captchaId = object.captchaId ?? ""; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(SecurityProfile.$type, SecurityProfile); + +const baseSecurityProfile_LabelsEntry: object = { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityProfile.LabelsEntry", + key: "", + value: "", +}; + +export const SecurityProfile_LabelsEntry = { + $type: + "yandex.cloud.smartwebsecurity.v1.SecurityProfile.LabelsEntry" as const, + + encode( + message: SecurityProfile_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SecurityProfile_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSecurityProfile_LabelsEntry, + } as SecurityProfile_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SecurityProfile_LabelsEntry { + const message = { + ...baseSecurityProfile_LabelsEntry, + } as SecurityProfile_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: SecurityProfile_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): SecurityProfile_LabelsEntry { + const message = { + ...baseSecurityProfile_LabelsEntry, + } as SecurityProfile_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + SecurityProfile_LabelsEntry.$type, + SecurityProfile_LabelsEntry +); + +const baseSecurityRule: object = { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityRule", + name: "", + priority: 0, + dryRun: false, + description: "", +}; + +export const SecurityRule = { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityRule" as const, + + encode( + message: SecurityRule, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.priority !== 0) { + writer.uint32(16).int64(message.priority); + } + if (message.dryRun === true) { + writer.uint32(24).bool(message.dryRun); + } + if (message.ruleCondition !== undefined) { + SecurityRule_RuleCondition.encode( + message.ruleCondition, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.smartProtection !== undefined) { + SecurityRule_SmartProtection.encode( + message.smartProtection, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.waf !== undefined) { + SecurityRule_Waf.encode(message.waf, writer.uint32(50).fork()).ldelim(); + } + if (message.description !== "") { + writer.uint32(58).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SecurityRule { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSecurityRule } as SecurityRule; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.priority = longToNumber(reader.int64() as Long); + break; + case 3: + message.dryRun = reader.bool(); + break; + case 4: + message.ruleCondition = SecurityRule_RuleCondition.decode( + reader, + reader.uint32() + ); + break; + case 5: + message.smartProtection = SecurityRule_SmartProtection.decode( + reader, + reader.uint32() + ); + break; + case 6: + message.waf = SecurityRule_Waf.decode(reader, reader.uint32()); + break; + case 7: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SecurityRule { + const message = { ...baseSecurityRule } as SecurityRule; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.priority = + object.priority !== undefined && object.priority !== null + ? Number(object.priority) + : 0; + message.dryRun = + object.dryRun !== undefined && object.dryRun !== null + ? Boolean(object.dryRun) + : false; + message.ruleCondition = + object.ruleCondition !== undefined && object.ruleCondition !== null + ? SecurityRule_RuleCondition.fromJSON(object.ruleCondition) + : undefined; + message.smartProtection = + object.smartProtection !== undefined && object.smartProtection !== null + ? SecurityRule_SmartProtection.fromJSON(object.smartProtection) + : undefined; + message.waf = + object.waf !== undefined && object.waf !== null + ? SecurityRule_Waf.fromJSON(object.waf) + : undefined; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + return message; + }, + + toJSON(message: SecurityRule): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.priority !== undefined && + (obj.priority = Math.round(message.priority)); + message.dryRun !== undefined && (obj.dryRun = message.dryRun); + message.ruleCondition !== undefined && + (obj.ruleCondition = message.ruleCondition + ? SecurityRule_RuleCondition.toJSON(message.ruleCondition) + : undefined); + message.smartProtection !== undefined && + (obj.smartProtection = message.smartProtection + ? SecurityRule_SmartProtection.toJSON(message.smartProtection) + : undefined); + message.waf !== undefined && + (obj.waf = message.waf + ? SecurityRule_Waf.toJSON(message.waf) + : undefined); + message.description !== undefined && + (obj.description = message.description); + return obj; + }, + + fromPartial, I>>( + object: I + ): SecurityRule { + const message = { ...baseSecurityRule } as SecurityRule; + message.name = object.name ?? ""; + message.priority = object.priority ?? 0; + message.dryRun = object.dryRun ?? false; + message.ruleCondition = + object.ruleCondition !== undefined && object.ruleCondition !== null + ? SecurityRule_RuleCondition.fromPartial(object.ruleCondition) + : undefined; + message.smartProtection = + object.smartProtection !== undefined && object.smartProtection !== null + ? SecurityRule_SmartProtection.fromPartial(object.smartProtection) + : undefined; + message.waf = + object.waf !== undefined && object.waf !== null + ? SecurityRule_Waf.fromPartial(object.waf) + : undefined; + message.description = object.description ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(SecurityRule.$type, SecurityRule); + +const baseSecurityRule_RuleCondition: object = { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityRule.RuleCondition", + action: 0, +}; + +export const SecurityRule_RuleCondition = { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityRule.RuleCondition" as const, + + encode( + message: SecurityRule_RuleCondition, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.action !== 0) { + writer.uint32(8).int32(message.action); + } + if (message.condition !== undefined) { + Condition.encode(message.condition, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SecurityRule_RuleCondition { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSecurityRule_RuleCondition, + } as SecurityRule_RuleCondition; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32() as any; + break; + case 2: + message.condition = Condition.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SecurityRule_RuleCondition { + const message = { + ...baseSecurityRule_RuleCondition, + } as SecurityRule_RuleCondition; + message.action = + object.action !== undefined && object.action !== null + ? securityRule_RuleCondition_ActionFromJSON(object.action) + : 0; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromJSON(object.condition) + : undefined; + return message; + }, + + toJSON(message: SecurityRule_RuleCondition): unknown { + const obj: any = {}; + message.action !== undefined && + (obj.action = securityRule_RuleCondition_ActionToJSON(message.action)); + message.condition !== undefined && + (obj.condition = message.condition + ? Condition.toJSON(message.condition) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): SecurityRule_RuleCondition { + const message = { + ...baseSecurityRule_RuleCondition, + } as SecurityRule_RuleCondition; + message.action = object.action ?? 0; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromPartial(object.condition) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + SecurityRule_RuleCondition.$type, + SecurityRule_RuleCondition +); + +const baseSecurityRule_SmartProtection: object = { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityRule.SmartProtection", + mode: 0, +}; + +export const SecurityRule_SmartProtection = { + $type: + "yandex.cloud.smartwebsecurity.v1.SecurityRule.SmartProtection" as const, + + encode( + message: SecurityRule_SmartProtection, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.mode !== 0) { + writer.uint32(8).int32(message.mode); + } + if (message.condition !== undefined) { + Condition.encode(message.condition, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SecurityRule_SmartProtection { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSecurityRule_SmartProtection, + } as SecurityRule_SmartProtection; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any; + break; + case 2: + message.condition = Condition.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SecurityRule_SmartProtection { + const message = { + ...baseSecurityRule_SmartProtection, + } as SecurityRule_SmartProtection; + message.mode = + object.mode !== undefined && object.mode !== null + ? securityRule_SmartProtection_ModeFromJSON(object.mode) + : 0; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromJSON(object.condition) + : undefined; + return message; + }, + + toJSON(message: SecurityRule_SmartProtection): unknown { + const obj: any = {}; + message.mode !== undefined && + (obj.mode = securityRule_SmartProtection_ModeToJSON(message.mode)); + message.condition !== undefined && + (obj.condition = message.condition + ? Condition.toJSON(message.condition) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): SecurityRule_SmartProtection { + const message = { + ...baseSecurityRule_SmartProtection, + } as SecurityRule_SmartProtection; + message.mode = object.mode ?? 0; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromPartial(object.condition) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + SecurityRule_SmartProtection.$type, + SecurityRule_SmartProtection +); + +const baseSecurityRule_Waf: object = { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityRule.Waf", + mode: 0, + wafProfileId: "", +}; + +export const SecurityRule_Waf = { + $type: "yandex.cloud.smartwebsecurity.v1.SecurityRule.Waf" as const, + + encode( + message: SecurityRule_Waf, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.mode !== 0) { + writer.uint32(8).int32(message.mode); + } + if (message.condition !== undefined) { + Condition.encode(message.condition, writer.uint32(18).fork()).ldelim(); + } + if (message.wafProfileId !== "") { + writer.uint32(26).string(message.wafProfileId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SecurityRule_Waf { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSecurityRule_Waf } as SecurityRule_Waf; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any; + break; + case 2: + message.condition = Condition.decode(reader, reader.uint32()); + break; + case 3: + message.wafProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SecurityRule_Waf { + const message = { ...baseSecurityRule_Waf } as SecurityRule_Waf; + message.mode = + object.mode !== undefined && object.mode !== null + ? securityRule_Waf_ModeFromJSON(object.mode) + : 0; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromJSON(object.condition) + : undefined; + message.wafProfileId = + object.wafProfileId !== undefined && object.wafProfileId !== null + ? String(object.wafProfileId) + : ""; + return message; + }, + + toJSON(message: SecurityRule_Waf): unknown { + const obj: any = {}; + message.mode !== undefined && + (obj.mode = securityRule_Waf_ModeToJSON(message.mode)); + message.condition !== undefined && + (obj.condition = message.condition + ? Condition.toJSON(message.condition) + : undefined); + message.wafProfileId !== undefined && + (obj.wafProfileId = message.wafProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): SecurityRule_Waf { + const message = { ...baseSecurityRule_Waf } as SecurityRule_Waf; + message.mode = object.mode ?? 0; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromPartial(object.condition) + : undefined; + message.wafProfileId = object.wafProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(SecurityRule_Waf.$type, SecurityRule_Waf); + +const baseCondition: object = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition", +}; + +export const Condition = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition" as const, + + encode( + message: Condition, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.authority !== undefined) { + Condition_AuthorityMatcher.encode( + message.authority, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.httpMethod !== undefined) { + Condition_HttpMethodMatcher.encode( + message.httpMethod, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.requestUri !== undefined) { + Condition_RequestUriMatcher.encode( + message.requestUri, + writer.uint32(26).fork() + ).ldelim(); + } + for (const v of message.headers) { + Condition_HeaderMatcher.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.sourceIp !== undefined) { + Condition_IpMatcher.encode( + message.sourceIp, + writer.uint32(42).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Condition { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCondition } as Condition; + message.headers = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = Condition_AuthorityMatcher.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.httpMethod = Condition_HttpMethodMatcher.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.requestUri = Condition_RequestUriMatcher.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.headers.push( + Condition_HeaderMatcher.decode(reader, reader.uint32()) + ); + break; + case 5: + message.sourceIp = Condition_IpMatcher.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition { + const message = { ...baseCondition } as Condition; + message.authority = + object.authority !== undefined && object.authority !== null + ? Condition_AuthorityMatcher.fromJSON(object.authority) + : undefined; + message.httpMethod = + object.httpMethod !== undefined && object.httpMethod !== null + ? Condition_HttpMethodMatcher.fromJSON(object.httpMethod) + : undefined; + message.requestUri = + object.requestUri !== undefined && object.requestUri !== null + ? Condition_RequestUriMatcher.fromJSON(object.requestUri) + : undefined; + message.headers = (object.headers ?? []).map((e: any) => + Condition_HeaderMatcher.fromJSON(e) + ); + message.sourceIp = + object.sourceIp !== undefined && object.sourceIp !== null + ? Condition_IpMatcher.fromJSON(object.sourceIp) + : undefined; + return message; + }, + + toJSON(message: Condition): unknown { + const obj: any = {}; + message.authority !== undefined && + (obj.authority = message.authority + ? Condition_AuthorityMatcher.toJSON(message.authority) + : undefined); + message.httpMethod !== undefined && + (obj.httpMethod = message.httpMethod + ? Condition_HttpMethodMatcher.toJSON(message.httpMethod) + : undefined); + message.requestUri !== undefined && + (obj.requestUri = message.requestUri + ? Condition_RequestUriMatcher.toJSON(message.requestUri) + : undefined); + if (message.headers) { + obj.headers = message.headers.map((e) => + e ? Condition_HeaderMatcher.toJSON(e) : undefined + ); + } else { + obj.headers = []; + } + message.sourceIp !== undefined && + (obj.sourceIp = message.sourceIp + ? Condition_IpMatcher.toJSON(message.sourceIp) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition { + const message = { ...baseCondition } as Condition; + message.authority = + object.authority !== undefined && object.authority !== null + ? Condition_AuthorityMatcher.fromPartial(object.authority) + : undefined; + message.httpMethod = + object.httpMethod !== undefined && object.httpMethod !== null + ? Condition_HttpMethodMatcher.fromPartial(object.httpMethod) + : undefined; + message.requestUri = + object.requestUri !== undefined && object.requestUri !== null + ? Condition_RequestUriMatcher.fromPartial(object.requestUri) + : undefined; + message.headers = + object.headers?.map((e) => Condition_HeaderMatcher.fromPartial(e)) || []; + message.sourceIp = + object.sourceIp !== undefined && object.sourceIp !== null + ? Condition_IpMatcher.fromPartial(object.sourceIp) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Condition.$type, Condition); + +const baseCondition_StringMatcher: object = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.StringMatcher", +}; + +export const Condition_StringMatcher = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.StringMatcher" as const, + + encode( + message: Condition_StringMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.exactMatch !== undefined) { + writer.uint32(10).string(message.exactMatch); + } + if (message.exactNotMatch !== undefined) { + writer.uint32(18).string(message.exactNotMatch); + } + if (message.prefixMatch !== undefined) { + writer.uint32(26).string(message.prefixMatch); + } + if (message.prefixNotMatch !== undefined) { + writer.uint32(34).string(message.prefixNotMatch); + } + if (message.pireRegexMatch !== undefined) { + writer.uint32(42).string(message.pireRegexMatch); + } + if (message.pireRegexNotMatch !== undefined) { + writer.uint32(50).string(message.pireRegexNotMatch); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_StringMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCondition_StringMatcher, + } as Condition_StringMatcher; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exactMatch = reader.string(); + break; + case 2: + message.exactNotMatch = reader.string(); + break; + case 3: + message.prefixMatch = reader.string(); + break; + case 4: + message.prefixNotMatch = reader.string(); + break; + case 5: + message.pireRegexMatch = reader.string(); + break; + case 6: + message.pireRegexNotMatch = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_StringMatcher { + const message = { + ...baseCondition_StringMatcher, + } as Condition_StringMatcher; + message.exactMatch = + object.exactMatch !== undefined && object.exactMatch !== null + ? String(object.exactMatch) + : undefined; + message.exactNotMatch = + object.exactNotMatch !== undefined && object.exactNotMatch !== null + ? String(object.exactNotMatch) + : undefined; + message.prefixMatch = + object.prefixMatch !== undefined && object.prefixMatch !== null + ? String(object.prefixMatch) + : undefined; + message.prefixNotMatch = + object.prefixNotMatch !== undefined && object.prefixNotMatch !== null + ? String(object.prefixNotMatch) + : undefined; + message.pireRegexMatch = + object.pireRegexMatch !== undefined && object.pireRegexMatch !== null + ? String(object.pireRegexMatch) + : undefined; + message.pireRegexNotMatch = + object.pireRegexNotMatch !== undefined && + object.pireRegexNotMatch !== null + ? String(object.pireRegexNotMatch) + : undefined; + return message; + }, + + toJSON(message: Condition_StringMatcher): unknown { + const obj: any = {}; + message.exactMatch !== undefined && (obj.exactMatch = message.exactMatch); + message.exactNotMatch !== undefined && + (obj.exactNotMatch = message.exactNotMatch); + message.prefixMatch !== undefined && + (obj.prefixMatch = message.prefixMatch); + message.prefixNotMatch !== undefined && + (obj.prefixNotMatch = message.prefixNotMatch); + message.pireRegexMatch !== undefined && + (obj.pireRegexMatch = message.pireRegexMatch); + message.pireRegexNotMatch !== undefined && + (obj.pireRegexNotMatch = message.pireRegexNotMatch); + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_StringMatcher { + const message = { + ...baseCondition_StringMatcher, + } as Condition_StringMatcher; + message.exactMatch = object.exactMatch ?? undefined; + message.exactNotMatch = object.exactNotMatch ?? undefined; + message.prefixMatch = object.prefixMatch ?? undefined; + message.prefixNotMatch = object.prefixNotMatch ?? undefined; + message.pireRegexMatch = object.pireRegexMatch ?? undefined; + message.pireRegexNotMatch = object.pireRegexNotMatch ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Condition_StringMatcher.$type, Condition_StringMatcher); + +const baseCondition_HttpMethodMatcher: object = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.HttpMethodMatcher", +}; + +export const Condition_HttpMethodMatcher = { + $type: + "yandex.cloud.smartwebsecurity.v1.Condition.HttpMethodMatcher" as const, + + encode( + message: Condition_HttpMethodMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.httpMethods) { + Condition_StringMatcher.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_HttpMethodMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCondition_HttpMethodMatcher, + } as Condition_HttpMethodMatcher; + message.httpMethods = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.httpMethods.push( + Condition_StringMatcher.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_HttpMethodMatcher { + const message = { + ...baseCondition_HttpMethodMatcher, + } as Condition_HttpMethodMatcher; + message.httpMethods = (object.httpMethods ?? []).map((e: any) => + Condition_StringMatcher.fromJSON(e) + ); + return message; + }, + + toJSON(message: Condition_HttpMethodMatcher): unknown { + const obj: any = {}; + if (message.httpMethods) { + obj.httpMethods = message.httpMethods.map((e) => + e ? Condition_StringMatcher.toJSON(e) : undefined + ); + } else { + obj.httpMethods = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_HttpMethodMatcher { + const message = { + ...baseCondition_HttpMethodMatcher, + } as Condition_HttpMethodMatcher; + message.httpMethods = + object.httpMethods?.map((e) => Condition_StringMatcher.fromPartial(e)) || + []; + return message; + }, +}; + +messageTypeRegistry.set( + Condition_HttpMethodMatcher.$type, + Condition_HttpMethodMatcher +); + +const baseCondition_AuthorityMatcher: object = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.AuthorityMatcher", +}; + +export const Condition_AuthorityMatcher = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.AuthorityMatcher" as const, + + encode( + message: Condition_AuthorityMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.authorities) { + Condition_StringMatcher.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_AuthorityMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCondition_AuthorityMatcher, + } as Condition_AuthorityMatcher; + message.authorities = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authorities.push( + Condition_StringMatcher.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_AuthorityMatcher { + const message = { + ...baseCondition_AuthorityMatcher, + } as Condition_AuthorityMatcher; + message.authorities = (object.authorities ?? []).map((e: any) => + Condition_StringMatcher.fromJSON(e) + ); + return message; + }, + + toJSON(message: Condition_AuthorityMatcher): unknown { + const obj: any = {}; + if (message.authorities) { + obj.authorities = message.authorities.map((e) => + e ? Condition_StringMatcher.toJSON(e) : undefined + ); + } else { + obj.authorities = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_AuthorityMatcher { + const message = { + ...baseCondition_AuthorityMatcher, + } as Condition_AuthorityMatcher; + message.authorities = + object.authorities?.map((e) => Condition_StringMatcher.fromPartial(e)) || + []; + return message; + }, +}; + +messageTypeRegistry.set( + Condition_AuthorityMatcher.$type, + Condition_AuthorityMatcher +); + +const baseCondition_RequestUriMatcher: object = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.RequestUriMatcher", +}; + +export const Condition_RequestUriMatcher = { + $type: + "yandex.cloud.smartwebsecurity.v1.Condition.RequestUriMatcher" as const, + + encode( + message: Condition_RequestUriMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.path !== undefined) { + Condition_StringMatcher.encode( + message.path, + writer.uint32(10).fork() + ).ldelim(); + } + for (const v of message.queries) { + Condition_QueryMatcher.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_RequestUriMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCondition_RequestUriMatcher, + } as Condition_RequestUriMatcher; + message.queries = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = Condition_StringMatcher.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.queries.push( + Condition_QueryMatcher.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_RequestUriMatcher { + const message = { + ...baseCondition_RequestUriMatcher, + } as Condition_RequestUriMatcher; + message.path = + object.path !== undefined && object.path !== null + ? Condition_StringMatcher.fromJSON(object.path) + : undefined; + message.queries = (object.queries ?? []).map((e: any) => + Condition_QueryMatcher.fromJSON(e) + ); + return message; + }, + + toJSON(message: Condition_RequestUriMatcher): unknown { + const obj: any = {}; + message.path !== undefined && + (obj.path = message.path + ? Condition_StringMatcher.toJSON(message.path) + : undefined); + if (message.queries) { + obj.queries = message.queries.map((e) => + e ? Condition_QueryMatcher.toJSON(e) : undefined + ); + } else { + obj.queries = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_RequestUriMatcher { + const message = { + ...baseCondition_RequestUriMatcher, + } as Condition_RequestUriMatcher; + message.path = + object.path !== undefined && object.path !== null + ? Condition_StringMatcher.fromPartial(object.path) + : undefined; + message.queries = + object.queries?.map((e) => Condition_QueryMatcher.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Condition_RequestUriMatcher.$type, + Condition_RequestUriMatcher +); + +const baseCondition_QueryMatcher: object = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.QueryMatcher", + key: "", +}; + +export const Condition_QueryMatcher = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.QueryMatcher" as const, + + encode( + message: Condition_QueryMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Condition_StringMatcher.encode( + message.value, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_QueryMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCondition_QueryMatcher } as Condition_QueryMatcher; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = Condition_StringMatcher.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_QueryMatcher { + const message = { ...baseCondition_QueryMatcher } as Condition_QueryMatcher; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? Condition_StringMatcher.fromJSON(object.value) + : undefined; + return message; + }, + + toJSON(message: Condition_QueryMatcher): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && + (obj.value = message.value + ? Condition_StringMatcher.toJSON(message.value) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_QueryMatcher { + const message = { ...baseCondition_QueryMatcher } as Condition_QueryMatcher; + message.key = object.key ?? ""; + message.value = + object.value !== undefined && object.value !== null + ? Condition_StringMatcher.fromPartial(object.value) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Condition_QueryMatcher.$type, Condition_QueryMatcher); + +const baseCondition_HeaderMatcher: object = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.HeaderMatcher", + name: "", +}; + +export const Condition_HeaderMatcher = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.HeaderMatcher" as const, + + encode( + message: Condition_HeaderMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.value !== undefined) { + Condition_StringMatcher.encode( + message.value, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_HeaderMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCondition_HeaderMatcher, + } as Condition_HeaderMatcher; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value = Condition_StringMatcher.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_HeaderMatcher { + const message = { + ...baseCondition_HeaderMatcher, + } as Condition_HeaderMatcher; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.value = + object.value !== undefined && object.value !== null + ? Condition_StringMatcher.fromJSON(object.value) + : undefined; + return message; + }, + + toJSON(message: Condition_HeaderMatcher): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.value !== undefined && + (obj.value = message.value + ? Condition_StringMatcher.toJSON(message.value) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_HeaderMatcher { + const message = { + ...baseCondition_HeaderMatcher, + } as Condition_HeaderMatcher; + message.name = object.name ?? ""; + message.value = + object.value !== undefined && object.value !== null + ? Condition_StringMatcher.fromPartial(object.value) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Condition_HeaderMatcher.$type, Condition_HeaderMatcher); + +const baseCondition_IpMatcher: object = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.IpMatcher", +}; + +export const Condition_IpMatcher = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.IpMatcher" as const, + + encode( + message: Condition_IpMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ipRangesMatch !== undefined) { + Condition_IpRangesMatcher.encode( + message.ipRangesMatch, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.ipRangesNotMatch !== undefined) { + Condition_IpRangesMatcher.encode( + message.ipRangesNotMatch, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.geoIpMatch !== undefined) { + Condition_GeoIpMatcher.encode( + message.geoIpMatch, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.geoIpNotMatch !== undefined) { + Condition_GeoIpMatcher.encode( + message.geoIpNotMatch, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Condition_IpMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCondition_IpMatcher } as Condition_IpMatcher; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ipRangesMatch = Condition_IpRangesMatcher.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.ipRangesNotMatch = Condition_IpRangesMatcher.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.geoIpMatch = Condition_GeoIpMatcher.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.geoIpNotMatch = Condition_GeoIpMatcher.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_IpMatcher { + const message = { ...baseCondition_IpMatcher } as Condition_IpMatcher; + message.ipRangesMatch = + object.ipRangesMatch !== undefined && object.ipRangesMatch !== null + ? Condition_IpRangesMatcher.fromJSON(object.ipRangesMatch) + : undefined; + message.ipRangesNotMatch = + object.ipRangesNotMatch !== undefined && object.ipRangesNotMatch !== null + ? Condition_IpRangesMatcher.fromJSON(object.ipRangesNotMatch) + : undefined; + message.geoIpMatch = + object.geoIpMatch !== undefined && object.geoIpMatch !== null + ? Condition_GeoIpMatcher.fromJSON(object.geoIpMatch) + : undefined; + message.geoIpNotMatch = + object.geoIpNotMatch !== undefined && object.geoIpNotMatch !== null + ? Condition_GeoIpMatcher.fromJSON(object.geoIpNotMatch) + : undefined; + return message; + }, + + toJSON(message: Condition_IpMatcher): unknown { + const obj: any = {}; + message.ipRangesMatch !== undefined && + (obj.ipRangesMatch = message.ipRangesMatch + ? Condition_IpRangesMatcher.toJSON(message.ipRangesMatch) + : undefined); + message.ipRangesNotMatch !== undefined && + (obj.ipRangesNotMatch = message.ipRangesNotMatch + ? Condition_IpRangesMatcher.toJSON(message.ipRangesNotMatch) + : undefined); + message.geoIpMatch !== undefined && + (obj.geoIpMatch = message.geoIpMatch + ? Condition_GeoIpMatcher.toJSON(message.geoIpMatch) + : undefined); + message.geoIpNotMatch !== undefined && + (obj.geoIpNotMatch = message.geoIpNotMatch + ? Condition_GeoIpMatcher.toJSON(message.geoIpNotMatch) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_IpMatcher { + const message = { ...baseCondition_IpMatcher } as Condition_IpMatcher; + message.ipRangesMatch = + object.ipRangesMatch !== undefined && object.ipRangesMatch !== null + ? Condition_IpRangesMatcher.fromPartial(object.ipRangesMatch) + : undefined; + message.ipRangesNotMatch = + object.ipRangesNotMatch !== undefined && object.ipRangesNotMatch !== null + ? Condition_IpRangesMatcher.fromPartial(object.ipRangesNotMatch) + : undefined; + message.geoIpMatch = + object.geoIpMatch !== undefined && object.geoIpMatch !== null + ? Condition_GeoIpMatcher.fromPartial(object.geoIpMatch) + : undefined; + message.geoIpNotMatch = + object.geoIpNotMatch !== undefined && object.geoIpNotMatch !== null + ? Condition_GeoIpMatcher.fromPartial(object.geoIpNotMatch) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Condition_IpMatcher.$type, Condition_IpMatcher); + +const baseCondition_IpRangesMatcher: object = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.IpRangesMatcher", + ipRanges: "", +}; + +export const Condition_IpRangesMatcher = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.IpRangesMatcher" as const, + + encode( + message: Condition_IpRangesMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.ipRanges) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_IpRangesMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCondition_IpRangesMatcher, + } as Condition_IpRangesMatcher; + message.ipRanges = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ipRanges.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_IpRangesMatcher { + const message = { + ...baseCondition_IpRangesMatcher, + } as Condition_IpRangesMatcher; + message.ipRanges = (object.ipRanges ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: Condition_IpRangesMatcher): unknown { + const obj: any = {}; + if (message.ipRanges) { + obj.ipRanges = message.ipRanges.map((e) => e); + } else { + obj.ipRanges = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_IpRangesMatcher { + const message = { + ...baseCondition_IpRangesMatcher, + } as Condition_IpRangesMatcher; + message.ipRanges = object.ipRanges?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + Condition_IpRangesMatcher.$type, + Condition_IpRangesMatcher +); + +const baseCondition_GeoIpMatcher: object = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.GeoIpMatcher", + locations: "", +}; + +export const Condition_GeoIpMatcher = { + $type: "yandex.cloud.smartwebsecurity.v1.Condition.GeoIpMatcher" as const, + + encode( + message: Condition_GeoIpMatcher, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.locations) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): Condition_GeoIpMatcher { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCondition_GeoIpMatcher } as Condition_GeoIpMatcher; + message.locations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.locations.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Condition_GeoIpMatcher { + const message = { ...baseCondition_GeoIpMatcher } as Condition_GeoIpMatcher; + message.locations = (object.locations ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: Condition_GeoIpMatcher): unknown { + const obj: any = {}; + if (message.locations) { + obj.locations = message.locations.map((e) => e); + } else { + obj.locations = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Condition_GeoIpMatcher { + const message = { ...baseCondition_GeoIpMatcher } as Condition_GeoIpMatcher; + message.locations = object.locations?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(Condition_GeoIpMatcher.$type, Condition_GeoIpMatcher); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/smartwebsecurity/v1/security_profile_service.ts b/src/generated/yandex/cloud/smartwebsecurity/v1/security_profile_service.ts new file mode 100644 index 00000000..fa7d8fa2 --- /dev/null +++ b/src/generated/yandex/cloud/smartwebsecurity/v1/security_profile_service.ts @@ -0,0 +1,1506 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + SecurityProfile_DefaultAction, + SecurityProfile, + SecurityRule, + securityProfile_DefaultActionFromJSON, + securityProfile_DefaultActionToJSON, +} from "../../../../yandex/cloud/smartwebsecurity/v1/security_profile"; +import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.smartwebsecurity.v1"; + +export interface GetSecurityProfileRequest { + $type: "yandex.cloud.smartwebsecurity.v1.GetSecurityProfileRequest"; + /** ID of the SecurityProfile resource to return. */ + securityProfileId: string; +} + +export interface ListSecurityProfilesRequest { + $type: "yandex.cloud.smartwebsecurity.v1.ListSecurityProfilesRequest"; + /** + * ID of the folder that the security profile belongs to. + * Currently page_size, page_token, filter and order_by are not supported and List method will return all security profiles in the folder. + */ + folderId: string; +} + +export interface ListSecurityProfilesResponse { + $type: "yandex.cloud.smartwebsecurity.v1.ListSecurityProfilesResponse"; + /** + * List of SecurityProfile resources. + * Currently next_page_token is not supported and List method will return all security profiles in the folder. + */ + securityProfiles: SecurityProfile[]; +} + +export interface CreateSecurityProfileRequest { + $type: "yandex.cloud.smartwebsecurity.v1.CreateSecurityProfileRequest"; + /** ID of the folder to create a security profile in. */ + folderId: string; + /** Labels as `` key:value `` pairs. Maximum of 64 per resource. */ + labels: { [key: string]: string }; + /** Name of the security profile. The name is unique within the folder. 1-50 characters long. */ + name: string; + /** Optional description of the security profile. */ + description: string; + /** Action to perform if none of rules matched. */ + defaultAction: SecurityProfile_DefaultAction; + /** List of security rules. */ + securityRules: SecurityRule[]; + /** Captcha ID to use with this security profile. Set empty to use default. */ + captchaId: string; + /** Advanced rate limiter profile ID to use with this security profile. Set empty to use default. */ + advancedRateLimiterProfileId: string; +} + +export interface CreateSecurityProfileRequest_LabelsEntry { + $type: "yandex.cloud.smartwebsecurity.v1.CreateSecurityProfileRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface CreateSecurityProfileMetadata { + $type: "yandex.cloud.smartwebsecurity.v1.CreateSecurityProfileMetadata"; + /** ID of the security profile that is being created. */ + securityProfileId: string; +} + +export interface UpdateSecurityProfileRequest { + $type: "yandex.cloud.smartwebsecurity.v1.UpdateSecurityProfileRequest"; + /** ID of the security profile to update. */ + securityProfileId: string; + /** Field mask that specifies which fields of the SecurityProfile resource are going to be updated. */ + updateMask?: FieldMask; + /** Labels as `` key:value `` pairs. Maximum of 64 per resource. */ + labels: { [key: string]: string }; + /** Name of the security profile. The name is unique within the folder. 1-50 characters long. */ + name: string; + /** Optional description of the security profile. */ + description: string; + /** Action to perform if none of rules matched. */ + defaultAction: SecurityProfile_DefaultAction; + /** List of security rules. */ + securityRules: SecurityRule[]; + /** Captcha ID to use with this security profile. Set empty to use default. */ + captchaId: string; + /** Advanced rate limiter profile ID to use with this security profile. Set empty to use default. */ + advancedRateLimiterProfileId: string; +} + +export interface UpdateSecurityProfileRequest_LabelsEntry { + $type: "yandex.cloud.smartwebsecurity.v1.UpdateSecurityProfileRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateSecurityProfileMetadata { + $type: "yandex.cloud.smartwebsecurity.v1.UpdateSecurityProfileMetadata"; + /** ID of the SecurityProfile resource that is being updated. */ + securityProfileId: string; +} + +export interface DeleteSecurityProfileRequest { + $type: "yandex.cloud.smartwebsecurity.v1.DeleteSecurityProfileRequest"; + /** ID of the security profile to delete. */ + securityProfileId: string; +} + +export interface DeleteSecurityProfileMetadata { + $type: "yandex.cloud.smartwebsecurity.v1.DeleteSecurityProfileMetadata"; + /** ID of the SecurityProfile resource that is being deleted. */ + securityProfileId: string; +} + +const baseGetSecurityProfileRequest: object = { + $type: "yandex.cloud.smartwebsecurity.v1.GetSecurityProfileRequest", + securityProfileId: "", +}; + +export const GetSecurityProfileRequest = { + $type: "yandex.cloud.smartwebsecurity.v1.GetSecurityProfileRequest" as const, + + encode( + message: GetSecurityProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.securityProfileId !== "") { + writer.uint32(10).string(message.securityProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetSecurityProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetSecurityProfileRequest, + } as GetSecurityProfileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.securityProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetSecurityProfileRequest { + const message = { + ...baseGetSecurityProfileRequest, + } as GetSecurityProfileRequest; + message.securityProfileId = + object.securityProfileId !== undefined && + object.securityProfileId !== null + ? String(object.securityProfileId) + : ""; + return message; + }, + + toJSON(message: GetSecurityProfileRequest): unknown { + const obj: any = {}; + message.securityProfileId !== undefined && + (obj.securityProfileId = message.securityProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetSecurityProfileRequest { + const message = { + ...baseGetSecurityProfileRequest, + } as GetSecurityProfileRequest; + message.securityProfileId = object.securityProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetSecurityProfileRequest.$type, + GetSecurityProfileRequest +); + +const baseListSecurityProfilesRequest: object = { + $type: "yandex.cloud.smartwebsecurity.v1.ListSecurityProfilesRequest", + folderId: "", +}; + +export const ListSecurityProfilesRequest = { + $type: + "yandex.cloud.smartwebsecurity.v1.ListSecurityProfilesRequest" as const, + + encode( + message: ListSecurityProfilesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListSecurityProfilesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListSecurityProfilesRequest, + } as ListSecurityProfilesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListSecurityProfilesRequest { + const message = { + ...baseListSecurityProfilesRequest, + } as ListSecurityProfilesRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + return message; + }, + + toJSON(message: ListSecurityProfilesRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListSecurityProfilesRequest { + const message = { + ...baseListSecurityProfilesRequest, + } as ListSecurityProfilesRequest; + message.folderId = object.folderId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListSecurityProfilesRequest.$type, + ListSecurityProfilesRequest +); + +const baseListSecurityProfilesResponse: object = { + $type: "yandex.cloud.smartwebsecurity.v1.ListSecurityProfilesResponse", +}; + +export const ListSecurityProfilesResponse = { + $type: + "yandex.cloud.smartwebsecurity.v1.ListSecurityProfilesResponse" as const, + + encode( + message: ListSecurityProfilesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.securityProfiles) { + SecurityProfile.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListSecurityProfilesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListSecurityProfilesResponse, + } as ListSecurityProfilesResponse; + message.securityProfiles = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.securityProfiles.push( + SecurityProfile.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListSecurityProfilesResponse { + const message = { + ...baseListSecurityProfilesResponse, + } as ListSecurityProfilesResponse; + message.securityProfiles = (object.securityProfiles ?? []).map((e: any) => + SecurityProfile.fromJSON(e) + ); + return message; + }, + + toJSON(message: ListSecurityProfilesResponse): unknown { + const obj: any = {}; + if (message.securityProfiles) { + obj.securityProfiles = message.securityProfiles.map((e) => + e ? SecurityProfile.toJSON(e) : undefined + ); + } else { + obj.securityProfiles = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ListSecurityProfilesResponse { + const message = { + ...baseListSecurityProfilesResponse, + } as ListSecurityProfilesResponse; + message.securityProfiles = + object.securityProfiles?.map((e) => SecurityProfile.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + ListSecurityProfilesResponse.$type, + ListSecurityProfilesResponse +); + +const baseCreateSecurityProfileRequest: object = { + $type: "yandex.cloud.smartwebsecurity.v1.CreateSecurityProfileRequest", + folderId: "", + name: "", + description: "", + defaultAction: 0, + captchaId: "", + advancedRateLimiterProfileId: "", +}; + +export const CreateSecurityProfileRequest = { + $type: + "yandex.cloud.smartwebsecurity.v1.CreateSecurityProfileRequest" as const, + + encode( + message: CreateSecurityProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateSecurityProfileRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.smartwebsecurity.v1.CreateSecurityProfileRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(18).fork() + ).ldelim(); + }); + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.defaultAction !== 0) { + writer.uint32(40).int32(message.defaultAction); + } + for (const v of message.securityRules) { + SecurityRule.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.captchaId !== "") { + writer.uint32(58).string(message.captchaId); + } + if (message.advancedRateLimiterProfileId !== "") { + writer.uint32(66).string(message.advancedRateLimiterProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateSecurityProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateSecurityProfileRequest, + } as CreateSecurityProfileRequest; + message.labels = {}; + message.securityRules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + const entry2 = CreateSecurityProfileRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry2.value !== undefined) { + message.labels[entry2.key] = entry2.value; + } + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.defaultAction = reader.int32() as any; + break; + case 6: + message.securityRules.push( + SecurityRule.decode(reader, reader.uint32()) + ); + break; + case 7: + message.captchaId = reader.string(); + break; + case 8: + message.advancedRateLimiterProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateSecurityProfileRequest { + const message = { + ...baseCreateSecurityProfileRequest, + } as CreateSecurityProfileRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.defaultAction = + object.defaultAction !== undefined && object.defaultAction !== null + ? securityProfile_DefaultActionFromJSON(object.defaultAction) + : 0; + message.securityRules = (object.securityRules ?? []).map((e: any) => + SecurityRule.fromJSON(e) + ); + message.captchaId = + object.captchaId !== undefined && object.captchaId !== null + ? String(object.captchaId) + : ""; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId !== undefined && + object.advancedRateLimiterProfileId !== null + ? String(object.advancedRateLimiterProfileId) + : ""; + return message; + }, + + toJSON(message: CreateSecurityProfileRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.defaultAction !== undefined && + (obj.defaultAction = securityProfile_DefaultActionToJSON( + message.defaultAction + )); + if (message.securityRules) { + obj.securityRules = message.securityRules.map((e) => + e ? SecurityRule.toJSON(e) : undefined + ); + } else { + obj.securityRules = []; + } + message.captchaId !== undefined && (obj.captchaId = message.captchaId); + message.advancedRateLimiterProfileId !== undefined && + (obj.advancedRateLimiterProfileId = message.advancedRateLimiterProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateSecurityProfileRequest { + const message = { + ...baseCreateSecurityProfileRequest, + } as CreateSecurityProfileRequest; + message.folderId = object.folderId ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.defaultAction = object.defaultAction ?? 0; + message.securityRules = + object.securityRules?.map((e) => SecurityRule.fromPartial(e)) || []; + message.captchaId = object.captchaId ?? ""; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateSecurityProfileRequest.$type, + CreateSecurityProfileRequest +); + +const baseCreateSecurityProfileRequest_LabelsEntry: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.CreateSecurityProfileRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateSecurityProfileRequest_LabelsEntry = { + $type: + "yandex.cloud.smartwebsecurity.v1.CreateSecurityProfileRequest.LabelsEntry" as const, + + encode( + message: CreateSecurityProfileRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateSecurityProfileRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateSecurityProfileRequest_LabelsEntry, + } as CreateSecurityProfileRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateSecurityProfileRequest_LabelsEntry { + const message = { + ...baseCreateSecurityProfileRequest_LabelsEntry, + } as CreateSecurityProfileRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateSecurityProfileRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateSecurityProfileRequest_LabelsEntry { + const message = { + ...baseCreateSecurityProfileRequest_LabelsEntry, + } as CreateSecurityProfileRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateSecurityProfileRequest_LabelsEntry.$type, + CreateSecurityProfileRequest_LabelsEntry +); + +const baseCreateSecurityProfileMetadata: object = { + $type: "yandex.cloud.smartwebsecurity.v1.CreateSecurityProfileMetadata", + securityProfileId: "", +}; + +export const CreateSecurityProfileMetadata = { + $type: + "yandex.cloud.smartwebsecurity.v1.CreateSecurityProfileMetadata" as const, + + encode( + message: CreateSecurityProfileMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.securityProfileId !== "") { + writer.uint32(10).string(message.securityProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateSecurityProfileMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateSecurityProfileMetadata, + } as CreateSecurityProfileMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.securityProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateSecurityProfileMetadata { + const message = { + ...baseCreateSecurityProfileMetadata, + } as CreateSecurityProfileMetadata; + message.securityProfileId = + object.securityProfileId !== undefined && + object.securityProfileId !== null + ? String(object.securityProfileId) + : ""; + return message; + }, + + toJSON(message: CreateSecurityProfileMetadata): unknown { + const obj: any = {}; + message.securityProfileId !== undefined && + (obj.securityProfileId = message.securityProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateSecurityProfileMetadata { + const message = { + ...baseCreateSecurityProfileMetadata, + } as CreateSecurityProfileMetadata; + message.securityProfileId = object.securityProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateSecurityProfileMetadata.$type, + CreateSecurityProfileMetadata +); + +const baseUpdateSecurityProfileRequest: object = { + $type: "yandex.cloud.smartwebsecurity.v1.UpdateSecurityProfileRequest", + securityProfileId: "", + name: "", + description: "", + defaultAction: 0, + captchaId: "", + advancedRateLimiterProfileId: "", +}; + +export const UpdateSecurityProfileRequest = { + $type: + "yandex.cloud.smartwebsecurity.v1.UpdateSecurityProfileRequest" as const, + + encode( + message: UpdateSecurityProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.securityProfileId !== "") { + writer.uint32(10).string(message.securityProfileId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateSecurityProfileRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.smartwebsecurity.v1.UpdateSecurityProfileRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(26).fork() + ).ldelim(); + }); + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + if (message.defaultAction !== 0) { + writer.uint32(48).int32(message.defaultAction); + } + for (const v of message.securityRules) { + SecurityRule.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.captchaId !== "") { + writer.uint32(66).string(message.captchaId); + } + if (message.advancedRateLimiterProfileId !== "") { + writer.uint32(74).string(message.advancedRateLimiterProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateSecurityProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateSecurityProfileRequest, + } as UpdateSecurityProfileRequest; + message.labels = {}; + message.securityRules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.securityProfileId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + const entry3 = UpdateSecurityProfileRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry3.value !== undefined) { + message.labels[entry3.key] = entry3.value; + } + break; + case 4: + message.name = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.defaultAction = reader.int32() as any; + break; + case 7: + message.securityRules.push( + SecurityRule.decode(reader, reader.uint32()) + ); + break; + case 8: + message.captchaId = reader.string(); + break; + case 9: + message.advancedRateLimiterProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateSecurityProfileRequest { + const message = { + ...baseUpdateSecurityProfileRequest, + } as UpdateSecurityProfileRequest; + message.securityProfileId = + object.securityProfileId !== undefined && + object.securityProfileId !== null + ? String(object.securityProfileId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.defaultAction = + object.defaultAction !== undefined && object.defaultAction !== null + ? securityProfile_DefaultActionFromJSON(object.defaultAction) + : 0; + message.securityRules = (object.securityRules ?? []).map((e: any) => + SecurityRule.fromJSON(e) + ); + message.captchaId = + object.captchaId !== undefined && object.captchaId !== null + ? String(object.captchaId) + : ""; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId !== undefined && + object.advancedRateLimiterProfileId !== null + ? String(object.advancedRateLimiterProfileId) + : ""; + return message; + }, + + toJSON(message: UpdateSecurityProfileRequest): unknown { + const obj: any = {}; + message.securityProfileId !== undefined && + (obj.securityProfileId = message.securityProfileId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.defaultAction !== undefined && + (obj.defaultAction = securityProfile_DefaultActionToJSON( + message.defaultAction + )); + if (message.securityRules) { + obj.securityRules = message.securityRules.map((e) => + e ? SecurityRule.toJSON(e) : undefined + ); + } else { + obj.securityRules = []; + } + message.captchaId !== undefined && (obj.captchaId = message.captchaId); + message.advancedRateLimiterProfileId !== undefined && + (obj.advancedRateLimiterProfileId = message.advancedRateLimiterProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateSecurityProfileRequest { + const message = { + ...baseUpdateSecurityProfileRequest, + } as UpdateSecurityProfileRequest; + message.securityProfileId = object.securityProfileId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.defaultAction = object.defaultAction ?? 0; + message.securityRules = + object.securityRules?.map((e) => SecurityRule.fromPartial(e)) || []; + message.captchaId = object.captchaId ?? ""; + message.advancedRateLimiterProfileId = + object.advancedRateLimiterProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateSecurityProfileRequest.$type, + UpdateSecurityProfileRequest +); + +const baseUpdateSecurityProfileRequest_LabelsEntry: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.UpdateSecurityProfileRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateSecurityProfileRequest_LabelsEntry = { + $type: + "yandex.cloud.smartwebsecurity.v1.UpdateSecurityProfileRequest.LabelsEntry" as const, + + encode( + message: UpdateSecurityProfileRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateSecurityProfileRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateSecurityProfileRequest_LabelsEntry, + } as UpdateSecurityProfileRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateSecurityProfileRequest_LabelsEntry { + const message = { + ...baseUpdateSecurityProfileRequest_LabelsEntry, + } as UpdateSecurityProfileRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateSecurityProfileRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateSecurityProfileRequest_LabelsEntry { + const message = { + ...baseUpdateSecurityProfileRequest_LabelsEntry, + } as UpdateSecurityProfileRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateSecurityProfileRequest_LabelsEntry.$type, + UpdateSecurityProfileRequest_LabelsEntry +); + +const baseUpdateSecurityProfileMetadata: object = { + $type: "yandex.cloud.smartwebsecurity.v1.UpdateSecurityProfileMetadata", + securityProfileId: "", +}; + +export const UpdateSecurityProfileMetadata = { + $type: + "yandex.cloud.smartwebsecurity.v1.UpdateSecurityProfileMetadata" as const, + + encode( + message: UpdateSecurityProfileMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.securityProfileId !== "") { + writer.uint32(10).string(message.securityProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateSecurityProfileMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateSecurityProfileMetadata, + } as UpdateSecurityProfileMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.securityProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateSecurityProfileMetadata { + const message = { + ...baseUpdateSecurityProfileMetadata, + } as UpdateSecurityProfileMetadata; + message.securityProfileId = + object.securityProfileId !== undefined && + object.securityProfileId !== null + ? String(object.securityProfileId) + : ""; + return message; + }, + + toJSON(message: UpdateSecurityProfileMetadata): unknown { + const obj: any = {}; + message.securityProfileId !== undefined && + (obj.securityProfileId = message.securityProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateSecurityProfileMetadata { + const message = { + ...baseUpdateSecurityProfileMetadata, + } as UpdateSecurityProfileMetadata; + message.securityProfileId = object.securityProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateSecurityProfileMetadata.$type, + UpdateSecurityProfileMetadata +); + +const baseDeleteSecurityProfileRequest: object = { + $type: "yandex.cloud.smartwebsecurity.v1.DeleteSecurityProfileRequest", + securityProfileId: "", +}; + +export const DeleteSecurityProfileRequest = { + $type: + "yandex.cloud.smartwebsecurity.v1.DeleteSecurityProfileRequest" as const, + + encode( + message: DeleteSecurityProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.securityProfileId !== "") { + writer.uint32(10).string(message.securityProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteSecurityProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteSecurityProfileRequest, + } as DeleteSecurityProfileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.securityProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteSecurityProfileRequest { + const message = { + ...baseDeleteSecurityProfileRequest, + } as DeleteSecurityProfileRequest; + message.securityProfileId = + object.securityProfileId !== undefined && + object.securityProfileId !== null + ? String(object.securityProfileId) + : ""; + return message; + }, + + toJSON(message: DeleteSecurityProfileRequest): unknown { + const obj: any = {}; + message.securityProfileId !== undefined && + (obj.securityProfileId = message.securityProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteSecurityProfileRequest { + const message = { + ...baseDeleteSecurityProfileRequest, + } as DeleteSecurityProfileRequest; + message.securityProfileId = object.securityProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteSecurityProfileRequest.$type, + DeleteSecurityProfileRequest +); + +const baseDeleteSecurityProfileMetadata: object = { + $type: "yandex.cloud.smartwebsecurity.v1.DeleteSecurityProfileMetadata", + securityProfileId: "", +}; + +export const DeleteSecurityProfileMetadata = { + $type: + "yandex.cloud.smartwebsecurity.v1.DeleteSecurityProfileMetadata" as const, + + encode( + message: DeleteSecurityProfileMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.securityProfileId !== "") { + writer.uint32(10).string(message.securityProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteSecurityProfileMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteSecurityProfileMetadata, + } as DeleteSecurityProfileMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.securityProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteSecurityProfileMetadata { + const message = { + ...baseDeleteSecurityProfileMetadata, + } as DeleteSecurityProfileMetadata; + message.securityProfileId = + object.securityProfileId !== undefined && + object.securityProfileId !== null + ? String(object.securityProfileId) + : ""; + return message; + }, + + toJSON(message: DeleteSecurityProfileMetadata): unknown { + const obj: any = {}; + message.securityProfileId !== undefined && + (obj.securityProfileId = message.securityProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteSecurityProfileMetadata { + const message = { + ...baseDeleteSecurityProfileMetadata, + } as DeleteSecurityProfileMetadata; + message.securityProfileId = object.securityProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteSecurityProfileMetadata.$type, + DeleteSecurityProfileMetadata +); + +/** A set of methods for managing SecurityProfile resources. */ +export const SecurityProfileServiceService = { + /** Returns the specified SecurityProfile resource. */ + get: { + path: "/yandex.cloud.smartwebsecurity.v1.SecurityProfileService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetSecurityProfileRequest) => + Buffer.from(GetSecurityProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetSecurityProfileRequest.decode(value), + responseSerialize: (value: SecurityProfile) => + Buffer.from(SecurityProfile.encode(value).finish()), + responseDeserialize: (value: Buffer) => SecurityProfile.decode(value), + }, + /** Retrieves the list of SecurityProfile resources in the specified folder. */ + list: { + path: "/yandex.cloud.smartwebsecurity.v1.SecurityProfileService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListSecurityProfilesRequest) => + Buffer.from(ListSecurityProfilesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListSecurityProfilesRequest.decode(value), + responseSerialize: (value: ListSecurityProfilesResponse) => + Buffer.from(ListSecurityProfilesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListSecurityProfilesResponse.decode(value), + }, + /** Creates a security profile in the specified folder using the data specified in the request. */ + create: { + path: "/yandex.cloud.smartwebsecurity.v1.SecurityProfileService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateSecurityProfileRequest) => + Buffer.from(CreateSecurityProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CreateSecurityProfileRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates the specified security profile. */ + update: { + path: "/yandex.cloud.smartwebsecurity.v1.SecurityProfileService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateSecurityProfileRequest) => + Buffer.from(UpdateSecurityProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateSecurityProfileRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes the specified security profile. */ + delete: { + path: "/yandex.cloud.smartwebsecurity.v1.SecurityProfileService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteSecurityProfileRequest) => + Buffer.from(DeleteSecurityProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteSecurityProfileRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface SecurityProfileServiceServer + extends UntypedServiceImplementation { + /** Returns the specified SecurityProfile resource. */ + get: handleUnaryCall; + /** Retrieves the list of SecurityProfile resources in the specified folder. */ + list: handleUnaryCall< + ListSecurityProfilesRequest, + ListSecurityProfilesResponse + >; + /** Creates a security profile in the specified folder using the data specified in the request. */ + create: handleUnaryCall; + /** Updates the specified security profile. */ + update: handleUnaryCall; + /** Deletes the specified security profile. */ + delete: handleUnaryCall; +} + +export interface SecurityProfileServiceClient extends Client { + /** Returns the specified SecurityProfile resource. */ + get( + request: GetSecurityProfileRequest, + callback: (error: ServiceError | null, response: SecurityProfile) => void + ): ClientUnaryCall; + get( + request: GetSecurityProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: SecurityProfile) => void + ): ClientUnaryCall; + get( + request: GetSecurityProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: SecurityProfile) => void + ): ClientUnaryCall; + /** Retrieves the list of SecurityProfile resources in the specified folder. */ + list( + request: ListSecurityProfilesRequest, + callback: ( + error: ServiceError | null, + response: ListSecurityProfilesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListSecurityProfilesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListSecurityProfilesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListSecurityProfilesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListSecurityProfilesResponse + ) => void + ): ClientUnaryCall; + /** Creates a security profile in the specified folder using the data specified in the request. */ + create( + request: CreateSecurityProfileRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateSecurityProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateSecurityProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates the specified security profile. */ + update( + request: UpdateSecurityProfileRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateSecurityProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateSecurityProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes the specified security profile. */ + delete( + request: DeleteSecurityProfileRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteSecurityProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteSecurityProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const SecurityProfileServiceClient = makeGenericClientConstructor( + SecurityProfileServiceService, + "yandex.cloud.smartwebsecurity.v1.SecurityProfileService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): SecurityProfileServiceClient; + service: typeof SecurityProfileServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/smartwebsecurity/v1/waf/rule_set_descriptor.ts b/src/generated/yandex/cloud/smartwebsecurity/v1/waf/rule_set_descriptor.ts new file mode 100644 index 00000000..7e593dc0 --- /dev/null +++ b/src/generated/yandex/cloud/smartwebsecurity/v1/waf/rule_set_descriptor.ts @@ -0,0 +1,300 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.smartwebsecurity.v1.waf"; + +export interface RuleSetDescriptor { + $type: "yandex.cloud.smartwebsecurity.v1.waf.RuleSetDescriptor"; + /** Name of the rule set */ + name: string; + /** Version of the rule set */ + version: string; + /** ID of the rule set */ + id: string; + /** List of rules */ + rules: RuleSetDescriptor_RuleDescription[]; +} + +export interface RuleSetDescriptor_RuleDescription { + $type: "yandex.cloud.smartwebsecurity.v1.waf.RuleSetDescriptor.RuleDescription"; + /** ID of the rule */ + id: string; + /** + * Numeric anomaly value, i.e., a potential attack indicator. + * The higher this value, the more likely it is that the request that satisfies the rule is an attack. + * See [documentation](/docs/smartwebsecurity/concepts/waf#anomaly). + */ + anomalyScore: number; + /** + * Paranoia level classifies rules according to their aggression. + * The higher the paranoia level, the better your protection, but also the higher the probability of WAF false positives. + * See [documentation](/docs/smartwebsecurity/concepts/waf#paranoia). + */ + paranoiaLevel: number; +} + +const baseRuleSetDescriptor: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.RuleSetDescriptor", + name: "", + version: "", + id: "", +}; + +export const RuleSetDescriptor = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.RuleSetDescriptor" as const, + + encode( + message: RuleSetDescriptor, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + if (message.id !== "") { + writer.uint32(26).string(message.id); + } + for (const v of message.rules) { + RuleSetDescriptor_RuleDescription.encode( + v!, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RuleSetDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRuleSetDescriptor } as RuleSetDescriptor; + message.rules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + message.id = reader.string(); + break; + case 4: + message.rules.push( + RuleSetDescriptor_RuleDescription.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RuleSetDescriptor { + const message = { ...baseRuleSetDescriptor } as RuleSetDescriptor; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.version = + object.version !== undefined && object.version !== null + ? String(object.version) + : ""; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.rules = (object.rules ?? []).map((e: any) => + RuleSetDescriptor_RuleDescription.fromJSON(e) + ); + return message; + }, + + toJSON(message: RuleSetDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.version !== undefined && (obj.version = message.version); + message.id !== undefined && (obj.id = message.id); + if (message.rules) { + obj.rules = message.rules.map((e) => + e ? RuleSetDescriptor_RuleDescription.toJSON(e) : undefined + ); + } else { + obj.rules = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): RuleSetDescriptor { + const message = { ...baseRuleSetDescriptor } as RuleSetDescriptor; + message.name = object.name ?? ""; + message.version = object.version ?? ""; + message.id = object.id ?? ""; + message.rules = + object.rules?.map((e) => + RuleSetDescriptor_RuleDescription.fromPartial(e) + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(RuleSetDescriptor.$type, RuleSetDescriptor); + +const baseRuleSetDescriptor_RuleDescription: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.RuleSetDescriptor.RuleDescription", + id: "", + anomalyScore: 0, + paranoiaLevel: 0, +}; + +export const RuleSetDescriptor_RuleDescription = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.RuleSetDescriptor.RuleDescription" as const, + + encode( + message: RuleSetDescriptor_RuleDescription, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.anomalyScore !== 0) { + writer.uint32(64).int64(message.anomalyScore); + } + if (message.paranoiaLevel !== 0) { + writer.uint32(72).int64(message.paranoiaLevel); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RuleSetDescriptor_RuleDescription { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRuleSetDescriptor_RuleDescription, + } as RuleSetDescriptor_RuleDescription; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 8: + message.anomalyScore = longToNumber(reader.int64() as Long); + break; + case 9: + message.paranoiaLevel = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RuleSetDescriptor_RuleDescription { + const message = { + ...baseRuleSetDescriptor_RuleDescription, + } as RuleSetDescriptor_RuleDescription; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.anomalyScore = + object.anomalyScore !== undefined && object.anomalyScore !== null + ? Number(object.anomalyScore) + : 0; + message.paranoiaLevel = + object.paranoiaLevel !== undefined && object.paranoiaLevel !== null + ? Number(object.paranoiaLevel) + : 0; + return message; + }, + + toJSON(message: RuleSetDescriptor_RuleDescription): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.anomalyScore !== undefined && + (obj.anomalyScore = Math.round(message.anomalyScore)); + message.paranoiaLevel !== undefined && + (obj.paranoiaLevel = Math.round(message.paranoiaLevel)); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): RuleSetDescriptor_RuleDescription { + const message = { + ...baseRuleSetDescriptor_RuleDescription, + } as RuleSetDescriptor_RuleDescription; + message.id = object.id ?? ""; + message.anomalyScore = object.anomalyScore ?? 0; + message.paranoiaLevel = object.paranoiaLevel ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + RuleSetDescriptor_RuleDescription.$type, + RuleSetDescriptor_RuleDescription +); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/smartwebsecurity/v1/waf/rule_set_descriptor_service.ts b/src/generated/yandex/cloud/smartwebsecurity/v1/waf/rule_set_descriptor_service.ts new file mode 100644 index 00000000..eba929e5 --- /dev/null +++ b/src/generated/yandex/cloud/smartwebsecurity/v1/waf/rule_set_descriptor_service.ts @@ -0,0 +1,201 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { RuleSetDescriptor } from "../../../../../yandex/cloud/smartwebsecurity/v1/waf/rule_set_descriptor"; + +export const protobufPackage = "yandex.cloud.smartwebsecurity.v1.waf"; + +export interface GetRuleSetDescriptorRequest { + $type: "yandex.cloud.smartwebsecurity.v1.waf.GetRuleSetDescriptorRequest"; + /** Name of the RuleSetDescriptor resource to return. */ + name: string; + /** Version of the RuleSetDescriptor resource to return. */ + version: string; +} + +const baseGetRuleSetDescriptorRequest: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.GetRuleSetDescriptorRequest", + name: "", + version: "", +}; + +export const GetRuleSetDescriptorRequest = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.GetRuleSetDescriptorRequest" as const, + + encode( + message: GetRuleSetDescriptorRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetRuleSetDescriptorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetRuleSetDescriptorRequest, + } as GetRuleSetDescriptorRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetRuleSetDescriptorRequest { + const message = { + ...baseGetRuleSetDescriptorRequest, + } as GetRuleSetDescriptorRequest; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.version = + object.version !== undefined && object.version !== null + ? String(object.version) + : ""; + return message; + }, + + toJSON(message: GetRuleSetDescriptorRequest): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.version !== undefined && (obj.version = message.version); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetRuleSetDescriptorRequest { + const message = { + ...baseGetRuleSetDescriptorRequest, + } as GetRuleSetDescriptorRequest; + message.name = object.name ?? ""; + message.version = object.version ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetRuleSetDescriptorRequest.$type, + GetRuleSetDescriptorRequest +); + +/** A set of methods for managing RuleSetDescriptor resources. */ +export const RuleSetDescriptorServiceService = { + /** Returns the specified RuleSetDescriptor resource. */ + get: { + path: "/yandex.cloud.smartwebsecurity.v1.waf.RuleSetDescriptorService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetRuleSetDescriptorRequest) => + Buffer.from(GetRuleSetDescriptorRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetRuleSetDescriptorRequest.decode(value), + responseSerialize: (value: RuleSetDescriptor) => + Buffer.from(RuleSetDescriptor.encode(value).finish()), + responseDeserialize: (value: Buffer) => RuleSetDescriptor.decode(value), + }, +} as const; + +export interface RuleSetDescriptorServiceServer + extends UntypedServiceImplementation { + /** Returns the specified RuleSetDescriptor resource. */ + get: handleUnaryCall; +} + +export interface RuleSetDescriptorServiceClient extends Client { + /** Returns the specified RuleSetDescriptor resource. */ + get( + request: GetRuleSetDescriptorRequest, + callback: (error: ServiceError | null, response: RuleSetDescriptor) => void + ): ClientUnaryCall; + get( + request: GetRuleSetDescriptorRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: RuleSetDescriptor) => void + ): ClientUnaryCall; + get( + request: GetRuleSetDescriptorRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: RuleSetDescriptor) => void + ): ClientUnaryCall; +} + +export const RuleSetDescriptorServiceClient = makeGenericClientConstructor( + RuleSetDescriptorServiceService, + "yandex.cloud.smartwebsecurity.v1.waf.RuleSetDescriptorService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): RuleSetDescriptorServiceClient; + service: typeof RuleSetDescriptorServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/smartwebsecurity/v1/waf/waf_profile.ts b/src/generated/yandex/cloud/smartwebsecurity/v1/waf/waf_profile.ts new file mode 100644 index 00000000..71da62cc --- /dev/null +++ b/src/generated/yandex/cloud/smartwebsecurity/v1/waf/waf_profile.ts @@ -0,0 +1,1168 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Condition } from "../../../../../yandex/cloud/smartwebsecurity/v1/security_profile"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.smartwebsecurity.v1.waf"; + +export interface WafProfile { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfile"; + /** ID of the WAF profile. */ + id: string; + /** ID of the folder that the WAF profile belongs to. */ + folderId: string; + /** ID of the cloud that the WAF profile belongs to. */ + cloudId: string; + /** Name of the WAF profile. The name is unique within the folder. 1-50 characters long. */ + name: string; + /** Optional description of the WAF profile. */ + description: string; + /** Labels as `` key:value `` pairs. Maximum of 64 per resource. */ + labels: { [key: string]: string }; + /** Creation timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. */ + createdAt?: Date; + /** Settings for each rule in rule set. */ + rules: WafProfileRule[]; + /** List of exclusion rules. See [Rules](/docs/smartwebsecurity/concepts/waf#exclusion-rules). */ + exclusionRules: WafProfileExclusionRule[]; + /** Core rule set settings. See [Basic rule set](/docs/smartwebsecurity/concepts/waf#rules-set) for details. */ + coreRuleSet?: WafProfile_CoreRuleSet | undefined; + /** Parameters for request body analyzer. */ + analyzeRequestBody?: WafProfile_AnalyzeRequestBody; +} + +export interface WafProfile_LabelsEntry { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfile.LabelsEntry"; + key: string; + value: string; +} + +export interface WafProfile_CoreRuleSet { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfile.CoreRuleSet"; + /** + * Anomaly score. + * Enter an integer within the range of 2 and 10000. + * The higher this value, the more likely it is that the request that satisfies the rule is an attack. + * See [Rules](/docs/smartwebsecurity/concepts/waf#anomaly) for more details. + */ + inboundAnomalyScore: number; + /** + * Paranoia level. + * Enter an integer within the range of 1 and 4. + * Paranoia level classifies rules according to their aggression. The higher the paranoia level, the better your protection, + * but also the higher the probability of WAF false positives. + * See [Rules](/docs/smartwebsecurity/concepts/waf#paranoia) for more details. + * NOTE: this option has no effect on enabling or disabling rules. + * it is used only as recommendation for user to enable all rules with paranoia_level <= this value. + */ + paranoiaLevel: number; + /** Rule set. */ + ruleSet?: RuleSet; +} + +export interface WafProfile_AnalyzeRequestBody { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfile.AnalyzeRequestBody"; + /** Possible to turn analyzer on and turn if off. */ + isEnabled: boolean; + /** Maximum size of body to pass to analyzer. In kilobytes. */ + sizeLimit: number; + /** Action to perform if maximum size of body exceeded. */ + sizeLimitAction: WafProfile_AnalyzeRequestBody_Action; +} + +/** Action to perform if maximum size of body exceeded. */ +export enum WafProfile_AnalyzeRequestBody_Action { + ACTION_UNSPECIFIED = 0, + /** IGNORE - Ignore request. */ + IGNORE = 1, + /** DENY - Deny request. */ + DENY = 2, + UNRECOGNIZED = -1, +} + +export function wafProfile_AnalyzeRequestBody_ActionFromJSON( + object: any +): WafProfile_AnalyzeRequestBody_Action { + switch (object) { + case 0: + case "ACTION_UNSPECIFIED": + return WafProfile_AnalyzeRequestBody_Action.ACTION_UNSPECIFIED; + case 1: + case "IGNORE": + return WafProfile_AnalyzeRequestBody_Action.IGNORE; + case 2: + case "DENY": + return WafProfile_AnalyzeRequestBody_Action.DENY; + case -1: + case "UNRECOGNIZED": + default: + return WafProfile_AnalyzeRequestBody_Action.UNRECOGNIZED; + } +} + +export function wafProfile_AnalyzeRequestBody_ActionToJSON( + object: WafProfile_AnalyzeRequestBody_Action +): string { + switch (object) { + case WafProfile_AnalyzeRequestBody_Action.ACTION_UNSPECIFIED: + return "ACTION_UNSPECIFIED"; + case WafProfile_AnalyzeRequestBody_Action.IGNORE: + return "IGNORE"; + case WafProfile_AnalyzeRequestBody_Action.DENY: + return "DENY"; + default: + return "UNKNOWN"; + } +} + +/** WafProfileRule object. Determines settings for each rule_id in rule set. */ +export interface WafProfileRule { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfileRule"; + /** Rule ID. */ + ruleId: string; + /** Determines is it rule enabled or not. */ + isEnabled: boolean; + /** Determines is it rule blocking or not. */ + isBlocking: boolean; +} + +/** A WafProfileExclusionRule object. See [Exclusion rules](/docs/smartwebsecurity/concepts/waf#exclusion-rules). */ +export interface WafProfileExclusionRule { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfileExclusionRule"; + /** Name of exclusion rule. */ + name: string; + /** Optional description of the rule. 0-512 characters long. */ + description: string; + /** The condition for matching traffic. */ + condition?: Condition; + /** Exclude rules. */ + excludeRules?: WafProfileExclusionRule_ExcludeRules; + /** Records the fact that an exception rule is triggered. */ + logExcluded: boolean; +} + +/** Determines list of excluded rules. */ +export interface WafProfileExclusionRule_ExcludeRules { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfileExclusionRule.ExcludeRules"; + /** Set this option true to exclude all rules. */ + excludeAll: boolean; + /** List of rules to exclude. */ + ruleIds: string[]; +} + +/** A RuleSet object. Determines name and version of rule set. */ +export interface RuleSet { + $type: "yandex.cloud.smartwebsecurity.v1.waf.RuleSet"; + /** Name of rule set. */ + name: string; + /** Version of rule set. */ + version: string; +} + +const baseWafProfile: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfile", + id: "", + folderId: "", + cloudId: "", + name: "", + description: "", +}; + +export const WafProfile = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfile" as const, + + encode( + message: WafProfile, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.cloudId !== "") { + writer.uint32(26).string(message.cloudId); + } + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + WafProfile_LabelsEntry.encode( + { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfile.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(58).fork() + ).ldelim(); + } + for (const v of message.rules) { + WafProfileRule.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.exclusionRules) { + WafProfileExclusionRule.encode(v!, writer.uint32(82).fork()).ldelim(); + } + if (message.coreRuleSet !== undefined) { + WafProfile_CoreRuleSet.encode( + message.coreRuleSet, + writer.uint32(90).fork() + ).ldelim(); + } + if (message.analyzeRequestBody !== undefined) { + WafProfile_AnalyzeRequestBody.encode( + message.analyzeRequestBody, + writer.uint32(98).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): WafProfile { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWafProfile } as WafProfile; + message.labels = {}; + message.rules = []; + message.exclusionRules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.cloudId = reader.string(); + break; + case 4: + message.name = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + const entry6 = WafProfile_LabelsEntry.decode(reader, reader.uint32()); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + case 7: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 9: + message.rules.push(WafProfileRule.decode(reader, reader.uint32())); + break; + case 10: + message.exclusionRules.push( + WafProfileExclusionRule.decode(reader, reader.uint32()) + ); + break; + case 11: + message.coreRuleSet = WafProfile_CoreRuleSet.decode( + reader, + reader.uint32() + ); + break; + case 12: + message.analyzeRequestBody = WafProfile_AnalyzeRequestBody.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WafProfile { + const message = { ...baseWafProfile } as WafProfile; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.cloudId = + object.cloudId !== undefined && object.cloudId !== null + ? String(object.cloudId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.rules = (object.rules ?? []).map((e: any) => + WafProfileRule.fromJSON(e) + ); + message.exclusionRules = (object.exclusionRules ?? []).map((e: any) => + WafProfileExclusionRule.fromJSON(e) + ); + message.coreRuleSet = + object.coreRuleSet !== undefined && object.coreRuleSet !== null + ? WafProfile_CoreRuleSet.fromJSON(object.coreRuleSet) + : undefined; + message.analyzeRequestBody = + object.analyzeRequestBody !== undefined && + object.analyzeRequestBody !== null + ? WafProfile_AnalyzeRequestBody.fromJSON(object.analyzeRequestBody) + : undefined; + return message; + }, + + toJSON(message: WafProfile): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.cloudId !== undefined && (obj.cloudId = message.cloudId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + if (message.rules) { + obj.rules = message.rules.map((e) => + e ? WafProfileRule.toJSON(e) : undefined + ); + } else { + obj.rules = []; + } + if (message.exclusionRules) { + obj.exclusionRules = message.exclusionRules.map((e) => + e ? WafProfileExclusionRule.toJSON(e) : undefined + ); + } else { + obj.exclusionRules = []; + } + message.coreRuleSet !== undefined && + (obj.coreRuleSet = message.coreRuleSet + ? WafProfile_CoreRuleSet.toJSON(message.coreRuleSet) + : undefined); + message.analyzeRequestBody !== undefined && + (obj.analyzeRequestBody = message.analyzeRequestBody + ? WafProfile_AnalyzeRequestBody.toJSON(message.analyzeRequestBody) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): WafProfile { + const message = { ...baseWafProfile } as WafProfile; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.cloudId = object.cloudId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.createdAt = object.createdAt ?? undefined; + message.rules = + object.rules?.map((e) => WafProfileRule.fromPartial(e)) || []; + message.exclusionRules = + object.exclusionRules?.map((e) => + WafProfileExclusionRule.fromPartial(e) + ) || []; + message.coreRuleSet = + object.coreRuleSet !== undefined && object.coreRuleSet !== null + ? WafProfile_CoreRuleSet.fromPartial(object.coreRuleSet) + : undefined; + message.analyzeRequestBody = + object.analyzeRequestBody !== undefined && + object.analyzeRequestBody !== null + ? WafProfile_AnalyzeRequestBody.fromPartial(object.analyzeRequestBody) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(WafProfile.$type, WafProfile); + +const baseWafProfile_LabelsEntry: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfile.LabelsEntry", + key: "", + value: "", +}; + +export const WafProfile_LabelsEntry = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfile.LabelsEntry" as const, + + encode( + message: WafProfile_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): WafProfile_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWafProfile_LabelsEntry } as WafProfile_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WafProfile_LabelsEntry { + const message = { ...baseWafProfile_LabelsEntry } as WafProfile_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: WafProfile_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): WafProfile_LabelsEntry { + const message = { ...baseWafProfile_LabelsEntry } as WafProfile_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(WafProfile_LabelsEntry.$type, WafProfile_LabelsEntry); + +const baseWafProfile_CoreRuleSet: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfile.CoreRuleSet", + inboundAnomalyScore: 0, + paranoiaLevel: 0, +}; + +export const WafProfile_CoreRuleSet = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfile.CoreRuleSet" as const, + + encode( + message: WafProfile_CoreRuleSet, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.inboundAnomalyScore !== 0) { + writer.uint32(8).int64(message.inboundAnomalyScore); + } + if (message.paranoiaLevel !== 0) { + writer.uint32(16).int64(message.paranoiaLevel); + } + if (message.ruleSet !== undefined) { + RuleSet.encode(message.ruleSet, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): WafProfile_CoreRuleSet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWafProfile_CoreRuleSet } as WafProfile_CoreRuleSet; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inboundAnomalyScore = longToNumber(reader.int64() as Long); + break; + case 2: + message.paranoiaLevel = longToNumber(reader.int64() as Long); + break; + case 3: + message.ruleSet = RuleSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WafProfile_CoreRuleSet { + const message = { ...baseWafProfile_CoreRuleSet } as WafProfile_CoreRuleSet; + message.inboundAnomalyScore = + object.inboundAnomalyScore !== undefined && + object.inboundAnomalyScore !== null + ? Number(object.inboundAnomalyScore) + : 0; + message.paranoiaLevel = + object.paranoiaLevel !== undefined && object.paranoiaLevel !== null + ? Number(object.paranoiaLevel) + : 0; + message.ruleSet = + object.ruleSet !== undefined && object.ruleSet !== null + ? RuleSet.fromJSON(object.ruleSet) + : undefined; + return message; + }, + + toJSON(message: WafProfile_CoreRuleSet): unknown { + const obj: any = {}; + message.inboundAnomalyScore !== undefined && + (obj.inboundAnomalyScore = Math.round(message.inboundAnomalyScore)); + message.paranoiaLevel !== undefined && + (obj.paranoiaLevel = Math.round(message.paranoiaLevel)); + message.ruleSet !== undefined && + (obj.ruleSet = message.ruleSet + ? RuleSet.toJSON(message.ruleSet) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): WafProfile_CoreRuleSet { + const message = { ...baseWafProfile_CoreRuleSet } as WafProfile_CoreRuleSet; + message.inboundAnomalyScore = object.inboundAnomalyScore ?? 0; + message.paranoiaLevel = object.paranoiaLevel ?? 0; + message.ruleSet = + object.ruleSet !== undefined && object.ruleSet !== null + ? RuleSet.fromPartial(object.ruleSet) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(WafProfile_CoreRuleSet.$type, WafProfile_CoreRuleSet); + +const baseWafProfile_AnalyzeRequestBody: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfile.AnalyzeRequestBody", + isEnabled: false, + sizeLimit: 0, + sizeLimitAction: 0, +}; + +export const WafProfile_AnalyzeRequestBody = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.WafProfile.AnalyzeRequestBody" as const, + + encode( + message: WafProfile_AnalyzeRequestBody, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.isEnabled === true) { + writer.uint32(8).bool(message.isEnabled); + } + if (message.sizeLimit !== 0) { + writer.uint32(16).int64(message.sizeLimit); + } + if (message.sizeLimitAction !== 0) { + writer.uint32(24).int32(message.sizeLimitAction); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): WafProfile_AnalyzeRequestBody { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseWafProfile_AnalyzeRequestBody, + } as WafProfile_AnalyzeRequestBody; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.isEnabled = reader.bool(); + break; + case 2: + message.sizeLimit = longToNumber(reader.int64() as Long); + break; + case 3: + message.sizeLimitAction = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WafProfile_AnalyzeRequestBody { + const message = { + ...baseWafProfile_AnalyzeRequestBody, + } as WafProfile_AnalyzeRequestBody; + message.isEnabled = + object.isEnabled !== undefined && object.isEnabled !== null + ? Boolean(object.isEnabled) + : false; + message.sizeLimit = + object.sizeLimit !== undefined && object.sizeLimit !== null + ? Number(object.sizeLimit) + : 0; + message.sizeLimitAction = + object.sizeLimitAction !== undefined && object.sizeLimitAction !== null + ? wafProfile_AnalyzeRequestBody_ActionFromJSON(object.sizeLimitAction) + : 0; + return message; + }, + + toJSON(message: WafProfile_AnalyzeRequestBody): unknown { + const obj: any = {}; + message.isEnabled !== undefined && (obj.isEnabled = message.isEnabled); + message.sizeLimit !== undefined && + (obj.sizeLimit = Math.round(message.sizeLimit)); + message.sizeLimitAction !== undefined && + (obj.sizeLimitAction = wafProfile_AnalyzeRequestBody_ActionToJSON( + message.sizeLimitAction + )); + return obj; + }, + + fromPartial, I>>( + object: I + ): WafProfile_AnalyzeRequestBody { + const message = { + ...baseWafProfile_AnalyzeRequestBody, + } as WafProfile_AnalyzeRequestBody; + message.isEnabled = object.isEnabled ?? false; + message.sizeLimit = object.sizeLimit ?? 0; + message.sizeLimitAction = object.sizeLimitAction ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + WafProfile_AnalyzeRequestBody.$type, + WafProfile_AnalyzeRequestBody +); + +const baseWafProfileRule: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfileRule", + ruleId: "", + isEnabled: false, + isBlocking: false, +}; + +export const WafProfileRule = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfileRule" as const, + + encode( + message: WafProfileRule, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ruleId !== "") { + writer.uint32(10).string(message.ruleId); + } + if (message.isEnabled === true) { + writer.uint32(16).bool(message.isEnabled); + } + if (message.isBlocking === true) { + writer.uint32(24).bool(message.isBlocking); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): WafProfileRule { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWafProfileRule } as WafProfileRule; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ruleId = reader.string(); + break; + case 2: + message.isEnabled = reader.bool(); + break; + case 3: + message.isBlocking = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WafProfileRule { + const message = { ...baseWafProfileRule } as WafProfileRule; + message.ruleId = + object.ruleId !== undefined && object.ruleId !== null + ? String(object.ruleId) + : ""; + message.isEnabled = + object.isEnabled !== undefined && object.isEnabled !== null + ? Boolean(object.isEnabled) + : false; + message.isBlocking = + object.isBlocking !== undefined && object.isBlocking !== null + ? Boolean(object.isBlocking) + : false; + return message; + }, + + toJSON(message: WafProfileRule): unknown { + const obj: any = {}; + message.ruleId !== undefined && (obj.ruleId = message.ruleId); + message.isEnabled !== undefined && (obj.isEnabled = message.isEnabled); + message.isBlocking !== undefined && (obj.isBlocking = message.isBlocking); + return obj; + }, + + fromPartial, I>>( + object: I + ): WafProfileRule { + const message = { ...baseWafProfileRule } as WafProfileRule; + message.ruleId = object.ruleId ?? ""; + message.isEnabled = object.isEnabled ?? false; + message.isBlocking = object.isBlocking ?? false; + return message; + }, +}; + +messageTypeRegistry.set(WafProfileRule.$type, WafProfileRule); + +const baseWafProfileExclusionRule: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.WafProfileExclusionRule", + name: "", + description: "", + logExcluded: false, +}; + +export const WafProfileExclusionRule = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.WafProfileExclusionRule" as const, + + encode( + message: WafProfileExclusionRule, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.condition !== undefined) { + Condition.encode(message.condition, writer.uint32(26).fork()).ldelim(); + } + if (message.excludeRules !== undefined) { + WafProfileExclusionRule_ExcludeRules.encode( + message.excludeRules, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.logExcluded === true) { + writer.uint32(40).bool(message.logExcluded); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): WafProfileExclusionRule { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseWafProfileExclusionRule, + } as WafProfileExclusionRule; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.condition = Condition.decode(reader, reader.uint32()); + break; + case 4: + message.excludeRules = WafProfileExclusionRule_ExcludeRules.decode( + reader, + reader.uint32() + ); + break; + case 5: + message.logExcluded = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WafProfileExclusionRule { + const message = { + ...baseWafProfileExclusionRule, + } as WafProfileExclusionRule; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromJSON(object.condition) + : undefined; + message.excludeRules = + object.excludeRules !== undefined && object.excludeRules !== null + ? WafProfileExclusionRule_ExcludeRules.fromJSON(object.excludeRules) + : undefined; + message.logExcluded = + object.logExcluded !== undefined && object.logExcluded !== null + ? Boolean(object.logExcluded) + : false; + return message; + }, + + toJSON(message: WafProfileExclusionRule): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + message.condition !== undefined && + (obj.condition = message.condition + ? Condition.toJSON(message.condition) + : undefined); + message.excludeRules !== undefined && + (obj.excludeRules = message.excludeRules + ? WafProfileExclusionRule_ExcludeRules.toJSON(message.excludeRules) + : undefined); + message.logExcluded !== undefined && + (obj.logExcluded = message.logExcluded); + return obj; + }, + + fromPartial, I>>( + object: I + ): WafProfileExclusionRule { + const message = { + ...baseWafProfileExclusionRule, + } as WafProfileExclusionRule; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.condition = + object.condition !== undefined && object.condition !== null + ? Condition.fromPartial(object.condition) + : undefined; + message.excludeRules = + object.excludeRules !== undefined && object.excludeRules !== null + ? WafProfileExclusionRule_ExcludeRules.fromPartial(object.excludeRules) + : undefined; + message.logExcluded = object.logExcluded ?? false; + return message; + }, +}; + +messageTypeRegistry.set(WafProfileExclusionRule.$type, WafProfileExclusionRule); + +const baseWafProfileExclusionRule_ExcludeRules: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.WafProfileExclusionRule.ExcludeRules", + excludeAll: false, + ruleIds: "", +}; + +export const WafProfileExclusionRule_ExcludeRules = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.WafProfileExclusionRule.ExcludeRules" as const, + + encode( + message: WafProfileExclusionRule_ExcludeRules, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.excludeAll === true) { + writer.uint32(8).bool(message.excludeAll); + } + for (const v of message.ruleIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): WafProfileExclusionRule_ExcludeRules { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseWafProfileExclusionRule_ExcludeRules, + } as WafProfileExclusionRule_ExcludeRules; + message.ruleIds = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.excludeAll = reader.bool(); + break; + case 2: + message.ruleIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WafProfileExclusionRule_ExcludeRules { + const message = { + ...baseWafProfileExclusionRule_ExcludeRules, + } as WafProfileExclusionRule_ExcludeRules; + message.excludeAll = + object.excludeAll !== undefined && object.excludeAll !== null + ? Boolean(object.excludeAll) + : false; + message.ruleIds = (object.ruleIds ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: WafProfileExclusionRule_ExcludeRules): unknown { + const obj: any = {}; + message.excludeAll !== undefined && (obj.excludeAll = message.excludeAll); + if (message.ruleIds) { + obj.ruleIds = message.ruleIds.map((e) => e); + } else { + obj.ruleIds = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): WafProfileExclusionRule_ExcludeRules { + const message = { + ...baseWafProfileExclusionRule_ExcludeRules, + } as WafProfileExclusionRule_ExcludeRules; + message.excludeAll = object.excludeAll ?? false; + message.ruleIds = object.ruleIds?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + WafProfileExclusionRule_ExcludeRules.$type, + WafProfileExclusionRule_ExcludeRules +); + +const baseRuleSet: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.RuleSet", + name: "", + version: "", +}; + +export const RuleSet = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.RuleSet" as const, + + encode( + message: RuleSet, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RuleSet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRuleSet } as RuleSet; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RuleSet { + const message = { ...baseRuleSet } as RuleSet; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.version = + object.version !== undefined && object.version !== null + ? String(object.version) + : ""; + return message; + }, + + toJSON(message: RuleSet): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.version !== undefined && (obj.version = message.version); + return obj; + }, + + fromPartial, I>>(object: I): RuleSet { + const message = { ...baseRuleSet } as RuleSet; + message.name = object.name ?? ""; + message.version = object.version ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(RuleSet.$type, RuleSet); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/smartwebsecurity/v1/waf/waf_profile_service.ts b/src/generated/yandex/cloud/smartwebsecurity/v1/waf/waf_profile_service.ts new file mode 100644 index 00000000..5f248cb3 --- /dev/null +++ b/src/generated/yandex/cloud/smartwebsecurity/v1/waf/waf_profile_service.ts @@ -0,0 +1,1513 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + WafProfile_AnalyzeRequestBody, + WafProfile, + WafProfileRule, + WafProfileExclusionRule, + WafProfile_CoreRuleSet, +} from "../../../../../yandex/cloud/smartwebsecurity/v1/waf/waf_profile"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.smartwebsecurity.v1.waf"; + +export interface GetWafProfileRequest { + $type: "yandex.cloud.smartwebsecurity.v1.waf.GetWafProfileRequest"; + /** ID of the WafProfile resource to return. */ + wafProfileId: string; +} + +export interface ListWafProfilesRequest { + $type: "yandex.cloud.smartwebsecurity.v1.waf.ListWafProfilesRequest"; + /** + * ID of the folder that the WAF profile belongs to. + * Currently page_size, page_token, filter and order_by are not supported and List method will return all WAF profiles in the folder. + */ + folderId: string; +} + +export interface ListWafProfilesResponse { + $type: "yandex.cloud.smartwebsecurity.v1.waf.ListWafProfilesResponse"; + /** + * List of WafProfile resources. + * Currently next_page_token is not supported and List method will return all WAF profiles in the folder. + */ + wafProfiles: WafProfile[]; +} + +export interface CreateWafProfileRequest { + $type: "yandex.cloud.smartwebsecurity.v1.waf.CreateWafProfileRequest"; + /** ID of the folder to create a WAF profile in. */ + folderId: string; + /** Name of the WAF profile. The name is unique within the folder. 1-50 characters long. */ + name: string; + /** Optional description of the WAF profile. */ + description: string; + /** Labels as `` key:value `` pairs. Maximum of 64 per resource. */ + labels: { [key: string]: string }; + /** Settings for each rule in rule set. */ + rules: WafProfileRule[]; + /** List of exclusion rules. See [Rules](/docs/smartwebsecurity/concepts/waf#exclusion-rules). */ + exclusionRules: WafProfileExclusionRule[]; + /** Core rule set settings. See [Basic rule set](/docs/smartwebsecurity/concepts/waf#rules-set) for details. */ + coreRuleSet?: WafProfile_CoreRuleSet | undefined; + /** Parameters for request body analyzer. */ + analyzeRequestBody?: WafProfile_AnalyzeRequestBody; +} + +export interface CreateWafProfileRequest_LabelsEntry { + $type: "yandex.cloud.smartwebsecurity.v1.waf.CreateWafProfileRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface CreateWafProfileMetadata { + $type: "yandex.cloud.smartwebsecurity.v1.waf.CreateWafProfileMetadata"; + /** ID of the WAF profile that is being created. */ + wafProfileId: string; +} + +export interface UpdateWafProfileRequest { + $type: "yandex.cloud.smartwebsecurity.v1.waf.UpdateWafProfileRequest"; + /** ID of the WAF profile to update. */ + wafProfileId: string; + /** Field mask that specifies which fields of the WafProfile resource are going to be updated. */ + updateMask?: FieldMask; + /** Name of the WAF profile. The name is unique within the folder. 1-50 characters long. */ + name: string; + /** Optional description of the WAF profile. */ + description: string; + /** Labels as `` key:value `` pairs. Maximum of 64 per resource. */ + labels: { [key: string]: string }; + /** Settings for each rule in rule set. */ + rules: WafProfileRule[]; + /** List of exclusion rules. See [Rules](/docs/smartwebsecurity/concepts/waf#exclusion-rules). */ + exclusionRules: WafProfileExclusionRule[]; + /** Core rule set settings. See [Basic rule set](/docs/smartwebsecurity/concepts/waf#rules-set) for details. */ + coreRuleSet?: WafProfile_CoreRuleSet | undefined; + /** Parameters for request body analyzer. */ + analyzeRequestBody?: WafProfile_AnalyzeRequestBody; +} + +export interface UpdateWafProfileRequest_LabelsEntry { + $type: "yandex.cloud.smartwebsecurity.v1.waf.UpdateWafProfileRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateWafProfileMetadata { + $type: "yandex.cloud.smartwebsecurity.v1.waf.UpdateWafProfileMetadata"; + /** ID of the WafProfile resource that is being updated. */ + wafProfileId: string; +} + +export interface DeleteWafProfileRequest { + $type: "yandex.cloud.smartwebsecurity.v1.waf.DeleteWafProfileRequest"; + /** ID of the WAF profile to delete. */ + wafProfileId: string; +} + +export interface DeleteWafProfileMetadata { + $type: "yandex.cloud.smartwebsecurity.v1.waf.DeleteWafProfileMetadata"; + /** ID of the WafProfile resource that is being deleted. */ + wafProfileId: string; +} + +const baseGetWafProfileRequest: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.GetWafProfileRequest", + wafProfileId: "", +}; + +export const GetWafProfileRequest = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.GetWafProfileRequest" as const, + + encode( + message: GetWafProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.wafProfileId !== "") { + writer.uint32(10).string(message.wafProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetWafProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetWafProfileRequest } as GetWafProfileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wafProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetWafProfileRequest { + const message = { ...baseGetWafProfileRequest } as GetWafProfileRequest; + message.wafProfileId = + object.wafProfileId !== undefined && object.wafProfileId !== null + ? String(object.wafProfileId) + : ""; + return message; + }, + + toJSON(message: GetWafProfileRequest): unknown { + const obj: any = {}; + message.wafProfileId !== undefined && + (obj.wafProfileId = message.wafProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetWafProfileRequest { + const message = { ...baseGetWafProfileRequest } as GetWafProfileRequest; + message.wafProfileId = object.wafProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetWafProfileRequest.$type, GetWafProfileRequest); + +const baseListWafProfilesRequest: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.ListWafProfilesRequest", + folderId: "", +}; + +export const ListWafProfilesRequest = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.ListWafProfilesRequest" as const, + + encode( + message: ListWafProfilesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListWafProfilesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListWafProfilesRequest } as ListWafProfilesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListWafProfilesRequest { + const message = { ...baseListWafProfilesRequest } as ListWafProfilesRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + return message; + }, + + toJSON(message: ListWafProfilesRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListWafProfilesRequest { + const message = { ...baseListWafProfilesRequest } as ListWafProfilesRequest; + message.folderId = object.folderId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListWafProfilesRequest.$type, ListWafProfilesRequest); + +const baseListWafProfilesResponse: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.ListWafProfilesResponse", +}; + +export const ListWafProfilesResponse = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.ListWafProfilesResponse" as const, + + encode( + message: ListWafProfilesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.wafProfiles) { + WafProfile.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListWafProfilesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListWafProfilesResponse, + } as ListWafProfilesResponse; + message.wafProfiles = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wafProfiles.push(WafProfile.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListWafProfilesResponse { + const message = { + ...baseListWafProfilesResponse, + } as ListWafProfilesResponse; + message.wafProfiles = (object.wafProfiles ?? []).map((e: any) => + WafProfile.fromJSON(e) + ); + return message; + }, + + toJSON(message: ListWafProfilesResponse): unknown { + const obj: any = {}; + if (message.wafProfiles) { + obj.wafProfiles = message.wafProfiles.map((e) => + e ? WafProfile.toJSON(e) : undefined + ); + } else { + obj.wafProfiles = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ListWafProfilesResponse { + const message = { + ...baseListWafProfilesResponse, + } as ListWafProfilesResponse; + message.wafProfiles = + object.wafProfiles?.map((e) => WafProfile.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ListWafProfilesResponse.$type, ListWafProfilesResponse); + +const baseCreateWafProfileRequest: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.CreateWafProfileRequest", + folderId: "", + name: "", + description: "", +}; + +export const CreateWafProfileRequest = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.CreateWafProfileRequest" as const, + + encode( + message: CreateWafProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateWafProfileRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.CreateWafProfileRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(34).fork() + ).ldelim(); + }); + for (const v of message.rules) { + WafProfileRule.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.exclusionRules) { + WafProfileExclusionRule.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.coreRuleSet !== undefined) { + WafProfile_CoreRuleSet.encode( + message.coreRuleSet, + writer.uint32(58).fork() + ).ldelim(); + } + if (message.analyzeRequestBody !== undefined) { + WafProfile_AnalyzeRequestBody.encode( + message.analyzeRequestBody, + writer.uint32(66).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateWafProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateWafProfileRequest, + } as CreateWafProfileRequest; + message.labels = {}; + message.rules = []; + message.exclusionRules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + const entry4 = CreateWafProfileRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry4.value !== undefined) { + message.labels[entry4.key] = entry4.value; + } + break; + case 5: + message.rules.push(WafProfileRule.decode(reader, reader.uint32())); + break; + case 6: + message.exclusionRules.push( + WafProfileExclusionRule.decode(reader, reader.uint32()) + ); + break; + case 7: + message.coreRuleSet = WafProfile_CoreRuleSet.decode( + reader, + reader.uint32() + ); + break; + case 8: + message.analyzeRequestBody = WafProfile_AnalyzeRequestBody.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateWafProfileRequest { + const message = { + ...baseCreateWafProfileRequest, + } as CreateWafProfileRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.rules = (object.rules ?? []).map((e: any) => + WafProfileRule.fromJSON(e) + ); + message.exclusionRules = (object.exclusionRules ?? []).map((e: any) => + WafProfileExclusionRule.fromJSON(e) + ); + message.coreRuleSet = + object.coreRuleSet !== undefined && object.coreRuleSet !== null + ? WafProfile_CoreRuleSet.fromJSON(object.coreRuleSet) + : undefined; + message.analyzeRequestBody = + object.analyzeRequestBody !== undefined && + object.analyzeRequestBody !== null + ? WafProfile_AnalyzeRequestBody.fromJSON(object.analyzeRequestBody) + : undefined; + return message; + }, + + toJSON(message: CreateWafProfileRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + if (message.rules) { + obj.rules = message.rules.map((e) => + e ? WafProfileRule.toJSON(e) : undefined + ); + } else { + obj.rules = []; + } + if (message.exclusionRules) { + obj.exclusionRules = message.exclusionRules.map((e) => + e ? WafProfileExclusionRule.toJSON(e) : undefined + ); + } else { + obj.exclusionRules = []; + } + message.coreRuleSet !== undefined && + (obj.coreRuleSet = message.coreRuleSet + ? WafProfile_CoreRuleSet.toJSON(message.coreRuleSet) + : undefined); + message.analyzeRequestBody !== undefined && + (obj.analyzeRequestBody = message.analyzeRequestBody + ? WafProfile_AnalyzeRequestBody.toJSON(message.analyzeRequestBody) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateWafProfileRequest { + const message = { + ...baseCreateWafProfileRequest, + } as CreateWafProfileRequest; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.rules = + object.rules?.map((e) => WafProfileRule.fromPartial(e)) || []; + message.exclusionRules = + object.exclusionRules?.map((e) => + WafProfileExclusionRule.fromPartial(e) + ) || []; + message.coreRuleSet = + object.coreRuleSet !== undefined && object.coreRuleSet !== null + ? WafProfile_CoreRuleSet.fromPartial(object.coreRuleSet) + : undefined; + message.analyzeRequestBody = + object.analyzeRequestBody !== undefined && + object.analyzeRequestBody !== null + ? WafProfile_AnalyzeRequestBody.fromPartial(object.analyzeRequestBody) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CreateWafProfileRequest.$type, CreateWafProfileRequest); + +const baseCreateWafProfileRequest_LabelsEntry: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.CreateWafProfileRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateWafProfileRequest_LabelsEntry = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.CreateWafProfileRequest.LabelsEntry" as const, + + encode( + message: CreateWafProfileRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateWafProfileRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateWafProfileRequest_LabelsEntry, + } as CreateWafProfileRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateWafProfileRequest_LabelsEntry { + const message = { + ...baseCreateWafProfileRequest_LabelsEntry, + } as CreateWafProfileRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateWafProfileRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateWafProfileRequest_LabelsEntry { + const message = { + ...baseCreateWafProfileRequest_LabelsEntry, + } as CreateWafProfileRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateWafProfileRequest_LabelsEntry.$type, + CreateWafProfileRequest_LabelsEntry +); + +const baseCreateWafProfileMetadata: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.CreateWafProfileMetadata", + wafProfileId: "", +}; + +export const CreateWafProfileMetadata = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.CreateWafProfileMetadata" as const, + + encode( + message: CreateWafProfileMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.wafProfileId !== "") { + writer.uint32(10).string(message.wafProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateWafProfileMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateWafProfileMetadata, + } as CreateWafProfileMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wafProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateWafProfileMetadata { + const message = { + ...baseCreateWafProfileMetadata, + } as CreateWafProfileMetadata; + message.wafProfileId = + object.wafProfileId !== undefined && object.wafProfileId !== null + ? String(object.wafProfileId) + : ""; + return message; + }, + + toJSON(message: CreateWafProfileMetadata): unknown { + const obj: any = {}; + message.wafProfileId !== undefined && + (obj.wafProfileId = message.wafProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateWafProfileMetadata { + const message = { + ...baseCreateWafProfileMetadata, + } as CreateWafProfileMetadata; + message.wafProfileId = object.wafProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateWafProfileMetadata.$type, + CreateWafProfileMetadata +); + +const baseUpdateWafProfileRequest: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.UpdateWafProfileRequest", + wafProfileId: "", + name: "", + description: "", +}; + +export const UpdateWafProfileRequest = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.UpdateWafProfileRequest" as const, + + encode( + message: UpdateWafProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.wafProfileId !== "") { + writer.uint32(10).string(message.wafProfileId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateWafProfileRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.UpdateWafProfileRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(42).fork() + ).ldelim(); + }); + for (const v of message.rules) { + WafProfileRule.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.exclusionRules) { + WafProfileExclusionRule.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.coreRuleSet !== undefined) { + WafProfile_CoreRuleSet.encode( + message.coreRuleSet, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.analyzeRequestBody !== undefined) { + WafProfile_AnalyzeRequestBody.encode( + message.analyzeRequestBody, + writer.uint32(74).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateWafProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateWafProfileRequest, + } as UpdateWafProfileRequest; + message.labels = {}; + message.rules = []; + message.exclusionRules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wafProfileId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + const entry5 = UpdateWafProfileRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry5.value !== undefined) { + message.labels[entry5.key] = entry5.value; + } + break; + case 6: + message.rules.push(WafProfileRule.decode(reader, reader.uint32())); + break; + case 7: + message.exclusionRules.push( + WafProfileExclusionRule.decode(reader, reader.uint32()) + ); + break; + case 8: + message.coreRuleSet = WafProfile_CoreRuleSet.decode( + reader, + reader.uint32() + ); + break; + case 9: + message.analyzeRequestBody = WafProfile_AnalyzeRequestBody.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateWafProfileRequest { + const message = { + ...baseUpdateWafProfileRequest, + } as UpdateWafProfileRequest; + message.wafProfileId = + object.wafProfileId !== undefined && object.wafProfileId !== null + ? String(object.wafProfileId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.rules = (object.rules ?? []).map((e: any) => + WafProfileRule.fromJSON(e) + ); + message.exclusionRules = (object.exclusionRules ?? []).map((e: any) => + WafProfileExclusionRule.fromJSON(e) + ); + message.coreRuleSet = + object.coreRuleSet !== undefined && object.coreRuleSet !== null + ? WafProfile_CoreRuleSet.fromJSON(object.coreRuleSet) + : undefined; + message.analyzeRequestBody = + object.analyzeRequestBody !== undefined && + object.analyzeRequestBody !== null + ? WafProfile_AnalyzeRequestBody.fromJSON(object.analyzeRequestBody) + : undefined; + return message; + }, + + toJSON(message: UpdateWafProfileRequest): unknown { + const obj: any = {}; + message.wafProfileId !== undefined && + (obj.wafProfileId = message.wafProfileId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + if (message.rules) { + obj.rules = message.rules.map((e) => + e ? WafProfileRule.toJSON(e) : undefined + ); + } else { + obj.rules = []; + } + if (message.exclusionRules) { + obj.exclusionRules = message.exclusionRules.map((e) => + e ? WafProfileExclusionRule.toJSON(e) : undefined + ); + } else { + obj.exclusionRules = []; + } + message.coreRuleSet !== undefined && + (obj.coreRuleSet = message.coreRuleSet + ? WafProfile_CoreRuleSet.toJSON(message.coreRuleSet) + : undefined); + message.analyzeRequestBody !== undefined && + (obj.analyzeRequestBody = message.analyzeRequestBody + ? WafProfile_AnalyzeRequestBody.toJSON(message.analyzeRequestBody) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateWafProfileRequest { + const message = { + ...baseUpdateWafProfileRequest, + } as UpdateWafProfileRequest; + message.wafProfileId = object.wafProfileId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.rules = + object.rules?.map((e) => WafProfileRule.fromPartial(e)) || []; + message.exclusionRules = + object.exclusionRules?.map((e) => + WafProfileExclusionRule.fromPartial(e) + ) || []; + message.coreRuleSet = + object.coreRuleSet !== undefined && object.coreRuleSet !== null + ? WafProfile_CoreRuleSet.fromPartial(object.coreRuleSet) + : undefined; + message.analyzeRequestBody = + object.analyzeRequestBody !== undefined && + object.analyzeRequestBody !== null + ? WafProfile_AnalyzeRequestBody.fromPartial(object.analyzeRequestBody) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UpdateWafProfileRequest.$type, UpdateWafProfileRequest); + +const baseUpdateWafProfileRequest_LabelsEntry: object = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.UpdateWafProfileRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateWafProfileRequest_LabelsEntry = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.UpdateWafProfileRequest.LabelsEntry" as const, + + encode( + message: UpdateWafProfileRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateWafProfileRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateWafProfileRequest_LabelsEntry, + } as UpdateWafProfileRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateWafProfileRequest_LabelsEntry { + const message = { + ...baseUpdateWafProfileRequest_LabelsEntry, + } as UpdateWafProfileRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateWafProfileRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateWafProfileRequest_LabelsEntry { + const message = { + ...baseUpdateWafProfileRequest_LabelsEntry, + } as UpdateWafProfileRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateWafProfileRequest_LabelsEntry.$type, + UpdateWafProfileRequest_LabelsEntry +); + +const baseUpdateWafProfileMetadata: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.UpdateWafProfileMetadata", + wafProfileId: "", +}; + +export const UpdateWafProfileMetadata = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.UpdateWafProfileMetadata" as const, + + encode( + message: UpdateWafProfileMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.wafProfileId !== "") { + writer.uint32(10).string(message.wafProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateWafProfileMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateWafProfileMetadata, + } as UpdateWafProfileMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wafProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateWafProfileMetadata { + const message = { + ...baseUpdateWafProfileMetadata, + } as UpdateWafProfileMetadata; + message.wafProfileId = + object.wafProfileId !== undefined && object.wafProfileId !== null + ? String(object.wafProfileId) + : ""; + return message; + }, + + toJSON(message: UpdateWafProfileMetadata): unknown { + const obj: any = {}; + message.wafProfileId !== undefined && + (obj.wafProfileId = message.wafProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateWafProfileMetadata { + const message = { + ...baseUpdateWafProfileMetadata, + } as UpdateWafProfileMetadata; + message.wafProfileId = object.wafProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateWafProfileMetadata.$type, + UpdateWafProfileMetadata +); + +const baseDeleteWafProfileRequest: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.DeleteWafProfileRequest", + wafProfileId: "", +}; + +export const DeleteWafProfileRequest = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.DeleteWafProfileRequest" as const, + + encode( + message: DeleteWafProfileRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.wafProfileId !== "") { + writer.uint32(10).string(message.wafProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteWafProfileRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteWafProfileRequest, + } as DeleteWafProfileRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wafProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteWafProfileRequest { + const message = { + ...baseDeleteWafProfileRequest, + } as DeleteWafProfileRequest; + message.wafProfileId = + object.wafProfileId !== undefined && object.wafProfileId !== null + ? String(object.wafProfileId) + : ""; + return message; + }, + + toJSON(message: DeleteWafProfileRequest): unknown { + const obj: any = {}; + message.wafProfileId !== undefined && + (obj.wafProfileId = message.wafProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteWafProfileRequest { + const message = { + ...baseDeleteWafProfileRequest, + } as DeleteWafProfileRequest; + message.wafProfileId = object.wafProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteWafProfileRequest.$type, DeleteWafProfileRequest); + +const baseDeleteWafProfileMetadata: object = { + $type: "yandex.cloud.smartwebsecurity.v1.waf.DeleteWafProfileMetadata", + wafProfileId: "", +}; + +export const DeleteWafProfileMetadata = { + $type: + "yandex.cloud.smartwebsecurity.v1.waf.DeleteWafProfileMetadata" as const, + + encode( + message: DeleteWafProfileMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.wafProfileId !== "") { + writer.uint32(10).string(message.wafProfileId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteWafProfileMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteWafProfileMetadata, + } as DeleteWafProfileMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wafProfileId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteWafProfileMetadata { + const message = { + ...baseDeleteWafProfileMetadata, + } as DeleteWafProfileMetadata; + message.wafProfileId = + object.wafProfileId !== undefined && object.wafProfileId !== null + ? String(object.wafProfileId) + : ""; + return message; + }, + + toJSON(message: DeleteWafProfileMetadata): unknown { + const obj: any = {}; + message.wafProfileId !== undefined && + (obj.wafProfileId = message.wafProfileId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteWafProfileMetadata { + const message = { + ...baseDeleteWafProfileMetadata, + } as DeleteWafProfileMetadata; + message.wafProfileId = object.wafProfileId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteWafProfileMetadata.$type, + DeleteWafProfileMetadata +); + +/** A set of methods for managing WafProfile resources. */ +export const WafProfileServiceService = { + /** Returns the specified WafProfile resource. */ + get: { + path: "/yandex.cloud.smartwebsecurity.v1.waf.WafProfileService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetWafProfileRequest) => + Buffer.from(GetWafProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetWafProfileRequest.decode(value), + responseSerialize: (value: WafProfile) => + Buffer.from(WafProfile.encode(value).finish()), + responseDeserialize: (value: Buffer) => WafProfile.decode(value), + }, + /** Retrieves the list of WafProfile resources in the specified folder. */ + list: { + path: "/yandex.cloud.smartwebsecurity.v1.waf.WafProfileService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListWafProfilesRequest) => + Buffer.from(ListWafProfilesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListWafProfilesRequest.decode(value), + responseSerialize: (value: ListWafProfilesResponse) => + Buffer.from(ListWafProfilesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListWafProfilesResponse.decode(value), + }, + /** Creates a WAF profile in the specified folder using the data specified in the request. */ + create: { + path: "/yandex.cloud.smartwebsecurity.v1.waf.WafProfileService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateWafProfileRequest) => + Buffer.from(CreateWafProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CreateWafProfileRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates the specified WAF profile. */ + update: { + path: "/yandex.cloud.smartwebsecurity.v1.waf.WafProfileService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateWafProfileRequest) => + Buffer.from(UpdateWafProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateWafProfileRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes the specified WAF profile. */ + delete: { + path: "/yandex.cloud.smartwebsecurity.v1.waf.WafProfileService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteWafProfileRequest) => + Buffer.from(DeleteWafProfileRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteWafProfileRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface WafProfileServiceServer extends UntypedServiceImplementation { + /** Returns the specified WafProfile resource. */ + get: handleUnaryCall; + /** Retrieves the list of WafProfile resources in the specified folder. */ + list: handleUnaryCall; + /** Creates a WAF profile in the specified folder using the data specified in the request. */ + create: handleUnaryCall; + /** Updates the specified WAF profile. */ + update: handleUnaryCall; + /** Deletes the specified WAF profile. */ + delete: handleUnaryCall; +} + +export interface WafProfileServiceClient extends Client { + /** Returns the specified WafProfile resource. */ + get( + request: GetWafProfileRequest, + callback: (error: ServiceError | null, response: WafProfile) => void + ): ClientUnaryCall; + get( + request: GetWafProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: WafProfile) => void + ): ClientUnaryCall; + get( + request: GetWafProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: WafProfile) => void + ): ClientUnaryCall; + /** Retrieves the list of WafProfile resources in the specified folder. */ + list( + request: ListWafProfilesRequest, + callback: ( + error: ServiceError | null, + response: ListWafProfilesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListWafProfilesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListWafProfilesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListWafProfilesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListWafProfilesResponse + ) => void + ): ClientUnaryCall; + /** Creates a WAF profile in the specified folder using the data specified in the request. */ + create( + request: CreateWafProfileRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateWafProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateWafProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates the specified WAF profile. */ + update( + request: UpdateWafProfileRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateWafProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateWafProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes the specified WAF profile. */ + delete( + request: DeleteWafProfileRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteWafProfileRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteWafProfileRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const WafProfileServiceClient = makeGenericClientConstructor( + WafProfileServiceService, + "yandex.cloud.smartwebsecurity.v1.waf.WafProfileService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): WafProfileServiceClient; + service: typeof WafProfileServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/index.ts b/src/generated/yandex/cloud/speechsense/index.ts new file mode 100644 index 00000000..d0bab56c --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/index.ts @@ -0,0 +1,19 @@ +export * as v1_audio from './v1/audio' +export * as v1_project from './v1/project' +export * as v1_project_service from './v1/project_service' +export * as v1_search from './v1/search' +export * as v1_talk from './v1/talk' +export * as v1_talk_service from './v1/talk_service' +export * as v1_text from './v1/text' +export * as v1_analysis_conversation_statistics from './v1/analysis/conversation_statistics' +export * as v1_analysis_interrupts_statistics from './v1/analysis/interrupts_statistics' +export * as v1_analysis_points from './v1/analysis/points' +export * as v1_analysis_predefined_classifiers from './v1/analysis/predefined_classifiers' +export * as v1_analysis_silence_statistics from './v1/analysis/silence_statistics' +export * as v1_analysis_speaker_statistics from './v1/analysis/speaker_statistics' +export * as v1_analysis_speech_statistics from './v1/analysis/speech_statistics' +export * as v1_analysis_statistics_common from './v1/analysis/statistics_common' +export * as v1_analysis_summarization from './v1/analysis/summarization' +export * as v1_analysis_text_classifiers from './v1/analysis/text_classifiers' +export * as v1_analysis_transcription from './v1/analysis/transcription' +export * as v1_analysis_utterance_statistics from './v1/analysis/utterance_statistics' \ No newline at end of file diff --git a/src/generated/yandex/cloud/speechsense/v1/analysis/conversation_statistics.ts b/src/generated/yandex/cloud/speechsense/v1/analysis/conversation_statistics.ts new file mode 100644 index 00000000..91e3289c --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/analysis/conversation_statistics.ts @@ -0,0 +1,148 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { AudioSegmentBoundaries } from "../../../../../yandex/cloud/speechsense/v1/analysis/statistics_common"; +import { SpeakerStatistics } from "../../../../../yandex/cloud/speechsense/v1/analysis/speaker_statistics"; + +export const protobufPackage = "yandex.cloud.speechsense.v1.analysis"; + +export interface ConversationStatistics { + $type: "yandex.cloud.speechsense.v1.analysis.ConversationStatistics"; + /** Audio segment boundaries */ + conversationBoundaries?: AudioSegmentBoundaries; + /** Average statistics for each speaker */ + speakerStatistics: SpeakerStatistics[]; +} + +const baseConversationStatistics: object = { + $type: "yandex.cloud.speechsense.v1.analysis.ConversationStatistics", +}; + +export const ConversationStatistics = { + $type: "yandex.cloud.speechsense.v1.analysis.ConversationStatistics" as const, + + encode( + message: ConversationStatistics, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.conversationBoundaries !== undefined) { + AudioSegmentBoundaries.encode( + message.conversationBoundaries, + writer.uint32(10).fork() + ).ldelim(); + } + for (const v of message.speakerStatistics) { + SpeakerStatistics.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ConversationStatistics { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConversationStatistics } as ConversationStatistics; + message.speakerStatistics = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.conversationBoundaries = AudioSegmentBoundaries.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.speakerStatistics.push( + SpeakerStatistics.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConversationStatistics { + const message = { ...baseConversationStatistics } as ConversationStatistics; + message.conversationBoundaries = + object.conversationBoundaries !== undefined && + object.conversationBoundaries !== null + ? AudioSegmentBoundaries.fromJSON(object.conversationBoundaries) + : undefined; + message.speakerStatistics = (object.speakerStatistics ?? []).map((e: any) => + SpeakerStatistics.fromJSON(e) + ); + return message; + }, + + toJSON(message: ConversationStatistics): unknown { + const obj: any = {}; + message.conversationBoundaries !== undefined && + (obj.conversationBoundaries = message.conversationBoundaries + ? AudioSegmentBoundaries.toJSON(message.conversationBoundaries) + : undefined); + if (message.speakerStatistics) { + obj.speakerStatistics = message.speakerStatistics.map((e) => + e ? SpeakerStatistics.toJSON(e) : undefined + ); + } else { + obj.speakerStatistics = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ConversationStatistics { + const message = { ...baseConversationStatistics } as ConversationStatistics; + message.conversationBoundaries = + object.conversationBoundaries !== undefined && + object.conversationBoundaries !== null + ? AudioSegmentBoundaries.fromPartial(object.conversationBoundaries) + : undefined; + message.speakerStatistics = + object.speakerStatistics?.map((e) => SpeakerStatistics.fromPartial(e)) || + []; + return message; + }, +}; + +messageTypeRegistry.set(ConversationStatistics.$type, ConversationStatistics); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/analysis/interrupts_statistics.ts b/src/generated/yandex/cloud/speechsense/v1/analysis/interrupts_statistics.ts new file mode 100644 index 00000000..49d8edcb --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/analysis/interrupts_statistics.ts @@ -0,0 +1,287 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { AudioSegmentBoundaries } from "../../../../../yandex/cloud/speechsense/v1/analysis/statistics_common"; + +export const protobufPackage = "yandex.cloud.speechsense.v1.analysis"; + +export interface InterruptsStatistics { + $type: "yandex.cloud.speechsense.v1.analysis.InterruptsStatistics"; + /** Interrupts description for every speaker */ + speakerInterrupts: InterruptsEvaluation[]; +} + +export interface InterruptsEvaluation { + $type: "yandex.cloud.speechsense.v1.analysis.InterruptsEvaluation"; + /** Speaker tag */ + speakerTag: string; + /** Number of interrupts made by the speaker */ + interruptsCount: number; + /** Total duration of all interrupts */ + interruptsDurationMs: number; + /** Boundaries for every interrupt */ + interrupts: AudioSegmentBoundaries[]; + /** Total duration of all interrupts in seconds */ + interruptsDurationSeconds: number; +} + +const baseInterruptsStatistics: object = { + $type: "yandex.cloud.speechsense.v1.analysis.InterruptsStatistics", +}; + +export const InterruptsStatistics = { + $type: "yandex.cloud.speechsense.v1.analysis.InterruptsStatistics" as const, + + encode( + message: InterruptsStatistics, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.speakerInterrupts) { + InterruptsEvaluation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): InterruptsStatistics { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseInterruptsStatistics } as InterruptsStatistics; + message.speakerInterrupts = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.speakerInterrupts.push( + InterruptsEvaluation.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterruptsStatistics { + const message = { ...baseInterruptsStatistics } as InterruptsStatistics; + message.speakerInterrupts = (object.speakerInterrupts ?? []).map((e: any) => + InterruptsEvaluation.fromJSON(e) + ); + return message; + }, + + toJSON(message: InterruptsStatistics): unknown { + const obj: any = {}; + if (message.speakerInterrupts) { + obj.speakerInterrupts = message.speakerInterrupts.map((e) => + e ? InterruptsEvaluation.toJSON(e) : undefined + ); + } else { + obj.speakerInterrupts = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): InterruptsStatistics { + const message = { ...baseInterruptsStatistics } as InterruptsStatistics; + message.speakerInterrupts = + object.speakerInterrupts?.map((e) => + InterruptsEvaluation.fromPartial(e) + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(InterruptsStatistics.$type, InterruptsStatistics); + +const baseInterruptsEvaluation: object = { + $type: "yandex.cloud.speechsense.v1.analysis.InterruptsEvaluation", + speakerTag: "", + interruptsCount: 0, + interruptsDurationMs: 0, + interruptsDurationSeconds: 0, +}; + +export const InterruptsEvaluation = { + $type: "yandex.cloud.speechsense.v1.analysis.InterruptsEvaluation" as const, + + encode( + message: InterruptsEvaluation, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.speakerTag !== "") { + writer.uint32(10).string(message.speakerTag); + } + if (message.interruptsCount !== 0) { + writer.uint32(16).int64(message.interruptsCount); + } + if (message.interruptsDurationMs !== 0) { + writer.uint32(24).int64(message.interruptsDurationMs); + } + for (const v of message.interrupts) { + AudioSegmentBoundaries.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.interruptsDurationSeconds !== 0) { + writer.uint32(40).int64(message.interruptsDurationSeconds); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): InterruptsEvaluation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseInterruptsEvaluation } as InterruptsEvaluation; + message.interrupts = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.speakerTag = reader.string(); + break; + case 2: + message.interruptsCount = longToNumber(reader.int64() as Long); + break; + case 3: + message.interruptsDurationMs = longToNumber(reader.int64() as Long); + break; + case 4: + message.interrupts.push( + AudioSegmentBoundaries.decode(reader, reader.uint32()) + ); + break; + case 5: + message.interruptsDurationSeconds = longToNumber( + reader.int64() as Long + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InterruptsEvaluation { + const message = { ...baseInterruptsEvaluation } as InterruptsEvaluation; + message.speakerTag = + object.speakerTag !== undefined && object.speakerTag !== null + ? String(object.speakerTag) + : ""; + message.interruptsCount = + object.interruptsCount !== undefined && object.interruptsCount !== null + ? Number(object.interruptsCount) + : 0; + message.interruptsDurationMs = + object.interruptsDurationMs !== undefined && + object.interruptsDurationMs !== null + ? Number(object.interruptsDurationMs) + : 0; + message.interrupts = (object.interrupts ?? []).map((e: any) => + AudioSegmentBoundaries.fromJSON(e) + ); + message.interruptsDurationSeconds = + object.interruptsDurationSeconds !== undefined && + object.interruptsDurationSeconds !== null + ? Number(object.interruptsDurationSeconds) + : 0; + return message; + }, + + toJSON(message: InterruptsEvaluation): unknown { + const obj: any = {}; + message.speakerTag !== undefined && (obj.speakerTag = message.speakerTag); + message.interruptsCount !== undefined && + (obj.interruptsCount = Math.round(message.interruptsCount)); + message.interruptsDurationMs !== undefined && + (obj.interruptsDurationMs = Math.round(message.interruptsDurationMs)); + if (message.interrupts) { + obj.interrupts = message.interrupts.map((e) => + e ? AudioSegmentBoundaries.toJSON(e) : undefined + ); + } else { + obj.interrupts = []; + } + message.interruptsDurationSeconds !== undefined && + (obj.interruptsDurationSeconds = Math.round( + message.interruptsDurationSeconds + )); + return obj; + }, + + fromPartial, I>>( + object: I + ): InterruptsEvaluation { + const message = { ...baseInterruptsEvaluation } as InterruptsEvaluation; + message.speakerTag = object.speakerTag ?? ""; + message.interruptsCount = object.interruptsCount ?? 0; + message.interruptsDurationMs = object.interruptsDurationMs ?? 0; + message.interrupts = + object.interrupts?.map((e) => AudioSegmentBoundaries.fromPartial(e)) || + []; + message.interruptsDurationSeconds = object.interruptsDurationSeconds ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(InterruptsEvaluation.$type, InterruptsEvaluation); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/analysis/points.ts b/src/generated/yandex/cloud/speechsense/v1/analysis/points.ts new file mode 100644 index 00000000..13ae5719 --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/analysis/points.ts @@ -0,0 +1,195 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { StringValue } from "../../../../../google/protobuf/wrappers"; + +export const protobufPackage = "yandex.cloud.speechsense.v1.analysis"; + +export interface Points { + $type: "yandex.cloud.speechsense.v1.analysis.Points"; + quiz: Quiz[]; +} + +export interface Quiz { + $type: "yandex.cloud.speechsense.v1.analysis.Quiz"; + request: string; + response?: string; + id: string; +} + +const basePoints: object = { + $type: "yandex.cloud.speechsense.v1.analysis.Points", +}; + +export const Points = { + $type: "yandex.cloud.speechsense.v1.analysis.Points" as const, + + encode( + message: Points, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.quiz) { + Quiz.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Points { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePoints } as Points; + message.quiz = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quiz.push(Quiz.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Points { + const message = { ...basePoints } as Points; + message.quiz = (object.quiz ?? []).map((e: any) => Quiz.fromJSON(e)); + return message; + }, + + toJSON(message: Points): unknown { + const obj: any = {}; + if (message.quiz) { + obj.quiz = message.quiz.map((e) => (e ? Quiz.toJSON(e) : undefined)); + } else { + obj.quiz = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Points { + const message = { ...basePoints } as Points; + message.quiz = object.quiz?.map((e) => Quiz.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Points.$type, Points); + +const baseQuiz: object = { + $type: "yandex.cloud.speechsense.v1.analysis.Quiz", + request: "", + id: "", +}; + +export const Quiz = { + $type: "yandex.cloud.speechsense.v1.analysis.Quiz" as const, + + encode(message: Quiz, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.request !== "") { + writer.uint32(10).string(message.request); + } + if (message.response !== undefined) { + StringValue.encode( + { $type: "google.protobuf.StringValue", value: message.response! }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.id !== "") { + writer.uint32(26).string(message.id); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Quiz { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQuiz } as Quiz; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.request = reader.string(); + break; + case 2: + message.response = StringValue.decode(reader, reader.uint32()).value; + break; + case 3: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Quiz { + const message = { ...baseQuiz } as Quiz; + message.request = + object.request !== undefined && object.request !== null + ? String(object.request) + : ""; + message.response = + object.response !== undefined && object.response !== null + ? String(object.response) + : undefined; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + return message; + }, + + toJSON(message: Quiz): unknown { + const obj: any = {}; + message.request !== undefined && (obj.request = message.request); + message.response !== undefined && (obj.response = message.response); + message.id !== undefined && (obj.id = message.id); + return obj; + }, + + fromPartial, I>>(object: I): Quiz { + const message = { ...baseQuiz } as Quiz; + message.request = object.request ?? ""; + message.response = object.response ?? undefined; + message.id = object.id ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Quiz.$type, Quiz); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/analysis/predefined_classifiers.ts b/src/generated/yandex/cloud/speechsense/v1/analysis/predefined_classifiers.ts new file mode 100644 index 00000000..26df8dd1 --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/analysis/predefined_classifiers.ts @@ -0,0 +1,410 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.speechsense.v1.analysis"; + +export interface RecognitionClassifierResult { + $type: "yandex.cloud.speechsense.v1.analysis.RecognitionClassifierResult"; + /** Start time of the audio segment used for classification */ + startTimeMs: number; + /** End time of the audio segment used for classification */ + endTimeMs: number; + /** Name of the triggered classifier */ + classifier: string; + /** List of highlights, i.e. parts of phrase that determine the result of the classification */ + highlights: PhraseHighlight[]; + /** Classifier predictions */ + labels: RecognitionClassifierLabel[]; +} + +export interface PhraseHighlight { + $type: "yandex.cloud.speechsense.v1.analysis.PhraseHighlight"; + /** Text transcription of the highlighted audio segment */ + text: string; + /** offset in symbols from the beginning of whole phrase where highlight begins */ + offset: number; + /** count of symbols in highlighted text */ + count: number; +} + +export interface RecognitionClassifierLabel { + $type: "yandex.cloud.speechsense.v1.analysis.RecognitionClassifierLabel"; + /** The label of the class predicted by the classifier */ + label: string; + /** The prediction confidence */ + confidence: number; +} + +const baseRecognitionClassifierResult: object = { + $type: "yandex.cloud.speechsense.v1.analysis.RecognitionClassifierResult", + startTimeMs: 0, + endTimeMs: 0, + classifier: "", +}; + +export const RecognitionClassifierResult = { + $type: + "yandex.cloud.speechsense.v1.analysis.RecognitionClassifierResult" as const, + + encode( + message: RecognitionClassifierResult, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.startTimeMs !== 0) { + writer.uint32(8).int64(message.startTimeMs); + } + if (message.endTimeMs !== 0) { + writer.uint32(16).int64(message.endTimeMs); + } + if (message.classifier !== "") { + writer.uint32(26).string(message.classifier); + } + for (const v of message.highlights) { + PhraseHighlight.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.labels) { + RecognitionClassifierLabel.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RecognitionClassifierResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRecognitionClassifierResult, + } as RecognitionClassifierResult; + message.highlights = []; + message.labels = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimeMs = longToNumber(reader.int64() as Long); + break; + case 2: + message.endTimeMs = longToNumber(reader.int64() as Long); + break; + case 3: + message.classifier = reader.string(); + break; + case 4: + message.highlights.push( + PhraseHighlight.decode(reader, reader.uint32()) + ); + break; + case 5: + message.labels.push( + RecognitionClassifierLabel.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RecognitionClassifierResult { + const message = { + ...baseRecognitionClassifierResult, + } as RecognitionClassifierResult; + message.startTimeMs = + object.startTimeMs !== undefined && object.startTimeMs !== null + ? Number(object.startTimeMs) + : 0; + message.endTimeMs = + object.endTimeMs !== undefined && object.endTimeMs !== null + ? Number(object.endTimeMs) + : 0; + message.classifier = + object.classifier !== undefined && object.classifier !== null + ? String(object.classifier) + : ""; + message.highlights = (object.highlights ?? []).map((e: any) => + PhraseHighlight.fromJSON(e) + ); + message.labels = (object.labels ?? []).map((e: any) => + RecognitionClassifierLabel.fromJSON(e) + ); + return message; + }, + + toJSON(message: RecognitionClassifierResult): unknown { + const obj: any = {}; + message.startTimeMs !== undefined && + (obj.startTimeMs = Math.round(message.startTimeMs)); + message.endTimeMs !== undefined && + (obj.endTimeMs = Math.round(message.endTimeMs)); + message.classifier !== undefined && (obj.classifier = message.classifier); + if (message.highlights) { + obj.highlights = message.highlights.map((e) => + e ? PhraseHighlight.toJSON(e) : undefined + ); + } else { + obj.highlights = []; + } + if (message.labels) { + obj.labels = message.labels.map((e) => + e ? RecognitionClassifierLabel.toJSON(e) : undefined + ); + } else { + obj.labels = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): RecognitionClassifierResult { + const message = { + ...baseRecognitionClassifierResult, + } as RecognitionClassifierResult; + message.startTimeMs = object.startTimeMs ?? 0; + message.endTimeMs = object.endTimeMs ?? 0; + message.classifier = object.classifier ?? ""; + message.highlights = + object.highlights?.map((e) => PhraseHighlight.fromPartial(e)) || []; + message.labels = + object.labels?.map((e) => RecognitionClassifierLabel.fromPartial(e)) || + []; + return message; + }, +}; + +messageTypeRegistry.set( + RecognitionClassifierResult.$type, + RecognitionClassifierResult +); + +const basePhraseHighlight: object = { + $type: "yandex.cloud.speechsense.v1.analysis.PhraseHighlight", + text: "", + offset: 0, + count: 0, +}; + +export const PhraseHighlight = { + $type: "yandex.cloud.speechsense.v1.analysis.PhraseHighlight" as const, + + encode( + message: PhraseHighlight, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.text !== "") { + writer.uint32(10).string(message.text); + } + if (message.offset !== 0) { + writer.uint32(16).int64(message.offset); + } + if (message.count !== 0) { + writer.uint32(24).int64(message.count); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PhraseHighlight { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePhraseHighlight } as PhraseHighlight; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.offset = longToNumber(reader.int64() as Long); + break; + case 3: + message.count = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PhraseHighlight { + const message = { ...basePhraseHighlight } as PhraseHighlight; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + message.offset = + object.offset !== undefined && object.offset !== null + ? Number(object.offset) + : 0; + message.count = + object.count !== undefined && object.count !== null + ? Number(object.count) + : 0; + return message; + }, + + toJSON(message: PhraseHighlight): unknown { + const obj: any = {}; + message.text !== undefined && (obj.text = message.text); + message.offset !== undefined && (obj.offset = Math.round(message.offset)); + message.count !== undefined && (obj.count = Math.round(message.count)); + return obj; + }, + + fromPartial, I>>( + object: I + ): PhraseHighlight { + const message = { ...basePhraseHighlight } as PhraseHighlight; + message.text = object.text ?? ""; + message.offset = object.offset ?? 0; + message.count = object.count ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(PhraseHighlight.$type, PhraseHighlight); + +const baseRecognitionClassifierLabel: object = { + $type: "yandex.cloud.speechsense.v1.analysis.RecognitionClassifierLabel", + label: "", + confidence: 0, +}; + +export const RecognitionClassifierLabel = { + $type: + "yandex.cloud.speechsense.v1.analysis.RecognitionClassifierLabel" as const, + + encode( + message: RecognitionClassifierLabel, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.label !== "") { + writer.uint32(10).string(message.label); + } + if (message.confidence !== 0) { + writer.uint32(17).double(message.confidence); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RecognitionClassifierLabel { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseRecognitionClassifierLabel, + } as RecognitionClassifierLabel; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.label = reader.string(); + break; + case 2: + message.confidence = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RecognitionClassifierLabel { + const message = { + ...baseRecognitionClassifierLabel, + } as RecognitionClassifierLabel; + message.label = + object.label !== undefined && object.label !== null + ? String(object.label) + : ""; + message.confidence = + object.confidence !== undefined && object.confidence !== null + ? Number(object.confidence) + : 0; + return message; + }, + + toJSON(message: RecognitionClassifierLabel): unknown { + const obj: any = {}; + message.label !== undefined && (obj.label = message.label); + message.confidence !== undefined && (obj.confidence = message.confidence); + return obj; + }, + + fromPartial, I>>( + object: I + ): RecognitionClassifierLabel { + const message = { + ...baseRecognitionClassifierLabel, + } as RecognitionClassifierLabel; + message.label = object.label ?? ""; + message.confidence = object.confidence ?? 0; + return message; + }, +}; + +messageTypeRegistry.set( + RecognitionClassifierLabel.$type, + RecognitionClassifierLabel +); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/analysis/silence_statistics.ts b/src/generated/yandex/cloud/speechsense/v1/analysis/silence_statistics.ts new file mode 100644 index 00000000..132e0197 --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/analysis/silence_statistics.ts @@ -0,0 +1,204 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { DescriptiveStatistics } from "../../../../../yandex/cloud/speechsense/v1/analysis/statistics_common"; + +export const protobufPackage = "yandex.cloud.speechsense.v1.analysis"; + +export interface SilenceStatistics { + $type: "yandex.cloud.speechsense.v1.analysis.SilenceStatistics"; + totalSimultaneousSilenceDurationMs: number; + /** Simultaneous silence ratio within audio segment */ + totalSimultaneousSilenceRatio: number; + /** Descriptive statistics for simultaneous silence duration distribution */ + simultaneousSilenceDurationEstimation?: DescriptiveStatistics; + totalSimultaneousSilenceDurationSeconds: number; +} + +const baseSilenceStatistics: object = { + $type: "yandex.cloud.speechsense.v1.analysis.SilenceStatistics", + totalSimultaneousSilenceDurationMs: 0, + totalSimultaneousSilenceRatio: 0, + totalSimultaneousSilenceDurationSeconds: 0, +}; + +export const SilenceStatistics = { + $type: "yandex.cloud.speechsense.v1.analysis.SilenceStatistics" as const, + + encode( + message: SilenceStatistics, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.totalSimultaneousSilenceDurationMs !== 0) { + writer.uint32(8).int64(message.totalSimultaneousSilenceDurationMs); + } + if (message.totalSimultaneousSilenceRatio !== 0) { + writer.uint32(17).double(message.totalSimultaneousSilenceRatio); + } + if (message.simultaneousSilenceDurationEstimation !== undefined) { + DescriptiveStatistics.encode( + message.simultaneousSilenceDurationEstimation, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.totalSimultaneousSilenceDurationSeconds !== 0) { + writer.uint32(32).int64(message.totalSimultaneousSilenceDurationSeconds); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SilenceStatistics { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSilenceStatistics } as SilenceStatistics; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalSimultaneousSilenceDurationMs = longToNumber( + reader.int64() as Long + ); + break; + case 2: + message.totalSimultaneousSilenceRatio = reader.double(); + break; + case 3: + message.simultaneousSilenceDurationEstimation = + DescriptiveStatistics.decode(reader, reader.uint32()); + break; + case 4: + message.totalSimultaneousSilenceDurationSeconds = longToNumber( + reader.int64() as Long + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SilenceStatistics { + const message = { ...baseSilenceStatistics } as SilenceStatistics; + message.totalSimultaneousSilenceDurationMs = + object.totalSimultaneousSilenceDurationMs !== undefined && + object.totalSimultaneousSilenceDurationMs !== null + ? Number(object.totalSimultaneousSilenceDurationMs) + : 0; + message.totalSimultaneousSilenceRatio = + object.totalSimultaneousSilenceRatio !== undefined && + object.totalSimultaneousSilenceRatio !== null + ? Number(object.totalSimultaneousSilenceRatio) + : 0; + message.simultaneousSilenceDurationEstimation = + object.simultaneousSilenceDurationEstimation !== undefined && + object.simultaneousSilenceDurationEstimation !== null + ? DescriptiveStatistics.fromJSON( + object.simultaneousSilenceDurationEstimation + ) + : undefined; + message.totalSimultaneousSilenceDurationSeconds = + object.totalSimultaneousSilenceDurationSeconds !== undefined && + object.totalSimultaneousSilenceDurationSeconds !== null + ? Number(object.totalSimultaneousSilenceDurationSeconds) + : 0; + return message; + }, + + toJSON(message: SilenceStatistics): unknown { + const obj: any = {}; + message.totalSimultaneousSilenceDurationMs !== undefined && + (obj.totalSimultaneousSilenceDurationMs = Math.round( + message.totalSimultaneousSilenceDurationMs + )); + message.totalSimultaneousSilenceRatio !== undefined && + (obj.totalSimultaneousSilenceRatio = + message.totalSimultaneousSilenceRatio); + message.simultaneousSilenceDurationEstimation !== undefined && + (obj.simultaneousSilenceDurationEstimation = + message.simultaneousSilenceDurationEstimation + ? DescriptiveStatistics.toJSON( + message.simultaneousSilenceDurationEstimation + ) + : undefined); + message.totalSimultaneousSilenceDurationSeconds !== undefined && + (obj.totalSimultaneousSilenceDurationSeconds = Math.round( + message.totalSimultaneousSilenceDurationSeconds + )); + return obj; + }, + + fromPartial, I>>( + object: I + ): SilenceStatistics { + const message = { ...baseSilenceStatistics } as SilenceStatistics; + message.totalSimultaneousSilenceDurationMs = + object.totalSimultaneousSilenceDurationMs ?? 0; + message.totalSimultaneousSilenceRatio = + object.totalSimultaneousSilenceRatio ?? 0; + message.simultaneousSilenceDurationEstimation = + object.simultaneousSilenceDurationEstimation !== undefined && + object.simultaneousSilenceDurationEstimation !== null + ? DescriptiveStatistics.fromPartial( + object.simultaneousSilenceDurationEstimation + ) + : undefined; + message.totalSimultaneousSilenceDurationSeconds = + object.totalSimultaneousSilenceDurationSeconds ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(SilenceStatistics.$type, SilenceStatistics); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/analysis/speaker_statistics.ts b/src/generated/yandex/cloud/speechsense/v1/analysis/speaker_statistics.ts new file mode 100644 index 00000000..860e0d5f --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/analysis/speaker_statistics.ts @@ -0,0 +1,254 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { UtteranceStatistics } from "../../../../../yandex/cloud/speechsense/v1/analysis/utterance_statistics"; +import { DescriptiveStatistics } from "../../../../../yandex/cloud/speechsense/v1/analysis/statistics_common"; + +export const protobufPackage = "yandex.cloud.speechsense.v1.analysis"; + +export interface SpeakerStatistics { + $type: "yandex.cloud.speechsense.v1.analysis.SpeakerStatistics"; + /** Speaker tag */ + speakerTag: string; + /** analysis of all phrases in format of single utterance */ + completeStatistics?: UtteranceStatistics; + /** Descriptive statistics for words per utterance distribution */ + wordsPerUtterance?: DescriptiveStatistics; + /** Descriptive statistics for letters per utterance distribution */ + lettersPerUtterance?: DescriptiveStatistics; + /** Number of utterances */ + utteranceCount: number; + /** Descriptive statistics for utterance duration distribution */ + utteranceDurationEstimation?: DescriptiveStatistics; +} + +const baseSpeakerStatistics: object = { + $type: "yandex.cloud.speechsense.v1.analysis.SpeakerStatistics", + speakerTag: "", + utteranceCount: 0, +}; + +export const SpeakerStatistics = { + $type: "yandex.cloud.speechsense.v1.analysis.SpeakerStatistics" as const, + + encode( + message: SpeakerStatistics, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.speakerTag !== "") { + writer.uint32(10).string(message.speakerTag); + } + if (message.completeStatistics !== undefined) { + UtteranceStatistics.encode( + message.completeStatistics, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.wordsPerUtterance !== undefined) { + DescriptiveStatistics.encode( + message.wordsPerUtterance, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.lettersPerUtterance !== undefined) { + DescriptiveStatistics.encode( + message.lettersPerUtterance, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.utteranceCount !== 0) { + writer.uint32(40).int64(message.utteranceCount); + } + if (message.utteranceDurationEstimation !== undefined) { + DescriptiveStatistics.encode( + message.utteranceDurationEstimation, + writer.uint32(50).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SpeakerStatistics { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSpeakerStatistics } as SpeakerStatistics; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.speakerTag = reader.string(); + break; + case 2: + message.completeStatistics = UtteranceStatistics.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.wordsPerUtterance = DescriptiveStatistics.decode( + reader, + reader.uint32() + ); + break; + case 4: + message.lettersPerUtterance = DescriptiveStatistics.decode( + reader, + reader.uint32() + ); + break; + case 5: + message.utteranceCount = longToNumber(reader.int64() as Long); + break; + case 6: + message.utteranceDurationEstimation = DescriptiveStatistics.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SpeakerStatistics { + const message = { ...baseSpeakerStatistics } as SpeakerStatistics; + message.speakerTag = + object.speakerTag !== undefined && object.speakerTag !== null + ? String(object.speakerTag) + : ""; + message.completeStatistics = + object.completeStatistics !== undefined && + object.completeStatistics !== null + ? UtteranceStatistics.fromJSON(object.completeStatistics) + : undefined; + message.wordsPerUtterance = + object.wordsPerUtterance !== undefined && + object.wordsPerUtterance !== null + ? DescriptiveStatistics.fromJSON(object.wordsPerUtterance) + : undefined; + message.lettersPerUtterance = + object.lettersPerUtterance !== undefined && + object.lettersPerUtterance !== null + ? DescriptiveStatistics.fromJSON(object.lettersPerUtterance) + : undefined; + message.utteranceCount = + object.utteranceCount !== undefined && object.utteranceCount !== null + ? Number(object.utteranceCount) + : 0; + message.utteranceDurationEstimation = + object.utteranceDurationEstimation !== undefined && + object.utteranceDurationEstimation !== null + ? DescriptiveStatistics.fromJSON(object.utteranceDurationEstimation) + : undefined; + return message; + }, + + toJSON(message: SpeakerStatistics): unknown { + const obj: any = {}; + message.speakerTag !== undefined && (obj.speakerTag = message.speakerTag); + message.completeStatistics !== undefined && + (obj.completeStatistics = message.completeStatistics + ? UtteranceStatistics.toJSON(message.completeStatistics) + : undefined); + message.wordsPerUtterance !== undefined && + (obj.wordsPerUtterance = message.wordsPerUtterance + ? DescriptiveStatistics.toJSON(message.wordsPerUtterance) + : undefined); + message.lettersPerUtterance !== undefined && + (obj.lettersPerUtterance = message.lettersPerUtterance + ? DescriptiveStatistics.toJSON(message.lettersPerUtterance) + : undefined); + message.utteranceCount !== undefined && + (obj.utteranceCount = Math.round(message.utteranceCount)); + message.utteranceDurationEstimation !== undefined && + (obj.utteranceDurationEstimation = message.utteranceDurationEstimation + ? DescriptiveStatistics.toJSON(message.utteranceDurationEstimation) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): SpeakerStatistics { + const message = { ...baseSpeakerStatistics } as SpeakerStatistics; + message.speakerTag = object.speakerTag ?? ""; + message.completeStatistics = + object.completeStatistics !== undefined && + object.completeStatistics !== null + ? UtteranceStatistics.fromPartial(object.completeStatistics) + : undefined; + message.wordsPerUtterance = + object.wordsPerUtterance !== undefined && + object.wordsPerUtterance !== null + ? DescriptiveStatistics.fromPartial(object.wordsPerUtterance) + : undefined; + message.lettersPerUtterance = + object.lettersPerUtterance !== undefined && + object.lettersPerUtterance !== null + ? DescriptiveStatistics.fromPartial(object.lettersPerUtterance) + : undefined; + message.utteranceCount = object.utteranceCount ?? 0; + message.utteranceDurationEstimation = + object.utteranceDurationEstimation !== undefined && + object.utteranceDurationEstimation !== null + ? DescriptiveStatistics.fromPartial(object.utteranceDurationEstimation) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(SpeakerStatistics.$type, SpeakerStatistics); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/analysis/speech_statistics.ts b/src/generated/yandex/cloud/speechsense/v1/analysis/speech_statistics.ts new file mode 100644 index 00000000..b2061035 --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/analysis/speech_statistics.ts @@ -0,0 +1,205 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { DescriptiveStatistics } from "../../../../../yandex/cloud/speechsense/v1/analysis/statistics_common"; + +export const protobufPackage = "yandex.cloud.speechsense.v1.analysis"; + +export interface SpeechStatistics { + $type: "yandex.cloud.speechsense.v1.analysis.SpeechStatistics"; + /** Total simultaneous speech duration in seconds */ + totalSimultaneousSpeechDurationSeconds: number; + /** Total simultaneous speech duration in ms */ + totalSimultaneousSpeechDurationMs: number; + /** Simultaneous speech ratio within audio segment */ + totalSimultaneousSpeechRatio: number; + /** Descriptive statistics for simultaneous speech duration distribution */ + simultaneousSpeechDurationEstimation?: DescriptiveStatistics; +} + +const baseSpeechStatistics: object = { + $type: "yandex.cloud.speechsense.v1.analysis.SpeechStatistics", + totalSimultaneousSpeechDurationSeconds: 0, + totalSimultaneousSpeechDurationMs: 0, + totalSimultaneousSpeechRatio: 0, +}; + +export const SpeechStatistics = { + $type: "yandex.cloud.speechsense.v1.analysis.SpeechStatistics" as const, + + encode( + message: SpeechStatistics, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.totalSimultaneousSpeechDurationSeconds !== 0) { + writer.uint32(8).int64(message.totalSimultaneousSpeechDurationSeconds); + } + if (message.totalSimultaneousSpeechDurationMs !== 0) { + writer.uint32(16).int64(message.totalSimultaneousSpeechDurationMs); + } + if (message.totalSimultaneousSpeechRatio !== 0) { + writer.uint32(25).double(message.totalSimultaneousSpeechRatio); + } + if (message.simultaneousSpeechDurationEstimation !== undefined) { + DescriptiveStatistics.encode( + message.simultaneousSpeechDurationEstimation, + writer.uint32(34).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SpeechStatistics { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSpeechStatistics } as SpeechStatistics; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalSimultaneousSpeechDurationSeconds = longToNumber( + reader.int64() as Long + ); + break; + case 2: + message.totalSimultaneousSpeechDurationMs = longToNumber( + reader.int64() as Long + ); + break; + case 3: + message.totalSimultaneousSpeechRatio = reader.double(); + break; + case 4: + message.simultaneousSpeechDurationEstimation = + DescriptiveStatistics.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SpeechStatistics { + const message = { ...baseSpeechStatistics } as SpeechStatistics; + message.totalSimultaneousSpeechDurationSeconds = + object.totalSimultaneousSpeechDurationSeconds !== undefined && + object.totalSimultaneousSpeechDurationSeconds !== null + ? Number(object.totalSimultaneousSpeechDurationSeconds) + : 0; + message.totalSimultaneousSpeechDurationMs = + object.totalSimultaneousSpeechDurationMs !== undefined && + object.totalSimultaneousSpeechDurationMs !== null + ? Number(object.totalSimultaneousSpeechDurationMs) + : 0; + message.totalSimultaneousSpeechRatio = + object.totalSimultaneousSpeechRatio !== undefined && + object.totalSimultaneousSpeechRatio !== null + ? Number(object.totalSimultaneousSpeechRatio) + : 0; + message.simultaneousSpeechDurationEstimation = + object.simultaneousSpeechDurationEstimation !== undefined && + object.simultaneousSpeechDurationEstimation !== null + ? DescriptiveStatistics.fromJSON( + object.simultaneousSpeechDurationEstimation + ) + : undefined; + return message; + }, + + toJSON(message: SpeechStatistics): unknown { + const obj: any = {}; + message.totalSimultaneousSpeechDurationSeconds !== undefined && + (obj.totalSimultaneousSpeechDurationSeconds = Math.round( + message.totalSimultaneousSpeechDurationSeconds + )); + message.totalSimultaneousSpeechDurationMs !== undefined && + (obj.totalSimultaneousSpeechDurationMs = Math.round( + message.totalSimultaneousSpeechDurationMs + )); + message.totalSimultaneousSpeechRatio !== undefined && + (obj.totalSimultaneousSpeechRatio = message.totalSimultaneousSpeechRatio); + message.simultaneousSpeechDurationEstimation !== undefined && + (obj.simultaneousSpeechDurationEstimation = + message.simultaneousSpeechDurationEstimation + ? DescriptiveStatistics.toJSON( + message.simultaneousSpeechDurationEstimation + ) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): SpeechStatistics { + const message = { ...baseSpeechStatistics } as SpeechStatistics; + message.totalSimultaneousSpeechDurationSeconds = + object.totalSimultaneousSpeechDurationSeconds ?? 0; + message.totalSimultaneousSpeechDurationMs = + object.totalSimultaneousSpeechDurationMs ?? 0; + message.totalSimultaneousSpeechRatio = + object.totalSimultaneousSpeechRatio ?? 0; + message.simultaneousSpeechDurationEstimation = + object.simultaneousSpeechDurationEstimation !== undefined && + object.simultaneousSpeechDurationEstimation !== null + ? DescriptiveStatistics.fromPartial( + object.simultaneousSpeechDurationEstimation + ) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(SpeechStatistics.$type, SpeechStatistics); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/analysis/statistics_common.ts b/src/generated/yandex/cloud/speechsense/v1/analysis/statistics_common.ts new file mode 100644 index 00000000..22f706f8 --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/analysis/statistics_common.ts @@ -0,0 +1,372 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.speechsense.v1.analysis"; + +export interface DescriptiveStatistics { + $type: "yandex.cloud.speechsense.v1.analysis.DescriptiveStatistics"; + /** Minimum observed value */ + min: number; + /** Maximum observed value */ + max: number; + /** Estimated mean of distribution */ + mean: number; + /** Estimated standard deviation of distribution */ + std: number; + /** List of evaluated quantiles */ + quantiles: Quantile[]; +} + +export interface Quantile { + $type: "yandex.cloud.speechsense.v1.analysis.Quantile"; + /** Quantile level in range (0, 1) */ + level: number; + /** Quantile value */ + value: number; +} + +export interface AudioSegmentBoundaries { + $type: "yandex.cloud.speechsense.v1.analysis.AudioSegmentBoundaries"; + /** Audio segment start time */ + startTimeMs: number; + /** Audio segment end time */ + endTimeMs: number; + /** Duration in seconds */ + durationSeconds: number; +} + +const baseDescriptiveStatistics: object = { + $type: "yandex.cloud.speechsense.v1.analysis.DescriptiveStatistics", + min: 0, + max: 0, + mean: 0, + std: 0, +}; + +export const DescriptiveStatistics = { + $type: "yandex.cloud.speechsense.v1.analysis.DescriptiveStatistics" as const, + + encode( + message: DescriptiveStatistics, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.min !== 0) { + writer.uint32(9).double(message.min); + } + if (message.max !== 0) { + writer.uint32(17).double(message.max); + } + if (message.mean !== 0) { + writer.uint32(25).double(message.mean); + } + if (message.std !== 0) { + writer.uint32(33).double(message.std); + } + for (const v of message.quantiles) { + Quantile.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DescriptiveStatistics { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDescriptiveStatistics } as DescriptiveStatistics; + message.quantiles = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.min = reader.double(); + break; + case 2: + message.max = reader.double(); + break; + case 3: + message.mean = reader.double(); + break; + case 4: + message.std = reader.double(); + break; + case 5: + message.quantiles.push(Quantile.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptiveStatistics { + const message = { ...baseDescriptiveStatistics } as DescriptiveStatistics; + message.min = + object.min !== undefined && object.min !== null ? Number(object.min) : 0; + message.max = + object.max !== undefined && object.max !== null ? Number(object.max) : 0; + message.mean = + object.mean !== undefined && object.mean !== null + ? Number(object.mean) + : 0; + message.std = + object.std !== undefined && object.std !== null ? Number(object.std) : 0; + message.quantiles = (object.quantiles ?? []).map((e: any) => + Quantile.fromJSON(e) + ); + return message; + }, + + toJSON(message: DescriptiveStatistics): unknown { + const obj: any = {}; + message.min !== undefined && (obj.min = message.min); + message.max !== undefined && (obj.max = message.max); + message.mean !== undefined && (obj.mean = message.mean); + message.std !== undefined && (obj.std = message.std); + if (message.quantiles) { + obj.quantiles = message.quantiles.map((e) => + e ? Quantile.toJSON(e) : undefined + ); + } else { + obj.quantiles = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): DescriptiveStatistics { + const message = { ...baseDescriptiveStatistics } as DescriptiveStatistics; + message.min = object.min ?? 0; + message.max = object.max ?? 0; + message.mean = object.mean ?? 0; + message.std = object.std ?? 0; + message.quantiles = + object.quantiles?.map((e) => Quantile.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(DescriptiveStatistics.$type, DescriptiveStatistics); + +const baseQuantile: object = { + $type: "yandex.cloud.speechsense.v1.analysis.Quantile", + level: 0, + value: 0, +}; + +export const Quantile = { + $type: "yandex.cloud.speechsense.v1.analysis.Quantile" as const, + + encode( + message: Quantile, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.level !== 0) { + writer.uint32(9).double(message.level); + } + if (message.value !== 0) { + writer.uint32(17).double(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Quantile { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQuantile } as Quantile; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.level = reader.double(); + break; + case 2: + message.value = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Quantile { + const message = { ...baseQuantile } as Quantile; + message.level = + object.level !== undefined && object.level !== null + ? Number(object.level) + : 0; + message.value = + object.value !== undefined && object.value !== null + ? Number(object.value) + : 0; + return message; + }, + + toJSON(message: Quantile): unknown { + const obj: any = {}; + message.level !== undefined && (obj.level = message.level); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>(object: I): Quantile { + const message = { ...baseQuantile } as Quantile; + message.level = object.level ?? 0; + message.value = object.value ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Quantile.$type, Quantile); + +const baseAudioSegmentBoundaries: object = { + $type: "yandex.cloud.speechsense.v1.analysis.AudioSegmentBoundaries", + startTimeMs: 0, + endTimeMs: 0, + durationSeconds: 0, +}; + +export const AudioSegmentBoundaries = { + $type: "yandex.cloud.speechsense.v1.analysis.AudioSegmentBoundaries" as const, + + encode( + message: AudioSegmentBoundaries, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.startTimeMs !== 0) { + writer.uint32(8).int64(message.startTimeMs); + } + if (message.endTimeMs !== 0) { + writer.uint32(16).int64(message.endTimeMs); + } + if (message.durationSeconds !== 0) { + writer.uint32(24).int64(message.durationSeconds); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AudioSegmentBoundaries { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAudioSegmentBoundaries } as AudioSegmentBoundaries; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimeMs = longToNumber(reader.int64() as Long); + break; + case 2: + message.endTimeMs = longToNumber(reader.int64() as Long); + break; + case 3: + message.durationSeconds = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AudioSegmentBoundaries { + const message = { ...baseAudioSegmentBoundaries } as AudioSegmentBoundaries; + message.startTimeMs = + object.startTimeMs !== undefined && object.startTimeMs !== null + ? Number(object.startTimeMs) + : 0; + message.endTimeMs = + object.endTimeMs !== undefined && object.endTimeMs !== null + ? Number(object.endTimeMs) + : 0; + message.durationSeconds = + object.durationSeconds !== undefined && object.durationSeconds !== null + ? Number(object.durationSeconds) + : 0; + return message; + }, + + toJSON(message: AudioSegmentBoundaries): unknown { + const obj: any = {}; + message.startTimeMs !== undefined && + (obj.startTimeMs = Math.round(message.startTimeMs)); + message.endTimeMs !== undefined && + (obj.endTimeMs = Math.round(message.endTimeMs)); + message.durationSeconds !== undefined && + (obj.durationSeconds = Math.round(message.durationSeconds)); + return obj; + }, + + fromPartial, I>>( + object: I + ): AudioSegmentBoundaries { + const message = { ...baseAudioSegmentBoundaries } as AudioSegmentBoundaries; + message.startTimeMs = object.startTimeMs ?? 0; + message.endTimeMs = object.endTimeMs ?? 0; + message.durationSeconds = object.durationSeconds ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(AudioSegmentBoundaries.$type, AudioSegmentBoundaries); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/analysis/summarization.ts b/src/generated/yandex/cloud/speechsense/v1/analysis/summarization.ts new file mode 100644 index 00000000..c372891c --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/analysis/summarization.ts @@ -0,0 +1,344 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.speechsense.v1.analysis"; + +export enum SummarizationFieldType { + SUMMARIZATION_FIELD_TYPE_UNSPECIFIED = 0, + TEXT = 1, + TEXT_ARRAY = 2, + UNRECOGNIZED = -1, +} + +export function summarizationFieldTypeFromJSON( + object: any +): SummarizationFieldType { + switch (object) { + case 0: + case "SUMMARIZATION_FIELD_TYPE_UNSPECIFIED": + return SummarizationFieldType.SUMMARIZATION_FIELD_TYPE_UNSPECIFIED; + case 1: + case "TEXT": + return SummarizationFieldType.TEXT; + case 2: + case "TEXT_ARRAY": + return SummarizationFieldType.TEXT_ARRAY; + case -1: + case "UNRECOGNIZED": + default: + return SummarizationFieldType.UNRECOGNIZED; + } +} + +export function summarizationFieldTypeToJSON( + object: SummarizationFieldType +): string { + switch (object) { + case SummarizationFieldType.SUMMARIZATION_FIELD_TYPE_UNSPECIFIED: + return "SUMMARIZATION_FIELD_TYPE_UNSPECIFIED"; + case SummarizationFieldType.TEXT: + return "TEXT"; + case SummarizationFieldType.TEXT_ARRAY: + return "TEXT_ARRAY"; + default: + return "UNKNOWN"; + } +} + +export interface Summarization { + $type: "yandex.cloud.speechsense.v1.analysis.Summarization"; + statements: SummarizationStatement[]; +} + +export interface SummarizationStatement { + $type: "yandex.cloud.speechsense.v1.analysis.SummarizationStatement"; + field?: SummarizationField; + response: string[]; +} + +export interface SummarizationField { + $type: "yandex.cloud.speechsense.v1.analysis.SummarizationField"; + id: string; + name: string; + type: SummarizationFieldType; +} + +const baseSummarization: object = { + $type: "yandex.cloud.speechsense.v1.analysis.Summarization", +}; + +export const Summarization = { + $type: "yandex.cloud.speechsense.v1.analysis.Summarization" as const, + + encode( + message: Summarization, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.statements) { + SummarizationStatement.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Summarization { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSummarization } as Summarization; + message.statements = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.statements.push( + SummarizationStatement.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Summarization { + const message = { ...baseSummarization } as Summarization; + message.statements = (object.statements ?? []).map((e: any) => + SummarizationStatement.fromJSON(e) + ); + return message; + }, + + toJSON(message: Summarization): unknown { + const obj: any = {}; + if (message.statements) { + obj.statements = message.statements.map((e) => + e ? SummarizationStatement.toJSON(e) : undefined + ); + } else { + obj.statements = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Summarization { + const message = { ...baseSummarization } as Summarization; + message.statements = + object.statements?.map((e) => SummarizationStatement.fromPartial(e)) || + []; + return message; + }, +}; + +messageTypeRegistry.set(Summarization.$type, Summarization); + +const baseSummarizationStatement: object = { + $type: "yandex.cloud.speechsense.v1.analysis.SummarizationStatement", + response: "", +}; + +export const SummarizationStatement = { + $type: "yandex.cloud.speechsense.v1.analysis.SummarizationStatement" as const, + + encode( + message: SummarizationStatement, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.field !== undefined) { + SummarizationField.encode( + message.field, + writer.uint32(10).fork() + ).ldelim(); + } + for (const v of message.response) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SummarizationStatement { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSummarizationStatement } as SummarizationStatement; + message.response = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.field = SummarizationField.decode(reader, reader.uint32()); + break; + case 2: + message.response.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SummarizationStatement { + const message = { ...baseSummarizationStatement } as SummarizationStatement; + message.field = + object.field !== undefined && object.field !== null + ? SummarizationField.fromJSON(object.field) + : undefined; + message.response = (object.response ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: SummarizationStatement): unknown { + const obj: any = {}; + message.field !== undefined && + (obj.field = message.field + ? SummarizationField.toJSON(message.field) + : undefined); + if (message.response) { + obj.response = message.response.map((e) => e); + } else { + obj.response = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): SummarizationStatement { + const message = { ...baseSummarizationStatement } as SummarizationStatement; + message.field = + object.field !== undefined && object.field !== null + ? SummarizationField.fromPartial(object.field) + : undefined; + message.response = object.response?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(SummarizationStatement.$type, SummarizationStatement); + +const baseSummarizationField: object = { + $type: "yandex.cloud.speechsense.v1.analysis.SummarizationField", + id: "", + name: "", + type: 0, +}; + +export const SummarizationField = { + $type: "yandex.cloud.speechsense.v1.analysis.SummarizationField" as const, + + encode( + message: SummarizationField, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(26).string(message.id); + } + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.type !== 0) { + writer.uint32(16).int32(message.type); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SummarizationField { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSummarizationField } as SummarizationField; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.id = reader.string(); + break; + case 1: + message.name = reader.string(); + break; + case 2: + message.type = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SummarizationField { + const message = { ...baseSummarizationField } as SummarizationField; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.type = + object.type !== undefined && object.type !== null + ? summarizationFieldTypeFromJSON(object.type) + : 0; + return message; + }, + + toJSON(message: SummarizationField): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.name !== undefined && (obj.name = message.name); + message.type !== undefined && + (obj.type = summarizationFieldTypeToJSON(message.type)); + return obj; + }, + + fromPartial, I>>( + object: I + ): SummarizationField { + const message = { ...baseSummarizationField } as SummarizationField; + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.type = object.type ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(SummarizationField.$type, SummarizationField); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/analysis/text_classifiers.ts b/src/generated/yandex/cloud/speechsense/v1/analysis/text_classifiers.ts new file mode 100644 index 00000000..bb728756 --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/analysis/text_classifiers.ts @@ -0,0 +1,427 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Int64Value } from "../../../../../google/protobuf/wrappers"; + +export const protobufPackage = "yandex.cloud.speechsense.v1.analysis"; + +export interface TextClassifiers { + $type: "yandex.cloud.speechsense.v1.analysis.TextClassifiers"; + classificationResult: ClassificationResult[]; +} + +export interface ClassificationResult { + $type: "yandex.cloud.speechsense.v1.analysis.ClassificationResult"; + /** Classifier name */ + classifier: string; + /** Classifier statistics */ + classifierStatistics: ClassifierStatistics[]; +} + +export interface ClassifierStatistics { + $type: "yandex.cloud.speechsense.v1.analysis.ClassifierStatistics"; + /** Channel number, null for whole talk */ + channelNumber?: number; + /** classifier total count */ + totalCount: number; + /** Represents various histograms build on top of classifiers */ + histograms: Histogram[]; +} + +export interface Histogram { + $type: "yandex.cloud.speechsense.v1.analysis.Histogram"; + /** + * histogram count values. For example: + * if len(count_values) = 2, it means that histogram is 50/50, + * if len(count_values) = 3 - [0] value represents first third, [1] - second third, [2] - last third, etc. + */ + countValues: number[]; +} + +const baseTextClassifiers: object = { + $type: "yandex.cloud.speechsense.v1.analysis.TextClassifiers", +}; + +export const TextClassifiers = { + $type: "yandex.cloud.speechsense.v1.analysis.TextClassifiers" as const, + + encode( + message: TextClassifiers, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.classificationResult) { + ClassificationResult.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TextClassifiers { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTextClassifiers } as TextClassifiers; + message.classificationResult = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classificationResult.push( + ClassificationResult.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TextClassifiers { + const message = { ...baseTextClassifiers } as TextClassifiers; + message.classificationResult = (object.classificationResult ?? []).map( + (e: any) => ClassificationResult.fromJSON(e) + ); + return message; + }, + + toJSON(message: TextClassifiers): unknown { + const obj: any = {}; + if (message.classificationResult) { + obj.classificationResult = message.classificationResult.map((e) => + e ? ClassificationResult.toJSON(e) : undefined + ); + } else { + obj.classificationResult = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): TextClassifiers { + const message = { ...baseTextClassifiers } as TextClassifiers; + message.classificationResult = + object.classificationResult?.map((e) => + ClassificationResult.fromPartial(e) + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(TextClassifiers.$type, TextClassifiers); + +const baseClassificationResult: object = { + $type: "yandex.cloud.speechsense.v1.analysis.ClassificationResult", + classifier: "", +}; + +export const ClassificationResult = { + $type: "yandex.cloud.speechsense.v1.analysis.ClassificationResult" as const, + + encode( + message: ClassificationResult, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.classifier !== "") { + writer.uint32(10).string(message.classifier); + } + for (const v of message.classifierStatistics) { + ClassifierStatistics.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ClassificationResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseClassificationResult } as ClassificationResult; + message.classifierStatistics = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classifier = reader.string(); + break; + case 2: + message.classifierStatistics.push( + ClassifierStatistics.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClassificationResult { + const message = { ...baseClassificationResult } as ClassificationResult; + message.classifier = + object.classifier !== undefined && object.classifier !== null + ? String(object.classifier) + : ""; + message.classifierStatistics = (object.classifierStatistics ?? []).map( + (e: any) => ClassifierStatistics.fromJSON(e) + ); + return message; + }, + + toJSON(message: ClassificationResult): unknown { + const obj: any = {}; + message.classifier !== undefined && (obj.classifier = message.classifier); + if (message.classifierStatistics) { + obj.classifierStatistics = message.classifierStatistics.map((e) => + e ? ClassifierStatistics.toJSON(e) : undefined + ); + } else { + obj.classifierStatistics = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ClassificationResult { + const message = { ...baseClassificationResult } as ClassificationResult; + message.classifier = object.classifier ?? ""; + message.classifierStatistics = + object.classifierStatistics?.map((e) => + ClassifierStatistics.fromPartial(e) + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(ClassificationResult.$type, ClassificationResult); + +const baseClassifierStatistics: object = { + $type: "yandex.cloud.speechsense.v1.analysis.ClassifierStatistics", + totalCount: 0, +}; + +export const ClassifierStatistics = { + $type: "yandex.cloud.speechsense.v1.analysis.ClassifierStatistics" as const, + + encode( + message: ClassifierStatistics, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelNumber !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.channelNumber! }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.totalCount !== 0) { + writer.uint32(16).int64(message.totalCount); + } + for (const v of message.histograms) { + Histogram.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ClassifierStatistics { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseClassifierStatistics } as ClassifierStatistics; + message.histograms = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelNumber = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 2: + message.totalCount = longToNumber(reader.int64() as Long); + break; + case 3: + message.histograms.push(Histogram.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClassifierStatistics { + const message = { ...baseClassifierStatistics } as ClassifierStatistics; + message.channelNumber = + object.channelNumber !== undefined && object.channelNumber !== null + ? Number(object.channelNumber) + : undefined; + message.totalCount = + object.totalCount !== undefined && object.totalCount !== null + ? Number(object.totalCount) + : 0; + message.histograms = (object.histograms ?? []).map((e: any) => + Histogram.fromJSON(e) + ); + return message; + }, + + toJSON(message: ClassifierStatistics): unknown { + const obj: any = {}; + message.channelNumber !== undefined && + (obj.channelNumber = message.channelNumber); + message.totalCount !== undefined && + (obj.totalCount = Math.round(message.totalCount)); + if (message.histograms) { + obj.histograms = message.histograms.map((e) => + e ? Histogram.toJSON(e) : undefined + ); + } else { + obj.histograms = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ClassifierStatistics { + const message = { ...baseClassifierStatistics } as ClassifierStatistics; + message.channelNumber = object.channelNumber ?? undefined; + message.totalCount = object.totalCount ?? 0; + message.histograms = + object.histograms?.map((e) => Histogram.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(ClassifierStatistics.$type, ClassifierStatistics); + +const baseHistogram: object = { + $type: "yandex.cloud.speechsense.v1.analysis.Histogram", + countValues: 0, +}; + +export const Histogram = { + $type: "yandex.cloud.speechsense.v1.analysis.Histogram" as const, + + encode( + message: Histogram, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.countValues) { + writer.int64(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Histogram { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHistogram } as Histogram; + message.countValues = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.countValues.push(longToNumber(reader.int64() as Long)); + } + } else { + message.countValues.push(longToNumber(reader.int64() as Long)); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Histogram { + const message = { ...baseHistogram } as Histogram; + message.countValues = (object.countValues ?? []).map((e: any) => Number(e)); + return message; + }, + + toJSON(message: Histogram): unknown { + const obj: any = {}; + if (message.countValues) { + obj.countValues = message.countValues.map((e) => Math.round(e)); + } else { + obj.countValues = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Histogram { + const message = { ...baseHistogram } as Histogram; + message.countValues = object.countValues?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(Histogram.$type, Histogram); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/analysis/transcription.ts b/src/generated/yandex/cloud/speechsense/v1/analysis/transcription.ts new file mode 100644 index 00000000..a32ba18d --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/analysis/transcription.ts @@ -0,0 +1,835 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { UtteranceStatistics } from "../../../../../yandex/cloud/speechsense/v1/analysis/utterance_statistics"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; +import { RecognitionClassifierResult } from "../../../../../yandex/cloud/speechsense/v1/analysis/predefined_classifiers"; + +export const protobufPackage = "yandex.cloud.speechsense.v1.analysis"; + +export interface Transcription { + $type: "yandex.cloud.speechsense.v1.analysis.Transcription"; + phrases: Phrase[]; + /** + * Their might be several algorithms that work on talk transcription. For example: speechkit and translator + * So there might be other fields here for tracing + */ + algorithmsMetadata: AlgorithmMetadata[]; +} + +export interface Phrase { + $type: "yandex.cloud.speechsense.v1.analysis.Phrase"; + channelNumber: number; + startTimeMs: number; + endTimeMs: number; + phrase?: PhraseText; + statistics?: PhraseStatistics; + classifiers: RecognitionClassifierResult[]; +} + +export interface PhraseText { + $type: "yandex.cloud.speechsense.v1.analysis.PhraseText"; + text: string; + language: string; + normalizedText: string; + words: Word[]; +} + +export interface Word { + $type: "yandex.cloud.speechsense.v1.analysis.Word"; + word: string; + startTimeMs: number; + endTimeMs: number; +} + +export interface AlgorithmMetadata { + $type: "yandex.cloud.speechsense.v1.analysis.AlgorithmMetadata"; + createdTaskDate?: Date; + completedTaskDate?: Date; + error?: Error; + traceId: string; + name: string; +} + +export interface Error { + $type: "yandex.cloud.speechsense.v1.analysis.Error"; + code: string; + message: string; +} + +export interface PhraseStatistics { + $type: "yandex.cloud.speechsense.v1.analysis.PhraseStatistics"; + statistics?: UtteranceStatistics; +} + +const baseTranscription: object = { + $type: "yandex.cloud.speechsense.v1.analysis.Transcription", +}; + +export const Transcription = { + $type: "yandex.cloud.speechsense.v1.analysis.Transcription" as const, + + encode( + message: Transcription, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.phrases) { + Phrase.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.algorithmsMetadata) { + AlgorithmMetadata.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Transcription { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTranscription } as Transcription; + message.phrases = []; + message.algorithmsMetadata = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.phrases.push(Phrase.decode(reader, reader.uint32())); + break; + case 2: + message.algorithmsMetadata.push( + AlgorithmMetadata.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Transcription { + const message = { ...baseTranscription } as Transcription; + message.phrases = (object.phrases ?? []).map((e: any) => + Phrase.fromJSON(e) + ); + message.algorithmsMetadata = (object.algorithmsMetadata ?? []).map( + (e: any) => AlgorithmMetadata.fromJSON(e) + ); + return message; + }, + + toJSON(message: Transcription): unknown { + const obj: any = {}; + if (message.phrases) { + obj.phrases = message.phrases.map((e) => + e ? Phrase.toJSON(e) : undefined + ); + } else { + obj.phrases = []; + } + if (message.algorithmsMetadata) { + obj.algorithmsMetadata = message.algorithmsMetadata.map((e) => + e ? AlgorithmMetadata.toJSON(e) : undefined + ); + } else { + obj.algorithmsMetadata = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): Transcription { + const message = { ...baseTranscription } as Transcription; + message.phrases = object.phrases?.map((e) => Phrase.fromPartial(e)) || []; + message.algorithmsMetadata = + object.algorithmsMetadata?.map((e) => AlgorithmMetadata.fromPartial(e)) || + []; + return message; + }, +}; + +messageTypeRegistry.set(Transcription.$type, Transcription); + +const basePhrase: object = { + $type: "yandex.cloud.speechsense.v1.analysis.Phrase", + channelNumber: 0, + startTimeMs: 0, + endTimeMs: 0, +}; + +export const Phrase = { + $type: "yandex.cloud.speechsense.v1.analysis.Phrase" as const, + + encode( + message: Phrase, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelNumber !== 0) { + writer.uint32(8).int64(message.channelNumber); + } + if (message.startTimeMs !== 0) { + writer.uint32(16).int64(message.startTimeMs); + } + if (message.endTimeMs !== 0) { + writer.uint32(24).int64(message.endTimeMs); + } + if (message.phrase !== undefined) { + PhraseText.encode(message.phrase, writer.uint32(34).fork()).ldelim(); + } + if (message.statistics !== undefined) { + PhraseStatistics.encode( + message.statistics, + writer.uint32(42).fork() + ).ldelim(); + } + for (const v of message.classifiers) { + RecognitionClassifierResult.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Phrase { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePhrase } as Phrase; + message.classifiers = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelNumber = longToNumber(reader.int64() as Long); + break; + case 2: + message.startTimeMs = longToNumber(reader.int64() as Long); + break; + case 3: + message.endTimeMs = longToNumber(reader.int64() as Long); + break; + case 4: + message.phrase = PhraseText.decode(reader, reader.uint32()); + break; + case 5: + message.statistics = PhraseStatistics.decode(reader, reader.uint32()); + break; + case 6: + message.classifiers.push( + RecognitionClassifierResult.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Phrase { + const message = { ...basePhrase } as Phrase; + message.channelNumber = + object.channelNumber !== undefined && object.channelNumber !== null + ? Number(object.channelNumber) + : 0; + message.startTimeMs = + object.startTimeMs !== undefined && object.startTimeMs !== null + ? Number(object.startTimeMs) + : 0; + message.endTimeMs = + object.endTimeMs !== undefined && object.endTimeMs !== null + ? Number(object.endTimeMs) + : 0; + message.phrase = + object.phrase !== undefined && object.phrase !== null + ? PhraseText.fromJSON(object.phrase) + : undefined; + message.statistics = + object.statistics !== undefined && object.statistics !== null + ? PhraseStatistics.fromJSON(object.statistics) + : undefined; + message.classifiers = (object.classifiers ?? []).map((e: any) => + RecognitionClassifierResult.fromJSON(e) + ); + return message; + }, + + toJSON(message: Phrase): unknown { + const obj: any = {}; + message.channelNumber !== undefined && + (obj.channelNumber = Math.round(message.channelNumber)); + message.startTimeMs !== undefined && + (obj.startTimeMs = Math.round(message.startTimeMs)); + message.endTimeMs !== undefined && + (obj.endTimeMs = Math.round(message.endTimeMs)); + message.phrase !== undefined && + (obj.phrase = message.phrase + ? PhraseText.toJSON(message.phrase) + : undefined); + message.statistics !== undefined && + (obj.statistics = message.statistics + ? PhraseStatistics.toJSON(message.statistics) + : undefined); + if (message.classifiers) { + obj.classifiers = message.classifiers.map((e) => + e ? RecognitionClassifierResult.toJSON(e) : undefined + ); + } else { + obj.classifiers = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Phrase { + const message = { ...basePhrase } as Phrase; + message.channelNumber = object.channelNumber ?? 0; + message.startTimeMs = object.startTimeMs ?? 0; + message.endTimeMs = object.endTimeMs ?? 0; + message.phrase = + object.phrase !== undefined && object.phrase !== null + ? PhraseText.fromPartial(object.phrase) + : undefined; + message.statistics = + object.statistics !== undefined && object.statistics !== null + ? PhraseStatistics.fromPartial(object.statistics) + : undefined; + message.classifiers = + object.classifiers?.map((e) => + RecognitionClassifierResult.fromPartial(e) + ) || []; + return message; + }, +}; + +messageTypeRegistry.set(Phrase.$type, Phrase); + +const basePhraseText: object = { + $type: "yandex.cloud.speechsense.v1.analysis.PhraseText", + text: "", + language: "", + normalizedText: "", +}; + +export const PhraseText = { + $type: "yandex.cloud.speechsense.v1.analysis.PhraseText" as const, + + encode( + message: PhraseText, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.text !== "") { + writer.uint32(10).string(message.text); + } + if (message.language !== "") { + writer.uint32(18).string(message.language); + } + if (message.normalizedText !== "") { + writer.uint32(26).string(message.normalizedText); + } + for (const v of message.words) { + Word.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PhraseText { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePhraseText } as PhraseText; + message.words = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.language = reader.string(); + break; + case 3: + message.normalizedText = reader.string(); + break; + case 4: + message.words.push(Word.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PhraseText { + const message = { ...basePhraseText } as PhraseText; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + message.language = + object.language !== undefined && object.language !== null + ? String(object.language) + : ""; + message.normalizedText = + object.normalizedText !== undefined && object.normalizedText !== null + ? String(object.normalizedText) + : ""; + message.words = (object.words ?? []).map((e: any) => Word.fromJSON(e)); + return message; + }, + + toJSON(message: PhraseText): unknown { + const obj: any = {}; + message.text !== undefined && (obj.text = message.text); + message.language !== undefined && (obj.language = message.language); + message.normalizedText !== undefined && + (obj.normalizedText = message.normalizedText); + if (message.words) { + obj.words = message.words.map((e) => (e ? Word.toJSON(e) : undefined)); + } else { + obj.words = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): PhraseText { + const message = { ...basePhraseText } as PhraseText; + message.text = object.text ?? ""; + message.language = object.language ?? ""; + message.normalizedText = object.normalizedText ?? ""; + message.words = object.words?.map((e) => Word.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(PhraseText.$type, PhraseText); + +const baseWord: object = { + $type: "yandex.cloud.speechsense.v1.analysis.Word", + word: "", + startTimeMs: 0, + endTimeMs: 0, +}; + +export const Word = { + $type: "yandex.cloud.speechsense.v1.analysis.Word" as const, + + encode(message: Word, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.word !== "") { + writer.uint32(10).string(message.word); + } + if (message.startTimeMs !== 0) { + writer.uint32(16).int64(message.startTimeMs); + } + if (message.endTimeMs !== 0) { + writer.uint32(24).int64(message.endTimeMs); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Word { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWord } as Word; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.word = reader.string(); + break; + case 2: + message.startTimeMs = longToNumber(reader.int64() as Long); + break; + case 3: + message.endTimeMs = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Word { + const message = { ...baseWord } as Word; + message.word = + object.word !== undefined && object.word !== null + ? String(object.word) + : ""; + message.startTimeMs = + object.startTimeMs !== undefined && object.startTimeMs !== null + ? Number(object.startTimeMs) + : 0; + message.endTimeMs = + object.endTimeMs !== undefined && object.endTimeMs !== null + ? Number(object.endTimeMs) + : 0; + return message; + }, + + toJSON(message: Word): unknown { + const obj: any = {}; + message.word !== undefined && (obj.word = message.word); + message.startTimeMs !== undefined && + (obj.startTimeMs = Math.round(message.startTimeMs)); + message.endTimeMs !== undefined && + (obj.endTimeMs = Math.round(message.endTimeMs)); + return obj; + }, + + fromPartial, I>>(object: I): Word { + const message = { ...baseWord } as Word; + message.word = object.word ?? ""; + message.startTimeMs = object.startTimeMs ?? 0; + message.endTimeMs = object.endTimeMs ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Word.$type, Word); + +const baseAlgorithmMetadata: object = { + $type: "yandex.cloud.speechsense.v1.analysis.AlgorithmMetadata", + traceId: "", + name: "", +}; + +export const AlgorithmMetadata = { + $type: "yandex.cloud.speechsense.v1.analysis.AlgorithmMetadata" as const, + + encode( + message: AlgorithmMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.createdTaskDate !== undefined) { + Timestamp.encode( + toTimestamp(message.createdTaskDate), + writer.uint32(10).fork() + ).ldelim(); + } + if (message.completedTaskDate !== undefined) { + Timestamp.encode( + toTimestamp(message.completedTaskDate), + writer.uint32(18).fork() + ).ldelim(); + } + if (message.error !== undefined) { + Error.encode(message.error, writer.uint32(26).fork()).ldelim(); + } + if (message.traceId !== "") { + writer.uint32(34).string(message.traceId); + } + if (message.name !== "") { + writer.uint32(42).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AlgorithmMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAlgorithmMetadata } as AlgorithmMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.createdTaskDate = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 2: + message.completedTaskDate = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 3: + message.error = Error.decode(reader, reader.uint32()); + break; + case 4: + message.traceId = reader.string(); + break; + case 5: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AlgorithmMetadata { + const message = { ...baseAlgorithmMetadata } as AlgorithmMetadata; + message.createdTaskDate = + object.createdTaskDate !== undefined && object.createdTaskDate !== null + ? fromJsonTimestamp(object.createdTaskDate) + : undefined; + message.completedTaskDate = + object.completedTaskDate !== undefined && + object.completedTaskDate !== null + ? fromJsonTimestamp(object.completedTaskDate) + : undefined; + message.error = + object.error !== undefined && object.error !== null + ? Error.fromJSON(object.error) + : undefined; + message.traceId = + object.traceId !== undefined && object.traceId !== null + ? String(object.traceId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + return message; + }, + + toJSON(message: AlgorithmMetadata): unknown { + const obj: any = {}; + message.createdTaskDate !== undefined && + (obj.createdTaskDate = message.createdTaskDate.toISOString()); + message.completedTaskDate !== undefined && + (obj.completedTaskDate = message.completedTaskDate.toISOString()); + message.error !== undefined && + (obj.error = message.error ? Error.toJSON(message.error) : undefined); + message.traceId !== undefined && (obj.traceId = message.traceId); + message.name !== undefined && (obj.name = message.name); + return obj; + }, + + fromPartial, I>>( + object: I + ): AlgorithmMetadata { + const message = { ...baseAlgorithmMetadata } as AlgorithmMetadata; + message.createdTaskDate = object.createdTaskDate ?? undefined; + message.completedTaskDate = object.completedTaskDate ?? undefined; + message.error = + object.error !== undefined && object.error !== null + ? Error.fromPartial(object.error) + : undefined; + message.traceId = object.traceId ?? ""; + message.name = object.name ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(AlgorithmMetadata.$type, AlgorithmMetadata); + +const baseError: object = { + $type: "yandex.cloud.speechsense.v1.analysis.Error", + code: "", + message: "", +}; + +export const Error = { + $type: "yandex.cloud.speechsense.v1.analysis.Error" as const, + + encode(message: Error, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.code !== "") { + writer.uint32(10).string(message.code); + } + if (message.message !== "") { + writer.uint32(18).string(message.message); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Error { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseError } as Error; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.string(); + break; + case 2: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Error { + const message = { ...baseError } as Error; + message.code = + object.code !== undefined && object.code !== null + ? String(object.code) + : ""; + message.message = + object.message !== undefined && object.message !== null + ? String(object.message) + : ""; + return message; + }, + + toJSON(message: Error): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = message.code); + message.message !== undefined && (obj.message = message.message); + return obj; + }, + + fromPartial, I>>(object: I): Error { + const message = { ...baseError } as Error; + message.code = object.code ?? ""; + message.message = object.message ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Error.$type, Error); + +const basePhraseStatistics: object = { + $type: "yandex.cloud.speechsense.v1.analysis.PhraseStatistics", +}; + +export const PhraseStatistics = { + $type: "yandex.cloud.speechsense.v1.analysis.PhraseStatistics" as const, + + encode( + message: PhraseStatistics, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.statistics !== undefined) { + UtteranceStatistics.encode( + message.statistics, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PhraseStatistics { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePhraseStatistics } as PhraseStatistics; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.statistics = UtteranceStatistics.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PhraseStatistics { + const message = { ...basePhraseStatistics } as PhraseStatistics; + message.statistics = + object.statistics !== undefined && object.statistics !== null + ? UtteranceStatistics.fromJSON(object.statistics) + : undefined; + return message; + }, + + toJSON(message: PhraseStatistics): unknown { + const obj: any = {}; + message.statistics !== undefined && + (obj.statistics = message.statistics + ? UtteranceStatistics.toJSON(message.statistics) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): PhraseStatistics { + const message = { ...basePhraseStatistics } as PhraseStatistics; + message.statistics = + object.statistics !== undefined && object.statistics !== null + ? UtteranceStatistics.fromPartial(object.statistics) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(PhraseStatistics.$type, PhraseStatistics); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/analysis/utterance_statistics.ts b/src/generated/yandex/cloud/speechsense/v1/analysis/utterance_statistics.ts new file mode 100644 index 00000000..afbbf0d3 --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/analysis/utterance_statistics.ts @@ -0,0 +1,301 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + AudioSegmentBoundaries, + DescriptiveStatistics, +} from "../../../../../yandex/cloud/speechsense/v1/analysis/statistics_common"; + +export const protobufPackage = "yandex.cloud.speechsense.v1.analysis"; + +export interface UtteranceStatistics { + $type: "yandex.cloud.speechsense.v1.analysis.UtteranceStatistics"; + speakerTag: string; + /** Audio segment boundaries */ + speechBoundaries?: AudioSegmentBoundaries; + /** Total speech duration */ + totalSpeechMs: number; + /** Speech ratio within audio segment */ + speechRatio: number; + /** Total silence duration */ + totalSilenceMs: number; + /** Silence ratio within audio segment */ + silenceRatio: number; + /** Number of words in recognized speech */ + wordsCount: number; + /** Number of letters in recognized speech */ + lettersCount: number; + /** Descriptive statistics for words per second distribution */ + wordsPerSecond?: DescriptiveStatistics; + /** Descriptive statistics for letters per second distribution */ + lettersPerSecond?: DescriptiveStatistics; +} + +const baseUtteranceStatistics: object = { + $type: "yandex.cloud.speechsense.v1.analysis.UtteranceStatistics", + speakerTag: "", + totalSpeechMs: 0, + speechRatio: 0, + totalSilenceMs: 0, + silenceRatio: 0, + wordsCount: 0, + lettersCount: 0, +}; + +export const UtteranceStatistics = { + $type: "yandex.cloud.speechsense.v1.analysis.UtteranceStatistics" as const, + + encode( + message: UtteranceStatistics, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.speakerTag !== "") { + writer.uint32(10).string(message.speakerTag); + } + if (message.speechBoundaries !== undefined) { + AudioSegmentBoundaries.encode( + message.speechBoundaries, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.totalSpeechMs !== 0) { + writer.uint32(24).int64(message.totalSpeechMs); + } + if (message.speechRatio !== 0) { + writer.uint32(33).double(message.speechRatio); + } + if (message.totalSilenceMs !== 0) { + writer.uint32(40).int64(message.totalSilenceMs); + } + if (message.silenceRatio !== 0) { + writer.uint32(49).double(message.silenceRatio); + } + if (message.wordsCount !== 0) { + writer.uint32(56).int64(message.wordsCount); + } + if (message.lettersCount !== 0) { + writer.uint32(64).int64(message.lettersCount); + } + if (message.wordsPerSecond !== undefined) { + DescriptiveStatistics.encode( + message.wordsPerSecond, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.lettersPerSecond !== undefined) { + DescriptiveStatistics.encode( + message.lettersPerSecond, + writer.uint32(82).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UtteranceStatistics { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUtteranceStatistics } as UtteranceStatistics; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.speakerTag = reader.string(); + break; + case 2: + message.speechBoundaries = AudioSegmentBoundaries.decode( + reader, + reader.uint32() + ); + break; + case 3: + message.totalSpeechMs = longToNumber(reader.int64() as Long); + break; + case 4: + message.speechRatio = reader.double(); + break; + case 5: + message.totalSilenceMs = longToNumber(reader.int64() as Long); + break; + case 6: + message.silenceRatio = reader.double(); + break; + case 7: + message.wordsCount = longToNumber(reader.int64() as Long); + break; + case 8: + message.lettersCount = longToNumber(reader.int64() as Long); + break; + case 9: + message.wordsPerSecond = DescriptiveStatistics.decode( + reader, + reader.uint32() + ); + break; + case 10: + message.lettersPerSecond = DescriptiveStatistics.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UtteranceStatistics { + const message = { ...baseUtteranceStatistics } as UtteranceStatistics; + message.speakerTag = + object.speakerTag !== undefined && object.speakerTag !== null + ? String(object.speakerTag) + : ""; + message.speechBoundaries = + object.speechBoundaries !== undefined && object.speechBoundaries !== null + ? AudioSegmentBoundaries.fromJSON(object.speechBoundaries) + : undefined; + message.totalSpeechMs = + object.totalSpeechMs !== undefined && object.totalSpeechMs !== null + ? Number(object.totalSpeechMs) + : 0; + message.speechRatio = + object.speechRatio !== undefined && object.speechRatio !== null + ? Number(object.speechRatio) + : 0; + message.totalSilenceMs = + object.totalSilenceMs !== undefined && object.totalSilenceMs !== null + ? Number(object.totalSilenceMs) + : 0; + message.silenceRatio = + object.silenceRatio !== undefined && object.silenceRatio !== null + ? Number(object.silenceRatio) + : 0; + message.wordsCount = + object.wordsCount !== undefined && object.wordsCount !== null + ? Number(object.wordsCount) + : 0; + message.lettersCount = + object.lettersCount !== undefined && object.lettersCount !== null + ? Number(object.lettersCount) + : 0; + message.wordsPerSecond = + object.wordsPerSecond !== undefined && object.wordsPerSecond !== null + ? DescriptiveStatistics.fromJSON(object.wordsPerSecond) + : undefined; + message.lettersPerSecond = + object.lettersPerSecond !== undefined && object.lettersPerSecond !== null + ? DescriptiveStatistics.fromJSON(object.lettersPerSecond) + : undefined; + return message; + }, + + toJSON(message: UtteranceStatistics): unknown { + const obj: any = {}; + message.speakerTag !== undefined && (obj.speakerTag = message.speakerTag); + message.speechBoundaries !== undefined && + (obj.speechBoundaries = message.speechBoundaries + ? AudioSegmentBoundaries.toJSON(message.speechBoundaries) + : undefined); + message.totalSpeechMs !== undefined && + (obj.totalSpeechMs = Math.round(message.totalSpeechMs)); + message.speechRatio !== undefined && + (obj.speechRatio = message.speechRatio); + message.totalSilenceMs !== undefined && + (obj.totalSilenceMs = Math.round(message.totalSilenceMs)); + message.silenceRatio !== undefined && + (obj.silenceRatio = message.silenceRatio); + message.wordsCount !== undefined && + (obj.wordsCount = Math.round(message.wordsCount)); + message.lettersCount !== undefined && + (obj.lettersCount = Math.round(message.lettersCount)); + message.wordsPerSecond !== undefined && + (obj.wordsPerSecond = message.wordsPerSecond + ? DescriptiveStatistics.toJSON(message.wordsPerSecond) + : undefined); + message.lettersPerSecond !== undefined && + (obj.lettersPerSecond = message.lettersPerSecond + ? DescriptiveStatistics.toJSON(message.lettersPerSecond) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UtteranceStatistics { + const message = { ...baseUtteranceStatistics } as UtteranceStatistics; + message.speakerTag = object.speakerTag ?? ""; + message.speechBoundaries = + object.speechBoundaries !== undefined && object.speechBoundaries !== null + ? AudioSegmentBoundaries.fromPartial(object.speechBoundaries) + : undefined; + message.totalSpeechMs = object.totalSpeechMs ?? 0; + message.speechRatio = object.speechRatio ?? 0; + message.totalSilenceMs = object.totalSilenceMs ?? 0; + message.silenceRatio = object.silenceRatio ?? 0; + message.wordsCount = object.wordsCount ?? 0; + message.lettersCount = object.lettersCount ?? 0; + message.wordsPerSecond = + object.wordsPerSecond !== undefined && object.wordsPerSecond !== null + ? DescriptiveStatistics.fromPartial(object.wordsPerSecond) + : undefined; + message.lettersPerSecond = + object.lettersPerSecond !== undefined && object.lettersPerSecond !== null + ? DescriptiveStatistics.fromPartial(object.lettersPerSecond) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UtteranceStatistics.$type, UtteranceStatistics); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/audio.ts b/src/generated/yandex/cloud/speechsense/v1/audio.ts new file mode 100644 index 00000000..e75033f4 --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/audio.ts @@ -0,0 +1,714 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.speechsense.v1"; + +/** RAW Audio format spec (no container to infer type). Used in AudioFormat options. */ +export interface RawAudio { + $type: "yandex.cloud.speechsense.v1.RawAudio"; + /** Type of audio encoding */ + audioEncoding: RawAudio_AudioEncoding; + /** PCM sample rate */ + sampleRateHertz: number; + /** PCM channel count. */ + audioChannelCount: number; +} + +export enum RawAudio_AudioEncoding { + AUDIO_ENCODING_UNSPECIFIED = 0, + /** AUDIO_ENCODING_LINEAR16_PCM - Audio bit depth 16-bit signed little-endian (Linear PCM). */ + AUDIO_ENCODING_LINEAR16_PCM = 1, + UNRECOGNIZED = -1, +} + +export function rawAudio_AudioEncodingFromJSON( + object: any +): RawAudio_AudioEncoding { + switch (object) { + case 0: + case "AUDIO_ENCODING_UNSPECIFIED": + return RawAudio_AudioEncoding.AUDIO_ENCODING_UNSPECIFIED; + case 1: + case "AUDIO_ENCODING_LINEAR16_PCM": + return RawAudio_AudioEncoding.AUDIO_ENCODING_LINEAR16_PCM; + case -1: + case "UNRECOGNIZED": + default: + return RawAudio_AudioEncoding.UNRECOGNIZED; + } +} + +export function rawAudio_AudioEncodingToJSON( + object: RawAudio_AudioEncoding +): string { + switch (object) { + case RawAudio_AudioEncoding.AUDIO_ENCODING_UNSPECIFIED: + return "AUDIO_ENCODING_UNSPECIFIED"; + case RawAudio_AudioEncoding.AUDIO_ENCODING_LINEAR16_PCM: + return "AUDIO_ENCODING_LINEAR16_PCM"; + default: + return "UNKNOWN"; + } +} + +/** Audio with fixed type in container. Used in AudioFormat options. */ +export interface ContainerAudio { + $type: "yandex.cloud.speechsense.v1.ContainerAudio"; + /** Type of audio container. */ + containerAudioType: ContainerAudio_ContainerAudioType; +} + +export enum ContainerAudio_ContainerAudioType { + CONTAINER_AUDIO_TYPE_UNSPECIFIED = 0, + /** CONTAINER_AUDIO_TYPE_WAV - Audio bit depth 16-bit signed little-endian (Linear PCM). */ + CONTAINER_AUDIO_TYPE_WAV = 1, + /** CONTAINER_AUDIO_TYPE_OGG_OPUS - Data is encoded using the OPUS audio codec and compressed using the OGG container format. */ + CONTAINER_AUDIO_TYPE_OGG_OPUS = 2, + /** CONTAINER_AUDIO_TYPE_MP3 - Data is encoded using MPEG-1/2 Layer III and compressed using the MP3 container format. */ + CONTAINER_AUDIO_TYPE_MP3 = 3, + UNRECOGNIZED = -1, +} + +export function containerAudio_ContainerAudioTypeFromJSON( + object: any +): ContainerAudio_ContainerAudioType { + switch (object) { + case 0: + case "CONTAINER_AUDIO_TYPE_UNSPECIFIED": + return ContainerAudio_ContainerAudioType.CONTAINER_AUDIO_TYPE_UNSPECIFIED; + case 1: + case "CONTAINER_AUDIO_TYPE_WAV": + return ContainerAudio_ContainerAudioType.CONTAINER_AUDIO_TYPE_WAV; + case 2: + case "CONTAINER_AUDIO_TYPE_OGG_OPUS": + return ContainerAudio_ContainerAudioType.CONTAINER_AUDIO_TYPE_OGG_OPUS; + case 3: + case "CONTAINER_AUDIO_TYPE_MP3": + return ContainerAudio_ContainerAudioType.CONTAINER_AUDIO_TYPE_MP3; + case -1: + case "UNRECOGNIZED": + default: + return ContainerAudio_ContainerAudioType.UNRECOGNIZED; + } +} + +export function containerAudio_ContainerAudioTypeToJSON( + object: ContainerAudio_ContainerAudioType +): string { + switch (object) { + case ContainerAudio_ContainerAudioType.CONTAINER_AUDIO_TYPE_UNSPECIFIED: + return "CONTAINER_AUDIO_TYPE_UNSPECIFIED"; + case ContainerAudio_ContainerAudioType.CONTAINER_AUDIO_TYPE_WAV: + return "CONTAINER_AUDIO_TYPE_WAV"; + case ContainerAudio_ContainerAudioType.CONTAINER_AUDIO_TYPE_OGG_OPUS: + return "CONTAINER_AUDIO_TYPE_OGG_OPUS"; + case ContainerAudio_ContainerAudioType.CONTAINER_AUDIO_TYPE_MP3: + return "CONTAINER_AUDIO_TYPE_MP3"; + default: + return "UNKNOWN"; + } +} + +/** Audio format options. */ +export interface AudioMetadata { + $type: "yandex.cloud.speechsense.v1.AudioMetadata"; + /** Audio without container. */ + rawAudio?: RawAudio | undefined; + /** Audio is wrapped in container. */ + containerAudio?: ContainerAudio | undefined; +} + +/** Data chunk with audio. */ +export interface AudioChunk { + $type: "yandex.cloud.speechsense.v1.AudioChunk"; + /** Bytes with audio data. */ + data: Buffer; +} + +/** + * Streaming audio request + * First message should be audio metadata. + * The next messages are audio data chunks. + */ +export interface AudioStreamingRequest { + $type: "yandex.cloud.speechsense.v1.AudioStreamingRequest"; + /** Session options. Should be the first message from user. */ + audioMetadata?: AudioMetadata | undefined; + /** Chunk with audio data. */ + chunk?: AudioChunk | undefined; +} + +/** request for sending small audios (< 128 mb) in one go */ +export interface AudioRequest { + $type: "yandex.cloud.speechsense.v1.AudioRequest"; + /** audio metadata */ + audioMetadata?: AudioMetadata; + /** Bytes with audio data. */ + audioData?: AudioChunk; +} + +const baseRawAudio: object = { + $type: "yandex.cloud.speechsense.v1.RawAudio", + audioEncoding: 0, + sampleRateHertz: 0, + audioChannelCount: 0, +}; + +export const RawAudio = { + $type: "yandex.cloud.speechsense.v1.RawAudio" as const, + + encode( + message: RawAudio, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.audioEncoding !== 0) { + writer.uint32(8).int32(message.audioEncoding); + } + if (message.sampleRateHertz !== 0) { + writer.uint32(16).int64(message.sampleRateHertz); + } + if (message.audioChannelCount !== 0) { + writer.uint32(24).int64(message.audioChannelCount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RawAudio { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRawAudio } as RawAudio; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.audioEncoding = reader.int32() as any; + break; + case 2: + message.sampleRateHertz = longToNumber(reader.int64() as Long); + break; + case 3: + message.audioChannelCount = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RawAudio { + const message = { ...baseRawAudio } as RawAudio; + message.audioEncoding = + object.audioEncoding !== undefined && object.audioEncoding !== null + ? rawAudio_AudioEncodingFromJSON(object.audioEncoding) + : 0; + message.sampleRateHertz = + object.sampleRateHertz !== undefined && object.sampleRateHertz !== null + ? Number(object.sampleRateHertz) + : 0; + message.audioChannelCount = + object.audioChannelCount !== undefined && + object.audioChannelCount !== null + ? Number(object.audioChannelCount) + : 0; + return message; + }, + + toJSON(message: RawAudio): unknown { + const obj: any = {}; + message.audioEncoding !== undefined && + (obj.audioEncoding = rawAudio_AudioEncodingToJSON(message.audioEncoding)); + message.sampleRateHertz !== undefined && + (obj.sampleRateHertz = Math.round(message.sampleRateHertz)); + message.audioChannelCount !== undefined && + (obj.audioChannelCount = Math.round(message.audioChannelCount)); + return obj; + }, + + fromPartial, I>>(object: I): RawAudio { + const message = { ...baseRawAudio } as RawAudio; + message.audioEncoding = object.audioEncoding ?? 0; + message.sampleRateHertz = object.sampleRateHertz ?? 0; + message.audioChannelCount = object.audioChannelCount ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(RawAudio.$type, RawAudio); + +const baseContainerAudio: object = { + $type: "yandex.cloud.speechsense.v1.ContainerAudio", + containerAudioType: 0, +}; + +export const ContainerAudio = { + $type: "yandex.cloud.speechsense.v1.ContainerAudio" as const, + + encode( + message: ContainerAudio, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.containerAudioType !== 0) { + writer.uint32(8).int32(message.containerAudioType); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ContainerAudio { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseContainerAudio } as ContainerAudio; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.containerAudioType = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ContainerAudio { + const message = { ...baseContainerAudio } as ContainerAudio; + message.containerAudioType = + object.containerAudioType !== undefined && + object.containerAudioType !== null + ? containerAudio_ContainerAudioTypeFromJSON(object.containerAudioType) + : 0; + return message; + }, + + toJSON(message: ContainerAudio): unknown { + const obj: any = {}; + message.containerAudioType !== undefined && + (obj.containerAudioType = containerAudio_ContainerAudioTypeToJSON( + message.containerAudioType + )); + return obj; + }, + + fromPartial, I>>( + object: I + ): ContainerAudio { + const message = { ...baseContainerAudio } as ContainerAudio; + message.containerAudioType = object.containerAudioType ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(ContainerAudio.$type, ContainerAudio); + +const baseAudioMetadata: object = { + $type: "yandex.cloud.speechsense.v1.AudioMetadata", +}; + +export const AudioMetadata = { + $type: "yandex.cloud.speechsense.v1.AudioMetadata" as const, + + encode( + message: AudioMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.rawAudio !== undefined) { + RawAudio.encode(message.rawAudio, writer.uint32(10).fork()).ldelim(); + } + if (message.containerAudio !== undefined) { + ContainerAudio.encode( + message.containerAudio, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AudioMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAudioMetadata } as AudioMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rawAudio = RawAudio.decode(reader, reader.uint32()); + break; + case 2: + message.containerAudio = ContainerAudio.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AudioMetadata { + const message = { ...baseAudioMetadata } as AudioMetadata; + message.rawAudio = + object.rawAudio !== undefined && object.rawAudio !== null + ? RawAudio.fromJSON(object.rawAudio) + : undefined; + message.containerAudio = + object.containerAudio !== undefined && object.containerAudio !== null + ? ContainerAudio.fromJSON(object.containerAudio) + : undefined; + return message; + }, + + toJSON(message: AudioMetadata): unknown { + const obj: any = {}; + message.rawAudio !== undefined && + (obj.rawAudio = message.rawAudio + ? RawAudio.toJSON(message.rawAudio) + : undefined); + message.containerAudio !== undefined && + (obj.containerAudio = message.containerAudio + ? ContainerAudio.toJSON(message.containerAudio) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): AudioMetadata { + const message = { ...baseAudioMetadata } as AudioMetadata; + message.rawAudio = + object.rawAudio !== undefined && object.rawAudio !== null + ? RawAudio.fromPartial(object.rawAudio) + : undefined; + message.containerAudio = + object.containerAudio !== undefined && object.containerAudio !== null + ? ContainerAudio.fromPartial(object.containerAudio) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(AudioMetadata.$type, AudioMetadata); + +const baseAudioChunk: object = { + $type: "yandex.cloud.speechsense.v1.AudioChunk", +}; + +export const AudioChunk = { + $type: "yandex.cloud.speechsense.v1.AudioChunk" as const, + + encode( + message: AudioChunk, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AudioChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAudioChunk } as AudioChunk; + message.data = Buffer.alloc(0); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes() as Buffer; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AudioChunk { + const message = { ...baseAudioChunk } as AudioChunk; + message.data = + object.data !== undefined && object.data !== null + ? Buffer.from(bytesFromBase64(object.data)) + : Buffer.alloc(0); + return message; + }, + + toJSON(message: AudioChunk): unknown { + const obj: any = {}; + message.data !== undefined && + (obj.data = base64FromBytes( + message.data !== undefined ? message.data : Buffer.alloc(0) + )); + return obj; + }, + + fromPartial, I>>( + object: I + ): AudioChunk { + const message = { ...baseAudioChunk } as AudioChunk; + message.data = object.data ?? Buffer.alloc(0); + return message; + }, +}; + +messageTypeRegistry.set(AudioChunk.$type, AudioChunk); + +const baseAudioStreamingRequest: object = { + $type: "yandex.cloud.speechsense.v1.AudioStreamingRequest", +}; + +export const AudioStreamingRequest = { + $type: "yandex.cloud.speechsense.v1.AudioStreamingRequest" as const, + + encode( + message: AudioStreamingRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.audioMetadata !== undefined) { + AudioMetadata.encode( + message.audioMetadata, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.chunk !== undefined) { + AudioChunk.encode(message.chunk, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): AudioStreamingRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAudioStreamingRequest } as AudioStreamingRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.audioMetadata = AudioMetadata.decode(reader, reader.uint32()); + break; + case 2: + message.chunk = AudioChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AudioStreamingRequest { + const message = { ...baseAudioStreamingRequest } as AudioStreamingRequest; + message.audioMetadata = + object.audioMetadata !== undefined && object.audioMetadata !== null + ? AudioMetadata.fromJSON(object.audioMetadata) + : undefined; + message.chunk = + object.chunk !== undefined && object.chunk !== null + ? AudioChunk.fromJSON(object.chunk) + : undefined; + return message; + }, + + toJSON(message: AudioStreamingRequest): unknown { + const obj: any = {}; + message.audioMetadata !== undefined && + (obj.audioMetadata = message.audioMetadata + ? AudioMetadata.toJSON(message.audioMetadata) + : undefined); + message.chunk !== undefined && + (obj.chunk = message.chunk + ? AudioChunk.toJSON(message.chunk) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): AudioStreamingRequest { + const message = { ...baseAudioStreamingRequest } as AudioStreamingRequest; + message.audioMetadata = + object.audioMetadata !== undefined && object.audioMetadata !== null + ? AudioMetadata.fromPartial(object.audioMetadata) + : undefined; + message.chunk = + object.chunk !== undefined && object.chunk !== null + ? AudioChunk.fromPartial(object.chunk) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(AudioStreamingRequest.$type, AudioStreamingRequest); + +const baseAudioRequest: object = { + $type: "yandex.cloud.speechsense.v1.AudioRequest", +}; + +export const AudioRequest = { + $type: "yandex.cloud.speechsense.v1.AudioRequest" as const, + + encode( + message: AudioRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.audioMetadata !== undefined) { + AudioMetadata.encode( + message.audioMetadata, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.audioData !== undefined) { + AudioChunk.encode(message.audioData, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AudioRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAudioRequest } as AudioRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.audioMetadata = AudioMetadata.decode(reader, reader.uint32()); + break; + case 2: + message.audioData = AudioChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AudioRequest { + const message = { ...baseAudioRequest } as AudioRequest; + message.audioMetadata = + object.audioMetadata !== undefined && object.audioMetadata !== null + ? AudioMetadata.fromJSON(object.audioMetadata) + : undefined; + message.audioData = + object.audioData !== undefined && object.audioData !== null + ? AudioChunk.fromJSON(object.audioData) + : undefined; + return message; + }, + + toJSON(message: AudioRequest): unknown { + const obj: any = {}; + message.audioMetadata !== undefined && + (obj.audioMetadata = message.audioMetadata + ? AudioMetadata.toJSON(message.audioMetadata) + : undefined); + message.audioData !== undefined && + (obj.audioData = message.audioData + ? AudioChunk.toJSON(message.audioData) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): AudioRequest { + const message = { ...baseAudioRequest } as AudioRequest; + message.audioMetadata = + object.audioMetadata !== undefined && object.audioMetadata !== null + ? AudioMetadata.fromPartial(object.audioMetadata) + : undefined; + message.audioData = + object.audioData !== undefined && object.audioData !== null + ? AudioChunk.fromPartial(object.audioData) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(AudioRequest.$type, AudioRequest); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (const byte of arr) { + bin.push(String.fromCharCode(byte)); + } + return btoa(bin.join("")); +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/project.ts b/src/generated/yandex/cloud/speechsense/v1/project.ts new file mode 100644 index 00000000..2f37860c --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/project.ts @@ -0,0 +1,336 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.speechsense.v1"; + +export interface Project { + $type: "yandex.cloud.speechsense.v1.Project"; + id: string; + name: string; + connectionId: string; + description: string; + createdBy: string; + createdAt?: Date; + modifiedBy: string; + modifiedAt?: Date; + filters: FieldFilter[]; +} + +/** simple filters to match talks based on their connection metadata */ +export interface FieldFilter { + $type: "yandex.cloud.speechsense.v1.FieldFilter"; + /** connection metadata field key */ + key: string; + /** connection metadata field value */ + fieldValue: string; +} + +const baseProject: object = { + $type: "yandex.cloud.speechsense.v1.Project", + id: "", + name: "", + connectionId: "", + description: "", + createdBy: "", + modifiedBy: "", +}; + +export const Project = { + $type: "yandex.cloud.speechsense.v1.Project" as const, + + encode( + message: Project, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.connectionId !== "") { + writer.uint32(26).string(message.connectionId); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.createdBy !== "") { + writer.uint32(42).string(message.createdBy); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(50).fork() + ).ldelim(); + } + if (message.modifiedBy !== "") { + writer.uint32(58).string(message.modifiedBy); + } + if (message.modifiedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.modifiedAt), + writer.uint32(66).fork() + ).ldelim(); + } + for (const v of message.filters) { + FieldFilter.encode(v!, writer.uint32(74).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Project { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseProject } as Project; + message.filters = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.connectionId = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.createdBy = reader.string(); + break; + case 6: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 7: + message.modifiedBy = reader.string(); + break; + case 8: + message.modifiedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 9: + message.filters.push(FieldFilter.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Project { + const message = { ...baseProject } as Project; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.connectionId = + object.connectionId !== undefined && object.connectionId !== null + ? String(object.connectionId) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.modifiedBy = + object.modifiedBy !== undefined && object.modifiedBy !== null + ? String(object.modifiedBy) + : ""; + message.modifiedAt = + object.modifiedAt !== undefined && object.modifiedAt !== null + ? fromJsonTimestamp(object.modifiedAt) + : undefined; + message.filters = (object.filters ?? []).map((e: any) => + FieldFilter.fromJSON(e) + ); + return message; + }, + + toJSON(message: Project): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.name !== undefined && (obj.name = message.name); + message.connectionId !== undefined && + (obj.connectionId = message.connectionId); + message.description !== undefined && + (obj.description = message.description); + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.modifiedBy !== undefined && (obj.modifiedBy = message.modifiedBy); + message.modifiedAt !== undefined && + (obj.modifiedAt = message.modifiedAt.toISOString()); + if (message.filters) { + obj.filters = message.filters.map((e) => + e ? FieldFilter.toJSON(e) : undefined + ); + } else { + obj.filters = []; + } + return obj; + }, + + fromPartial, I>>(object: I): Project { + const message = { ...baseProject } as Project; + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.connectionId = object.connectionId ?? ""; + message.description = object.description ?? ""; + message.createdBy = object.createdBy ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.modifiedBy = object.modifiedBy ?? ""; + message.modifiedAt = object.modifiedAt ?? undefined; + message.filters = + object.filters?.map((e) => FieldFilter.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(Project.$type, Project); + +const baseFieldFilter: object = { + $type: "yandex.cloud.speechsense.v1.FieldFilter", + key: "", + fieldValue: "", +}; + +export const FieldFilter = { + $type: "yandex.cloud.speechsense.v1.FieldFilter" as const, + + encode( + message: FieldFilter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.fieldValue !== "") { + writer.uint32(18).string(message.fieldValue); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FieldFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldFilter } as FieldFilter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.fieldValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldFilter { + const message = { ...baseFieldFilter } as FieldFilter; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.fieldValue = + object.fieldValue !== undefined && object.fieldValue !== null + ? String(object.fieldValue) + : ""; + return message; + }, + + toJSON(message: FieldFilter): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.fieldValue !== undefined && (obj.fieldValue = message.fieldValue); + return obj; + }, + + fromPartial, I>>( + object: I + ): FieldFilter { + const message = { ...baseFieldFilter } as FieldFilter; + message.key = object.key ?? ""; + message.fieldValue = object.fieldValue ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(FieldFilter.$type, FieldFilter); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/project_service.ts b/src/generated/yandex/cloud/speechsense/v1/project_service.ts new file mode 100644 index 00000000..b60a7950 --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/project_service.ts @@ -0,0 +1,295 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { FieldFilter } from "../../../../yandex/cloud/speechsense/v1/project"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.speechsense.v1"; + +export interface CreateProjectRequest { + $type: "yandex.cloud.speechsense.v1.CreateProjectRequest"; + /** project name */ + name: string; + /** id of connection the project should belong too */ + connectionId: string; + /** project description */ + description: string; + /** project filters */ + filters: FieldFilter[]; +} + +export interface CreateProjectMetadata { + $type: "yandex.cloud.speechsense.v1.CreateProjectMetadata"; + id: string; +} + +const baseCreateProjectRequest: object = { + $type: "yandex.cloud.speechsense.v1.CreateProjectRequest", + name: "", + connectionId: "", + description: "", +}; + +export const CreateProjectRequest = { + $type: "yandex.cloud.speechsense.v1.CreateProjectRequest" as const, + + encode( + message: CreateProjectRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + for (const v of message.filters) { + FieldFilter.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateProjectRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateProjectRequest } as CreateProjectRequest; + message.filters = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.filters.push(FieldFilter.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateProjectRequest { + const message = { ...baseCreateProjectRequest } as CreateProjectRequest; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.connectionId = + object.connectionId !== undefined && object.connectionId !== null + ? String(object.connectionId) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.filters = (object.filters ?? []).map((e: any) => + FieldFilter.fromJSON(e) + ); + return message; + }, + + toJSON(message: CreateProjectRequest): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.connectionId !== undefined && + (obj.connectionId = message.connectionId); + message.description !== undefined && + (obj.description = message.description); + if (message.filters) { + obj.filters = message.filters.map((e) => + e ? FieldFilter.toJSON(e) : undefined + ); + } else { + obj.filters = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateProjectRequest { + const message = { ...baseCreateProjectRequest } as CreateProjectRequest; + message.name = object.name ?? ""; + message.connectionId = object.connectionId ?? ""; + message.description = object.description ?? ""; + message.filters = + object.filters?.map((e) => FieldFilter.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(CreateProjectRequest.$type, CreateProjectRequest); + +const baseCreateProjectMetadata: object = { + $type: "yandex.cloud.speechsense.v1.CreateProjectMetadata", + id: "", +}; + +export const CreateProjectMetadata = { + $type: "yandex.cloud.speechsense.v1.CreateProjectMetadata" as const, + + encode( + message: CreateProjectMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateProjectMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateProjectMetadata } as CreateProjectMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateProjectMetadata { + const message = { ...baseCreateProjectMetadata } as CreateProjectMetadata; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + return message; + }, + + toJSON(message: CreateProjectMetadata): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateProjectMetadata { + const message = { ...baseCreateProjectMetadata } as CreateProjectMetadata; + message.id = object.id ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateProjectMetadata.$type, CreateProjectMetadata); + +export const ProjectServiceService = { + /** rpc for creating speechsense project */ + create: { + path: "/yandex.cloud.speechsense.v1.ProjectService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateProjectRequest) => + Buffer.from(CreateProjectRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateProjectRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface ProjectServiceServer extends UntypedServiceImplementation { + /** rpc for creating speechsense project */ + create: handleUnaryCall; +} + +export interface ProjectServiceClient extends Client { + /** rpc for creating speechsense project */ + create( + request: CreateProjectRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateProjectRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateProjectRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const ProjectServiceClient = makeGenericClientConstructor( + ProjectServiceService, + "yandex.cloud.speechsense.v1.ProjectService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ProjectServiceClient; + service: typeof ProjectServiceService; +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/search.ts b/src/generated/yandex/cloud/speechsense/v1/search.ts new file mode 100644 index 00000000..bb705e89 --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/search.ts @@ -0,0 +1,1302 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Duration } from "../../../../google/protobuf/duration"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { Int64Value, DoubleValue } from "../../../../google/protobuf/wrappers"; + +export const protobufPackage = "yandex.cloud.speechsense.v1"; + +export enum SortOrder { + SORT_ORDER_UNSPECIFIED = 0, + SORT_ORDER_ASC = 1, + SORT_ORDER_DESC = 2, + UNRECOGNIZED = -1, +} + +export function sortOrderFromJSON(object: any): SortOrder { + switch (object) { + case 0: + case "SORT_ORDER_UNSPECIFIED": + return SortOrder.SORT_ORDER_UNSPECIFIED; + case 1: + case "SORT_ORDER_ASC": + return SortOrder.SORT_ORDER_ASC; + case 2: + case "SORT_ORDER_DESC": + return SortOrder.SORT_ORDER_DESC; + case -1: + case "UNRECOGNIZED": + default: + return SortOrder.UNRECOGNIZED; + } +} + +export function sortOrderToJSON(object: SortOrder): string { + switch (object) { + case SortOrder.SORT_ORDER_UNSPECIFIED: + return "SORT_ORDER_UNSPECIFIED"; + case SortOrder.SORT_ORDER_ASC: + return "SORT_ORDER_ASC"; + case SortOrder.SORT_ORDER_DESC: + return "SORT_ORDER_DESC"; + default: + return "UNKNOWN"; + } +} + +export interface Filter { + $type: "yandex.cloud.speechsense.v1.Filter"; + /** metadata key (user.some_key / system.created_at / analysis.speechkit.duration) */ + key: string; + /** find talk matched by any text filters */ + anyMatch?: AnyMatchFilter | undefined; + /** find talks with value from int range */ + intRange?: IntRangeFilter | undefined; + /** find talks with value from double range */ + doubleRange?: DoubleRangeFilter | undefined; + /** find talks with value from date range */ + dateRange?: DateRangeFilter | undefined; + /** find talks with value from duration range */ + durationRange?: DurationRangeFilter | undefined; + /** find talks with value equals boolean */ + booleanMatch?: BooleanFilter | undefined; + inverse: boolean; + /** channel number to apply filter for, starting with 0. applies to all channels if not specified */ + channelNumber?: number; +} + +export interface Query { + $type: "yandex.cloud.speechsense.v1.Query"; + text: string; + /** should or should NOT match */ + inverse: boolean; + /** id of channel to search ("1", "2", ..., any channel if not set) */ + channelNumber?: number; +} + +export interface AnyMatchFilter { + $type: "yandex.cloud.speechsense.v1.AnyMatchFilter"; + /** values list to match with "OR" operator */ + values: string[]; +} + +/** indicates whether to include range boundaries */ +export interface BoundsInclusive { + $type: "yandex.cloud.speechsense.v1.BoundsInclusive"; + /** include from bound */ + fromInclusive: boolean; + /** include to bound */ + toInclusive: boolean; +} + +export interface IntRangeFilter { + $type: "yandex.cloud.speechsense.v1.IntRangeFilter"; + fromValue?: number; + toValue?: number; + boundsInclusive?: BoundsInclusive; +} + +export interface DoubleRangeFilter { + $type: "yandex.cloud.speechsense.v1.DoubleRangeFilter"; + fromValue?: number; + toValue?: number; + boundsInclusive?: BoundsInclusive; +} + +export interface DateRangeFilter { + $type: "yandex.cloud.speechsense.v1.DateRangeFilter"; + fromValue?: Date; + toValue?: Date; + boundsInclusive?: BoundsInclusive; +} + +export interface DurationRangeFilter { + $type: "yandex.cloud.speechsense.v1.DurationRangeFilter"; + fromValue?: Duration; + toValue?: Duration; + boundsInclusive?: BoundsInclusive; +} + +export interface BooleanFilter { + $type: "yandex.cloud.speechsense.v1.BooleanFilter"; + value: boolean; +} + +export interface SortData { + $type: "yandex.cloud.speechsense.v1.SortData"; + fields: SortField[]; +} + +export interface SortField { + $type: "yandex.cloud.speechsense.v1.SortField"; + /** sorting key */ + field: string; + /** sorting order by current `field` */ + order: SortOrder; + /** number of field in comparing order (sort by key1 (position = 0), then key2 (position = 1), then key3...) */ + position: number; +} + +const baseFilter: object = { + $type: "yandex.cloud.speechsense.v1.Filter", + key: "", + inverse: false, +}; + +export const Filter = { + $type: "yandex.cloud.speechsense.v1.Filter" as const, + + encode( + message: Filter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.anyMatch !== undefined) { + AnyMatchFilter.encode( + message.anyMatch, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.intRange !== undefined) { + IntRangeFilter.encode( + message.intRange, + writer.uint32(26).fork() + ).ldelim(); + } + if (message.doubleRange !== undefined) { + DoubleRangeFilter.encode( + message.doubleRange, + writer.uint32(34).fork() + ).ldelim(); + } + if (message.dateRange !== undefined) { + DateRangeFilter.encode( + message.dateRange, + writer.uint32(42).fork() + ).ldelim(); + } + if (message.durationRange !== undefined) { + DurationRangeFilter.encode( + message.durationRange, + writer.uint32(50).fork() + ).ldelim(); + } + if (message.booleanMatch !== undefined) { + BooleanFilter.encode( + message.booleanMatch, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.inverse === true) { + writer.uint32(56).bool(message.inverse); + } + if (message.channelNumber !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.channelNumber! }, + writer.uint32(66).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Filter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFilter } as Filter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.anyMatch = AnyMatchFilter.decode(reader, reader.uint32()); + break; + case 3: + message.intRange = IntRangeFilter.decode(reader, reader.uint32()); + break; + case 4: + message.doubleRange = DoubleRangeFilter.decode( + reader, + reader.uint32() + ); + break; + case 5: + message.dateRange = DateRangeFilter.decode(reader, reader.uint32()); + break; + case 6: + message.durationRange = DurationRangeFilter.decode( + reader, + reader.uint32() + ); + break; + case 9: + message.booleanMatch = BooleanFilter.decode(reader, reader.uint32()); + break; + case 7: + message.inverse = reader.bool(); + break; + case 8: + message.channelNumber = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Filter { + const message = { ...baseFilter } as Filter; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.anyMatch = + object.anyMatch !== undefined && object.anyMatch !== null + ? AnyMatchFilter.fromJSON(object.anyMatch) + : undefined; + message.intRange = + object.intRange !== undefined && object.intRange !== null + ? IntRangeFilter.fromJSON(object.intRange) + : undefined; + message.doubleRange = + object.doubleRange !== undefined && object.doubleRange !== null + ? DoubleRangeFilter.fromJSON(object.doubleRange) + : undefined; + message.dateRange = + object.dateRange !== undefined && object.dateRange !== null + ? DateRangeFilter.fromJSON(object.dateRange) + : undefined; + message.durationRange = + object.durationRange !== undefined && object.durationRange !== null + ? DurationRangeFilter.fromJSON(object.durationRange) + : undefined; + message.booleanMatch = + object.booleanMatch !== undefined && object.booleanMatch !== null + ? BooleanFilter.fromJSON(object.booleanMatch) + : undefined; + message.inverse = + object.inverse !== undefined && object.inverse !== null + ? Boolean(object.inverse) + : false; + message.channelNumber = + object.channelNumber !== undefined && object.channelNumber !== null + ? Number(object.channelNumber) + : undefined; + return message; + }, + + toJSON(message: Filter): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.anyMatch !== undefined && + (obj.anyMatch = message.anyMatch + ? AnyMatchFilter.toJSON(message.anyMatch) + : undefined); + message.intRange !== undefined && + (obj.intRange = message.intRange + ? IntRangeFilter.toJSON(message.intRange) + : undefined); + message.doubleRange !== undefined && + (obj.doubleRange = message.doubleRange + ? DoubleRangeFilter.toJSON(message.doubleRange) + : undefined); + message.dateRange !== undefined && + (obj.dateRange = message.dateRange + ? DateRangeFilter.toJSON(message.dateRange) + : undefined); + message.durationRange !== undefined && + (obj.durationRange = message.durationRange + ? DurationRangeFilter.toJSON(message.durationRange) + : undefined); + message.booleanMatch !== undefined && + (obj.booleanMatch = message.booleanMatch + ? BooleanFilter.toJSON(message.booleanMatch) + : undefined); + message.inverse !== undefined && (obj.inverse = message.inverse); + message.channelNumber !== undefined && + (obj.channelNumber = message.channelNumber); + return obj; + }, + + fromPartial, I>>(object: I): Filter { + const message = { ...baseFilter } as Filter; + message.key = object.key ?? ""; + message.anyMatch = + object.anyMatch !== undefined && object.anyMatch !== null + ? AnyMatchFilter.fromPartial(object.anyMatch) + : undefined; + message.intRange = + object.intRange !== undefined && object.intRange !== null + ? IntRangeFilter.fromPartial(object.intRange) + : undefined; + message.doubleRange = + object.doubleRange !== undefined && object.doubleRange !== null + ? DoubleRangeFilter.fromPartial(object.doubleRange) + : undefined; + message.dateRange = + object.dateRange !== undefined && object.dateRange !== null + ? DateRangeFilter.fromPartial(object.dateRange) + : undefined; + message.durationRange = + object.durationRange !== undefined && object.durationRange !== null + ? DurationRangeFilter.fromPartial(object.durationRange) + : undefined; + message.booleanMatch = + object.booleanMatch !== undefined && object.booleanMatch !== null + ? BooleanFilter.fromPartial(object.booleanMatch) + : undefined; + message.inverse = object.inverse ?? false; + message.channelNumber = object.channelNumber ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Filter.$type, Filter); + +const baseQuery: object = { + $type: "yandex.cloud.speechsense.v1.Query", + text: "", + inverse: false, +}; + +export const Query = { + $type: "yandex.cloud.speechsense.v1.Query" as const, + + encode(message: Query, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.text !== "") { + writer.uint32(10).string(message.text); + } + if (message.inverse === true) { + writer.uint32(16).bool(message.inverse); + } + if (message.channelNumber !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.channelNumber! }, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Query { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQuery } as Query; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.inverse = reader.bool(); + break; + case 3: + message.channelNumber = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Query { + const message = { ...baseQuery } as Query; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + message.inverse = + object.inverse !== undefined && object.inverse !== null + ? Boolean(object.inverse) + : false; + message.channelNumber = + object.channelNumber !== undefined && object.channelNumber !== null + ? Number(object.channelNumber) + : undefined; + return message; + }, + + toJSON(message: Query): unknown { + const obj: any = {}; + message.text !== undefined && (obj.text = message.text); + message.inverse !== undefined && (obj.inverse = message.inverse); + message.channelNumber !== undefined && + (obj.channelNumber = message.channelNumber); + return obj; + }, + + fromPartial, I>>(object: I): Query { + const message = { ...baseQuery } as Query; + message.text = object.text ?? ""; + message.inverse = object.inverse ?? false; + message.channelNumber = object.channelNumber ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Query.$type, Query); + +const baseAnyMatchFilter: object = { + $type: "yandex.cloud.speechsense.v1.AnyMatchFilter", + values: "", +}; + +export const AnyMatchFilter = { + $type: "yandex.cloud.speechsense.v1.AnyMatchFilter" as const, + + encode( + message: AnyMatchFilter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.values) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AnyMatchFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAnyMatchFilter } as AnyMatchFilter; + message.values = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.values.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AnyMatchFilter { + const message = { ...baseAnyMatchFilter } as AnyMatchFilter; + message.values = (object.values ?? []).map((e: any) => String(e)); + return message; + }, + + toJSON(message: AnyMatchFilter): unknown { + const obj: any = {}; + if (message.values) { + obj.values = message.values.map((e) => e); + } else { + obj.values = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): AnyMatchFilter { + const message = { ...baseAnyMatchFilter } as AnyMatchFilter; + message.values = object.values?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set(AnyMatchFilter.$type, AnyMatchFilter); + +const baseBoundsInclusive: object = { + $type: "yandex.cloud.speechsense.v1.BoundsInclusive", + fromInclusive: false, + toInclusive: false, +}; + +export const BoundsInclusive = { + $type: "yandex.cloud.speechsense.v1.BoundsInclusive" as const, + + encode( + message: BoundsInclusive, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.fromInclusive === true) { + writer.uint32(8).bool(message.fromInclusive); + } + if (message.toInclusive === true) { + writer.uint32(16).bool(message.toInclusive); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BoundsInclusive { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBoundsInclusive } as BoundsInclusive; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromInclusive = reader.bool(); + break; + case 2: + message.toInclusive = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BoundsInclusive { + const message = { ...baseBoundsInclusive } as BoundsInclusive; + message.fromInclusive = + object.fromInclusive !== undefined && object.fromInclusive !== null + ? Boolean(object.fromInclusive) + : false; + message.toInclusive = + object.toInclusive !== undefined && object.toInclusive !== null + ? Boolean(object.toInclusive) + : false; + return message; + }, + + toJSON(message: BoundsInclusive): unknown { + const obj: any = {}; + message.fromInclusive !== undefined && + (obj.fromInclusive = message.fromInclusive); + message.toInclusive !== undefined && + (obj.toInclusive = message.toInclusive); + return obj; + }, + + fromPartial, I>>( + object: I + ): BoundsInclusive { + const message = { ...baseBoundsInclusive } as BoundsInclusive; + message.fromInclusive = object.fromInclusive ?? false; + message.toInclusive = object.toInclusive ?? false; + return message; + }, +}; + +messageTypeRegistry.set(BoundsInclusive.$type, BoundsInclusive); + +const baseIntRangeFilter: object = { + $type: "yandex.cloud.speechsense.v1.IntRangeFilter", +}; + +export const IntRangeFilter = { + $type: "yandex.cloud.speechsense.v1.IntRangeFilter" as const, + + encode( + message: IntRangeFilter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.fromValue !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.fromValue! }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.toValue !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.toValue! }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.boundsInclusive !== undefined) { + BoundsInclusive.encode( + message.boundsInclusive, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IntRangeFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseIntRangeFilter } as IntRangeFilter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromValue = Int64Value.decode(reader, reader.uint32()).value; + break; + case 2: + message.toValue = Int64Value.decode(reader, reader.uint32()).value; + break; + case 3: + message.boundsInclusive = BoundsInclusive.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IntRangeFilter { + const message = { ...baseIntRangeFilter } as IntRangeFilter; + message.fromValue = + object.fromValue !== undefined && object.fromValue !== null + ? Number(object.fromValue) + : undefined; + message.toValue = + object.toValue !== undefined && object.toValue !== null + ? Number(object.toValue) + : undefined; + message.boundsInclusive = + object.boundsInclusive !== undefined && object.boundsInclusive !== null + ? BoundsInclusive.fromJSON(object.boundsInclusive) + : undefined; + return message; + }, + + toJSON(message: IntRangeFilter): unknown { + const obj: any = {}; + message.fromValue !== undefined && (obj.fromValue = message.fromValue); + message.toValue !== undefined && (obj.toValue = message.toValue); + message.boundsInclusive !== undefined && + (obj.boundsInclusive = message.boundsInclusive + ? BoundsInclusive.toJSON(message.boundsInclusive) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): IntRangeFilter { + const message = { ...baseIntRangeFilter } as IntRangeFilter; + message.fromValue = object.fromValue ?? undefined; + message.toValue = object.toValue ?? undefined; + message.boundsInclusive = + object.boundsInclusive !== undefined && object.boundsInclusive !== null + ? BoundsInclusive.fromPartial(object.boundsInclusive) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(IntRangeFilter.$type, IntRangeFilter); + +const baseDoubleRangeFilter: object = { + $type: "yandex.cloud.speechsense.v1.DoubleRangeFilter", +}; + +export const DoubleRangeFilter = { + $type: "yandex.cloud.speechsense.v1.DoubleRangeFilter" as const, + + encode( + message: DoubleRangeFilter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.fromValue !== undefined) { + DoubleValue.encode( + { $type: "google.protobuf.DoubleValue", value: message.fromValue! }, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.toValue !== undefined) { + DoubleValue.encode( + { $type: "google.protobuf.DoubleValue", value: message.toValue! }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.boundsInclusive !== undefined) { + BoundsInclusive.encode( + message.boundsInclusive, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DoubleRangeFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDoubleRangeFilter } as DoubleRangeFilter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromValue = DoubleValue.decode(reader, reader.uint32()).value; + break; + case 2: + message.toValue = DoubleValue.decode(reader, reader.uint32()).value; + break; + case 3: + message.boundsInclusive = BoundsInclusive.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DoubleRangeFilter { + const message = { ...baseDoubleRangeFilter } as DoubleRangeFilter; + message.fromValue = + object.fromValue !== undefined && object.fromValue !== null + ? Number(object.fromValue) + : undefined; + message.toValue = + object.toValue !== undefined && object.toValue !== null + ? Number(object.toValue) + : undefined; + message.boundsInclusive = + object.boundsInclusive !== undefined && object.boundsInclusive !== null + ? BoundsInclusive.fromJSON(object.boundsInclusive) + : undefined; + return message; + }, + + toJSON(message: DoubleRangeFilter): unknown { + const obj: any = {}; + message.fromValue !== undefined && (obj.fromValue = message.fromValue); + message.toValue !== undefined && (obj.toValue = message.toValue); + message.boundsInclusive !== undefined && + (obj.boundsInclusive = message.boundsInclusive + ? BoundsInclusive.toJSON(message.boundsInclusive) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): DoubleRangeFilter { + const message = { ...baseDoubleRangeFilter } as DoubleRangeFilter; + message.fromValue = object.fromValue ?? undefined; + message.toValue = object.toValue ?? undefined; + message.boundsInclusive = + object.boundsInclusive !== undefined && object.boundsInclusive !== null + ? BoundsInclusive.fromPartial(object.boundsInclusive) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(DoubleRangeFilter.$type, DoubleRangeFilter); + +const baseDateRangeFilter: object = { + $type: "yandex.cloud.speechsense.v1.DateRangeFilter", +}; + +export const DateRangeFilter = { + $type: "yandex.cloud.speechsense.v1.DateRangeFilter" as const, + + encode( + message: DateRangeFilter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.fromValue !== undefined) { + Timestamp.encode( + toTimestamp(message.fromValue), + writer.uint32(10).fork() + ).ldelim(); + } + if (message.toValue !== undefined) { + Timestamp.encode( + toTimestamp(message.toValue), + writer.uint32(18).fork() + ).ldelim(); + } + if (message.boundsInclusive !== undefined) { + BoundsInclusive.encode( + message.boundsInclusive, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DateRangeFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDateRangeFilter } as DateRangeFilter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromValue = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 2: + message.toValue = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 3: + message.boundsInclusive = BoundsInclusive.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DateRangeFilter { + const message = { ...baseDateRangeFilter } as DateRangeFilter; + message.fromValue = + object.fromValue !== undefined && object.fromValue !== null + ? fromJsonTimestamp(object.fromValue) + : undefined; + message.toValue = + object.toValue !== undefined && object.toValue !== null + ? fromJsonTimestamp(object.toValue) + : undefined; + message.boundsInclusive = + object.boundsInclusive !== undefined && object.boundsInclusive !== null + ? BoundsInclusive.fromJSON(object.boundsInclusive) + : undefined; + return message; + }, + + toJSON(message: DateRangeFilter): unknown { + const obj: any = {}; + message.fromValue !== undefined && + (obj.fromValue = message.fromValue.toISOString()); + message.toValue !== undefined && + (obj.toValue = message.toValue.toISOString()); + message.boundsInclusive !== undefined && + (obj.boundsInclusive = message.boundsInclusive + ? BoundsInclusive.toJSON(message.boundsInclusive) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): DateRangeFilter { + const message = { ...baseDateRangeFilter } as DateRangeFilter; + message.fromValue = object.fromValue ?? undefined; + message.toValue = object.toValue ?? undefined; + message.boundsInclusive = + object.boundsInclusive !== undefined && object.boundsInclusive !== null + ? BoundsInclusive.fromPartial(object.boundsInclusive) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(DateRangeFilter.$type, DateRangeFilter); + +const baseDurationRangeFilter: object = { + $type: "yandex.cloud.speechsense.v1.DurationRangeFilter", +}; + +export const DurationRangeFilter = { + $type: "yandex.cloud.speechsense.v1.DurationRangeFilter" as const, + + encode( + message: DurationRangeFilter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.fromValue !== undefined) { + Duration.encode(message.fromValue, writer.uint32(10).fork()).ldelim(); + } + if (message.toValue !== undefined) { + Duration.encode(message.toValue, writer.uint32(18).fork()).ldelim(); + } + if (message.boundsInclusive !== undefined) { + BoundsInclusive.encode( + message.boundsInclusive, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DurationRangeFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDurationRangeFilter } as DurationRangeFilter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromValue = Duration.decode(reader, reader.uint32()); + break; + case 2: + message.toValue = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.boundsInclusive = BoundsInclusive.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DurationRangeFilter { + const message = { ...baseDurationRangeFilter } as DurationRangeFilter; + message.fromValue = + object.fromValue !== undefined && object.fromValue !== null + ? Duration.fromJSON(object.fromValue) + : undefined; + message.toValue = + object.toValue !== undefined && object.toValue !== null + ? Duration.fromJSON(object.toValue) + : undefined; + message.boundsInclusive = + object.boundsInclusive !== undefined && object.boundsInclusive !== null + ? BoundsInclusive.fromJSON(object.boundsInclusive) + : undefined; + return message; + }, + + toJSON(message: DurationRangeFilter): unknown { + const obj: any = {}; + message.fromValue !== undefined && + (obj.fromValue = message.fromValue + ? Duration.toJSON(message.fromValue) + : undefined); + message.toValue !== undefined && + (obj.toValue = message.toValue + ? Duration.toJSON(message.toValue) + : undefined); + message.boundsInclusive !== undefined && + (obj.boundsInclusive = message.boundsInclusive + ? BoundsInclusive.toJSON(message.boundsInclusive) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): DurationRangeFilter { + const message = { ...baseDurationRangeFilter } as DurationRangeFilter; + message.fromValue = + object.fromValue !== undefined && object.fromValue !== null + ? Duration.fromPartial(object.fromValue) + : undefined; + message.toValue = + object.toValue !== undefined && object.toValue !== null + ? Duration.fromPartial(object.toValue) + : undefined; + message.boundsInclusive = + object.boundsInclusive !== undefined && object.boundsInclusive !== null + ? BoundsInclusive.fromPartial(object.boundsInclusive) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(DurationRangeFilter.$type, DurationRangeFilter); + +const baseBooleanFilter: object = { + $type: "yandex.cloud.speechsense.v1.BooleanFilter", + value: false, +}; + +export const BooleanFilter = { + $type: "yandex.cloud.speechsense.v1.BooleanFilter" as const, + + encode( + message: BooleanFilter, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.value === true) { + writer.uint32(8).bool(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BooleanFilter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBooleanFilter } as BooleanFilter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BooleanFilter { + const message = { ...baseBooleanFilter } as BooleanFilter; + message.value = + object.value !== undefined && object.value !== null + ? Boolean(object.value) + : false; + return message; + }, + + toJSON(message: BooleanFilter): unknown { + const obj: any = {}; + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): BooleanFilter { + const message = { ...baseBooleanFilter } as BooleanFilter; + message.value = object.value ?? false; + return message; + }, +}; + +messageTypeRegistry.set(BooleanFilter.$type, BooleanFilter); + +const baseSortData: object = { $type: "yandex.cloud.speechsense.v1.SortData" }; + +export const SortData = { + $type: "yandex.cloud.speechsense.v1.SortData" as const, + + encode( + message: SortData, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.fields) { + SortField.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SortData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSortData } as SortData; + message.fields = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fields.push(SortField.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SortData { + const message = { ...baseSortData } as SortData; + message.fields = (object.fields ?? []).map((e: any) => + SortField.fromJSON(e) + ); + return message; + }, + + toJSON(message: SortData): unknown { + const obj: any = {}; + if (message.fields) { + obj.fields = message.fields.map((e) => + e ? SortField.toJSON(e) : undefined + ); + } else { + obj.fields = []; + } + return obj; + }, + + fromPartial, I>>(object: I): SortData { + const message = { ...baseSortData } as SortData; + message.fields = object.fields?.map((e) => SortField.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(SortData.$type, SortData); + +const baseSortField: object = { + $type: "yandex.cloud.speechsense.v1.SortField", + field: "", + order: 0, + position: 0, +}; + +export const SortField = { + $type: "yandex.cloud.speechsense.v1.SortField" as const, + + encode( + message: SortField, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.field !== "") { + writer.uint32(10).string(message.field); + } + if (message.order !== 0) { + writer.uint32(16).int32(message.order); + } + if (message.position !== 0) { + writer.uint32(24).int64(message.position); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SortField { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSortField } as SortField; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.field = reader.string(); + break; + case 2: + message.order = reader.int32() as any; + break; + case 3: + message.position = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SortField { + const message = { ...baseSortField } as SortField; + message.field = + object.field !== undefined && object.field !== null + ? String(object.field) + : ""; + message.order = + object.order !== undefined && object.order !== null + ? sortOrderFromJSON(object.order) + : 0; + message.position = + object.position !== undefined && object.position !== null + ? Number(object.position) + : 0; + return message; + }, + + toJSON(message: SortField): unknown { + const obj: any = {}; + message.field !== undefined && (obj.field = message.field); + message.order !== undefined && (obj.order = sortOrderToJSON(message.order)); + message.position !== undefined && + (obj.position = Math.round(message.position)); + return obj; + }, + + fromPartial, I>>( + object: I + ): SortField { + const message = { ...baseSortField } as SortField; + message.field = object.field ?? ""; + message.order = object.order ?? 0; + message.position = object.position ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(SortField.$type, SortField); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/talk.ts b/src/generated/yandex/cloud/speechsense/v1/talk.ts new file mode 100644 index 00000000..d874d2bd --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/talk.ts @@ -0,0 +1,628 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Transcription } from "../../../../yandex/cloud/speechsense/v1/analysis/transcription"; +import { SpeechStatistics } from "../../../../yandex/cloud/speechsense/v1/analysis/speech_statistics"; +import { SilenceStatistics } from "../../../../yandex/cloud/speechsense/v1/analysis/silence_statistics"; +import { InterruptsStatistics } from "../../../../yandex/cloud/speechsense/v1/analysis/interrupts_statistics"; +import { ConversationStatistics } from "../../../../yandex/cloud/speechsense/v1/analysis/conversation_statistics"; +import { Points } from "../../../../yandex/cloud/speechsense/v1/analysis/points"; +import { TextClassifiers } from "../../../../yandex/cloud/speechsense/v1/analysis/text_classifiers"; +import { Summarization } from "../../../../yandex/cloud/speechsense/v1/analysis/summarization"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.speechsense.v1"; + +/** connection field type */ +export enum FieldType { + FIELD_TYPE_UNSPECIFIED = 0, + FIELD_TYPE_STRING = 1, + FIELD_TYPE_NUMBER = 2, + FIELD_TYPE_DECIMAL = 3, + FIELD_TYPE_BOOLEAN = 4, + FIELD_TYPE_DATE = 5, + FIELD_TYPE_JSON = 6, + UNRECOGNIZED = -1, +} + +export function fieldTypeFromJSON(object: any): FieldType { + switch (object) { + case 0: + case "FIELD_TYPE_UNSPECIFIED": + return FieldType.FIELD_TYPE_UNSPECIFIED; + case 1: + case "FIELD_TYPE_STRING": + return FieldType.FIELD_TYPE_STRING; + case 2: + case "FIELD_TYPE_NUMBER": + return FieldType.FIELD_TYPE_NUMBER; + case 3: + case "FIELD_TYPE_DECIMAL": + return FieldType.FIELD_TYPE_DECIMAL; + case 4: + case "FIELD_TYPE_BOOLEAN": + return FieldType.FIELD_TYPE_BOOLEAN; + case 5: + case "FIELD_TYPE_DATE": + return FieldType.FIELD_TYPE_DATE; + case 6: + case "FIELD_TYPE_JSON": + return FieldType.FIELD_TYPE_JSON; + case -1: + case "UNRECOGNIZED": + default: + return FieldType.UNRECOGNIZED; + } +} + +export function fieldTypeToJSON(object: FieldType): string { + switch (object) { + case FieldType.FIELD_TYPE_UNSPECIFIED: + return "FIELD_TYPE_UNSPECIFIED"; + case FieldType.FIELD_TYPE_STRING: + return "FIELD_TYPE_STRING"; + case FieldType.FIELD_TYPE_NUMBER: + return "FIELD_TYPE_NUMBER"; + case FieldType.FIELD_TYPE_DECIMAL: + return "FIELD_TYPE_DECIMAL"; + case FieldType.FIELD_TYPE_BOOLEAN: + return "FIELD_TYPE_BOOLEAN"; + case FieldType.FIELD_TYPE_DATE: + return "FIELD_TYPE_DATE"; + case FieldType.FIELD_TYPE_JSON: + return "FIELD_TYPE_JSON"; + default: + return "UNKNOWN"; + } +} + +export interface Talk { + $type: "yandex.cloud.speechsense.v1.Talk"; + /** talk id */ + id: string; + organizationId: string; + spaceId: string; + connectionId: string; + projectIds: string[]; + /** audition info */ + createdBy: string; + createdAt?: Date; + modifiedBy: string; + modifiedAt?: Date; + /** key-value representation of talk fields with values */ + talkFields: Field[]; + /** various ml analysis results */ + transcription?: Transcription; + speechStatistics?: SpeechStatistics; + silenceStatistics?: SilenceStatistics; + interruptsStatistics?: InterruptsStatistics; + conversationStatistics?: ConversationStatistics; + points?: Points; + textClassifiers?: TextClassifiers; + summarization?: Summarization; +} + +/** connection field value */ +export interface Field { + $type: "yandex.cloud.speechsense.v1.Field"; + /** name of the field */ + name: string; + /** field value */ + value: string; + /** field type */ + type: FieldType; +} + +const baseTalk: object = { + $type: "yandex.cloud.speechsense.v1.Talk", + id: "", + organizationId: "", + spaceId: "", + connectionId: "", + projectIds: "", + createdBy: "", + modifiedBy: "", +}; + +export const Talk = { + $type: "yandex.cloud.speechsense.v1.Talk" as const, + + encode(message: Talk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.organizationId !== "") { + writer.uint32(18).string(message.organizationId); + } + if (message.spaceId !== "") { + writer.uint32(26).string(message.spaceId); + } + if (message.connectionId !== "") { + writer.uint32(34).string(message.connectionId); + } + for (const v of message.projectIds) { + writer.uint32(42).string(v!); + } + if (message.createdBy !== "") { + writer.uint32(50).string(message.createdBy); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(58).fork() + ).ldelim(); + } + if (message.modifiedBy !== "") { + writer.uint32(66).string(message.modifiedBy); + } + if (message.modifiedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.modifiedAt), + writer.uint32(74).fork() + ).ldelim(); + } + for (const v of message.talkFields) { + Field.encode(v!, writer.uint32(82).fork()).ldelim(); + } + if (message.transcription !== undefined) { + Transcription.encode( + message.transcription, + writer.uint32(90).fork() + ).ldelim(); + } + if (message.speechStatistics !== undefined) { + SpeechStatistics.encode( + message.speechStatistics, + writer.uint32(98).fork() + ).ldelim(); + } + if (message.silenceStatistics !== undefined) { + SilenceStatistics.encode( + message.silenceStatistics, + writer.uint32(106).fork() + ).ldelim(); + } + if (message.interruptsStatistics !== undefined) { + InterruptsStatistics.encode( + message.interruptsStatistics, + writer.uint32(114).fork() + ).ldelim(); + } + if (message.conversationStatistics !== undefined) { + ConversationStatistics.encode( + message.conversationStatistics, + writer.uint32(122).fork() + ).ldelim(); + } + if (message.points !== undefined) { + Points.encode(message.points, writer.uint32(130).fork()).ldelim(); + } + if (message.textClassifiers !== undefined) { + TextClassifiers.encode( + message.textClassifiers, + writer.uint32(138).fork() + ).ldelim(); + } + if (message.summarization !== undefined) { + Summarization.encode( + message.summarization, + writer.uint32(146).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Talk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTalk } as Talk; + message.projectIds = []; + message.talkFields = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.organizationId = reader.string(); + break; + case 3: + message.spaceId = reader.string(); + break; + case 4: + message.connectionId = reader.string(); + break; + case 5: + message.projectIds.push(reader.string()); + break; + case 6: + message.createdBy = reader.string(); + break; + case 7: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 8: + message.modifiedBy = reader.string(); + break; + case 9: + message.modifiedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 10: + message.talkFields.push(Field.decode(reader, reader.uint32())); + break; + case 11: + message.transcription = Transcription.decode(reader, reader.uint32()); + break; + case 12: + message.speechStatistics = SpeechStatistics.decode( + reader, + reader.uint32() + ); + break; + case 13: + message.silenceStatistics = SilenceStatistics.decode( + reader, + reader.uint32() + ); + break; + case 14: + message.interruptsStatistics = InterruptsStatistics.decode( + reader, + reader.uint32() + ); + break; + case 15: + message.conversationStatistics = ConversationStatistics.decode( + reader, + reader.uint32() + ); + break; + case 16: + message.points = Points.decode(reader, reader.uint32()); + break; + case 17: + message.textClassifiers = TextClassifiers.decode( + reader, + reader.uint32() + ); + break; + case 18: + message.summarization = Summarization.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Talk { + const message = { ...baseTalk } as Talk; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.spaceId = + object.spaceId !== undefined && object.spaceId !== null + ? String(object.spaceId) + : ""; + message.connectionId = + object.connectionId !== undefined && object.connectionId !== null + ? String(object.connectionId) + : ""; + message.projectIds = (object.projectIds ?? []).map((e: any) => String(e)); + message.createdBy = + object.createdBy !== undefined && object.createdBy !== null + ? String(object.createdBy) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.modifiedBy = + object.modifiedBy !== undefined && object.modifiedBy !== null + ? String(object.modifiedBy) + : ""; + message.modifiedAt = + object.modifiedAt !== undefined && object.modifiedAt !== null + ? fromJsonTimestamp(object.modifiedAt) + : undefined; + message.talkFields = (object.talkFields ?? []).map((e: any) => + Field.fromJSON(e) + ); + message.transcription = + object.transcription !== undefined && object.transcription !== null + ? Transcription.fromJSON(object.transcription) + : undefined; + message.speechStatistics = + object.speechStatistics !== undefined && object.speechStatistics !== null + ? SpeechStatistics.fromJSON(object.speechStatistics) + : undefined; + message.silenceStatistics = + object.silenceStatistics !== undefined && + object.silenceStatistics !== null + ? SilenceStatistics.fromJSON(object.silenceStatistics) + : undefined; + message.interruptsStatistics = + object.interruptsStatistics !== undefined && + object.interruptsStatistics !== null + ? InterruptsStatistics.fromJSON(object.interruptsStatistics) + : undefined; + message.conversationStatistics = + object.conversationStatistics !== undefined && + object.conversationStatistics !== null + ? ConversationStatistics.fromJSON(object.conversationStatistics) + : undefined; + message.points = + object.points !== undefined && object.points !== null + ? Points.fromJSON(object.points) + : undefined; + message.textClassifiers = + object.textClassifiers !== undefined && object.textClassifiers !== null + ? TextClassifiers.fromJSON(object.textClassifiers) + : undefined; + message.summarization = + object.summarization !== undefined && object.summarization !== null + ? Summarization.fromJSON(object.summarization) + : undefined; + return message; + }, + + toJSON(message: Talk): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.spaceId !== undefined && (obj.spaceId = message.spaceId); + message.connectionId !== undefined && + (obj.connectionId = message.connectionId); + if (message.projectIds) { + obj.projectIds = message.projectIds.map((e) => e); + } else { + obj.projectIds = []; + } + message.createdBy !== undefined && (obj.createdBy = message.createdBy); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.modifiedBy !== undefined && (obj.modifiedBy = message.modifiedBy); + message.modifiedAt !== undefined && + (obj.modifiedAt = message.modifiedAt.toISOString()); + if (message.talkFields) { + obj.talkFields = message.talkFields.map((e) => + e ? Field.toJSON(e) : undefined + ); + } else { + obj.talkFields = []; + } + message.transcription !== undefined && + (obj.transcription = message.transcription + ? Transcription.toJSON(message.transcription) + : undefined); + message.speechStatistics !== undefined && + (obj.speechStatistics = message.speechStatistics + ? SpeechStatistics.toJSON(message.speechStatistics) + : undefined); + message.silenceStatistics !== undefined && + (obj.silenceStatistics = message.silenceStatistics + ? SilenceStatistics.toJSON(message.silenceStatistics) + : undefined); + message.interruptsStatistics !== undefined && + (obj.interruptsStatistics = message.interruptsStatistics + ? InterruptsStatistics.toJSON(message.interruptsStatistics) + : undefined); + message.conversationStatistics !== undefined && + (obj.conversationStatistics = message.conversationStatistics + ? ConversationStatistics.toJSON(message.conversationStatistics) + : undefined); + message.points !== undefined && + (obj.points = message.points ? Points.toJSON(message.points) : undefined); + message.textClassifiers !== undefined && + (obj.textClassifiers = message.textClassifiers + ? TextClassifiers.toJSON(message.textClassifiers) + : undefined); + message.summarization !== undefined && + (obj.summarization = message.summarization + ? Summarization.toJSON(message.summarization) + : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Talk { + const message = { ...baseTalk } as Talk; + message.id = object.id ?? ""; + message.organizationId = object.organizationId ?? ""; + message.spaceId = object.spaceId ?? ""; + message.connectionId = object.connectionId ?? ""; + message.projectIds = object.projectIds?.map((e) => e) || []; + message.createdBy = object.createdBy ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.modifiedBy = object.modifiedBy ?? ""; + message.modifiedAt = object.modifiedAt ?? undefined; + message.talkFields = + object.talkFields?.map((e) => Field.fromPartial(e)) || []; + message.transcription = + object.transcription !== undefined && object.transcription !== null + ? Transcription.fromPartial(object.transcription) + : undefined; + message.speechStatistics = + object.speechStatistics !== undefined && object.speechStatistics !== null + ? SpeechStatistics.fromPartial(object.speechStatistics) + : undefined; + message.silenceStatistics = + object.silenceStatistics !== undefined && + object.silenceStatistics !== null + ? SilenceStatistics.fromPartial(object.silenceStatistics) + : undefined; + message.interruptsStatistics = + object.interruptsStatistics !== undefined && + object.interruptsStatistics !== null + ? InterruptsStatistics.fromPartial(object.interruptsStatistics) + : undefined; + message.conversationStatistics = + object.conversationStatistics !== undefined && + object.conversationStatistics !== null + ? ConversationStatistics.fromPartial(object.conversationStatistics) + : undefined; + message.points = + object.points !== undefined && object.points !== null + ? Points.fromPartial(object.points) + : undefined; + message.textClassifiers = + object.textClassifiers !== undefined && object.textClassifiers !== null + ? TextClassifiers.fromPartial(object.textClassifiers) + : undefined; + message.summarization = + object.summarization !== undefined && object.summarization !== null + ? Summarization.fromPartial(object.summarization) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Talk.$type, Talk); + +const baseField: object = { + $type: "yandex.cloud.speechsense.v1.Field", + name: "", + value: "", + type: 0, +}; + +export const Field = { + $type: "yandex.cloud.speechsense.v1.Field" as const, + + encode(message: Field, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + if (message.type !== 0) { + writer.uint32(24).int32(message.type); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Field { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseField } as Field; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + case 3: + message.type = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Field { + const message = { ...baseField } as Field; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + message.type = + object.type !== undefined && object.type !== null + ? fieldTypeFromJSON(object.type) + : 0; + return message; + }, + + toJSON(message: Field): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.value !== undefined && (obj.value = message.value); + message.type !== undefined && (obj.type = fieldTypeToJSON(message.type)); + return obj; + }, + + fromPartial, I>>(object: I): Field { + const message = { ...baseField } as Field; + message.name = object.name ?? ""; + message.value = object.value ?? ""; + message.type = object.type ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Field.$type, Field); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/talk_service.ts b/src/generated/yandex/cloud/speechsense/v1/talk_service.ts new file mode 100644 index 00000000..687da787 --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/talk_service.ts @@ -0,0 +1,1693 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleClientStreamingCall, + handleUnaryCall, + Client, + ClientWritableStream, + Metadata, + CallOptions, + ClientUnaryCall, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + AudioRequest, + AudioStreamingRequest, +} from "../../../../yandex/cloud/speechsense/v1/audio"; +import { TextContent } from "../../../../yandex/cloud/speechsense/v1/text"; +import { + Query, + SortData, + Filter, +} from "../../../../yandex/cloud/speechsense/v1/search"; +import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { Talk } from "../../../../yandex/cloud/speechsense/v1/talk"; + +export const protobufPackage = "yandex.cloud.speechsense.v1"; + +export enum UserRole { + USER_ROLE_UNSPECIFIED = 0, + USER_ROLE_OPERATOR = 1, + USER_ROLE_CLIENT = 2, + USER_ROLE_BOT = 3, + UNRECOGNIZED = -1, +} + +export function userRoleFromJSON(object: any): UserRole { + switch (object) { + case 0: + case "USER_ROLE_UNSPECIFIED": + return UserRole.USER_ROLE_UNSPECIFIED; + case 1: + case "USER_ROLE_OPERATOR": + return UserRole.USER_ROLE_OPERATOR; + case 2: + case "USER_ROLE_CLIENT": + return UserRole.USER_ROLE_CLIENT; + case 3: + case "USER_ROLE_BOT": + return UserRole.USER_ROLE_BOT; + case -1: + case "UNRECOGNIZED": + default: + return UserRole.UNRECOGNIZED; + } +} + +export function userRoleToJSON(object: UserRole): string { + switch (object) { + case UserRole.USER_ROLE_UNSPECIFIED: + return "USER_ROLE_UNSPECIFIED"; + case UserRole.USER_ROLE_OPERATOR: + return "USER_ROLE_OPERATOR"; + case UserRole.USER_ROLE_CLIENT: + return "USER_ROLE_CLIENT"; + case UserRole.USER_ROLE_BOT: + return "USER_ROLE_BOT"; + default: + return "UNKNOWN"; + } +} + +/** streaming request to create audio dialog */ +export interface StreamTalkRequest { + $type: "yandex.cloud.speechsense.v1.StreamTalkRequest"; + /** talk document metadata containing channel id and channel field values */ + metadata?: TalkMetadata | undefined; + /** audio metadata or chunk */ + audio?: AudioStreamingRequest | undefined; +} + +/** request to create audio dialog */ +export interface UploadTalkRequest { + $type: "yandex.cloud.speechsense.v1.UploadTalkRequest"; + metadata?: TalkMetadata; + /** audio payload */ + audio?: AudioRequest; +} + +export interface UploadTalkResponse { + $type: "yandex.cloud.speechsense.v1.UploadTalkResponse"; + /** id of created talk document */ + talkId: string; +} + +/** request to create text based dialog */ +export interface UploadTextRequest { + $type: "yandex.cloud.speechsense.v1.UploadTextRequest"; + metadata?: TalkMetadata; + textContent?: TextContent; +} + +export interface UploadTextResponse { + $type: "yandex.cloud.speechsense.v1.UploadTextResponse"; + /** id of created talk document */ + talkId: string; +} + +export interface TalkMetadata { + $type: "yandex.cloud.speechsense.v1.TalkMetadata"; + /** id of connection this talk belongs too */ + connectionId: string; + /** channel defined fields */ + fields: { [key: string]: string }; + /** per user specific metadata */ + users: UserMetadata[]; +} + +export interface TalkMetadata_FieldsEntry { + $type: "yandex.cloud.speechsense.v1.TalkMetadata.FieldsEntry"; + key: string; + value: string; +} + +export interface UserMetadata { + $type: "yandex.cloud.speechsense.v1.UserMetadata"; + id: string; + role: UserRole; + fields: { [key: string]: string }; +} + +export interface UserMetadata_FieldsEntry { + $type: "yandex.cloud.speechsense.v1.UserMetadata.FieldsEntry"; + key: string; + value: string; +} + +export interface SearchTalkRequest { + $type: "yandex.cloud.speechsense.v1.SearchTalkRequest"; + /** id of organization */ + organizationId: string; + /** id of space */ + spaceId: string; + /** id of connection */ + connectionId: string; + /** id of project */ + projectId: string; + /** metadata keys filters (user and system) */ + filters: Filter[]; + /** Full-text search query */ + query?: Query; + /** page size, from 1 to 1000, default 100 */ + pageSize: number; + /** next page token, if page is not first */ + pageToken: string; + /** talks sorting options */ + sortData?: SortData; +} + +export interface SearchTalkResponse { + $type: "yandex.cloud.speechsense.v1.SearchTalkResponse"; + /** page results entries */ + talkIds: string[]; + /** total documents matched */ + talksCount: number; + /** page token for next request */ + nextPageToken: string; +} + +export interface GetTalkRequest { + $type: "yandex.cloud.speechsense.v1.GetTalkRequest"; + /** id of organization */ + organizationId: string; + /** id of space */ + spaceId: string; + /** id of connection to search data */ + connectionId: string; + /** id of project to search data */ + projectId: string; + /** + * ids of talks to return. Requesting too many talks may result in "message exceeds maximum size" error. + * Up to 100 of talks per request is recommended. + */ + talkIds: string[]; + /** All types of analysis will be returned if not set. */ + resultsMask?: FieldMask; +} + +export interface GetTalkResponse { + $type: "yandex.cloud.speechsense.v1.GetTalkResponse"; + talk: Talk[]; +} + +const baseStreamTalkRequest: object = { + $type: "yandex.cloud.speechsense.v1.StreamTalkRequest", +}; + +export const StreamTalkRequest = { + $type: "yandex.cloud.speechsense.v1.StreamTalkRequest" as const, + + encode( + message: StreamTalkRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.metadata !== undefined) { + TalkMetadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + } + if (message.audio !== undefined) { + AudioStreamingRequest.encode( + message.audio, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StreamTalkRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStreamTalkRequest } as StreamTalkRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadata = TalkMetadata.decode(reader, reader.uint32()); + break; + case 2: + message.audio = AudioStreamingRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StreamTalkRequest { + const message = { ...baseStreamTalkRequest } as StreamTalkRequest; + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? TalkMetadata.fromJSON(object.metadata) + : undefined; + message.audio = + object.audio !== undefined && object.audio !== null + ? AudioStreamingRequest.fromJSON(object.audio) + : undefined; + return message; + }, + + toJSON(message: StreamTalkRequest): unknown { + const obj: any = {}; + message.metadata !== undefined && + (obj.metadata = message.metadata + ? TalkMetadata.toJSON(message.metadata) + : undefined); + message.audio !== undefined && + (obj.audio = message.audio + ? AudioStreamingRequest.toJSON(message.audio) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): StreamTalkRequest { + const message = { ...baseStreamTalkRequest } as StreamTalkRequest; + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? TalkMetadata.fromPartial(object.metadata) + : undefined; + message.audio = + object.audio !== undefined && object.audio !== null + ? AudioStreamingRequest.fromPartial(object.audio) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(StreamTalkRequest.$type, StreamTalkRequest); + +const baseUploadTalkRequest: object = { + $type: "yandex.cloud.speechsense.v1.UploadTalkRequest", +}; + +export const UploadTalkRequest = { + $type: "yandex.cloud.speechsense.v1.UploadTalkRequest" as const, + + encode( + message: UploadTalkRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.metadata !== undefined) { + TalkMetadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + } + if (message.audio !== undefined) { + AudioRequest.encode(message.audio, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UploadTalkRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUploadTalkRequest } as UploadTalkRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadata = TalkMetadata.decode(reader, reader.uint32()); + break; + case 2: + message.audio = AudioRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UploadTalkRequest { + const message = { ...baseUploadTalkRequest } as UploadTalkRequest; + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? TalkMetadata.fromJSON(object.metadata) + : undefined; + message.audio = + object.audio !== undefined && object.audio !== null + ? AudioRequest.fromJSON(object.audio) + : undefined; + return message; + }, + + toJSON(message: UploadTalkRequest): unknown { + const obj: any = {}; + message.metadata !== undefined && + (obj.metadata = message.metadata + ? TalkMetadata.toJSON(message.metadata) + : undefined); + message.audio !== undefined && + (obj.audio = message.audio + ? AudioRequest.toJSON(message.audio) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UploadTalkRequest { + const message = { ...baseUploadTalkRequest } as UploadTalkRequest; + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? TalkMetadata.fromPartial(object.metadata) + : undefined; + message.audio = + object.audio !== undefined && object.audio !== null + ? AudioRequest.fromPartial(object.audio) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UploadTalkRequest.$type, UploadTalkRequest); + +const baseUploadTalkResponse: object = { + $type: "yandex.cloud.speechsense.v1.UploadTalkResponse", + talkId: "", +}; + +export const UploadTalkResponse = { + $type: "yandex.cloud.speechsense.v1.UploadTalkResponse" as const, + + encode( + message: UploadTalkResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.talkId !== "") { + writer.uint32(10).string(message.talkId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UploadTalkResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUploadTalkResponse } as UploadTalkResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.talkId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UploadTalkResponse { + const message = { ...baseUploadTalkResponse } as UploadTalkResponse; + message.talkId = + object.talkId !== undefined && object.talkId !== null + ? String(object.talkId) + : ""; + return message; + }, + + toJSON(message: UploadTalkResponse): unknown { + const obj: any = {}; + message.talkId !== undefined && (obj.talkId = message.talkId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UploadTalkResponse { + const message = { ...baseUploadTalkResponse } as UploadTalkResponse; + message.talkId = object.talkId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UploadTalkResponse.$type, UploadTalkResponse); + +const baseUploadTextRequest: object = { + $type: "yandex.cloud.speechsense.v1.UploadTextRequest", +}; + +export const UploadTextRequest = { + $type: "yandex.cloud.speechsense.v1.UploadTextRequest" as const, + + encode( + message: UploadTextRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.metadata !== undefined) { + TalkMetadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + } + if (message.textContent !== undefined) { + TextContent.encode( + message.textContent, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UploadTextRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUploadTextRequest } as UploadTextRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadata = TalkMetadata.decode(reader, reader.uint32()); + break; + case 2: + message.textContent = TextContent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UploadTextRequest { + const message = { ...baseUploadTextRequest } as UploadTextRequest; + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? TalkMetadata.fromJSON(object.metadata) + : undefined; + message.textContent = + object.textContent !== undefined && object.textContent !== null + ? TextContent.fromJSON(object.textContent) + : undefined; + return message; + }, + + toJSON(message: UploadTextRequest): unknown { + const obj: any = {}; + message.metadata !== undefined && + (obj.metadata = message.metadata + ? TalkMetadata.toJSON(message.metadata) + : undefined); + message.textContent !== undefined && + (obj.textContent = message.textContent + ? TextContent.toJSON(message.textContent) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UploadTextRequest { + const message = { ...baseUploadTextRequest } as UploadTextRequest; + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? TalkMetadata.fromPartial(object.metadata) + : undefined; + message.textContent = + object.textContent !== undefined && object.textContent !== null + ? TextContent.fromPartial(object.textContent) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UploadTextRequest.$type, UploadTextRequest); + +const baseUploadTextResponse: object = { + $type: "yandex.cloud.speechsense.v1.UploadTextResponse", + talkId: "", +}; + +export const UploadTextResponse = { + $type: "yandex.cloud.speechsense.v1.UploadTextResponse" as const, + + encode( + message: UploadTextResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.talkId !== "") { + writer.uint32(10).string(message.talkId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UploadTextResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUploadTextResponse } as UploadTextResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.talkId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UploadTextResponse { + const message = { ...baseUploadTextResponse } as UploadTextResponse; + message.talkId = + object.talkId !== undefined && object.talkId !== null + ? String(object.talkId) + : ""; + return message; + }, + + toJSON(message: UploadTextResponse): unknown { + const obj: any = {}; + message.talkId !== undefined && (obj.talkId = message.talkId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UploadTextResponse { + const message = { ...baseUploadTextResponse } as UploadTextResponse; + message.talkId = object.talkId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UploadTextResponse.$type, UploadTextResponse); + +const baseTalkMetadata: object = { + $type: "yandex.cloud.speechsense.v1.TalkMetadata", + connectionId: "", +}; + +export const TalkMetadata = { + $type: "yandex.cloud.speechsense.v1.TalkMetadata" as const, + + encode( + message: TalkMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + Object.entries(message.fields).forEach(([key, value]) => { + TalkMetadata_FieldsEntry.encode( + { + $type: "yandex.cloud.speechsense.v1.TalkMetadata.FieldsEntry", + key: key as any, + value, + }, + writer.uint32(18).fork() + ).ldelim(); + }); + for (const v of message.users) { + UserMetadata.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TalkMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTalkMetadata } as TalkMetadata; + message.fields = {}; + message.users = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + const entry2 = TalkMetadata_FieldsEntry.decode( + reader, + reader.uint32() + ); + if (entry2.value !== undefined) { + message.fields[entry2.key] = entry2.value; + } + break; + case 3: + message.users.push(UserMetadata.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TalkMetadata { + const message = { ...baseTalkMetadata } as TalkMetadata; + message.connectionId = + object.connectionId !== undefined && object.connectionId !== null + ? String(object.connectionId) + : ""; + message.fields = Object.entries(object.fields ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.users = (object.users ?? []).map((e: any) => + UserMetadata.fromJSON(e) + ); + return message; + }, + + toJSON(message: TalkMetadata): unknown { + const obj: any = {}; + message.connectionId !== undefined && + (obj.connectionId = message.connectionId); + obj.fields = {}; + if (message.fields) { + Object.entries(message.fields).forEach(([k, v]) => { + obj.fields[k] = v; + }); + } + if (message.users) { + obj.users = message.users.map((e) => + e ? UserMetadata.toJSON(e) : undefined + ); + } else { + obj.users = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): TalkMetadata { + const message = { ...baseTalkMetadata } as TalkMetadata; + message.connectionId = object.connectionId ?? ""; + message.fields = Object.entries(object.fields ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.users = object.users?.map((e) => UserMetadata.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(TalkMetadata.$type, TalkMetadata); + +const baseTalkMetadata_FieldsEntry: object = { + $type: "yandex.cloud.speechsense.v1.TalkMetadata.FieldsEntry", + key: "", + value: "", +}; + +export const TalkMetadata_FieldsEntry = { + $type: "yandex.cloud.speechsense.v1.TalkMetadata.FieldsEntry" as const, + + encode( + message: TalkMetadata_FieldsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): TalkMetadata_FieldsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseTalkMetadata_FieldsEntry, + } as TalkMetadata_FieldsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TalkMetadata_FieldsEntry { + const message = { + ...baseTalkMetadata_FieldsEntry, + } as TalkMetadata_FieldsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: TalkMetadata_FieldsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): TalkMetadata_FieldsEntry { + const message = { + ...baseTalkMetadata_FieldsEntry, + } as TalkMetadata_FieldsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + TalkMetadata_FieldsEntry.$type, + TalkMetadata_FieldsEntry +); + +const baseUserMetadata: object = { + $type: "yandex.cloud.speechsense.v1.UserMetadata", + id: "", + role: 0, +}; + +export const UserMetadata = { + $type: "yandex.cloud.speechsense.v1.UserMetadata" as const, + + encode( + message: UserMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.role !== 0) { + writer.uint32(16).int32(message.role); + } + Object.entries(message.fields).forEach(([key, value]) => { + UserMetadata_FieldsEntry.encode( + { + $type: "yandex.cloud.speechsense.v1.UserMetadata.FieldsEntry", + key: key as any, + value, + }, + writer.uint32(26).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UserMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUserMetadata } as UserMetadata; + message.fields = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.role = reader.int32() as any; + break; + case 3: + const entry3 = UserMetadata_FieldsEntry.decode( + reader, + reader.uint32() + ); + if (entry3.value !== undefined) { + message.fields[entry3.key] = entry3.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UserMetadata { + const message = { ...baseUserMetadata } as UserMetadata; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.role = + object.role !== undefined && object.role !== null + ? userRoleFromJSON(object.role) + : 0; + message.fields = Object.entries(object.fields ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: UserMetadata): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.role !== undefined && (obj.role = userRoleToJSON(message.role)); + obj.fields = {}; + if (message.fields) { + Object.entries(message.fields).forEach(([k, v]) => { + obj.fields[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): UserMetadata { + const message = { ...baseUserMetadata } as UserMetadata; + message.id = object.id ?? ""; + message.role = object.role ?? 0; + message.fields = Object.entries(object.fields ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(UserMetadata.$type, UserMetadata); + +const baseUserMetadata_FieldsEntry: object = { + $type: "yandex.cloud.speechsense.v1.UserMetadata.FieldsEntry", + key: "", + value: "", +}; + +export const UserMetadata_FieldsEntry = { + $type: "yandex.cloud.speechsense.v1.UserMetadata.FieldsEntry" as const, + + encode( + message: UserMetadata_FieldsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UserMetadata_FieldsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUserMetadata_FieldsEntry, + } as UserMetadata_FieldsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UserMetadata_FieldsEntry { + const message = { + ...baseUserMetadata_FieldsEntry, + } as UserMetadata_FieldsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UserMetadata_FieldsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): UserMetadata_FieldsEntry { + const message = { + ...baseUserMetadata_FieldsEntry, + } as UserMetadata_FieldsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UserMetadata_FieldsEntry.$type, + UserMetadata_FieldsEntry +); + +const baseSearchTalkRequest: object = { + $type: "yandex.cloud.speechsense.v1.SearchTalkRequest", + organizationId: "", + spaceId: "", + connectionId: "", + projectId: "", + pageSize: 0, + pageToken: "", +}; + +export const SearchTalkRequest = { + $type: "yandex.cloud.speechsense.v1.SearchTalkRequest" as const, + + encode( + message: SearchTalkRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.organizationId !== "") { + writer.uint32(10).string(message.organizationId); + } + if (message.spaceId !== "") { + writer.uint32(18).string(message.spaceId); + } + if (message.connectionId !== "") { + writer.uint32(26).string(message.connectionId); + } + if (message.projectId !== "") { + writer.uint32(34).string(message.projectId); + } + for (const v of message.filters) { + Filter.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.query !== undefined) { + Query.encode(message.query, writer.uint32(50).fork()).ldelim(); + } + if (message.pageSize !== 0) { + writer.uint32(56).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(66).string(message.pageToken); + } + if (message.sortData !== undefined) { + SortData.encode(message.sortData, writer.uint32(74).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SearchTalkRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSearchTalkRequest } as SearchTalkRequest; + message.filters = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationId = reader.string(); + break; + case 2: + message.spaceId = reader.string(); + break; + case 3: + message.connectionId = reader.string(); + break; + case 4: + message.projectId = reader.string(); + break; + case 5: + message.filters.push(Filter.decode(reader, reader.uint32())); + break; + case 6: + message.query = Query.decode(reader, reader.uint32()); + break; + case 7: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 8: + message.pageToken = reader.string(); + break; + case 9: + message.sortData = SortData.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SearchTalkRequest { + const message = { ...baseSearchTalkRequest } as SearchTalkRequest; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.spaceId = + object.spaceId !== undefined && object.spaceId !== null + ? String(object.spaceId) + : ""; + message.connectionId = + object.connectionId !== undefined && object.connectionId !== null + ? String(object.connectionId) + : ""; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + message.filters = (object.filters ?? []).map((e: any) => + Filter.fromJSON(e) + ); + message.query = + object.query !== undefined && object.query !== null + ? Query.fromJSON(object.query) + : undefined; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.sortData = + object.sortData !== undefined && object.sortData !== null + ? SortData.fromJSON(object.sortData) + : undefined; + return message; + }, + + toJSON(message: SearchTalkRequest): unknown { + const obj: any = {}; + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.spaceId !== undefined && (obj.spaceId = message.spaceId); + message.connectionId !== undefined && + (obj.connectionId = message.connectionId); + message.projectId !== undefined && (obj.projectId = message.projectId); + if (message.filters) { + obj.filters = message.filters.map((e) => + e ? Filter.toJSON(e) : undefined + ); + } else { + obj.filters = []; + } + message.query !== undefined && + (obj.query = message.query ? Query.toJSON(message.query) : undefined); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.sortData !== undefined && + (obj.sortData = message.sortData + ? SortData.toJSON(message.sortData) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): SearchTalkRequest { + const message = { ...baseSearchTalkRequest } as SearchTalkRequest; + message.organizationId = object.organizationId ?? ""; + message.spaceId = object.spaceId ?? ""; + message.connectionId = object.connectionId ?? ""; + message.projectId = object.projectId ?? ""; + message.filters = object.filters?.map((e) => Filter.fromPartial(e)) || []; + message.query = + object.query !== undefined && object.query !== null + ? Query.fromPartial(object.query) + : undefined; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.sortData = + object.sortData !== undefined && object.sortData !== null + ? SortData.fromPartial(object.sortData) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(SearchTalkRequest.$type, SearchTalkRequest); + +const baseSearchTalkResponse: object = { + $type: "yandex.cloud.speechsense.v1.SearchTalkResponse", + talkIds: "", + talksCount: 0, + nextPageToken: "", +}; + +export const SearchTalkResponse = { + $type: "yandex.cloud.speechsense.v1.SearchTalkResponse" as const, + + encode( + message: SearchTalkResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.talkIds) { + writer.uint32(10).string(v!); + } + if (message.talksCount !== 0) { + writer.uint32(16).int64(message.talksCount); + } + if (message.nextPageToken !== "") { + writer.uint32(26).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SearchTalkResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSearchTalkResponse } as SearchTalkResponse; + message.talkIds = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.talkIds.push(reader.string()); + break; + case 2: + message.talksCount = longToNumber(reader.int64() as Long); + break; + case 3: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SearchTalkResponse { + const message = { ...baseSearchTalkResponse } as SearchTalkResponse; + message.talkIds = (object.talkIds ?? []).map((e: any) => String(e)); + message.talksCount = + object.talksCount !== undefined && object.talksCount !== null + ? Number(object.talksCount) + : 0; + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: SearchTalkResponse): unknown { + const obj: any = {}; + if (message.talkIds) { + obj.talkIds = message.talkIds.map((e) => e); + } else { + obj.talkIds = []; + } + message.talksCount !== undefined && + (obj.talksCount = Math.round(message.talksCount)); + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): SearchTalkResponse { + const message = { ...baseSearchTalkResponse } as SearchTalkResponse; + message.talkIds = object.talkIds?.map((e) => e) || []; + message.talksCount = object.talksCount ?? 0; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(SearchTalkResponse.$type, SearchTalkResponse); + +const baseGetTalkRequest: object = { + $type: "yandex.cloud.speechsense.v1.GetTalkRequest", + organizationId: "", + spaceId: "", + connectionId: "", + projectId: "", + talkIds: "", +}; + +export const GetTalkRequest = { + $type: "yandex.cloud.speechsense.v1.GetTalkRequest" as const, + + encode( + message: GetTalkRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.organizationId !== "") { + writer.uint32(10).string(message.organizationId); + } + if (message.spaceId !== "") { + writer.uint32(18).string(message.spaceId); + } + if (message.connectionId !== "") { + writer.uint32(26).string(message.connectionId); + } + if (message.projectId !== "") { + writer.uint32(34).string(message.projectId); + } + for (const v of message.talkIds) { + writer.uint32(42).string(v!); + } + if (message.resultsMask !== undefined) { + FieldMask.encode(message.resultsMask, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetTalkRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetTalkRequest } as GetTalkRequest; + message.talkIds = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationId = reader.string(); + break; + case 2: + message.spaceId = reader.string(); + break; + case 3: + message.connectionId = reader.string(); + break; + case 4: + message.projectId = reader.string(); + break; + case 5: + message.talkIds.push(reader.string()); + break; + case 6: + message.resultsMask = FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetTalkRequest { + const message = { ...baseGetTalkRequest } as GetTalkRequest; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.spaceId = + object.spaceId !== undefined && object.spaceId !== null + ? String(object.spaceId) + : ""; + message.connectionId = + object.connectionId !== undefined && object.connectionId !== null + ? String(object.connectionId) + : ""; + message.projectId = + object.projectId !== undefined && object.projectId !== null + ? String(object.projectId) + : ""; + message.talkIds = (object.talkIds ?? []).map((e: any) => String(e)); + message.resultsMask = + object.resultsMask !== undefined && object.resultsMask !== null + ? FieldMask.fromJSON(object.resultsMask) + : undefined; + return message; + }, + + toJSON(message: GetTalkRequest): unknown { + const obj: any = {}; + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.spaceId !== undefined && (obj.spaceId = message.spaceId); + message.connectionId !== undefined && + (obj.connectionId = message.connectionId); + message.projectId !== undefined && (obj.projectId = message.projectId); + if (message.talkIds) { + obj.talkIds = message.talkIds.map((e) => e); + } else { + obj.talkIds = []; + } + message.resultsMask !== undefined && + (obj.resultsMask = message.resultsMask + ? FieldMask.toJSON(message.resultsMask) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetTalkRequest { + const message = { ...baseGetTalkRequest } as GetTalkRequest; + message.organizationId = object.organizationId ?? ""; + message.spaceId = object.spaceId ?? ""; + message.connectionId = object.connectionId ?? ""; + message.projectId = object.projectId ?? ""; + message.talkIds = object.talkIds?.map((e) => e) || []; + message.resultsMask = + object.resultsMask !== undefined && object.resultsMask !== null + ? FieldMask.fromPartial(object.resultsMask) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(GetTalkRequest.$type, GetTalkRequest); + +const baseGetTalkResponse: object = { + $type: "yandex.cloud.speechsense.v1.GetTalkResponse", +}; + +export const GetTalkResponse = { + $type: "yandex.cloud.speechsense.v1.GetTalkResponse" as const, + + encode( + message: GetTalkResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.talk) { + Talk.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetTalkResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetTalkResponse } as GetTalkResponse; + message.talk = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.talk.push(Talk.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetTalkResponse { + const message = { ...baseGetTalkResponse } as GetTalkResponse; + message.talk = (object.talk ?? []).map((e: any) => Talk.fromJSON(e)); + return message; + }, + + toJSON(message: GetTalkResponse): unknown { + const obj: any = {}; + if (message.talk) { + obj.talk = message.talk.map((e) => (e ? Talk.toJSON(e) : undefined)); + } else { + obj.talk = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): GetTalkResponse { + const message = { ...baseGetTalkResponse } as GetTalkResponse; + message.talk = object.talk?.map((e) => Talk.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(GetTalkResponse.$type, GetTalkResponse); + +export const TalkServiceService = { + /** + * rpc for streaming talk documents. First message should contain Talk related metadata, + * second - audio metadata, others should contain audio bytes in chunks + */ + uploadAsStream: { + path: "/yandex.cloud.speechsense.v1.TalkService/UploadAsStream", + requestStream: true, + responseStream: false, + requestSerialize: (value: StreamTalkRequest) => + Buffer.from(StreamTalkRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => StreamTalkRequest.decode(value), + responseSerialize: (value: UploadTalkResponse) => + Buffer.from(UploadTalkResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => UploadTalkResponse.decode(value), + }, + /** rpc for uploading talk document as single message */ + upload: { + path: "/yandex.cloud.speechsense.v1.TalkService/Upload", + requestStream: false, + responseStream: false, + requestSerialize: (value: UploadTalkRequest) => + Buffer.from(UploadTalkRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UploadTalkRequest.decode(value), + responseSerialize: (value: UploadTalkResponse) => + Buffer.from(UploadTalkResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => UploadTalkResponse.decode(value), + }, + /** rpc for uploading text talk document */ + uploadText: { + path: "/yandex.cloud.speechsense.v1.TalkService/UploadText", + requestStream: false, + responseStream: false, + requestSerialize: (value: UploadTextRequest) => + Buffer.from(UploadTextRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UploadTextRequest.decode(value), + responseSerialize: (value: UploadTextResponse) => + Buffer.from(UploadTextResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => UploadTextResponse.decode(value), + }, + /** rpc for searching talks. will return ids only */ + search: { + path: "/yandex.cloud.speechsense.v1.TalkService/Search", + requestStream: false, + responseStream: false, + requestSerialize: (value: SearchTalkRequest) => + Buffer.from(SearchTalkRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => SearchTalkRequest.decode(value), + responseSerialize: (value: SearchTalkResponse) => + Buffer.from(SearchTalkResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => SearchTalkResponse.decode(value), + }, + /** rpc for bulk get */ + get: { + path: "/yandex.cloud.speechsense.v1.TalkService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetTalkRequest) => + Buffer.from(GetTalkRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetTalkRequest.decode(value), + responseSerialize: (value: GetTalkResponse) => + Buffer.from(GetTalkResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => GetTalkResponse.decode(value), + }, +} as const; + +export interface TalkServiceServer extends UntypedServiceImplementation { + /** + * rpc for streaming talk documents. First message should contain Talk related metadata, + * second - audio metadata, others should contain audio bytes in chunks + */ + uploadAsStream: handleClientStreamingCall< + StreamTalkRequest, + UploadTalkResponse + >; + /** rpc for uploading talk document as single message */ + upload: handleUnaryCall; + /** rpc for uploading text talk document */ + uploadText: handleUnaryCall; + /** rpc for searching talks. will return ids only */ + search: handleUnaryCall; + /** rpc for bulk get */ + get: handleUnaryCall; +} + +export interface TalkServiceClient extends Client { + /** + * rpc for streaming talk documents. First message should contain Talk related metadata, + * second - audio metadata, others should contain audio bytes in chunks + */ + uploadAsStream( + callback: (error: ServiceError | null, response: UploadTalkResponse) => void + ): ClientWritableStream; + uploadAsStream( + metadata: Metadata, + callback: (error: ServiceError | null, response: UploadTalkResponse) => void + ): ClientWritableStream; + uploadAsStream( + options: Partial, + callback: (error: ServiceError | null, response: UploadTalkResponse) => void + ): ClientWritableStream; + uploadAsStream( + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: UploadTalkResponse) => void + ): ClientWritableStream; + /** rpc for uploading talk document as single message */ + upload( + request: UploadTalkRequest, + callback: (error: ServiceError | null, response: UploadTalkResponse) => void + ): ClientUnaryCall; + upload( + request: UploadTalkRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: UploadTalkResponse) => void + ): ClientUnaryCall; + upload( + request: UploadTalkRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: UploadTalkResponse) => void + ): ClientUnaryCall; + /** rpc for uploading text talk document */ + uploadText( + request: UploadTextRequest, + callback: (error: ServiceError | null, response: UploadTextResponse) => void + ): ClientUnaryCall; + uploadText( + request: UploadTextRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: UploadTextResponse) => void + ): ClientUnaryCall; + uploadText( + request: UploadTextRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: UploadTextResponse) => void + ): ClientUnaryCall; + /** rpc for searching talks. will return ids only */ + search( + request: SearchTalkRequest, + callback: (error: ServiceError | null, response: SearchTalkResponse) => void + ): ClientUnaryCall; + search( + request: SearchTalkRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: SearchTalkResponse) => void + ): ClientUnaryCall; + search( + request: SearchTalkRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: SearchTalkResponse) => void + ): ClientUnaryCall; + /** rpc for bulk get */ + get( + request: GetTalkRequest, + callback: (error: ServiceError | null, response: GetTalkResponse) => void + ): ClientUnaryCall; + get( + request: GetTalkRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: GetTalkResponse) => void + ): ClientUnaryCall; + get( + request: GetTalkRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: GetTalkResponse) => void + ): ClientUnaryCall; +} + +export const TalkServiceClient = makeGenericClientConstructor( + TalkServiceService, + "yandex.cloud.speechsense.v1.TalkService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): TalkServiceClient; + service: typeof TalkServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/speechsense/v1/text.ts b/src/generated/yandex/cloud/speechsense/v1/text.ts new file mode 100644 index 00000000..b9e53f7c --- /dev/null +++ b/src/generated/yandex/cloud/speechsense/v1/text.ts @@ -0,0 +1,302 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.speechsense.v1"; + +export interface TextContent { + $type: "yandex.cloud.speechsense.v1.TextContent"; + messages: Message[]; +} + +export interface Message { + $type: "yandex.cloud.speechsense.v1.Message"; + userId: string; + timestamp?: Date; + text?: TextPayload | undefined; +} + +export interface TextPayload { + $type: "yandex.cloud.speechsense.v1.TextPayload"; + text: string; +} + +const baseTextContent: object = { + $type: "yandex.cloud.speechsense.v1.TextContent", +}; + +export const TextContent = { + $type: "yandex.cloud.speechsense.v1.TextContent" as const, + + encode( + message: TextContent, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.messages) { + Message.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TextContent { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTextContent } as TextContent; + message.messages = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messages.push(Message.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TextContent { + const message = { ...baseTextContent } as TextContent; + message.messages = (object.messages ?? []).map((e: any) => + Message.fromJSON(e) + ); + return message; + }, + + toJSON(message: TextContent): unknown { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map((e) => + e ? Message.toJSON(e) : undefined + ); + } else { + obj.messages = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): TextContent { + const message = { ...baseTextContent } as TextContent; + message.messages = + object.messages?.map((e) => Message.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set(TextContent.$type, TextContent); + +const baseMessage: object = { + $type: "yandex.cloud.speechsense.v1.Message", + userId: "", +}; + +export const Message = { + $type: "yandex.cloud.speechsense.v1.Message" as const, + + encode( + message: Message, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.userId !== "") { + writer.uint32(10).string(message.userId); + } + if (message.timestamp !== undefined) { + Timestamp.encode( + toTimestamp(message.timestamp), + writer.uint32(18).fork() + ).ldelim(); + } + if (message.text !== undefined) { + TextPayload.encode(message.text, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Message { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessage } as Message; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userId = reader.string(); + break; + case 2: + message.timestamp = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 3: + message.text = TextPayload.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Message { + const message = { ...baseMessage } as Message; + message.userId = + object.userId !== undefined && object.userId !== null + ? String(object.userId) + : ""; + message.timestamp = + object.timestamp !== undefined && object.timestamp !== null + ? fromJsonTimestamp(object.timestamp) + : undefined; + message.text = + object.text !== undefined && object.text !== null + ? TextPayload.fromJSON(object.text) + : undefined; + return message; + }, + + toJSON(message: Message): unknown { + const obj: any = {}; + message.userId !== undefined && (obj.userId = message.userId); + message.timestamp !== undefined && + (obj.timestamp = message.timestamp.toISOString()); + message.text !== undefined && + (obj.text = message.text ? TextPayload.toJSON(message.text) : undefined); + return obj; + }, + + fromPartial, I>>(object: I): Message { + const message = { ...baseMessage } as Message; + message.userId = object.userId ?? ""; + message.timestamp = object.timestamp ?? undefined; + message.text = + object.text !== undefined && object.text !== null + ? TextPayload.fromPartial(object.text) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(Message.$type, Message); + +const baseTextPayload: object = { + $type: "yandex.cloud.speechsense.v1.TextPayload", + text: "", +}; + +export const TextPayload = { + $type: "yandex.cloud.speechsense.v1.TextPayload" as const, + + encode( + message: TextPayload, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.text !== "") { + writer.uint32(10).string(message.text); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TextPayload { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTextPayload } as TextPayload; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TextPayload { + const message = { ...baseTextPayload } as TextPayload; + message.text = + object.text !== undefined && object.text !== null + ? String(object.text) + : ""; + return message; + }, + + toJSON(message: TextPayload): unknown { + const obj: any = {}; + message.text !== undefined && (obj.text = message.text); + return obj; + }, + + fromPartial, I>>( + object: I + ): TextPayload { + const message = { ...baseTextPayload } as TextPayload; + message.text = object.text ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(TextPayload.$type, TextPayload); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/storage/index.ts b/src/generated/yandex/cloud/storage/index.ts index 85ff5061..ea2c225b 100644 --- a/src/generated/yandex/cloud/storage/index.ts +++ b/src/generated/yandex/cloud/storage/index.ts @@ -1,2 +1,3 @@ -export * as bucket from './v1/bucket' -export * as bucket_service from './v1/bucket_service' \ No newline at end of file +export * as v1_bucket from './v1/bucket' +export * as v1_bucket_service from './v1/bucket_service' +export * as v1_s3api from './v1/s3api' \ No newline at end of file diff --git a/src/generated/yandex/cloud/storage/v1/bucket.ts b/src/generated/yandex/cloud/storage/v1/bucket.ts index 6940a739..8e36baea 100644 --- a/src/generated/yandex/cloud/storage/v1/bucket.ts +++ b/src/generated/yandex/cloud/storage/v1/bucket.ts @@ -653,6 +653,14 @@ export interface LifecycleRule { * At transition, the non-current version of the object is transitioned to the specified storage class. */ noncurrentTransitions: LifecycleRule_NoncurrentTransition[]; + /** + * Expiration rule for non-current delete markers of an objects in a bucket with versioning + * enabled ([Bucket.versioning] is `VERSIONING_ENABLED`) or suspended (`VERSIONING_SUSPENDED`). + * Works in the same way as noncurrent_expiration rule, but only for delete markers. + * + * At expiration, the non-current delete marker of the object is deleted and cannot be recovered. + */ + noncurrentDeleteMarkers?: LifecycleRule_NoncurrentDeleteMarkers; } export interface LifecycleRule_AfterDays { @@ -664,6 +672,15 @@ export interface LifecycleRule_AfterDays { daysAfterExpiration?: number; } +export interface LifecycleRule_NoncurrentDeleteMarkers { + $type: "yandex.cloud.storage.v1.LifecycleRule.NoncurrentDeleteMarkers"; + /** + * Time period, in number of days since the version of a delete marker was classified as non-current, after which + * the delete marker expires. + */ + noncurrentDays?: number; +} + export interface LifecycleRule_NoncurrentExpiration { $type: "yandex.cloud.storage.v1.LifecycleRule.NoncurrentExpiration"; /** @@ -767,6 +784,18 @@ export interface LifecycleRule_RuleFilter { objectSizeGreaterThan?: number; /** Size that the object must be less t. */ objectSizeLessThan?: number; + /** Tags that the object's tag set must have for the rule to apply. */ + tag?: Tag; + /** Apply a logical AND to all of the predicates configured inside the And operator. */ + andOperator?: LifecycleRule_RuleFilter_And; +} + +export interface LifecycleRule_RuleFilter_And { + $type: "yandex.cloud.storage.v1.LifecycleRule.RuleFilter.And"; + prefix: string; + objectSizeGreaterThan?: number; + objectSizeLessThan?: number; + tag: Tag[]; } export interface Counters { @@ -2416,6 +2445,12 @@ export const LifecycleRule = { writer.uint32(66).fork() ).ldelim(); } + if (message.noncurrentDeleteMarkers !== undefined) { + LifecycleRule_NoncurrentDeleteMarkers.encode( + message.noncurrentDeleteMarkers, + writer.uint32(74).fork() + ).ldelim(); + } return writer; }, @@ -2464,6 +2499,13 @@ export const LifecycleRule = { LifecycleRule_NoncurrentTransition.decode(reader, reader.uint32()) ); break; + case 9: + message.noncurrentDeleteMarkers = + LifecycleRule_NoncurrentDeleteMarkers.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -2510,6 +2552,13 @@ export const LifecycleRule = { message.noncurrentTransitions = (object.noncurrentTransitions ?? []).map( (e: any) => LifecycleRule_NoncurrentTransition.fromJSON(e) ); + message.noncurrentDeleteMarkers = + object.noncurrentDeleteMarkers !== undefined && + object.noncurrentDeleteMarkers !== null + ? LifecycleRule_NoncurrentDeleteMarkers.fromJSON( + object.noncurrentDeleteMarkers + ) + : undefined; return message; }, @@ -2552,6 +2601,12 @@ export const LifecycleRule = { } else { obj.noncurrentTransitions = []; } + message.noncurrentDeleteMarkers !== undefined && + (obj.noncurrentDeleteMarkers = message.noncurrentDeleteMarkers + ? LifecycleRule_NoncurrentDeleteMarkers.toJSON( + message.noncurrentDeleteMarkers + ) + : undefined); return obj; }, @@ -2590,6 +2645,13 @@ export const LifecycleRule = { object.noncurrentTransitions?.map((e) => LifecycleRule_NoncurrentTransition.fromPartial(e) ) || []; + message.noncurrentDeleteMarkers = + object.noncurrentDeleteMarkers !== undefined && + object.noncurrentDeleteMarkers !== null + ? LifecycleRule_NoncurrentDeleteMarkers.fromPartial( + object.noncurrentDeleteMarkers + ) + : undefined; return message; }, }; @@ -2677,6 +2739,87 @@ export const LifecycleRule_AfterDays = { messageTypeRegistry.set(LifecycleRule_AfterDays.$type, LifecycleRule_AfterDays); +const baseLifecycleRule_NoncurrentDeleteMarkers: object = { + $type: "yandex.cloud.storage.v1.LifecycleRule.NoncurrentDeleteMarkers", +}; + +export const LifecycleRule_NoncurrentDeleteMarkers = { + $type: + "yandex.cloud.storage.v1.LifecycleRule.NoncurrentDeleteMarkers" as const, + + encode( + message: LifecycleRule_NoncurrentDeleteMarkers, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.noncurrentDays !== undefined) { + Int64Value.encode( + { $type: "google.protobuf.Int64Value", value: message.noncurrentDays! }, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): LifecycleRule_NoncurrentDeleteMarkers { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseLifecycleRule_NoncurrentDeleteMarkers, + } as LifecycleRule_NoncurrentDeleteMarkers; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.noncurrentDays = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LifecycleRule_NoncurrentDeleteMarkers { + const message = { + ...baseLifecycleRule_NoncurrentDeleteMarkers, + } as LifecycleRule_NoncurrentDeleteMarkers; + message.noncurrentDays = + object.noncurrentDays !== undefined && object.noncurrentDays !== null + ? Number(object.noncurrentDays) + : undefined; + return message; + }, + + toJSON(message: LifecycleRule_NoncurrentDeleteMarkers): unknown { + const obj: any = {}; + message.noncurrentDays !== undefined && + (obj.noncurrentDays = message.noncurrentDays); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): LifecycleRule_NoncurrentDeleteMarkers { + const message = { + ...baseLifecycleRule_NoncurrentDeleteMarkers, + } as LifecycleRule_NoncurrentDeleteMarkers; + message.noncurrentDays = object.noncurrentDays ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set( + LifecycleRule_NoncurrentDeleteMarkers.$type, + LifecycleRule_NoncurrentDeleteMarkers +); + const baseLifecycleRule_NoncurrentExpiration: object = { $type: "yandex.cloud.storage.v1.LifecycleRule.NoncurrentExpiration", }; @@ -3108,6 +3251,15 @@ export const LifecycleRule_RuleFilter = { writer.uint32(26).fork() ).ldelim(); } + if (message.tag !== undefined) { + Tag.encode(message.tag, writer.uint32(34).fork()).ldelim(); + } + if (message.andOperator !== undefined) { + LifecycleRule_RuleFilter_And.encode( + message.andOperator, + writer.uint32(42).fork() + ).ldelim(); + } return writer; }, @@ -3138,6 +3290,15 @@ export const LifecycleRule_RuleFilter = { reader.uint32() ).value; break; + case 4: + message.tag = Tag.decode(reader, reader.uint32()); + break; + case 5: + message.andOperator = LifecycleRule_RuleFilter_And.decode( + reader, + reader.uint32() + ); + break; default: reader.skipType(tag & 7); break; @@ -3164,6 +3325,14 @@ export const LifecycleRule_RuleFilter = { object.objectSizeLessThan !== null ? Number(object.objectSizeLessThan) : undefined; + message.tag = + object.tag !== undefined && object.tag !== null + ? Tag.fromJSON(object.tag) + : undefined; + message.andOperator = + object.andOperator !== undefined && object.andOperator !== null + ? LifecycleRule_RuleFilter_And.fromJSON(object.andOperator) + : undefined; return message; }, @@ -3174,6 +3343,12 @@ export const LifecycleRule_RuleFilter = { (obj.objectSizeGreaterThan = message.objectSizeGreaterThan); message.objectSizeLessThan !== undefined && (obj.objectSizeLessThan = message.objectSizeLessThan); + message.tag !== undefined && + (obj.tag = message.tag ? Tag.toJSON(message.tag) : undefined); + message.andOperator !== undefined && + (obj.andOperator = message.andOperator + ? LifecycleRule_RuleFilter_And.toJSON(message.andOperator) + : undefined); return obj; }, @@ -3186,6 +3361,14 @@ export const LifecycleRule_RuleFilter = { message.prefix = object.prefix ?? ""; message.objectSizeGreaterThan = object.objectSizeGreaterThan ?? undefined; message.objectSizeLessThan = object.objectSizeLessThan ?? undefined; + message.tag = + object.tag !== undefined && object.tag !== null + ? Tag.fromPartial(object.tag) + : undefined; + message.andOperator = + object.andOperator !== undefined && object.andOperator !== null + ? LifecycleRule_RuleFilter_And.fromPartial(object.andOperator) + : undefined; return message; }, }; @@ -3195,6 +3378,140 @@ messageTypeRegistry.set( LifecycleRule_RuleFilter ); +const baseLifecycleRule_RuleFilter_And: object = { + $type: "yandex.cloud.storage.v1.LifecycleRule.RuleFilter.And", + prefix: "", +}; + +export const LifecycleRule_RuleFilter_And = { + $type: "yandex.cloud.storage.v1.LifecycleRule.RuleFilter.And" as const, + + encode( + message: LifecycleRule_RuleFilter_And, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.prefix !== "") { + writer.uint32(10).string(message.prefix); + } + if (message.objectSizeGreaterThan !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.objectSizeGreaterThan!, + }, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.objectSizeLessThan !== undefined) { + Int64Value.encode( + { + $type: "google.protobuf.Int64Value", + value: message.objectSizeLessThan!, + }, + writer.uint32(26).fork() + ).ldelim(); + } + for (const v of message.tag) { + Tag.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): LifecycleRule_RuleFilter_And { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseLifecycleRule_RuleFilter_And, + } as LifecycleRule_RuleFilter_And; + message.tag = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prefix = reader.string(); + break; + case 2: + message.objectSizeGreaterThan = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 3: + message.objectSizeLessThan = Int64Value.decode( + reader, + reader.uint32() + ).value; + break; + case 4: + message.tag.push(Tag.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LifecycleRule_RuleFilter_And { + const message = { + ...baseLifecycleRule_RuleFilter_And, + } as LifecycleRule_RuleFilter_And; + message.prefix = + object.prefix !== undefined && object.prefix !== null + ? String(object.prefix) + : ""; + message.objectSizeGreaterThan = + object.objectSizeGreaterThan !== undefined && + object.objectSizeGreaterThan !== null + ? Number(object.objectSizeGreaterThan) + : undefined; + message.objectSizeLessThan = + object.objectSizeLessThan !== undefined && + object.objectSizeLessThan !== null + ? Number(object.objectSizeLessThan) + : undefined; + message.tag = (object.tag ?? []).map((e: any) => Tag.fromJSON(e)); + return message; + }, + + toJSON(message: LifecycleRule_RuleFilter_And): unknown { + const obj: any = {}; + message.prefix !== undefined && (obj.prefix = message.prefix); + message.objectSizeGreaterThan !== undefined && + (obj.objectSizeGreaterThan = message.objectSizeGreaterThan); + message.objectSizeLessThan !== undefined && + (obj.objectSizeLessThan = message.objectSizeLessThan); + if (message.tag) { + obj.tag = message.tag.map((e) => (e ? Tag.toJSON(e) : undefined)); + } else { + obj.tag = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): LifecycleRule_RuleFilter_And { + const message = { + ...baseLifecycleRule_RuleFilter_And, + } as LifecycleRule_RuleFilter_And; + message.prefix = object.prefix ?? ""; + message.objectSizeGreaterThan = object.objectSizeGreaterThan ?? undefined; + message.objectSizeLessThan = object.objectSizeLessThan ?? undefined; + message.tag = object.tag?.map((e) => Tag.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + LifecycleRule_RuleFilter_And.$type, + LifecycleRule_RuleFilter_And +); + const baseCounters: object = { $type: "yandex.cloud.storage.v1.Counters", simpleObjectSize: 0, diff --git a/src/generated/yandex/cloud/storage/v1/s3api.ts b/src/generated/yandex/cloud/storage/v1/s3api.ts new file mode 100644 index 00000000..67889040 --- /dev/null +++ b/src/generated/yandex/cloud/storage/v1/s3api.ts @@ -0,0 +1,2295 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.storage.v1"; + +/** Represents a response of the get object request to S3. */ +export interface S3APIGetObjectResponse { + $type: "yandex.cloud.storage.v1.S3APIGetObjectResponse"; + /** MD5 hash of the object. */ + etag: string; + /** Unique request ID. */ + requestId: string; + /** Indicates that a range of bytes was specified in the request. */ + acceptRanges: string; + /** Specifies caching behavior along the request/reply chain. */ + cacheControl: string; + /** Specifies presentational information for the object. */ + contentDisposition: string; + /** Indicates what content encodings have been applied to the object. */ + contentEncoding: string; + /** The language the content is in. */ + contentLanguage: string; + /** Size of the body in bytes. */ + contentLength: number; + /** The portion of the object returned in the response. */ + contentRange: string; + /** A standard MIME type describing the format of the object data. */ + contentType: string; + /** Version ID of the object. */ + versionId: string; + /** The date and time at which the object is no longer cacheable. */ + expiresAt?: Date; + /** Date and time when the object was last modified. */ + lastModifiedAt?: Date; + /** Object user-defined metadata. */ + metadata: { [key: string]: string }; + /** Provides storage class information of the object. */ + storageClass: string; + /** Encryption algorithm used to encrypt the object. */ + serverSideEncryption: string; + /** ID of the key KMS. */ + sseKmsKeyId: string; + /** Type of retention put on the object. */ + objectLockMode: string; + /** Date and time until which the object is retained */ + objectLockRetainUntilDate?: Date; + /** Type of legal hold put on the object */ + objectLockLegalHoldStatus: string; +} + +export interface S3APIGetObjectResponse_MetadataEntry { + $type: "yandex.cloud.storage.v1.S3APIGetObjectResponse.MetadataEntry"; + key: string; + value: string; +} + +/** Represents a response of the put object request to S3. */ +export interface S3APIPutObjectResponse { + $type: "yandex.cloud.storage.v1.S3APIPutObjectResponse"; + /** MD5 hash of the object. */ + etag: string; + /** Unique request ID. */ + requestId: string; + /** Version ID of the object. */ + versionId: string; +} + +/** Represents a response of the delete object request to S3. */ +export interface S3APIDeleteObjectResponse { + $type: "yandex.cloud.storage.v1.S3APIDeleteObjectResponse"; + /** Unique request ID. */ + requestId: string; + /** Version ID of the object. */ + versionId: string; +} + +export interface CopyObjectResult { + $type: "yandex.cloud.storage.v1.CopyObjectResult"; + /** Returns the ETag of the new object. */ + etag: string; + /** Creation date of the object. */ + lastModifiedAt?: Date; +} + +/** Represents a response of the copy object request to S3. */ +export interface S3APICopyObjectResponse { + $type: "yandex.cloud.storage.v1.S3APICopyObjectResponse"; + /** Container for all response elements. */ + copyObjectResult?: CopyObjectResult; + /** Unique request ID. */ + requestId: string; + /** Version ID of the source object that was copied. */ + copySourceVersionId: string; + /** Version ID of the newly created copy. */ + versionId: string; +} + +export interface SuccessfullyDeletedObject { + $type: "yandex.cloud.storage.v1.SuccessfullyDeletedObject"; + /** The name of the deleted object. */ + key: string; + /** The version ID of the deleted object. */ + versionId: string; + /** Specifies whether the versioned object that was permanently deleted was (true) or was not (false) a delete marker. */ + deleteMarker: boolean; + /** The version ID of the delete marker created as a result of the DELETE operation. */ + deleteMarkerVersionId: string; +} + +export interface DeleteObjectError { + $type: "yandex.cloud.storage.v1.DeleteObjectError"; + /** The error key. */ + key: string; + /** The version ID of the error. */ + versionId: string; + /** The error code is a string that uniquely identifies an error condition. */ + code: string; + /** The error message contains a generic description of the error condition in English. */ + msg: string; +} + +/** Represents a response of the delete objects request to S3. */ +export interface S3APIDeleteObjectsResponse { + $type: "yandex.cloud.storage.v1.S3APIDeleteObjectsResponse"; + /** List of successfully deleted objects */ + deleted: SuccessfullyDeletedObject[]; + /** List of objects that attempted to be deleted but encountered an error */ + errors: DeleteObjectError[]; + /** Unique request ID. */ + requestId: string; +} + +/** Represents a response of the put object retention request to S3. */ +export interface S3APIPutObjectRetentionResponse { + $type: "yandex.cloud.storage.v1.S3APIPutObjectRetentionResponse"; + /** Unique request ID. */ + requestId: string; +} + +export interface ObjectLockRetention { + $type: "yandex.cloud.storage.v1.ObjectLockRetention"; + /** Indicates the Retention mode for the specified object. */ + mode: string; + /** The date on which this object lock retention will expire. */ + retainUntilDate?: Date; +} + +/** Represents a response of the get object retention request to S3. */ +export interface S3APIGetObjectRetentionResponse { + $type: "yandex.cloud.storage.v1.S3APIGetObjectRetentionResponse"; + /** Unique request ID. */ + requestId: string; + /** An object retention settings. */ + retention?: ObjectLockRetention; +} + +/** Represents a response of the put object retention request to S3. */ +export interface S3APIPutObjectLegalHoldResponse { + $type: "yandex.cloud.storage.v1.S3APIPutObjectLegalHoldResponse"; + /** Unique request ID. */ + requestId: string; +} + +export interface ObjectLockLegalHold { + $type: "yandex.cloud.storage.v1.ObjectLockLegalHold"; + /** Indicates whether the specified object has a legal hold in place. */ + status: string; +} + +/** Represents a response of the get object legal hold request to S3. */ +export interface S3APIGetObjectLegalHoldResponse { + $type: "yandex.cloud.storage.v1.S3APIGetObjectLegalHoldResponse"; + /** Unique request ID. */ + requestId: string; + /** The current legal hold status for the specified object. */ + legalHold?: ObjectLockLegalHold; +} + +/** Represents a response of put object tagging request to S3. */ +export interface S3APIPutObjectTaggingResponse { + $type: "yandex.cloud.storage.v1.S3APIPutObjectTaggingResponse"; + /** Unique request ID. */ + requestId: string; + /** The versionId of the object the tag-set was added to. */ + versionId: string; +} + +export interface ObjectTag { + $type: "yandex.cloud.storage.v1.ObjectTag"; + /** Key of the object tag. */ + key: string; + /** Value of the object tag. */ + value: string; +} + +/** Represents a response of get object tagging request to S3. */ +export interface S3APIGetObjectTaggingResponse { + $type: "yandex.cloud.storage.v1.S3APIGetObjectTaggingResponse"; + /** Unique request ID. */ + requestId: string; + /** The versionId of the object for which you got the tagging information. */ + versionId: string; + /** Contains the tag set. */ + tagSet: ObjectTag[]; +} + +/** Represents a response of delete object tagging request to S3. */ +export interface S3APIDeleteObjectTaggingResponse { + $type: "yandex.cloud.storage.v1.S3APIDeleteObjectTaggingResponse"; + /** Unique request ID. */ + requestId: string; + /** The versionId of the object the tag-set was removed from. */ + versionId: string; +} + +const baseS3APIGetObjectResponse: object = { + $type: "yandex.cloud.storage.v1.S3APIGetObjectResponse", + etag: "", + requestId: "", + acceptRanges: "", + cacheControl: "", + contentDisposition: "", + contentEncoding: "", + contentLanguage: "", + contentLength: 0, + contentRange: "", + contentType: "", + versionId: "", + storageClass: "", + serverSideEncryption: "", + sseKmsKeyId: "", + objectLockMode: "", + objectLockLegalHoldStatus: "", +}; + +export const S3APIGetObjectResponse = { + $type: "yandex.cloud.storage.v1.S3APIGetObjectResponse" as const, + + encode( + message: S3APIGetObjectResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.etag !== "") { + writer.uint32(10).string(message.etag); + } + if (message.requestId !== "") { + writer.uint32(18).string(message.requestId); + } + if (message.acceptRanges !== "") { + writer.uint32(26).string(message.acceptRanges); + } + if (message.cacheControl !== "") { + writer.uint32(34).string(message.cacheControl); + } + if (message.contentDisposition !== "") { + writer.uint32(42).string(message.contentDisposition); + } + if (message.contentEncoding !== "") { + writer.uint32(50).string(message.contentEncoding); + } + if (message.contentLanguage !== "") { + writer.uint32(58).string(message.contentLanguage); + } + if (message.contentLength !== 0) { + writer.uint32(64).int64(message.contentLength); + } + if (message.contentRange !== "") { + writer.uint32(74).string(message.contentRange); + } + if (message.contentType !== "") { + writer.uint32(82).string(message.contentType); + } + if (message.versionId !== "") { + writer.uint32(90).string(message.versionId); + } + if (message.expiresAt !== undefined) { + Timestamp.encode( + toTimestamp(message.expiresAt), + writer.uint32(98).fork() + ).ldelim(); + } + if (message.lastModifiedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.lastModifiedAt), + writer.uint32(106).fork() + ).ldelim(); + } + Object.entries(message.metadata).forEach(([key, value]) => { + S3APIGetObjectResponse_MetadataEntry.encode( + { + $type: "yandex.cloud.storage.v1.S3APIGetObjectResponse.MetadataEntry", + key: key as any, + value, + }, + writer.uint32(114).fork() + ).ldelim(); + }); + if (message.storageClass !== "") { + writer.uint32(122).string(message.storageClass); + } + if (message.serverSideEncryption !== "") { + writer.uint32(130).string(message.serverSideEncryption); + } + if (message.sseKmsKeyId !== "") { + writer.uint32(138).string(message.sseKmsKeyId); + } + if (message.objectLockMode !== "") { + writer.uint32(146).string(message.objectLockMode); + } + if (message.objectLockRetainUntilDate !== undefined) { + Timestamp.encode( + toTimestamp(message.objectLockRetainUntilDate), + writer.uint32(154).fork() + ).ldelim(); + } + if (message.objectLockLegalHoldStatus !== "") { + writer.uint32(162).string(message.objectLockLegalHoldStatus); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): S3APIGetObjectResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseS3APIGetObjectResponse } as S3APIGetObjectResponse; + message.metadata = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.etag = reader.string(); + break; + case 2: + message.requestId = reader.string(); + break; + case 3: + message.acceptRanges = reader.string(); + break; + case 4: + message.cacheControl = reader.string(); + break; + case 5: + message.contentDisposition = reader.string(); + break; + case 6: + message.contentEncoding = reader.string(); + break; + case 7: + message.contentLanguage = reader.string(); + break; + case 8: + message.contentLength = longToNumber(reader.int64() as Long); + break; + case 9: + message.contentRange = reader.string(); + break; + case 10: + message.contentType = reader.string(); + break; + case 11: + message.versionId = reader.string(); + break; + case 12: + message.expiresAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 13: + message.lastModifiedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 14: + const entry14 = S3APIGetObjectResponse_MetadataEntry.decode( + reader, + reader.uint32() + ); + if (entry14.value !== undefined) { + message.metadata[entry14.key] = entry14.value; + } + break; + case 15: + message.storageClass = reader.string(); + break; + case 16: + message.serverSideEncryption = reader.string(); + break; + case 17: + message.sseKmsKeyId = reader.string(); + break; + case 18: + message.objectLockMode = reader.string(); + break; + case 19: + message.objectLockRetainUntilDate = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 20: + message.objectLockLegalHoldStatus = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3APIGetObjectResponse { + const message = { ...baseS3APIGetObjectResponse } as S3APIGetObjectResponse; + message.etag = + object.etag !== undefined && object.etag !== null + ? String(object.etag) + : ""; + message.requestId = + object.requestId !== undefined && object.requestId !== null + ? String(object.requestId) + : ""; + message.acceptRanges = + object.acceptRanges !== undefined && object.acceptRanges !== null + ? String(object.acceptRanges) + : ""; + message.cacheControl = + object.cacheControl !== undefined && object.cacheControl !== null + ? String(object.cacheControl) + : ""; + message.contentDisposition = + object.contentDisposition !== undefined && + object.contentDisposition !== null + ? String(object.contentDisposition) + : ""; + message.contentEncoding = + object.contentEncoding !== undefined && object.contentEncoding !== null + ? String(object.contentEncoding) + : ""; + message.contentLanguage = + object.contentLanguage !== undefined && object.contentLanguage !== null + ? String(object.contentLanguage) + : ""; + message.contentLength = + object.contentLength !== undefined && object.contentLength !== null + ? Number(object.contentLength) + : 0; + message.contentRange = + object.contentRange !== undefined && object.contentRange !== null + ? String(object.contentRange) + : ""; + message.contentType = + object.contentType !== undefined && object.contentType !== null + ? String(object.contentType) + : ""; + message.versionId = + object.versionId !== undefined && object.versionId !== null + ? String(object.versionId) + : ""; + message.expiresAt = + object.expiresAt !== undefined && object.expiresAt !== null + ? fromJsonTimestamp(object.expiresAt) + : undefined; + message.lastModifiedAt = + object.lastModifiedAt !== undefined && object.lastModifiedAt !== null + ? fromJsonTimestamp(object.lastModifiedAt) + : undefined; + message.metadata = Object.entries(object.metadata ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.storageClass = + object.storageClass !== undefined && object.storageClass !== null + ? String(object.storageClass) + : ""; + message.serverSideEncryption = + object.serverSideEncryption !== undefined && + object.serverSideEncryption !== null + ? String(object.serverSideEncryption) + : ""; + message.sseKmsKeyId = + object.sseKmsKeyId !== undefined && object.sseKmsKeyId !== null + ? String(object.sseKmsKeyId) + : ""; + message.objectLockMode = + object.objectLockMode !== undefined && object.objectLockMode !== null + ? String(object.objectLockMode) + : ""; + message.objectLockRetainUntilDate = + object.objectLockRetainUntilDate !== undefined && + object.objectLockRetainUntilDate !== null + ? fromJsonTimestamp(object.objectLockRetainUntilDate) + : undefined; + message.objectLockLegalHoldStatus = + object.objectLockLegalHoldStatus !== undefined && + object.objectLockLegalHoldStatus !== null + ? String(object.objectLockLegalHoldStatus) + : ""; + return message; + }, + + toJSON(message: S3APIGetObjectResponse): unknown { + const obj: any = {}; + message.etag !== undefined && (obj.etag = message.etag); + message.requestId !== undefined && (obj.requestId = message.requestId); + message.acceptRanges !== undefined && + (obj.acceptRanges = message.acceptRanges); + message.cacheControl !== undefined && + (obj.cacheControl = message.cacheControl); + message.contentDisposition !== undefined && + (obj.contentDisposition = message.contentDisposition); + message.contentEncoding !== undefined && + (obj.contentEncoding = message.contentEncoding); + message.contentLanguage !== undefined && + (obj.contentLanguage = message.contentLanguage); + message.contentLength !== undefined && + (obj.contentLength = Math.round(message.contentLength)); + message.contentRange !== undefined && + (obj.contentRange = message.contentRange); + message.contentType !== undefined && + (obj.contentType = message.contentType); + message.versionId !== undefined && (obj.versionId = message.versionId); + message.expiresAt !== undefined && + (obj.expiresAt = message.expiresAt.toISOString()); + message.lastModifiedAt !== undefined && + (obj.lastModifiedAt = message.lastModifiedAt.toISOString()); + obj.metadata = {}; + if (message.metadata) { + Object.entries(message.metadata).forEach(([k, v]) => { + obj.metadata[k] = v; + }); + } + message.storageClass !== undefined && + (obj.storageClass = message.storageClass); + message.serverSideEncryption !== undefined && + (obj.serverSideEncryption = message.serverSideEncryption); + message.sseKmsKeyId !== undefined && + (obj.sseKmsKeyId = message.sseKmsKeyId); + message.objectLockMode !== undefined && + (obj.objectLockMode = message.objectLockMode); + message.objectLockRetainUntilDate !== undefined && + (obj.objectLockRetainUntilDate = + message.objectLockRetainUntilDate.toISOString()); + message.objectLockLegalHoldStatus !== undefined && + (obj.objectLockLegalHoldStatus = message.objectLockLegalHoldStatus); + return obj; + }, + + fromPartial, I>>( + object: I + ): S3APIGetObjectResponse { + const message = { ...baseS3APIGetObjectResponse } as S3APIGetObjectResponse; + message.etag = object.etag ?? ""; + message.requestId = object.requestId ?? ""; + message.acceptRanges = object.acceptRanges ?? ""; + message.cacheControl = object.cacheControl ?? ""; + message.contentDisposition = object.contentDisposition ?? ""; + message.contentEncoding = object.contentEncoding ?? ""; + message.contentLanguage = object.contentLanguage ?? ""; + message.contentLength = object.contentLength ?? 0; + message.contentRange = object.contentRange ?? ""; + message.contentType = object.contentType ?? ""; + message.versionId = object.versionId ?? ""; + message.expiresAt = object.expiresAt ?? undefined; + message.lastModifiedAt = object.lastModifiedAt ?? undefined; + message.metadata = Object.entries(object.metadata ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.storageClass = object.storageClass ?? ""; + message.serverSideEncryption = object.serverSideEncryption ?? ""; + message.sseKmsKeyId = object.sseKmsKeyId ?? ""; + message.objectLockMode = object.objectLockMode ?? ""; + message.objectLockRetainUntilDate = + object.objectLockRetainUntilDate ?? undefined; + message.objectLockLegalHoldStatus = object.objectLockLegalHoldStatus ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(S3APIGetObjectResponse.$type, S3APIGetObjectResponse); + +const baseS3APIGetObjectResponse_MetadataEntry: object = { + $type: "yandex.cloud.storage.v1.S3APIGetObjectResponse.MetadataEntry", + key: "", + value: "", +}; + +export const S3APIGetObjectResponse_MetadataEntry = { + $type: + "yandex.cloud.storage.v1.S3APIGetObjectResponse.MetadataEntry" as const, + + encode( + message: S3APIGetObjectResponse_MetadataEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): S3APIGetObjectResponse_MetadataEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseS3APIGetObjectResponse_MetadataEntry, + } as S3APIGetObjectResponse_MetadataEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3APIGetObjectResponse_MetadataEntry { + const message = { + ...baseS3APIGetObjectResponse_MetadataEntry, + } as S3APIGetObjectResponse_MetadataEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: S3APIGetObjectResponse_MetadataEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): S3APIGetObjectResponse_MetadataEntry { + const message = { + ...baseS3APIGetObjectResponse_MetadataEntry, + } as S3APIGetObjectResponse_MetadataEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + S3APIGetObjectResponse_MetadataEntry.$type, + S3APIGetObjectResponse_MetadataEntry +); + +const baseS3APIPutObjectResponse: object = { + $type: "yandex.cloud.storage.v1.S3APIPutObjectResponse", + etag: "", + requestId: "", + versionId: "", +}; + +export const S3APIPutObjectResponse = { + $type: "yandex.cloud.storage.v1.S3APIPutObjectResponse" as const, + + encode( + message: S3APIPutObjectResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.etag !== "") { + writer.uint32(10).string(message.etag); + } + if (message.requestId !== "") { + writer.uint32(18).string(message.requestId); + } + if (message.versionId !== "") { + writer.uint32(26).string(message.versionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): S3APIPutObjectResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseS3APIPutObjectResponse } as S3APIPutObjectResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.etag = reader.string(); + break; + case 2: + message.requestId = reader.string(); + break; + case 3: + message.versionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3APIPutObjectResponse { + const message = { ...baseS3APIPutObjectResponse } as S3APIPutObjectResponse; + message.etag = + object.etag !== undefined && object.etag !== null + ? String(object.etag) + : ""; + message.requestId = + object.requestId !== undefined && object.requestId !== null + ? String(object.requestId) + : ""; + message.versionId = + object.versionId !== undefined && object.versionId !== null + ? String(object.versionId) + : ""; + return message; + }, + + toJSON(message: S3APIPutObjectResponse): unknown { + const obj: any = {}; + message.etag !== undefined && (obj.etag = message.etag); + message.requestId !== undefined && (obj.requestId = message.requestId); + message.versionId !== undefined && (obj.versionId = message.versionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): S3APIPutObjectResponse { + const message = { ...baseS3APIPutObjectResponse } as S3APIPutObjectResponse; + message.etag = object.etag ?? ""; + message.requestId = object.requestId ?? ""; + message.versionId = object.versionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(S3APIPutObjectResponse.$type, S3APIPutObjectResponse); + +const baseS3APIDeleteObjectResponse: object = { + $type: "yandex.cloud.storage.v1.S3APIDeleteObjectResponse", + requestId: "", + versionId: "", +}; + +export const S3APIDeleteObjectResponse = { + $type: "yandex.cloud.storage.v1.S3APIDeleteObjectResponse" as const, + + encode( + message: S3APIDeleteObjectResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.requestId !== "") { + writer.uint32(10).string(message.requestId); + } + if (message.versionId !== "") { + writer.uint32(18).string(message.versionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): S3APIDeleteObjectResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseS3APIDeleteObjectResponse, + } as S3APIDeleteObjectResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requestId = reader.string(); + break; + case 2: + message.versionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3APIDeleteObjectResponse { + const message = { + ...baseS3APIDeleteObjectResponse, + } as S3APIDeleteObjectResponse; + message.requestId = + object.requestId !== undefined && object.requestId !== null + ? String(object.requestId) + : ""; + message.versionId = + object.versionId !== undefined && object.versionId !== null + ? String(object.versionId) + : ""; + return message; + }, + + toJSON(message: S3APIDeleteObjectResponse): unknown { + const obj: any = {}; + message.requestId !== undefined && (obj.requestId = message.requestId); + message.versionId !== undefined && (obj.versionId = message.versionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): S3APIDeleteObjectResponse { + const message = { + ...baseS3APIDeleteObjectResponse, + } as S3APIDeleteObjectResponse; + message.requestId = object.requestId ?? ""; + message.versionId = object.versionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + S3APIDeleteObjectResponse.$type, + S3APIDeleteObjectResponse +); + +const baseCopyObjectResult: object = { + $type: "yandex.cloud.storage.v1.CopyObjectResult", + etag: "", +}; + +export const CopyObjectResult = { + $type: "yandex.cloud.storage.v1.CopyObjectResult" as const, + + encode( + message: CopyObjectResult, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.etag !== "") { + writer.uint32(10).string(message.etag); + } + if (message.lastModifiedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.lastModifiedAt), + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CopyObjectResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCopyObjectResult } as CopyObjectResult; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.etag = reader.string(); + break; + case 2: + message.lastModifiedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CopyObjectResult { + const message = { ...baseCopyObjectResult } as CopyObjectResult; + message.etag = + object.etag !== undefined && object.etag !== null + ? String(object.etag) + : ""; + message.lastModifiedAt = + object.lastModifiedAt !== undefined && object.lastModifiedAt !== null + ? fromJsonTimestamp(object.lastModifiedAt) + : undefined; + return message; + }, + + toJSON(message: CopyObjectResult): unknown { + const obj: any = {}; + message.etag !== undefined && (obj.etag = message.etag); + message.lastModifiedAt !== undefined && + (obj.lastModifiedAt = message.lastModifiedAt.toISOString()); + return obj; + }, + + fromPartial, I>>( + object: I + ): CopyObjectResult { + const message = { ...baseCopyObjectResult } as CopyObjectResult; + message.etag = object.etag ?? ""; + message.lastModifiedAt = object.lastModifiedAt ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(CopyObjectResult.$type, CopyObjectResult); + +const baseS3APICopyObjectResponse: object = { + $type: "yandex.cloud.storage.v1.S3APICopyObjectResponse", + requestId: "", + copySourceVersionId: "", + versionId: "", +}; + +export const S3APICopyObjectResponse = { + $type: "yandex.cloud.storage.v1.S3APICopyObjectResponse" as const, + + encode( + message: S3APICopyObjectResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.copyObjectResult !== undefined) { + CopyObjectResult.encode( + message.copyObjectResult, + writer.uint32(10).fork() + ).ldelim(); + } + if (message.requestId !== "") { + writer.uint32(18).string(message.requestId); + } + if (message.copySourceVersionId !== "") { + writer.uint32(26).string(message.copySourceVersionId); + } + if (message.versionId !== "") { + writer.uint32(34).string(message.versionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): S3APICopyObjectResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseS3APICopyObjectResponse, + } as S3APICopyObjectResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.copyObjectResult = CopyObjectResult.decode( + reader, + reader.uint32() + ); + break; + case 2: + message.requestId = reader.string(); + break; + case 3: + message.copySourceVersionId = reader.string(); + break; + case 4: + message.versionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3APICopyObjectResponse { + const message = { + ...baseS3APICopyObjectResponse, + } as S3APICopyObjectResponse; + message.copyObjectResult = + object.copyObjectResult !== undefined && object.copyObjectResult !== null + ? CopyObjectResult.fromJSON(object.copyObjectResult) + : undefined; + message.requestId = + object.requestId !== undefined && object.requestId !== null + ? String(object.requestId) + : ""; + message.copySourceVersionId = + object.copySourceVersionId !== undefined && + object.copySourceVersionId !== null + ? String(object.copySourceVersionId) + : ""; + message.versionId = + object.versionId !== undefined && object.versionId !== null + ? String(object.versionId) + : ""; + return message; + }, + + toJSON(message: S3APICopyObjectResponse): unknown { + const obj: any = {}; + message.copyObjectResult !== undefined && + (obj.copyObjectResult = message.copyObjectResult + ? CopyObjectResult.toJSON(message.copyObjectResult) + : undefined); + message.requestId !== undefined && (obj.requestId = message.requestId); + message.copySourceVersionId !== undefined && + (obj.copySourceVersionId = message.copySourceVersionId); + message.versionId !== undefined && (obj.versionId = message.versionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): S3APICopyObjectResponse { + const message = { + ...baseS3APICopyObjectResponse, + } as S3APICopyObjectResponse; + message.copyObjectResult = + object.copyObjectResult !== undefined && object.copyObjectResult !== null + ? CopyObjectResult.fromPartial(object.copyObjectResult) + : undefined; + message.requestId = object.requestId ?? ""; + message.copySourceVersionId = object.copySourceVersionId ?? ""; + message.versionId = object.versionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(S3APICopyObjectResponse.$type, S3APICopyObjectResponse); + +const baseSuccessfullyDeletedObject: object = { + $type: "yandex.cloud.storage.v1.SuccessfullyDeletedObject", + key: "", + versionId: "", + deleteMarker: false, + deleteMarkerVersionId: "", +}; + +export const SuccessfullyDeletedObject = { + $type: "yandex.cloud.storage.v1.SuccessfullyDeletedObject" as const, + + encode( + message: SuccessfullyDeletedObject, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.versionId !== "") { + writer.uint32(18).string(message.versionId); + } + if (message.deleteMarker === true) { + writer.uint32(24).bool(message.deleteMarker); + } + if (message.deleteMarkerVersionId !== "") { + writer.uint32(34).string(message.deleteMarkerVersionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SuccessfullyDeletedObject { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseSuccessfullyDeletedObject, + } as SuccessfullyDeletedObject; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.versionId = reader.string(); + break; + case 3: + message.deleteMarker = reader.bool(); + break; + case 4: + message.deleteMarkerVersionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SuccessfullyDeletedObject { + const message = { + ...baseSuccessfullyDeletedObject, + } as SuccessfullyDeletedObject; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.versionId = + object.versionId !== undefined && object.versionId !== null + ? String(object.versionId) + : ""; + message.deleteMarker = + object.deleteMarker !== undefined && object.deleteMarker !== null + ? Boolean(object.deleteMarker) + : false; + message.deleteMarkerVersionId = + object.deleteMarkerVersionId !== undefined && + object.deleteMarkerVersionId !== null + ? String(object.deleteMarkerVersionId) + : ""; + return message; + }, + + toJSON(message: SuccessfullyDeletedObject): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.versionId !== undefined && (obj.versionId = message.versionId); + message.deleteMarker !== undefined && + (obj.deleteMarker = message.deleteMarker); + message.deleteMarkerVersionId !== undefined && + (obj.deleteMarkerVersionId = message.deleteMarkerVersionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): SuccessfullyDeletedObject { + const message = { + ...baseSuccessfullyDeletedObject, + } as SuccessfullyDeletedObject; + message.key = object.key ?? ""; + message.versionId = object.versionId ?? ""; + message.deleteMarker = object.deleteMarker ?? false; + message.deleteMarkerVersionId = object.deleteMarkerVersionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + SuccessfullyDeletedObject.$type, + SuccessfullyDeletedObject +); + +const baseDeleteObjectError: object = { + $type: "yandex.cloud.storage.v1.DeleteObjectError", + key: "", + versionId: "", + code: "", + msg: "", +}; + +export const DeleteObjectError = { + $type: "yandex.cloud.storage.v1.DeleteObjectError" as const, + + encode( + message: DeleteObjectError, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.versionId !== "") { + writer.uint32(18).string(message.versionId); + } + if (message.code !== "") { + writer.uint32(26).string(message.code); + } + if (message.msg !== "") { + writer.uint32(34).string(message.msg); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteObjectError { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteObjectError } as DeleteObjectError; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.versionId = reader.string(); + break; + case 3: + message.code = reader.string(); + break; + case 4: + message.msg = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteObjectError { + const message = { ...baseDeleteObjectError } as DeleteObjectError; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.versionId = + object.versionId !== undefined && object.versionId !== null + ? String(object.versionId) + : ""; + message.code = + object.code !== undefined && object.code !== null + ? String(object.code) + : ""; + message.msg = + object.msg !== undefined && object.msg !== null ? String(object.msg) : ""; + return message; + }, + + toJSON(message: DeleteObjectError): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.versionId !== undefined && (obj.versionId = message.versionId); + message.code !== undefined && (obj.code = message.code); + message.msg !== undefined && (obj.msg = message.msg); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteObjectError { + const message = { ...baseDeleteObjectError } as DeleteObjectError; + message.key = object.key ?? ""; + message.versionId = object.versionId ?? ""; + message.code = object.code ?? ""; + message.msg = object.msg ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteObjectError.$type, DeleteObjectError); + +const baseS3APIDeleteObjectsResponse: object = { + $type: "yandex.cloud.storage.v1.S3APIDeleteObjectsResponse", + requestId: "", +}; + +export const S3APIDeleteObjectsResponse = { + $type: "yandex.cloud.storage.v1.S3APIDeleteObjectsResponse" as const, + + encode( + message: S3APIDeleteObjectsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.deleted) { + SuccessfullyDeletedObject.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.errors) { + DeleteObjectError.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.requestId !== "") { + writer.uint32(26).string(message.requestId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): S3APIDeleteObjectsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseS3APIDeleteObjectsResponse, + } as S3APIDeleteObjectsResponse; + message.deleted = []; + message.errors = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deleted.push( + SuccessfullyDeletedObject.decode(reader, reader.uint32()) + ); + break; + case 2: + message.errors.push( + DeleteObjectError.decode(reader, reader.uint32()) + ); + break; + case 3: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3APIDeleteObjectsResponse { + const message = { + ...baseS3APIDeleteObjectsResponse, + } as S3APIDeleteObjectsResponse; + message.deleted = (object.deleted ?? []).map((e: any) => + SuccessfullyDeletedObject.fromJSON(e) + ); + message.errors = (object.errors ?? []).map((e: any) => + DeleteObjectError.fromJSON(e) + ); + message.requestId = + object.requestId !== undefined && object.requestId !== null + ? String(object.requestId) + : ""; + return message; + }, + + toJSON(message: S3APIDeleteObjectsResponse): unknown { + const obj: any = {}; + if (message.deleted) { + obj.deleted = message.deleted.map((e) => + e ? SuccessfullyDeletedObject.toJSON(e) : undefined + ); + } else { + obj.deleted = []; + } + if (message.errors) { + obj.errors = message.errors.map((e) => + e ? DeleteObjectError.toJSON(e) : undefined + ); + } else { + obj.errors = []; + } + message.requestId !== undefined && (obj.requestId = message.requestId); + return obj; + }, + + fromPartial, I>>( + object: I + ): S3APIDeleteObjectsResponse { + const message = { + ...baseS3APIDeleteObjectsResponse, + } as S3APIDeleteObjectsResponse; + message.deleted = + object.deleted?.map((e) => SuccessfullyDeletedObject.fromPartial(e)) || + []; + message.errors = + object.errors?.map((e) => DeleteObjectError.fromPartial(e)) || []; + message.requestId = object.requestId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + S3APIDeleteObjectsResponse.$type, + S3APIDeleteObjectsResponse +); + +const baseS3APIPutObjectRetentionResponse: object = { + $type: "yandex.cloud.storage.v1.S3APIPutObjectRetentionResponse", + requestId: "", +}; + +export const S3APIPutObjectRetentionResponse = { + $type: "yandex.cloud.storage.v1.S3APIPutObjectRetentionResponse" as const, + + encode( + message: S3APIPutObjectRetentionResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.requestId !== "") { + writer.uint32(10).string(message.requestId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): S3APIPutObjectRetentionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseS3APIPutObjectRetentionResponse, + } as S3APIPutObjectRetentionResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3APIPutObjectRetentionResponse { + const message = { + ...baseS3APIPutObjectRetentionResponse, + } as S3APIPutObjectRetentionResponse; + message.requestId = + object.requestId !== undefined && object.requestId !== null + ? String(object.requestId) + : ""; + return message; + }, + + toJSON(message: S3APIPutObjectRetentionResponse): unknown { + const obj: any = {}; + message.requestId !== undefined && (obj.requestId = message.requestId); + return obj; + }, + + fromPartial, I>>( + object: I + ): S3APIPutObjectRetentionResponse { + const message = { + ...baseS3APIPutObjectRetentionResponse, + } as S3APIPutObjectRetentionResponse; + message.requestId = object.requestId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + S3APIPutObjectRetentionResponse.$type, + S3APIPutObjectRetentionResponse +); + +const baseObjectLockRetention: object = { + $type: "yandex.cloud.storage.v1.ObjectLockRetention", + mode: "", +}; + +export const ObjectLockRetention = { + $type: "yandex.cloud.storage.v1.ObjectLockRetention" as const, + + encode( + message: ObjectLockRetention, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.mode !== "") { + writer.uint32(10).string(message.mode); + } + if (message.retainUntilDate !== undefined) { + Timestamp.encode( + toTimestamp(message.retainUntilDate), + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ObjectLockRetention { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseObjectLockRetention } as ObjectLockRetention; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.string(); + break; + case 2: + message.retainUntilDate = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ObjectLockRetention { + const message = { ...baseObjectLockRetention } as ObjectLockRetention; + message.mode = + object.mode !== undefined && object.mode !== null + ? String(object.mode) + : ""; + message.retainUntilDate = + object.retainUntilDate !== undefined && object.retainUntilDate !== null + ? fromJsonTimestamp(object.retainUntilDate) + : undefined; + return message; + }, + + toJSON(message: ObjectLockRetention): unknown { + const obj: any = {}; + message.mode !== undefined && (obj.mode = message.mode); + message.retainUntilDate !== undefined && + (obj.retainUntilDate = message.retainUntilDate.toISOString()); + return obj; + }, + + fromPartial, I>>( + object: I + ): ObjectLockRetention { + const message = { ...baseObjectLockRetention } as ObjectLockRetention; + message.mode = object.mode ?? ""; + message.retainUntilDate = object.retainUntilDate ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(ObjectLockRetention.$type, ObjectLockRetention); + +const baseS3APIGetObjectRetentionResponse: object = { + $type: "yandex.cloud.storage.v1.S3APIGetObjectRetentionResponse", + requestId: "", +}; + +export const S3APIGetObjectRetentionResponse = { + $type: "yandex.cloud.storage.v1.S3APIGetObjectRetentionResponse" as const, + + encode( + message: S3APIGetObjectRetentionResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.requestId !== "") { + writer.uint32(10).string(message.requestId); + } + if (message.retention !== undefined) { + ObjectLockRetention.encode( + message.retention, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): S3APIGetObjectRetentionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseS3APIGetObjectRetentionResponse, + } as S3APIGetObjectRetentionResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requestId = reader.string(); + break; + case 2: + message.retention = ObjectLockRetention.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3APIGetObjectRetentionResponse { + const message = { + ...baseS3APIGetObjectRetentionResponse, + } as S3APIGetObjectRetentionResponse; + message.requestId = + object.requestId !== undefined && object.requestId !== null + ? String(object.requestId) + : ""; + message.retention = + object.retention !== undefined && object.retention !== null + ? ObjectLockRetention.fromJSON(object.retention) + : undefined; + return message; + }, + + toJSON(message: S3APIGetObjectRetentionResponse): unknown { + const obj: any = {}; + message.requestId !== undefined && (obj.requestId = message.requestId); + message.retention !== undefined && + (obj.retention = message.retention + ? ObjectLockRetention.toJSON(message.retention) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): S3APIGetObjectRetentionResponse { + const message = { + ...baseS3APIGetObjectRetentionResponse, + } as S3APIGetObjectRetentionResponse; + message.requestId = object.requestId ?? ""; + message.retention = + object.retention !== undefined && object.retention !== null + ? ObjectLockRetention.fromPartial(object.retention) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + S3APIGetObjectRetentionResponse.$type, + S3APIGetObjectRetentionResponse +); + +const baseS3APIPutObjectLegalHoldResponse: object = { + $type: "yandex.cloud.storage.v1.S3APIPutObjectLegalHoldResponse", + requestId: "", +}; + +export const S3APIPutObjectLegalHoldResponse = { + $type: "yandex.cloud.storage.v1.S3APIPutObjectLegalHoldResponse" as const, + + encode( + message: S3APIPutObjectLegalHoldResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.requestId !== "") { + writer.uint32(10).string(message.requestId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): S3APIPutObjectLegalHoldResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseS3APIPutObjectLegalHoldResponse, + } as S3APIPutObjectLegalHoldResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3APIPutObjectLegalHoldResponse { + const message = { + ...baseS3APIPutObjectLegalHoldResponse, + } as S3APIPutObjectLegalHoldResponse; + message.requestId = + object.requestId !== undefined && object.requestId !== null + ? String(object.requestId) + : ""; + return message; + }, + + toJSON(message: S3APIPutObjectLegalHoldResponse): unknown { + const obj: any = {}; + message.requestId !== undefined && (obj.requestId = message.requestId); + return obj; + }, + + fromPartial, I>>( + object: I + ): S3APIPutObjectLegalHoldResponse { + const message = { + ...baseS3APIPutObjectLegalHoldResponse, + } as S3APIPutObjectLegalHoldResponse; + message.requestId = object.requestId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + S3APIPutObjectLegalHoldResponse.$type, + S3APIPutObjectLegalHoldResponse +); + +const baseObjectLockLegalHold: object = { + $type: "yandex.cloud.storage.v1.ObjectLockLegalHold", + status: "", +}; + +export const ObjectLockLegalHold = { + $type: "yandex.cloud.storage.v1.ObjectLockLegalHold" as const, + + encode( + message: ObjectLockLegalHold, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ObjectLockLegalHold { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseObjectLockLegalHold } as ObjectLockLegalHold; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ObjectLockLegalHold { + const message = { ...baseObjectLockLegalHold } as ObjectLockLegalHold; + message.status = + object.status !== undefined && object.status !== null + ? String(object.status) + : ""; + return message; + }, + + toJSON(message: ObjectLockLegalHold): unknown { + const obj: any = {}; + message.status !== undefined && (obj.status = message.status); + return obj; + }, + + fromPartial, I>>( + object: I + ): ObjectLockLegalHold { + const message = { ...baseObjectLockLegalHold } as ObjectLockLegalHold; + message.status = object.status ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ObjectLockLegalHold.$type, ObjectLockLegalHold); + +const baseS3APIGetObjectLegalHoldResponse: object = { + $type: "yandex.cloud.storage.v1.S3APIGetObjectLegalHoldResponse", + requestId: "", +}; + +export const S3APIGetObjectLegalHoldResponse = { + $type: "yandex.cloud.storage.v1.S3APIGetObjectLegalHoldResponse" as const, + + encode( + message: S3APIGetObjectLegalHoldResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.requestId !== "") { + writer.uint32(10).string(message.requestId); + } + if (message.legalHold !== undefined) { + ObjectLockLegalHold.encode( + message.legalHold, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): S3APIGetObjectLegalHoldResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseS3APIGetObjectLegalHoldResponse, + } as S3APIGetObjectLegalHoldResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requestId = reader.string(); + break; + case 2: + message.legalHold = ObjectLockLegalHold.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3APIGetObjectLegalHoldResponse { + const message = { + ...baseS3APIGetObjectLegalHoldResponse, + } as S3APIGetObjectLegalHoldResponse; + message.requestId = + object.requestId !== undefined && object.requestId !== null + ? String(object.requestId) + : ""; + message.legalHold = + object.legalHold !== undefined && object.legalHold !== null + ? ObjectLockLegalHold.fromJSON(object.legalHold) + : undefined; + return message; + }, + + toJSON(message: S3APIGetObjectLegalHoldResponse): unknown { + const obj: any = {}; + message.requestId !== undefined && (obj.requestId = message.requestId); + message.legalHold !== undefined && + (obj.legalHold = message.legalHold + ? ObjectLockLegalHold.toJSON(message.legalHold) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): S3APIGetObjectLegalHoldResponse { + const message = { + ...baseS3APIGetObjectLegalHoldResponse, + } as S3APIGetObjectLegalHoldResponse; + message.requestId = object.requestId ?? ""; + message.legalHold = + object.legalHold !== undefined && object.legalHold !== null + ? ObjectLockLegalHold.fromPartial(object.legalHold) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + S3APIGetObjectLegalHoldResponse.$type, + S3APIGetObjectLegalHoldResponse +); + +const baseS3APIPutObjectTaggingResponse: object = { + $type: "yandex.cloud.storage.v1.S3APIPutObjectTaggingResponse", + requestId: "", + versionId: "", +}; + +export const S3APIPutObjectTaggingResponse = { + $type: "yandex.cloud.storage.v1.S3APIPutObjectTaggingResponse" as const, + + encode( + message: S3APIPutObjectTaggingResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.requestId !== "") { + writer.uint32(10).string(message.requestId); + } + if (message.versionId !== "") { + writer.uint32(18).string(message.versionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): S3APIPutObjectTaggingResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseS3APIPutObjectTaggingResponse, + } as S3APIPutObjectTaggingResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requestId = reader.string(); + break; + case 2: + message.versionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3APIPutObjectTaggingResponse { + const message = { + ...baseS3APIPutObjectTaggingResponse, + } as S3APIPutObjectTaggingResponse; + message.requestId = + object.requestId !== undefined && object.requestId !== null + ? String(object.requestId) + : ""; + message.versionId = + object.versionId !== undefined && object.versionId !== null + ? String(object.versionId) + : ""; + return message; + }, + + toJSON(message: S3APIPutObjectTaggingResponse): unknown { + const obj: any = {}; + message.requestId !== undefined && (obj.requestId = message.requestId); + message.versionId !== undefined && (obj.versionId = message.versionId); + return obj; + }, + + fromPartial, I>>( + object: I + ): S3APIPutObjectTaggingResponse { + const message = { + ...baseS3APIPutObjectTaggingResponse, + } as S3APIPutObjectTaggingResponse; + message.requestId = object.requestId ?? ""; + message.versionId = object.versionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + S3APIPutObjectTaggingResponse.$type, + S3APIPutObjectTaggingResponse +); + +const baseObjectTag: object = { + $type: "yandex.cloud.storage.v1.ObjectTag", + key: "", + value: "", +}; + +export const ObjectTag = { + $type: "yandex.cloud.storage.v1.ObjectTag" as const, + + encode( + message: ObjectTag, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ObjectTag { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseObjectTag } as ObjectTag; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ObjectTag { + const message = { ...baseObjectTag } as ObjectTag; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: ObjectTag): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): ObjectTag { + const message = { ...baseObjectTag } as ObjectTag; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ObjectTag.$type, ObjectTag); + +const baseS3APIGetObjectTaggingResponse: object = { + $type: "yandex.cloud.storage.v1.S3APIGetObjectTaggingResponse", + requestId: "", + versionId: "", +}; + +export const S3APIGetObjectTaggingResponse = { + $type: "yandex.cloud.storage.v1.S3APIGetObjectTaggingResponse" as const, + + encode( + message: S3APIGetObjectTaggingResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.requestId !== "") { + writer.uint32(10).string(message.requestId); + } + if (message.versionId !== "") { + writer.uint32(18).string(message.versionId); + } + for (const v of message.tagSet) { + ObjectTag.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): S3APIGetObjectTaggingResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseS3APIGetObjectTaggingResponse, + } as S3APIGetObjectTaggingResponse; + message.tagSet = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requestId = reader.string(); + break; + case 2: + message.versionId = reader.string(); + break; + case 3: + message.tagSet.push(ObjectTag.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3APIGetObjectTaggingResponse { + const message = { + ...baseS3APIGetObjectTaggingResponse, + } as S3APIGetObjectTaggingResponse; + message.requestId = + object.requestId !== undefined && object.requestId !== null + ? String(object.requestId) + : ""; + message.versionId = + object.versionId !== undefined && object.versionId !== null + ? String(object.versionId) + : ""; + message.tagSet = (object.tagSet ?? []).map((e: any) => + ObjectTag.fromJSON(e) + ); + return message; + }, + + toJSON(message: S3APIGetObjectTaggingResponse): unknown { + const obj: any = {}; + message.requestId !== undefined && (obj.requestId = message.requestId); + message.versionId !== undefined && (obj.versionId = message.versionId); + if (message.tagSet) { + obj.tagSet = message.tagSet.map((e) => + e ? ObjectTag.toJSON(e) : undefined + ); + } else { + obj.tagSet = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): S3APIGetObjectTaggingResponse { + const message = { + ...baseS3APIGetObjectTaggingResponse, + } as S3APIGetObjectTaggingResponse; + message.requestId = object.requestId ?? ""; + message.versionId = object.versionId ?? ""; + message.tagSet = object.tagSet?.map((e) => ObjectTag.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + S3APIGetObjectTaggingResponse.$type, + S3APIGetObjectTaggingResponse +); + +const baseS3APIDeleteObjectTaggingResponse: object = { + $type: "yandex.cloud.storage.v1.S3APIDeleteObjectTaggingResponse", + requestId: "", + versionId: "", +}; + +export const S3APIDeleteObjectTaggingResponse = { + $type: "yandex.cloud.storage.v1.S3APIDeleteObjectTaggingResponse" as const, + + encode( + message: S3APIDeleteObjectTaggingResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.requestId !== "") { + writer.uint32(10).string(message.requestId); + } + if (message.versionId !== "") { + writer.uint32(18).string(message.versionId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): S3APIDeleteObjectTaggingResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseS3APIDeleteObjectTaggingResponse, + } as S3APIDeleteObjectTaggingResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.requestId = reader.string(); + break; + case 2: + message.versionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): S3APIDeleteObjectTaggingResponse { + const message = { + ...baseS3APIDeleteObjectTaggingResponse, + } as S3APIDeleteObjectTaggingResponse; + message.requestId = + object.requestId !== undefined && object.requestId !== null + ? String(object.requestId) + : ""; + message.versionId = + object.versionId !== undefined && object.versionId !== null + ? String(object.versionId) + : ""; + return message; + }, + + toJSON(message: S3APIDeleteObjectTaggingResponse): unknown { + const obj: any = {}; + message.requestId !== undefined && (obj.requestId = message.requestId); + message.versionId !== undefined && (obj.versionId = message.versionId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): S3APIDeleteObjectTaggingResponse { + const message = { + ...baseS3APIDeleteObjectTaggingResponse, + } as S3APIDeleteObjectTaggingResponse; + message.requestId = object.requestId ?? ""; + message.versionId = object.versionId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + S3APIDeleteObjectTaggingResponse.$type, + S3APIDeleteObjectTaggingResponse +); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/video/index.ts b/src/generated/yandex/cloud/video/index.ts new file mode 100644 index 00000000..96596092 --- /dev/null +++ b/src/generated/yandex/cloud/video/index.ts @@ -0,0 +1,13 @@ +export * as v1_channel from './v1/channel' +export * as v1_channel_service from './v1/channel_service' +export * as v1_episode from './v1/episode' +export * as v1_episode_service from './v1/episode_service' +export * as v1_manifest from './v1/manifest' +export * as v1_stream from './v1/stream' +export * as v1_stream_line from './v1/stream_line' +export * as v1_stream_line_service from './v1/stream_line_service' +export * as v1_stream_service from './v1/stream_service' +export * as v1_thumbnail from './v1/thumbnail' +export * as v1_thumbnail_service from './v1/thumbnail_service' +export * as v1_video from './v1/video' +export * as v1_video_service from './v1/video_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/video/v1/channel.ts b/src/generated/yandex/cloud/video/v1/channel.ts new file mode 100644 index 00000000..5abdb7d8 --- /dev/null +++ b/src/generated/yandex/cloud/video/v1/channel.ts @@ -0,0 +1,331 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.video.v1"; + +/** Root entity for content separation. */ +export interface Channel { + $type: "yandex.cloud.video.v1.Channel"; + /** ID of the channel. */ + id: string; + /** ID of the organization where channel should be created. */ + organizationId: string; + /** Channel title. */ + title: string; + /** Channel description. */ + description: string; + /** Time when channel was created. */ + createdAt?: Date; + /** Time of last channel update. */ + updatedAt?: Date; + /** Custom labels as `` key:value `` pairs. Maximum 64 per resource. */ + labels: { [key: string]: string }; +} + +export interface Channel_LabelsEntry { + $type: "yandex.cloud.video.v1.Channel.LabelsEntry"; + key: string; + value: string; +} + +const baseChannel: object = { + $type: "yandex.cloud.video.v1.Channel", + id: "", + organizationId: "", + title: "", + description: "", +}; + +export const Channel = { + $type: "yandex.cloud.video.v1.Channel" as const, + + encode( + message: Channel, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.organizationId !== "") { + writer.uint32(18).string(message.organizationId); + } + if (message.title !== "") { + writer.uint32(26).string(message.title); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(802).fork() + ).ldelim(); + } + if (message.updatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.updatedAt), + writer.uint32(810).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + Channel_LabelsEntry.encode( + { + $type: "yandex.cloud.video.v1.Channel.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(1602).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Channel { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseChannel } as Channel; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.organizationId = reader.string(); + break; + case 3: + message.title = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 100: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 101: + message.updatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 200: + const entry200 = Channel_LabelsEntry.decode(reader, reader.uint32()); + if (entry200.value !== undefined) { + message.labels[entry200.key] = entry200.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Channel { + const message = { ...baseChannel } as Channel; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.updatedAt = + object.updatedAt !== undefined && object.updatedAt !== null + ? fromJsonTimestamp(object.updatedAt) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: Channel): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.updatedAt !== undefined && + (obj.updatedAt = message.updatedAt.toISOString()); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>(object: I): Channel { + const message = { ...baseChannel } as Channel; + message.id = object.id ?? ""; + message.organizationId = object.organizationId ?? ""; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.updatedAt = object.updatedAt ?? undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(Channel.$type, Channel); + +const baseChannel_LabelsEntry: object = { + $type: "yandex.cloud.video.v1.Channel.LabelsEntry", + key: "", + value: "", +}; + +export const Channel_LabelsEntry = { + $type: "yandex.cloud.video.v1.Channel.LabelsEntry" as const, + + encode( + message: Channel_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Channel_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseChannel_LabelsEntry } as Channel_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Channel_LabelsEntry { + const message = { ...baseChannel_LabelsEntry } as Channel_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Channel_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Channel_LabelsEntry { + const message = { ...baseChannel_LabelsEntry } as Channel_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Channel_LabelsEntry.$type, Channel_LabelsEntry); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/video/v1/channel_service.ts b/src/generated/yandex/cloud/video/v1/channel_service.ts new file mode 100644 index 00000000..d6cd1152 --- /dev/null +++ b/src/generated/yandex/cloud/video/v1/channel_service.ts @@ -0,0 +1,1331 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { Channel } from "../../../../yandex/cloud/video/v1/channel"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.video.v1"; + +export interface GetChannelRequest { + $type: "yandex.cloud.video.v1.GetChannelRequest"; + /** ID of the channel. */ + channelId: string; +} + +export interface ListChannelsRequest { + $type: "yandex.cloud.video.v1.ListChannelsRequest"; + /** ID of the organization. */ + organizationId: string; + /** The maximum number of the results per page to return. Default value: 100. */ + pageSize: number; + /** Page token for getting the next page of the result. */ + pageToken: string; + /** + * By which column the listing should be ordered and in which direction, + * format is "createdAt desc". "id asc" if omitted. + * Possible fields: ["id", "createdAt", "updatedAt"] + * Both snake_case and camelCase are supported for fields. + */ + orderBy: string; + /** + * Filter expression that filters resources listed in the response. + * Expressions are composed of terms connected by logic operators. + * Value in quotes: `'` or `"` + * Example: "key1='value' AND key2='value'" + * Supported operators: ["AND"]. + * Supported fields: ["title"] + * Both snake_case and camelCase are supported for fields. + */ + filter: string; +} + +export interface ListChannelsResponse { + $type: "yandex.cloud.video.v1.ListChannelsResponse"; + /** List of channels for specific organization. */ + channels: Channel[]; + /** Token for getting the next page. */ + nextPageToken: string; +} + +export interface CreateChannelRequest { + $type: "yandex.cloud.video.v1.CreateChannelRequest"; + /** ID of the organization. */ + organizationId: string; + /** Channel title. */ + title: string; + /** Channel description. */ + description: string; + /** Custom labels as `` key:value `` pairs. Maximum 64 per resource. */ + labels: { [key: string]: string }; +} + +export interface CreateChannelRequest_LabelsEntry { + $type: "yandex.cloud.video.v1.CreateChannelRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface CreateChannelMetadata { + $type: "yandex.cloud.video.v1.CreateChannelMetadata"; + /** ID of the channel. */ + channelId: string; +} + +export interface UpdateChannelRequest { + $type: "yandex.cloud.video.v1.UpdateChannelRequest"; + /** ID of the channel. */ + channelId: string; + /** Field mask that specifies which fields of the channel are going to be updated. */ + fieldMask?: FieldMask; + /** Channel title. */ + title: string; + /** Channel description. */ + description: string; + /** Custom labels as `` key:value `` pairs. Maximum 64 per resource. */ + labels: { [key: string]: string }; +} + +export interface UpdateChannelRequest_LabelsEntry { + $type: "yandex.cloud.video.v1.UpdateChannelRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateChannelMetadata { + $type: "yandex.cloud.video.v1.UpdateChannelMetadata"; + /** ID of the channel. */ + channelId: string; +} + +export interface DeleteChannelRequest { + $type: "yandex.cloud.video.v1.DeleteChannelRequest"; + /** ID of the channel. */ + channelId: string; +} + +export interface DeleteChannelMetadata { + $type: "yandex.cloud.video.v1.DeleteChannelMetadata"; + /** ID of the channel. */ + channelId: string; +} + +const baseGetChannelRequest: object = { + $type: "yandex.cloud.video.v1.GetChannelRequest", + channelId: "", +}; + +export const GetChannelRequest = { + $type: "yandex.cloud.video.v1.GetChannelRequest" as const, + + encode( + message: GetChannelRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetChannelRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetChannelRequest } as GetChannelRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetChannelRequest { + const message = { ...baseGetChannelRequest } as GetChannelRequest; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + return message; + }, + + toJSON(message: GetChannelRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetChannelRequest { + const message = { ...baseGetChannelRequest } as GetChannelRequest; + message.channelId = object.channelId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetChannelRequest.$type, GetChannelRequest); + +const baseListChannelsRequest: object = { + $type: "yandex.cloud.video.v1.ListChannelsRequest", + organizationId: "", + pageSize: 0, + pageToken: "", + orderBy: "", + filter: "", +}; + +export const ListChannelsRequest = { + $type: "yandex.cloud.video.v1.ListChannelsRequest" as const, + + encode( + message: ListChannelsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.organizationId !== "") { + writer.uint32(10).string(message.organizationId); + } + if (message.pageSize !== 0) { + writer.uint32(800).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(810).string(message.pageToken); + } + if (message.orderBy !== "") { + writer.uint32(818).string(message.orderBy); + } + if (message.filter !== "") { + writer.uint32(826).string(message.filter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListChannelsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListChannelsRequest } as ListChannelsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationId = reader.string(); + break; + case 100: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 101: + message.pageToken = reader.string(); + break; + case 102: + message.orderBy = reader.string(); + break; + case 103: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListChannelsRequest { + const message = { ...baseListChannelsRequest } as ListChannelsRequest; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.orderBy = + object.orderBy !== undefined && object.orderBy !== null + ? String(object.orderBy) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListChannelsRequest): unknown { + const obj: any = {}; + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.orderBy !== undefined && (obj.orderBy = message.orderBy); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListChannelsRequest { + const message = { ...baseListChannelsRequest } as ListChannelsRequest; + message.organizationId = object.organizationId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.orderBy = object.orderBy ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListChannelsRequest.$type, ListChannelsRequest); + +const baseListChannelsResponse: object = { + $type: "yandex.cloud.video.v1.ListChannelsResponse", + nextPageToken: "", +}; + +export const ListChannelsResponse = { + $type: "yandex.cloud.video.v1.ListChannelsResponse" as const, + + encode( + message: ListChannelsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.channels) { + Channel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(802).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListChannelsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListChannelsResponse } as ListChannelsResponse; + message.channels = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channels.push(Channel.decode(reader, reader.uint32())); + break; + case 100: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListChannelsResponse { + const message = { ...baseListChannelsResponse } as ListChannelsResponse; + message.channels = (object.channels ?? []).map((e: any) => + Channel.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListChannelsResponse): unknown { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map((e) => + e ? Channel.toJSON(e) : undefined + ); + } else { + obj.channels = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListChannelsResponse { + const message = { ...baseListChannelsResponse } as ListChannelsResponse; + message.channels = + object.channels?.map((e) => Channel.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListChannelsResponse.$type, ListChannelsResponse); + +const baseCreateChannelRequest: object = { + $type: "yandex.cloud.video.v1.CreateChannelRequest", + organizationId: "", + title: "", + description: "", +}; + +export const CreateChannelRequest = { + $type: "yandex.cloud.video.v1.CreateChannelRequest" as const, + + encode( + message: CreateChannelRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.organizationId !== "") { + writer.uint32(10).string(message.organizationId); + } + if (message.title !== "") { + writer.uint32(18).string(message.title); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateChannelRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.video.v1.CreateChannelRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(1602).fork() + ).ldelim(); + }); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateChannelRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateChannelRequest } as CreateChannelRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationId = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 200: + const entry200 = CreateChannelRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry200.value !== undefined) { + message.labels[entry200.key] = entry200.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateChannelRequest { + const message = { ...baseCreateChannelRequest } as CreateChannelRequest; + message.organizationId = + object.organizationId !== undefined && object.organizationId !== null + ? String(object.organizationId) + : ""; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: CreateChannelRequest): unknown { + const obj: any = {}; + message.organizationId !== undefined && + (obj.organizationId = message.organizationId); + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateChannelRequest { + const message = { ...baseCreateChannelRequest } as CreateChannelRequest; + message.organizationId = object.organizationId ?? ""; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(CreateChannelRequest.$type, CreateChannelRequest); + +const baseCreateChannelRequest_LabelsEntry: object = { + $type: "yandex.cloud.video.v1.CreateChannelRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateChannelRequest_LabelsEntry = { + $type: "yandex.cloud.video.v1.CreateChannelRequest.LabelsEntry" as const, + + encode( + message: CreateChannelRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateChannelRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateChannelRequest_LabelsEntry, + } as CreateChannelRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateChannelRequest_LabelsEntry { + const message = { + ...baseCreateChannelRequest_LabelsEntry, + } as CreateChannelRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateChannelRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateChannelRequest_LabelsEntry { + const message = { + ...baseCreateChannelRequest_LabelsEntry, + } as CreateChannelRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateChannelRequest_LabelsEntry.$type, + CreateChannelRequest_LabelsEntry +); + +const baseCreateChannelMetadata: object = { + $type: "yandex.cloud.video.v1.CreateChannelMetadata", + channelId: "", +}; + +export const CreateChannelMetadata = { + $type: "yandex.cloud.video.v1.CreateChannelMetadata" as const, + + encode( + message: CreateChannelMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateChannelMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateChannelMetadata } as CreateChannelMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateChannelMetadata { + const message = { ...baseCreateChannelMetadata } as CreateChannelMetadata; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + return message; + }, + + toJSON(message: CreateChannelMetadata): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateChannelMetadata { + const message = { ...baseCreateChannelMetadata } as CreateChannelMetadata; + message.channelId = object.channelId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateChannelMetadata.$type, CreateChannelMetadata); + +const baseUpdateChannelRequest: object = { + $type: "yandex.cloud.video.v1.UpdateChannelRequest", + channelId: "", + title: "", + description: "", +}; + +export const UpdateChannelRequest = { + $type: "yandex.cloud.video.v1.UpdateChannelRequest" as const, + + encode( + message: UpdateChannelRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.fieldMask !== undefined) { + FieldMask.encode(message.fieldMask, writer.uint32(18).fork()).ldelim(); + } + if (message.title !== "") { + writer.uint32(26).string(message.title); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateChannelRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.video.v1.UpdateChannelRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(1602).fork() + ).ldelim(); + }); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateChannelRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateChannelRequest } as UpdateChannelRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.fieldMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.title = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 200: + const entry200 = UpdateChannelRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry200.value !== undefined) { + message.labels[entry200.key] = entry200.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateChannelRequest { + const message = { ...baseUpdateChannelRequest } as UpdateChannelRequest; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + message.fieldMask = + object.fieldMask !== undefined && object.fieldMask !== null + ? FieldMask.fromJSON(object.fieldMask) + : undefined; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: UpdateChannelRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.fieldMask !== undefined && + (obj.fieldMask = message.fieldMask + ? FieldMask.toJSON(message.fieldMask) + : undefined); + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateChannelRequest { + const message = { ...baseUpdateChannelRequest } as UpdateChannelRequest; + message.channelId = object.channelId ?? ""; + message.fieldMask = + object.fieldMask !== undefined && object.fieldMask !== null + ? FieldMask.fromPartial(object.fieldMask) + : undefined; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(UpdateChannelRequest.$type, UpdateChannelRequest); + +const baseUpdateChannelRequest_LabelsEntry: object = { + $type: "yandex.cloud.video.v1.UpdateChannelRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateChannelRequest_LabelsEntry = { + $type: "yandex.cloud.video.v1.UpdateChannelRequest.LabelsEntry" as const, + + encode( + message: UpdateChannelRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateChannelRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateChannelRequest_LabelsEntry, + } as UpdateChannelRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateChannelRequest_LabelsEntry { + const message = { + ...baseUpdateChannelRequest_LabelsEntry, + } as UpdateChannelRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateChannelRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateChannelRequest_LabelsEntry { + const message = { + ...baseUpdateChannelRequest_LabelsEntry, + } as UpdateChannelRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateChannelRequest_LabelsEntry.$type, + UpdateChannelRequest_LabelsEntry +); + +const baseUpdateChannelMetadata: object = { + $type: "yandex.cloud.video.v1.UpdateChannelMetadata", + channelId: "", +}; + +export const UpdateChannelMetadata = { + $type: "yandex.cloud.video.v1.UpdateChannelMetadata" as const, + + encode( + message: UpdateChannelMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateChannelMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateChannelMetadata } as UpdateChannelMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateChannelMetadata { + const message = { ...baseUpdateChannelMetadata } as UpdateChannelMetadata; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + return message; + }, + + toJSON(message: UpdateChannelMetadata): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateChannelMetadata { + const message = { ...baseUpdateChannelMetadata } as UpdateChannelMetadata; + message.channelId = object.channelId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateChannelMetadata.$type, UpdateChannelMetadata); + +const baseDeleteChannelRequest: object = { + $type: "yandex.cloud.video.v1.DeleteChannelRequest", + channelId: "", +}; + +export const DeleteChannelRequest = { + $type: "yandex.cloud.video.v1.DeleteChannelRequest" as const, + + encode( + message: DeleteChannelRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteChannelRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteChannelRequest } as DeleteChannelRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteChannelRequest { + const message = { ...baseDeleteChannelRequest } as DeleteChannelRequest; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + return message; + }, + + toJSON(message: DeleteChannelRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteChannelRequest { + const message = { ...baseDeleteChannelRequest } as DeleteChannelRequest; + message.channelId = object.channelId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteChannelRequest.$type, DeleteChannelRequest); + +const baseDeleteChannelMetadata: object = { + $type: "yandex.cloud.video.v1.DeleteChannelMetadata", + channelId: "", +}; + +export const DeleteChannelMetadata = { + $type: "yandex.cloud.video.v1.DeleteChannelMetadata" as const, + + encode( + message: DeleteChannelMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteChannelMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteChannelMetadata } as DeleteChannelMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteChannelMetadata { + const message = { ...baseDeleteChannelMetadata } as DeleteChannelMetadata; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + return message; + }, + + toJSON(message: DeleteChannelMetadata): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteChannelMetadata { + const message = { ...baseDeleteChannelMetadata } as DeleteChannelMetadata; + message.channelId = object.channelId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteChannelMetadata.$type, DeleteChannelMetadata); + +/** Channel management service. */ +export const ChannelServiceService = { + /** Returns the specific channel. */ + get: { + path: "/yandex.cloud.video.v1.ChannelService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetChannelRequest) => + Buffer.from(GetChannelRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetChannelRequest.decode(value), + responseSerialize: (value: Channel) => + Buffer.from(Channel.encode(value).finish()), + responseDeserialize: (value: Buffer) => Channel.decode(value), + }, + /** List channels for organization. */ + list: { + path: "/yandex.cloud.video.v1.ChannelService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListChannelsRequest) => + Buffer.from(ListChannelsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListChannelsRequest.decode(value), + responseSerialize: (value: ListChannelsResponse) => + Buffer.from(ListChannelsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListChannelsResponse.decode(value), + }, + /** Create channel. */ + create: { + path: "/yandex.cloud.video.v1.ChannelService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateChannelRequest) => + Buffer.from(CreateChannelRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateChannelRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Update channel. */ + update: { + path: "/yandex.cloud.video.v1.ChannelService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateChannelRequest) => + Buffer.from(UpdateChannelRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateChannelRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Delete channel. */ + delete: { + path: "/yandex.cloud.video.v1.ChannelService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteChannelRequest) => + Buffer.from(DeleteChannelRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteChannelRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface ChannelServiceServer extends UntypedServiceImplementation { + /** Returns the specific channel. */ + get: handleUnaryCall; + /** List channels for organization. */ + list: handleUnaryCall; + /** Create channel. */ + create: handleUnaryCall; + /** Update channel. */ + update: handleUnaryCall; + /** Delete channel. */ + delete: handleUnaryCall; +} + +export interface ChannelServiceClient extends Client { + /** Returns the specific channel. */ + get( + request: GetChannelRequest, + callback: (error: ServiceError | null, response: Channel) => void + ): ClientUnaryCall; + get( + request: GetChannelRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Channel) => void + ): ClientUnaryCall; + get( + request: GetChannelRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Channel) => void + ): ClientUnaryCall; + /** List channels for organization. */ + list( + request: ListChannelsRequest, + callback: ( + error: ServiceError | null, + response: ListChannelsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListChannelsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListChannelsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListChannelsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListChannelsResponse + ) => void + ): ClientUnaryCall; + /** Create channel. */ + create( + request: CreateChannelRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateChannelRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateChannelRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Update channel. */ + update( + request: UpdateChannelRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateChannelRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateChannelRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Delete channel. */ + delete( + request: DeleteChannelRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteChannelRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteChannelRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const ChannelServiceClient = makeGenericClientConstructor( + ChannelServiceService, + "yandex.cloud.video.v1.ChannelService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ChannelServiceClient; + service: typeof ChannelServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/video/v1/episode.ts b/src/generated/yandex/cloud/video/v1/episode.ts new file mode 100644 index 00000000..0c205472 --- /dev/null +++ b/src/generated/yandex/cloud/video/v1/episode.ts @@ -0,0 +1,563 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.video.v1"; + +export interface Episode { + $type: "yandex.cloud.video.v1.Episode"; + /** ID of the episode. */ + id: string; + /** ID of the stream. Optional, empty if the episode is linked to the line */ + streamId: string; + /** ID of the line. Optional, empty if the episode is linked to the stream */ + lineId: string; + /** Channel title. */ + title: string; + /** Channel description. */ + description: string; + /** ID of the thumbnail. */ + thumbnailId: string; + /** Episode start time. */ + startTime?: Date; + /** Episode finish time. */ + finishTime?: Date; + /** + * Enables episode DVR mode. DVR seconds determines how many last seconds of the stream are available. + * + * possible values: + * * `0`: infinite dvr size, the full length of the stream allowed to display + * * `>0`: size of dvr window in seconds, the minimum value is 30s + */ + dvrSeconds: number; + visibilityStatus: Episode_VisibilityStatus; + /** Episode is available to everyone. */ + publicAccess?: EpisodePublicAccessRights | undefined; + /** Checking access rights using the authorization system. */ + authSystemAccess?: EpisodeAuthSystemAccessRights | undefined; + /** Time when episode was created. */ + createdAt?: Date; + /** Time of last episode update. */ + updatedAt?: Date; +} + +export enum Episode_VisibilityStatus { + VISIBILITY_STATUS_UNSPECIFIED = 0, + PUBLISHED = 1, + UNPUBLISHED = 2, + UNRECOGNIZED = -1, +} + +export function episode_VisibilityStatusFromJSON( + object: any +): Episode_VisibilityStatus { + switch (object) { + case 0: + case "VISIBILITY_STATUS_UNSPECIFIED": + return Episode_VisibilityStatus.VISIBILITY_STATUS_UNSPECIFIED; + case 1: + case "PUBLISHED": + return Episode_VisibilityStatus.PUBLISHED; + case 2: + case "UNPUBLISHED": + return Episode_VisibilityStatus.UNPUBLISHED; + case -1: + case "UNRECOGNIZED": + default: + return Episode_VisibilityStatus.UNRECOGNIZED; + } +} + +export function episode_VisibilityStatusToJSON( + object: Episode_VisibilityStatus +): string { + switch (object) { + case Episode_VisibilityStatus.VISIBILITY_STATUS_UNSPECIFIED: + return "VISIBILITY_STATUS_UNSPECIFIED"; + case Episode_VisibilityStatus.PUBLISHED: + return "PUBLISHED"; + case Episode_VisibilityStatus.UNPUBLISHED: + return "UNPUBLISHED"; + default: + return "UNKNOWN"; + } +} + +export interface EpisodePublicAccessRights { + $type: "yandex.cloud.video.v1.EpisodePublicAccessRights"; +} + +export interface EpisodeAuthSystemAccessRights { + $type: "yandex.cloud.video.v1.EpisodeAuthSystemAccessRights"; +} + +const baseEpisode: object = { + $type: "yandex.cloud.video.v1.Episode", + id: "", + streamId: "", + lineId: "", + title: "", + description: "", + thumbnailId: "", + dvrSeconds: 0, + visibilityStatus: 0, +}; + +export const Episode = { + $type: "yandex.cloud.video.v1.Episode" as const, + + encode( + message: Episode, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.streamId !== "") { + writer.uint32(18).string(message.streamId); + } + if (message.lineId !== "") { + writer.uint32(26).string(message.lineId); + } + if (message.title !== "") { + writer.uint32(34).string(message.title); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + if (message.thumbnailId !== "") { + writer.uint32(50).string(message.thumbnailId); + } + if (message.startTime !== undefined) { + Timestamp.encode( + toTimestamp(message.startTime), + writer.uint32(58).fork() + ).ldelim(); + } + if (message.finishTime !== undefined) { + Timestamp.encode( + toTimestamp(message.finishTime), + writer.uint32(66).fork() + ).ldelim(); + } + if (message.dvrSeconds !== 0) { + writer.uint32(72).int64(message.dvrSeconds); + } + if (message.visibilityStatus !== 0) { + writer.uint32(80).int32(message.visibilityStatus); + } + if (message.publicAccess !== undefined) { + EpisodePublicAccessRights.encode( + message.publicAccess, + writer.uint32(8002).fork() + ).ldelim(); + } + if (message.authSystemAccess !== undefined) { + EpisodeAuthSystemAccessRights.encode( + message.authSystemAccess, + writer.uint32(8018).fork() + ).ldelim(); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(802).fork() + ).ldelim(); + } + if (message.updatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.updatedAt), + writer.uint32(810).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Episode { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEpisode } as Episode; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.streamId = reader.string(); + break; + case 3: + message.lineId = reader.string(); + break; + case 4: + message.title = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.thumbnailId = reader.string(); + break; + case 7: + message.startTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 8: + message.finishTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 9: + message.dvrSeconds = longToNumber(reader.int64() as Long); + break; + case 10: + message.visibilityStatus = reader.int32() as any; + break; + case 1000: + message.publicAccess = EpisodePublicAccessRights.decode( + reader, + reader.uint32() + ); + break; + case 1002: + message.authSystemAccess = EpisodeAuthSystemAccessRights.decode( + reader, + reader.uint32() + ); + break; + case 100: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 101: + message.updatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Episode { + const message = { ...baseEpisode } as Episode; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.streamId = + object.streamId !== undefined && object.streamId !== null + ? String(object.streamId) + : ""; + message.lineId = + object.lineId !== undefined && object.lineId !== null + ? String(object.lineId) + : ""; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + message.startTime = + object.startTime !== undefined && object.startTime !== null + ? fromJsonTimestamp(object.startTime) + : undefined; + message.finishTime = + object.finishTime !== undefined && object.finishTime !== null + ? fromJsonTimestamp(object.finishTime) + : undefined; + message.dvrSeconds = + object.dvrSeconds !== undefined && object.dvrSeconds !== null + ? Number(object.dvrSeconds) + : 0; + message.visibilityStatus = + object.visibilityStatus !== undefined && object.visibilityStatus !== null + ? episode_VisibilityStatusFromJSON(object.visibilityStatus) + : 0; + message.publicAccess = + object.publicAccess !== undefined && object.publicAccess !== null + ? EpisodePublicAccessRights.fromJSON(object.publicAccess) + : undefined; + message.authSystemAccess = + object.authSystemAccess !== undefined && object.authSystemAccess !== null + ? EpisodeAuthSystemAccessRights.fromJSON(object.authSystemAccess) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.updatedAt = + object.updatedAt !== undefined && object.updatedAt !== null + ? fromJsonTimestamp(object.updatedAt) + : undefined; + return message; + }, + + toJSON(message: Episode): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.streamId !== undefined && (obj.streamId = message.streamId); + message.lineId !== undefined && (obj.lineId = message.lineId); + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + message.startTime !== undefined && + (obj.startTime = message.startTime.toISOString()); + message.finishTime !== undefined && + (obj.finishTime = message.finishTime.toISOString()); + message.dvrSeconds !== undefined && + (obj.dvrSeconds = Math.round(message.dvrSeconds)); + message.visibilityStatus !== undefined && + (obj.visibilityStatus = episode_VisibilityStatusToJSON( + message.visibilityStatus + )); + message.publicAccess !== undefined && + (obj.publicAccess = message.publicAccess + ? EpisodePublicAccessRights.toJSON(message.publicAccess) + : undefined); + message.authSystemAccess !== undefined && + (obj.authSystemAccess = message.authSystemAccess + ? EpisodeAuthSystemAccessRights.toJSON(message.authSystemAccess) + : undefined); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.updatedAt !== undefined && + (obj.updatedAt = message.updatedAt.toISOString()); + return obj; + }, + + fromPartial, I>>(object: I): Episode { + const message = { ...baseEpisode } as Episode; + message.id = object.id ?? ""; + message.streamId = object.streamId ?? ""; + message.lineId = object.lineId ?? ""; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.thumbnailId = object.thumbnailId ?? ""; + message.startTime = object.startTime ?? undefined; + message.finishTime = object.finishTime ?? undefined; + message.dvrSeconds = object.dvrSeconds ?? 0; + message.visibilityStatus = object.visibilityStatus ?? 0; + message.publicAccess = + object.publicAccess !== undefined && object.publicAccess !== null + ? EpisodePublicAccessRights.fromPartial(object.publicAccess) + : undefined; + message.authSystemAccess = + object.authSystemAccess !== undefined && object.authSystemAccess !== null + ? EpisodeAuthSystemAccessRights.fromPartial(object.authSystemAccess) + : undefined; + message.createdAt = object.createdAt ?? undefined; + message.updatedAt = object.updatedAt ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Episode.$type, Episode); + +const baseEpisodePublicAccessRights: object = { + $type: "yandex.cloud.video.v1.EpisodePublicAccessRights", +}; + +export const EpisodePublicAccessRights = { + $type: "yandex.cloud.video.v1.EpisodePublicAccessRights" as const, + + encode( + _: EpisodePublicAccessRights, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): EpisodePublicAccessRights { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEpisodePublicAccessRights, + } as EpisodePublicAccessRights; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): EpisodePublicAccessRights { + const message = { + ...baseEpisodePublicAccessRights, + } as EpisodePublicAccessRights; + return message; + }, + + toJSON(_: EpisodePublicAccessRights): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): EpisodePublicAccessRights { + const message = { + ...baseEpisodePublicAccessRights, + } as EpisodePublicAccessRights; + return message; + }, +}; + +messageTypeRegistry.set( + EpisodePublicAccessRights.$type, + EpisodePublicAccessRights +); + +const baseEpisodeAuthSystemAccessRights: object = { + $type: "yandex.cloud.video.v1.EpisodeAuthSystemAccessRights", +}; + +export const EpisodeAuthSystemAccessRights = { + $type: "yandex.cloud.video.v1.EpisodeAuthSystemAccessRights" as const, + + encode( + _: EpisodeAuthSystemAccessRights, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): EpisodeAuthSystemAccessRights { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEpisodeAuthSystemAccessRights, + } as EpisodeAuthSystemAccessRights; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): EpisodeAuthSystemAccessRights { + const message = { + ...baseEpisodeAuthSystemAccessRights, + } as EpisodeAuthSystemAccessRights; + return message; + }, + + toJSON(_: EpisodeAuthSystemAccessRights): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): EpisodeAuthSystemAccessRights { + const message = { + ...baseEpisodeAuthSystemAccessRights, + } as EpisodeAuthSystemAccessRights; + return message; + }, +}; + +messageTypeRegistry.set( + EpisodeAuthSystemAccessRights.$type, + EpisodeAuthSystemAccessRights +); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/video/v1/episode_service.ts b/src/generated/yandex/cloud/video/v1/episode_service.ts new file mode 100644 index 00000000..5a8aa83d --- /dev/null +++ b/src/generated/yandex/cloud/video/v1/episode_service.ts @@ -0,0 +1,2403 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { Episode } from "../../../../yandex/cloud/video/v1/episode"; +import { Manifest } from "../../../../yandex/cloud/video/v1/manifest"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.video.v1"; + +export interface GetEpisodeRequest { + $type: "yandex.cloud.video.v1.GetEpisodeRequest"; + /** ID of the episode. */ + episodeId: string; +} + +export interface ListEpisodesRequest { + $type: "yandex.cloud.video.v1.ListEpisodesRequest"; + /** ID of the stream. */ + streamId: string | undefined; + /** ID of the line. */ + lineId: string | undefined; + /** The maximum number of the results per page to return. Default value: 100. */ + pageSize: number; + /** Page token for getting the next page of the result. */ + pageToken: string; + /** + * By which column the listing should be ordered and in which direction, + * format is "createdAt desc". "id asc" if omitted. + * Possible fields: ["id", "createdAt", "updatedAt"] + * Both snake_case and camelCase are supported for fields. + */ + orderBy: string; + /** + * Filter expression that filters resources listed in the response. + * Expressions are composed of terms connected by logic operators. + * Value in quotes: `'` or `"` + * Example: "key1='value' AND key2='value'" + * Supported operators: ["AND"]. + * Supported fields: ["title"] + * Both snake_case and camelCase are supported for fields. + */ + filter: string; +} + +export interface ListEpisodesResponse { + $type: "yandex.cloud.video.v1.ListEpisodesResponse"; + /** List of episodes for specific parent_id. */ + episodes: Episode[]; + /** Token for getting the next page. */ + nextPageToken: string; +} + +export interface CreateEpisodeRequest { + $type: "yandex.cloud.video.v1.CreateEpisodeRequest"; + /** ID of the stream. */ + streamId: string | undefined; + /** ID of the line. */ + lineId: string | undefined; + /** Episode title. */ + title: string; + /** Episode description. */ + description: string; + /** ID of the thumbnail. */ + thumbnailId: string; + /** Episode start time. */ + startTime?: Date; + /** Episode finish time. */ + finishTime?: Date; + /** + * Enables episode DVR mode. DVR seconds determines how many last seconds of the stream are available. + * + * possible values: + * * `0`: infinite dvr size, the full length of the stream allowed to display + * * `>0`: size of dvr window in seconds, the minimum value is 30s + */ + dvrSeconds: number; + /** Episode is available to everyone. */ + publicAccess?: EpisodePublicAccessParams | undefined; + /** Checking access rights using the authorization system. */ + authSystemAccess?: EpisodeAuthSystemAccessParams | undefined; +} + +export interface EpisodePublicAccessParams { + $type: "yandex.cloud.video.v1.EpisodePublicAccessParams"; +} + +export interface EpisodeAuthSystemAccessParams { + $type: "yandex.cloud.video.v1.EpisodeAuthSystemAccessParams"; +} + +export interface CreateEpisodeMetadata { + $type: "yandex.cloud.video.v1.CreateEpisodeMetadata"; + /** ID of the episode. */ + episodeId: string; +} + +export interface UpdateEpisodeRequest { + $type: "yandex.cloud.video.v1.UpdateEpisodeRequest"; + /** ID of the episode. */ + episodeId: string; + /** Field mask that specifies which fields of the episode are going to be updated. */ + fieldMask?: FieldMask; + /** Episode title. */ + title: string; + /** Episode description. */ + description: string; + /** ID of the thumbnail. */ + thumbnailId: string; + startTime?: Date; + /** Episode finish time. */ + finishTime?: Date; + /** + * Enables episode DVR mode. DVR seconds determines how many last seconds of the stream are available. + * + * possible values: + * * `0`: infinite dvr size, the full length of the stream allowed to display + * * `>0`: size of dvr window in seconds, the minimum value is 30s + */ + dvrSeconds: number; + /** Episode is available to everyone. */ + publicAccess?: EpisodePublicAccessParams | undefined; + /** Checking access rights using the authorization system. */ + authSystemAccess?: EpisodeAuthSystemAccessParams | undefined; +} + +export interface UpdateEpisodeMetadata { + $type: "yandex.cloud.video.v1.UpdateEpisodeMetadata"; + /** ID of the episode. */ + episodeId: string; +} + +export interface DeleteEpisodeRequest { + $type: "yandex.cloud.video.v1.DeleteEpisodeRequest"; + /** ID of the episode. */ + episodeId: string; +} + +export interface DeleteEpisodeMetadata { + $type: "yandex.cloud.video.v1.DeleteEpisodeMetadata"; + /** ID of the episode. */ + episodeId: string; +} + +export interface PerformEpisodeActionRequest { + $type: "yandex.cloud.video.v1.PerformEpisodeActionRequest"; + /** ID of the episode. */ + episodeId: string; + publish?: PublishEpisodeAction | undefined; + unpublish?: UnpublishEpisodeAction | undefined; +} + +export interface PublishEpisodeAction { + $type: "yandex.cloud.video.v1.PublishEpisodeAction"; +} + +export interface UnpublishEpisodeAction { + $type: "yandex.cloud.video.v1.UnpublishEpisodeAction"; +} + +export interface PerformEpisodeActionMetadata { + $type: "yandex.cloud.video.v1.PerformEpisodeActionMetadata"; + /** ID of the episode. */ + episodeId: string; +} + +export interface GetEpisodePlayerURLRequest { + $type: "yandex.cloud.video.v1.GetEpisodePlayerURLRequest"; + /** ID of the episode. */ + episodeId: string; + params?: EpisodePlayerParams; +} + +export interface EpisodePlayerParams { + $type: "yandex.cloud.video.v1.EpisodePlayerParams"; + /** If true, a player will be muted by default. */ + mute: boolean; + /** If true, playback will start automatically. */ + autoplay: boolean; + /** If true, a player interface will be hidden by default. */ + hidden: boolean; +} + +export interface GetEpisodePlayerURLResponse { + $type: "yandex.cloud.video.v1.GetEpisodePlayerURLResponse"; + /** Direct link to the video. */ + playerUrl: string; + /** HTML embed code in Iframe format. */ + html: string; +} + +export interface GetEpisodeManifestsRequest { + $type: "yandex.cloud.video.v1.GetEpisodeManifestsRequest"; + /** ID of the episode. */ + episodeId: string; +} + +export interface GetEpisodeManifestsResponse { + $type: "yandex.cloud.video.v1.GetEpisodeManifestsResponse"; + manifests: Manifest[]; +} + +const baseGetEpisodeRequest: object = { + $type: "yandex.cloud.video.v1.GetEpisodeRequest", + episodeId: "", +}; + +export const GetEpisodeRequest = { + $type: "yandex.cloud.video.v1.GetEpisodeRequest" as const, + + encode( + message: GetEpisodeRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.episodeId !== "") { + writer.uint32(10).string(message.episodeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetEpisodeRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetEpisodeRequest } as GetEpisodeRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.episodeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetEpisodeRequest { + const message = { ...baseGetEpisodeRequest } as GetEpisodeRequest; + message.episodeId = + object.episodeId !== undefined && object.episodeId !== null + ? String(object.episodeId) + : ""; + return message; + }, + + toJSON(message: GetEpisodeRequest): unknown { + const obj: any = {}; + message.episodeId !== undefined && (obj.episodeId = message.episodeId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetEpisodeRequest { + const message = { ...baseGetEpisodeRequest } as GetEpisodeRequest; + message.episodeId = object.episodeId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetEpisodeRequest.$type, GetEpisodeRequest); + +const baseListEpisodesRequest: object = { + $type: "yandex.cloud.video.v1.ListEpisodesRequest", + pageSize: 0, + pageToken: "", + orderBy: "", + filter: "", +}; + +export const ListEpisodesRequest = { + $type: "yandex.cloud.video.v1.ListEpisodesRequest" as const, + + encode( + message: ListEpisodesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamId !== undefined) { + writer.uint32(10).string(message.streamId); + } + if (message.lineId !== undefined) { + writer.uint32(18).string(message.lineId); + } + if (message.pageSize !== 0) { + writer.uint32(800).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(810).string(message.pageToken); + } + if (message.orderBy !== "") { + writer.uint32(818).string(message.orderBy); + } + if (message.filter !== "") { + writer.uint32(826).string(message.filter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListEpisodesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListEpisodesRequest } as ListEpisodesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamId = reader.string(); + break; + case 2: + message.lineId = reader.string(); + break; + case 100: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 101: + message.pageToken = reader.string(); + break; + case 102: + message.orderBy = reader.string(); + break; + case 103: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListEpisodesRequest { + const message = { ...baseListEpisodesRequest } as ListEpisodesRequest; + message.streamId = + object.streamId !== undefined && object.streamId !== null + ? String(object.streamId) + : undefined; + message.lineId = + object.lineId !== undefined && object.lineId !== null + ? String(object.lineId) + : undefined; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.orderBy = + object.orderBy !== undefined && object.orderBy !== null + ? String(object.orderBy) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListEpisodesRequest): unknown { + const obj: any = {}; + message.streamId !== undefined && (obj.streamId = message.streamId); + message.lineId !== undefined && (obj.lineId = message.lineId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.orderBy !== undefined && (obj.orderBy = message.orderBy); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListEpisodesRequest { + const message = { ...baseListEpisodesRequest } as ListEpisodesRequest; + message.streamId = object.streamId ?? undefined; + message.lineId = object.lineId ?? undefined; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.orderBy = object.orderBy ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListEpisodesRequest.$type, ListEpisodesRequest); + +const baseListEpisodesResponse: object = { + $type: "yandex.cloud.video.v1.ListEpisodesResponse", + nextPageToken: "", +}; + +export const ListEpisodesResponse = { + $type: "yandex.cloud.video.v1.ListEpisodesResponse" as const, + + encode( + message: ListEpisodesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.episodes) { + Episode.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(802).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListEpisodesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListEpisodesResponse } as ListEpisodesResponse; + message.episodes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.episodes.push(Episode.decode(reader, reader.uint32())); + break; + case 100: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListEpisodesResponse { + const message = { ...baseListEpisodesResponse } as ListEpisodesResponse; + message.episodes = (object.episodes ?? []).map((e: any) => + Episode.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListEpisodesResponse): unknown { + const obj: any = {}; + if (message.episodes) { + obj.episodes = message.episodes.map((e) => + e ? Episode.toJSON(e) : undefined + ); + } else { + obj.episodes = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListEpisodesResponse { + const message = { ...baseListEpisodesResponse } as ListEpisodesResponse; + message.episodes = + object.episodes?.map((e) => Episode.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListEpisodesResponse.$type, ListEpisodesResponse); + +const baseCreateEpisodeRequest: object = { + $type: "yandex.cloud.video.v1.CreateEpisodeRequest", + title: "", + description: "", + thumbnailId: "", + dvrSeconds: 0, +}; + +export const CreateEpisodeRequest = { + $type: "yandex.cloud.video.v1.CreateEpisodeRequest" as const, + + encode( + message: CreateEpisodeRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamId !== undefined) { + writer.uint32(802).string(message.streamId); + } + if (message.lineId !== undefined) { + writer.uint32(810).string(message.lineId); + } + if (message.title !== "") { + writer.uint32(18).string(message.title); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.thumbnailId !== "") { + writer.uint32(34).string(message.thumbnailId); + } + if (message.startTime !== undefined) { + Timestamp.encode( + toTimestamp(message.startTime), + writer.uint32(42).fork() + ).ldelim(); + } + if (message.finishTime !== undefined) { + Timestamp.encode( + toTimestamp(message.finishTime), + writer.uint32(50).fork() + ).ldelim(); + } + if (message.dvrSeconds !== 0) { + writer.uint32(56).int64(message.dvrSeconds); + } + if (message.publicAccess !== undefined) { + EpisodePublicAccessParams.encode( + message.publicAccess, + writer.uint32(8002).fork() + ).ldelim(); + } + if (message.authSystemAccess !== undefined) { + EpisodeAuthSystemAccessParams.encode( + message.authSystemAccess, + writer.uint32(8018).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateEpisodeRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateEpisodeRequest } as CreateEpisodeRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 100: + message.streamId = reader.string(); + break; + case 101: + message.lineId = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.thumbnailId = reader.string(); + break; + case 5: + message.startTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 6: + message.finishTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 7: + message.dvrSeconds = longToNumber(reader.int64() as Long); + break; + case 1000: + message.publicAccess = EpisodePublicAccessParams.decode( + reader, + reader.uint32() + ); + break; + case 1002: + message.authSystemAccess = EpisodeAuthSystemAccessParams.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateEpisodeRequest { + const message = { ...baseCreateEpisodeRequest } as CreateEpisodeRequest; + message.streamId = + object.streamId !== undefined && object.streamId !== null + ? String(object.streamId) + : undefined; + message.lineId = + object.lineId !== undefined && object.lineId !== null + ? String(object.lineId) + : undefined; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + message.startTime = + object.startTime !== undefined && object.startTime !== null + ? fromJsonTimestamp(object.startTime) + : undefined; + message.finishTime = + object.finishTime !== undefined && object.finishTime !== null + ? fromJsonTimestamp(object.finishTime) + : undefined; + message.dvrSeconds = + object.dvrSeconds !== undefined && object.dvrSeconds !== null + ? Number(object.dvrSeconds) + : 0; + message.publicAccess = + object.publicAccess !== undefined && object.publicAccess !== null + ? EpisodePublicAccessParams.fromJSON(object.publicAccess) + : undefined; + message.authSystemAccess = + object.authSystemAccess !== undefined && object.authSystemAccess !== null + ? EpisodeAuthSystemAccessParams.fromJSON(object.authSystemAccess) + : undefined; + return message; + }, + + toJSON(message: CreateEpisodeRequest): unknown { + const obj: any = {}; + message.streamId !== undefined && (obj.streamId = message.streamId); + message.lineId !== undefined && (obj.lineId = message.lineId); + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + message.startTime !== undefined && + (obj.startTime = message.startTime.toISOString()); + message.finishTime !== undefined && + (obj.finishTime = message.finishTime.toISOString()); + message.dvrSeconds !== undefined && + (obj.dvrSeconds = Math.round(message.dvrSeconds)); + message.publicAccess !== undefined && + (obj.publicAccess = message.publicAccess + ? EpisodePublicAccessParams.toJSON(message.publicAccess) + : undefined); + message.authSystemAccess !== undefined && + (obj.authSystemAccess = message.authSystemAccess + ? EpisodeAuthSystemAccessParams.toJSON(message.authSystemAccess) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateEpisodeRequest { + const message = { ...baseCreateEpisodeRequest } as CreateEpisodeRequest; + message.streamId = object.streamId ?? undefined; + message.lineId = object.lineId ?? undefined; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.thumbnailId = object.thumbnailId ?? ""; + message.startTime = object.startTime ?? undefined; + message.finishTime = object.finishTime ?? undefined; + message.dvrSeconds = object.dvrSeconds ?? 0; + message.publicAccess = + object.publicAccess !== undefined && object.publicAccess !== null + ? EpisodePublicAccessParams.fromPartial(object.publicAccess) + : undefined; + message.authSystemAccess = + object.authSystemAccess !== undefined && object.authSystemAccess !== null + ? EpisodeAuthSystemAccessParams.fromPartial(object.authSystemAccess) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CreateEpisodeRequest.$type, CreateEpisodeRequest); + +const baseEpisodePublicAccessParams: object = { + $type: "yandex.cloud.video.v1.EpisodePublicAccessParams", +}; + +export const EpisodePublicAccessParams = { + $type: "yandex.cloud.video.v1.EpisodePublicAccessParams" as const, + + encode( + _: EpisodePublicAccessParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): EpisodePublicAccessParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEpisodePublicAccessParams, + } as EpisodePublicAccessParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): EpisodePublicAccessParams { + const message = { + ...baseEpisodePublicAccessParams, + } as EpisodePublicAccessParams; + return message; + }, + + toJSON(_: EpisodePublicAccessParams): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): EpisodePublicAccessParams { + const message = { + ...baseEpisodePublicAccessParams, + } as EpisodePublicAccessParams; + return message; + }, +}; + +messageTypeRegistry.set( + EpisodePublicAccessParams.$type, + EpisodePublicAccessParams +); + +const baseEpisodeAuthSystemAccessParams: object = { + $type: "yandex.cloud.video.v1.EpisodeAuthSystemAccessParams", +}; + +export const EpisodeAuthSystemAccessParams = { + $type: "yandex.cloud.video.v1.EpisodeAuthSystemAccessParams" as const, + + encode( + _: EpisodeAuthSystemAccessParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): EpisodeAuthSystemAccessParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseEpisodeAuthSystemAccessParams, + } as EpisodeAuthSystemAccessParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): EpisodeAuthSystemAccessParams { + const message = { + ...baseEpisodeAuthSystemAccessParams, + } as EpisodeAuthSystemAccessParams; + return message; + }, + + toJSON(_: EpisodeAuthSystemAccessParams): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): EpisodeAuthSystemAccessParams { + const message = { + ...baseEpisodeAuthSystemAccessParams, + } as EpisodeAuthSystemAccessParams; + return message; + }, +}; + +messageTypeRegistry.set( + EpisodeAuthSystemAccessParams.$type, + EpisodeAuthSystemAccessParams +); + +const baseCreateEpisodeMetadata: object = { + $type: "yandex.cloud.video.v1.CreateEpisodeMetadata", + episodeId: "", +}; + +export const CreateEpisodeMetadata = { + $type: "yandex.cloud.video.v1.CreateEpisodeMetadata" as const, + + encode( + message: CreateEpisodeMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.episodeId !== "") { + writer.uint32(10).string(message.episodeId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateEpisodeMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateEpisodeMetadata } as CreateEpisodeMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.episodeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateEpisodeMetadata { + const message = { ...baseCreateEpisodeMetadata } as CreateEpisodeMetadata; + message.episodeId = + object.episodeId !== undefined && object.episodeId !== null + ? String(object.episodeId) + : ""; + return message; + }, + + toJSON(message: CreateEpisodeMetadata): unknown { + const obj: any = {}; + message.episodeId !== undefined && (obj.episodeId = message.episodeId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateEpisodeMetadata { + const message = { ...baseCreateEpisodeMetadata } as CreateEpisodeMetadata; + message.episodeId = object.episodeId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateEpisodeMetadata.$type, CreateEpisodeMetadata); + +const baseUpdateEpisodeRequest: object = { + $type: "yandex.cloud.video.v1.UpdateEpisodeRequest", + episodeId: "", + title: "", + description: "", + thumbnailId: "", + dvrSeconds: 0, +}; + +export const UpdateEpisodeRequest = { + $type: "yandex.cloud.video.v1.UpdateEpisodeRequest" as const, + + encode( + message: UpdateEpisodeRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.episodeId !== "") { + writer.uint32(10).string(message.episodeId); + } + if (message.fieldMask !== undefined) { + FieldMask.encode(message.fieldMask, writer.uint32(18).fork()).ldelim(); + } + if (message.title !== "") { + writer.uint32(26).string(message.title); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.thumbnailId !== "") { + writer.uint32(42).string(message.thumbnailId); + } + if (message.startTime !== undefined) { + Timestamp.encode( + toTimestamp(message.startTime), + writer.uint32(50).fork() + ).ldelim(); + } + if (message.finishTime !== undefined) { + Timestamp.encode( + toTimestamp(message.finishTime), + writer.uint32(58).fork() + ).ldelim(); + } + if (message.dvrSeconds !== 0) { + writer.uint32(64).int64(message.dvrSeconds); + } + if (message.publicAccess !== undefined) { + EpisodePublicAccessParams.encode( + message.publicAccess, + writer.uint32(8002).fork() + ).ldelim(); + } + if (message.authSystemAccess !== undefined) { + EpisodeAuthSystemAccessParams.encode( + message.authSystemAccess, + writer.uint32(8018).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateEpisodeRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateEpisodeRequest } as UpdateEpisodeRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.episodeId = reader.string(); + break; + case 2: + message.fieldMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.title = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.thumbnailId = reader.string(); + break; + case 6: + message.startTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 7: + message.finishTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 8: + message.dvrSeconds = longToNumber(reader.int64() as Long); + break; + case 1000: + message.publicAccess = EpisodePublicAccessParams.decode( + reader, + reader.uint32() + ); + break; + case 1002: + message.authSystemAccess = EpisodeAuthSystemAccessParams.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateEpisodeRequest { + const message = { ...baseUpdateEpisodeRequest } as UpdateEpisodeRequest; + message.episodeId = + object.episodeId !== undefined && object.episodeId !== null + ? String(object.episodeId) + : ""; + message.fieldMask = + object.fieldMask !== undefined && object.fieldMask !== null + ? FieldMask.fromJSON(object.fieldMask) + : undefined; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + message.startTime = + object.startTime !== undefined && object.startTime !== null + ? fromJsonTimestamp(object.startTime) + : undefined; + message.finishTime = + object.finishTime !== undefined && object.finishTime !== null + ? fromJsonTimestamp(object.finishTime) + : undefined; + message.dvrSeconds = + object.dvrSeconds !== undefined && object.dvrSeconds !== null + ? Number(object.dvrSeconds) + : 0; + message.publicAccess = + object.publicAccess !== undefined && object.publicAccess !== null + ? EpisodePublicAccessParams.fromJSON(object.publicAccess) + : undefined; + message.authSystemAccess = + object.authSystemAccess !== undefined && object.authSystemAccess !== null + ? EpisodeAuthSystemAccessParams.fromJSON(object.authSystemAccess) + : undefined; + return message; + }, + + toJSON(message: UpdateEpisodeRequest): unknown { + const obj: any = {}; + message.episodeId !== undefined && (obj.episodeId = message.episodeId); + message.fieldMask !== undefined && + (obj.fieldMask = message.fieldMask + ? FieldMask.toJSON(message.fieldMask) + : undefined); + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + message.startTime !== undefined && + (obj.startTime = message.startTime.toISOString()); + message.finishTime !== undefined && + (obj.finishTime = message.finishTime.toISOString()); + message.dvrSeconds !== undefined && + (obj.dvrSeconds = Math.round(message.dvrSeconds)); + message.publicAccess !== undefined && + (obj.publicAccess = message.publicAccess + ? EpisodePublicAccessParams.toJSON(message.publicAccess) + : undefined); + message.authSystemAccess !== undefined && + (obj.authSystemAccess = message.authSystemAccess + ? EpisodeAuthSystemAccessParams.toJSON(message.authSystemAccess) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateEpisodeRequest { + const message = { ...baseUpdateEpisodeRequest } as UpdateEpisodeRequest; + message.episodeId = object.episodeId ?? ""; + message.fieldMask = + object.fieldMask !== undefined && object.fieldMask !== null + ? FieldMask.fromPartial(object.fieldMask) + : undefined; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.thumbnailId = object.thumbnailId ?? ""; + message.startTime = object.startTime ?? undefined; + message.finishTime = object.finishTime ?? undefined; + message.dvrSeconds = object.dvrSeconds ?? 0; + message.publicAccess = + object.publicAccess !== undefined && object.publicAccess !== null + ? EpisodePublicAccessParams.fromPartial(object.publicAccess) + : undefined; + message.authSystemAccess = + object.authSystemAccess !== undefined && object.authSystemAccess !== null + ? EpisodeAuthSystemAccessParams.fromPartial(object.authSystemAccess) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UpdateEpisodeRequest.$type, UpdateEpisodeRequest); + +const baseUpdateEpisodeMetadata: object = { + $type: "yandex.cloud.video.v1.UpdateEpisodeMetadata", + episodeId: "", +}; + +export const UpdateEpisodeMetadata = { + $type: "yandex.cloud.video.v1.UpdateEpisodeMetadata" as const, + + encode( + message: UpdateEpisodeMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.episodeId !== "") { + writer.uint32(10).string(message.episodeId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateEpisodeMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateEpisodeMetadata } as UpdateEpisodeMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.episodeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateEpisodeMetadata { + const message = { ...baseUpdateEpisodeMetadata } as UpdateEpisodeMetadata; + message.episodeId = + object.episodeId !== undefined && object.episodeId !== null + ? String(object.episodeId) + : ""; + return message; + }, + + toJSON(message: UpdateEpisodeMetadata): unknown { + const obj: any = {}; + message.episodeId !== undefined && (obj.episodeId = message.episodeId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateEpisodeMetadata { + const message = { ...baseUpdateEpisodeMetadata } as UpdateEpisodeMetadata; + message.episodeId = object.episodeId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateEpisodeMetadata.$type, UpdateEpisodeMetadata); + +const baseDeleteEpisodeRequest: object = { + $type: "yandex.cloud.video.v1.DeleteEpisodeRequest", + episodeId: "", +}; + +export const DeleteEpisodeRequest = { + $type: "yandex.cloud.video.v1.DeleteEpisodeRequest" as const, + + encode( + message: DeleteEpisodeRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.episodeId !== "") { + writer.uint32(10).string(message.episodeId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteEpisodeRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteEpisodeRequest } as DeleteEpisodeRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.episodeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteEpisodeRequest { + const message = { ...baseDeleteEpisodeRequest } as DeleteEpisodeRequest; + message.episodeId = + object.episodeId !== undefined && object.episodeId !== null + ? String(object.episodeId) + : ""; + return message; + }, + + toJSON(message: DeleteEpisodeRequest): unknown { + const obj: any = {}; + message.episodeId !== undefined && (obj.episodeId = message.episodeId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteEpisodeRequest { + const message = { ...baseDeleteEpisodeRequest } as DeleteEpisodeRequest; + message.episodeId = object.episodeId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteEpisodeRequest.$type, DeleteEpisodeRequest); + +const baseDeleteEpisodeMetadata: object = { + $type: "yandex.cloud.video.v1.DeleteEpisodeMetadata", + episodeId: "", +}; + +export const DeleteEpisodeMetadata = { + $type: "yandex.cloud.video.v1.DeleteEpisodeMetadata" as const, + + encode( + message: DeleteEpisodeMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.episodeId !== "") { + writer.uint32(10).string(message.episodeId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteEpisodeMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteEpisodeMetadata } as DeleteEpisodeMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.episodeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteEpisodeMetadata { + const message = { ...baseDeleteEpisodeMetadata } as DeleteEpisodeMetadata; + message.episodeId = + object.episodeId !== undefined && object.episodeId !== null + ? String(object.episodeId) + : ""; + return message; + }, + + toJSON(message: DeleteEpisodeMetadata): unknown { + const obj: any = {}; + message.episodeId !== undefined && (obj.episodeId = message.episodeId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteEpisodeMetadata { + const message = { ...baseDeleteEpisodeMetadata } as DeleteEpisodeMetadata; + message.episodeId = object.episodeId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteEpisodeMetadata.$type, DeleteEpisodeMetadata); + +const basePerformEpisodeActionRequest: object = { + $type: "yandex.cloud.video.v1.PerformEpisodeActionRequest", + episodeId: "", +}; + +export const PerformEpisodeActionRequest = { + $type: "yandex.cloud.video.v1.PerformEpisodeActionRequest" as const, + + encode( + message: PerformEpisodeActionRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.episodeId !== "") { + writer.uint32(10).string(message.episodeId); + } + if (message.publish !== undefined) { + PublishEpisodeAction.encode( + message.publish, + writer.uint32(8018).fork() + ).ldelim(); + } + if (message.unpublish !== undefined) { + UnpublishEpisodeAction.encode( + message.unpublish, + writer.uint32(8026).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PerformEpisodeActionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePerformEpisodeActionRequest, + } as PerformEpisodeActionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.episodeId = reader.string(); + break; + case 1002: + message.publish = PublishEpisodeAction.decode( + reader, + reader.uint32() + ); + break; + case 1003: + message.unpublish = UnpublishEpisodeAction.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PerformEpisodeActionRequest { + const message = { + ...basePerformEpisodeActionRequest, + } as PerformEpisodeActionRequest; + message.episodeId = + object.episodeId !== undefined && object.episodeId !== null + ? String(object.episodeId) + : ""; + message.publish = + object.publish !== undefined && object.publish !== null + ? PublishEpisodeAction.fromJSON(object.publish) + : undefined; + message.unpublish = + object.unpublish !== undefined && object.unpublish !== null + ? UnpublishEpisodeAction.fromJSON(object.unpublish) + : undefined; + return message; + }, + + toJSON(message: PerformEpisodeActionRequest): unknown { + const obj: any = {}; + message.episodeId !== undefined && (obj.episodeId = message.episodeId); + message.publish !== undefined && + (obj.publish = message.publish + ? PublishEpisodeAction.toJSON(message.publish) + : undefined); + message.unpublish !== undefined && + (obj.unpublish = message.unpublish + ? UnpublishEpisodeAction.toJSON(message.unpublish) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): PerformEpisodeActionRequest { + const message = { + ...basePerformEpisodeActionRequest, + } as PerformEpisodeActionRequest; + message.episodeId = object.episodeId ?? ""; + message.publish = + object.publish !== undefined && object.publish !== null + ? PublishEpisodeAction.fromPartial(object.publish) + : undefined; + message.unpublish = + object.unpublish !== undefined && object.unpublish !== null + ? UnpublishEpisodeAction.fromPartial(object.unpublish) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + PerformEpisodeActionRequest.$type, + PerformEpisodeActionRequest +); + +const basePublishEpisodeAction: object = { + $type: "yandex.cloud.video.v1.PublishEpisodeAction", +}; + +export const PublishEpisodeAction = { + $type: "yandex.cloud.video.v1.PublishEpisodeAction" as const, + + encode( + _: PublishEpisodeAction, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PublishEpisodeAction { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublishEpisodeAction } as PublishEpisodeAction; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): PublishEpisodeAction { + const message = { ...basePublishEpisodeAction } as PublishEpisodeAction; + return message; + }, + + toJSON(_: PublishEpisodeAction): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): PublishEpisodeAction { + const message = { ...basePublishEpisodeAction } as PublishEpisodeAction; + return message; + }, +}; + +messageTypeRegistry.set(PublishEpisodeAction.$type, PublishEpisodeAction); + +const baseUnpublishEpisodeAction: object = { + $type: "yandex.cloud.video.v1.UnpublishEpisodeAction", +}; + +export const UnpublishEpisodeAction = { + $type: "yandex.cloud.video.v1.UnpublishEpisodeAction" as const, + + encode( + _: UnpublishEpisodeAction, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UnpublishEpisodeAction { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUnpublishEpisodeAction } as UnpublishEpisodeAction; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): UnpublishEpisodeAction { + const message = { ...baseUnpublishEpisodeAction } as UnpublishEpisodeAction; + return message; + }, + + toJSON(_: UnpublishEpisodeAction): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): UnpublishEpisodeAction { + const message = { ...baseUnpublishEpisodeAction } as UnpublishEpisodeAction; + return message; + }, +}; + +messageTypeRegistry.set(UnpublishEpisodeAction.$type, UnpublishEpisodeAction); + +const basePerformEpisodeActionMetadata: object = { + $type: "yandex.cloud.video.v1.PerformEpisodeActionMetadata", + episodeId: "", +}; + +export const PerformEpisodeActionMetadata = { + $type: "yandex.cloud.video.v1.PerformEpisodeActionMetadata" as const, + + encode( + message: PerformEpisodeActionMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.episodeId !== "") { + writer.uint32(10).string(message.episodeId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PerformEpisodeActionMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePerformEpisodeActionMetadata, + } as PerformEpisodeActionMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.episodeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PerformEpisodeActionMetadata { + const message = { + ...basePerformEpisodeActionMetadata, + } as PerformEpisodeActionMetadata; + message.episodeId = + object.episodeId !== undefined && object.episodeId !== null + ? String(object.episodeId) + : ""; + return message; + }, + + toJSON(message: PerformEpisodeActionMetadata): unknown { + const obj: any = {}; + message.episodeId !== undefined && (obj.episodeId = message.episodeId); + return obj; + }, + + fromPartial, I>>( + object: I + ): PerformEpisodeActionMetadata { + const message = { + ...basePerformEpisodeActionMetadata, + } as PerformEpisodeActionMetadata; + message.episodeId = object.episodeId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + PerformEpisodeActionMetadata.$type, + PerformEpisodeActionMetadata +); + +const baseGetEpisodePlayerURLRequest: object = { + $type: "yandex.cloud.video.v1.GetEpisodePlayerURLRequest", + episodeId: "", +}; + +export const GetEpisodePlayerURLRequest = { + $type: "yandex.cloud.video.v1.GetEpisodePlayerURLRequest" as const, + + encode( + message: GetEpisodePlayerURLRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.episodeId !== "") { + writer.uint32(10).string(message.episodeId); + } + if (message.params !== undefined) { + EpisodePlayerParams.encode( + message.params, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetEpisodePlayerURLRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetEpisodePlayerURLRequest, + } as GetEpisodePlayerURLRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.episodeId = reader.string(); + break; + case 2: + message.params = EpisodePlayerParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetEpisodePlayerURLRequest { + const message = { + ...baseGetEpisodePlayerURLRequest, + } as GetEpisodePlayerURLRequest; + message.episodeId = + object.episodeId !== undefined && object.episodeId !== null + ? String(object.episodeId) + : ""; + message.params = + object.params !== undefined && object.params !== null + ? EpisodePlayerParams.fromJSON(object.params) + : undefined; + return message; + }, + + toJSON(message: GetEpisodePlayerURLRequest): unknown { + const obj: any = {}; + message.episodeId !== undefined && (obj.episodeId = message.episodeId); + message.params !== undefined && + (obj.params = message.params + ? EpisodePlayerParams.toJSON(message.params) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetEpisodePlayerURLRequest { + const message = { + ...baseGetEpisodePlayerURLRequest, + } as GetEpisodePlayerURLRequest; + message.episodeId = object.episodeId ?? ""; + message.params = + object.params !== undefined && object.params !== null + ? EpisodePlayerParams.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + GetEpisodePlayerURLRequest.$type, + GetEpisodePlayerURLRequest +); + +const baseEpisodePlayerParams: object = { + $type: "yandex.cloud.video.v1.EpisodePlayerParams", + mute: false, + autoplay: false, + hidden: false, +}; + +export const EpisodePlayerParams = { + $type: "yandex.cloud.video.v1.EpisodePlayerParams" as const, + + encode( + message: EpisodePlayerParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.mute === true) { + writer.uint32(8).bool(message.mute); + } + if (message.autoplay === true) { + writer.uint32(16).bool(message.autoplay); + } + if (message.hidden === true) { + writer.uint32(24).bool(message.hidden); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EpisodePlayerParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEpisodePlayerParams } as EpisodePlayerParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mute = reader.bool(); + break; + case 2: + message.autoplay = reader.bool(); + break; + case 3: + message.hidden = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EpisodePlayerParams { + const message = { ...baseEpisodePlayerParams } as EpisodePlayerParams; + message.mute = + object.mute !== undefined && object.mute !== null + ? Boolean(object.mute) + : false; + message.autoplay = + object.autoplay !== undefined && object.autoplay !== null + ? Boolean(object.autoplay) + : false; + message.hidden = + object.hidden !== undefined && object.hidden !== null + ? Boolean(object.hidden) + : false; + return message; + }, + + toJSON(message: EpisodePlayerParams): unknown { + const obj: any = {}; + message.mute !== undefined && (obj.mute = message.mute); + message.autoplay !== undefined && (obj.autoplay = message.autoplay); + message.hidden !== undefined && (obj.hidden = message.hidden); + return obj; + }, + + fromPartial, I>>( + object: I + ): EpisodePlayerParams { + const message = { ...baseEpisodePlayerParams } as EpisodePlayerParams; + message.mute = object.mute ?? false; + message.autoplay = object.autoplay ?? false; + message.hidden = object.hidden ?? false; + return message; + }, +}; + +messageTypeRegistry.set(EpisodePlayerParams.$type, EpisodePlayerParams); + +const baseGetEpisodePlayerURLResponse: object = { + $type: "yandex.cloud.video.v1.GetEpisodePlayerURLResponse", + playerUrl: "", + html: "", +}; + +export const GetEpisodePlayerURLResponse = { + $type: "yandex.cloud.video.v1.GetEpisodePlayerURLResponse" as const, + + encode( + message: GetEpisodePlayerURLResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.playerUrl !== "") { + writer.uint32(10).string(message.playerUrl); + } + if (message.html !== "") { + writer.uint32(18).string(message.html); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetEpisodePlayerURLResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetEpisodePlayerURLResponse, + } as GetEpisodePlayerURLResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.playerUrl = reader.string(); + break; + case 2: + message.html = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetEpisodePlayerURLResponse { + const message = { + ...baseGetEpisodePlayerURLResponse, + } as GetEpisodePlayerURLResponse; + message.playerUrl = + object.playerUrl !== undefined && object.playerUrl !== null + ? String(object.playerUrl) + : ""; + message.html = + object.html !== undefined && object.html !== null + ? String(object.html) + : ""; + return message; + }, + + toJSON(message: GetEpisodePlayerURLResponse): unknown { + const obj: any = {}; + message.playerUrl !== undefined && (obj.playerUrl = message.playerUrl); + message.html !== undefined && (obj.html = message.html); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetEpisodePlayerURLResponse { + const message = { + ...baseGetEpisodePlayerURLResponse, + } as GetEpisodePlayerURLResponse; + message.playerUrl = object.playerUrl ?? ""; + message.html = object.html ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetEpisodePlayerURLResponse.$type, + GetEpisodePlayerURLResponse +); + +const baseGetEpisodeManifestsRequest: object = { + $type: "yandex.cloud.video.v1.GetEpisodeManifestsRequest", + episodeId: "", +}; + +export const GetEpisodeManifestsRequest = { + $type: "yandex.cloud.video.v1.GetEpisodeManifestsRequest" as const, + + encode( + message: GetEpisodeManifestsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.episodeId !== "") { + writer.uint32(10).string(message.episodeId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetEpisodeManifestsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetEpisodeManifestsRequest, + } as GetEpisodeManifestsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.episodeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetEpisodeManifestsRequest { + const message = { + ...baseGetEpisodeManifestsRequest, + } as GetEpisodeManifestsRequest; + message.episodeId = + object.episodeId !== undefined && object.episodeId !== null + ? String(object.episodeId) + : ""; + return message; + }, + + toJSON(message: GetEpisodeManifestsRequest): unknown { + const obj: any = {}; + message.episodeId !== undefined && (obj.episodeId = message.episodeId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetEpisodeManifestsRequest { + const message = { + ...baseGetEpisodeManifestsRequest, + } as GetEpisodeManifestsRequest; + message.episodeId = object.episodeId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetEpisodeManifestsRequest.$type, + GetEpisodeManifestsRequest +); + +const baseGetEpisodeManifestsResponse: object = { + $type: "yandex.cloud.video.v1.GetEpisodeManifestsResponse", +}; + +export const GetEpisodeManifestsResponse = { + $type: "yandex.cloud.video.v1.GetEpisodeManifestsResponse" as const, + + encode( + message: GetEpisodeManifestsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.manifests) { + Manifest.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetEpisodeManifestsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetEpisodeManifestsResponse, + } as GetEpisodeManifestsResponse; + message.manifests = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.manifests.push(Manifest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetEpisodeManifestsResponse { + const message = { + ...baseGetEpisodeManifestsResponse, + } as GetEpisodeManifestsResponse; + message.manifests = (object.manifests ?? []).map((e: any) => + Manifest.fromJSON(e) + ); + return message; + }, + + toJSON(message: GetEpisodeManifestsResponse): unknown { + const obj: any = {}; + if (message.manifests) { + obj.manifests = message.manifests.map((e) => + e ? Manifest.toJSON(e) : undefined + ); + } else { + obj.manifests = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): GetEpisodeManifestsResponse { + const message = { + ...baseGetEpisodeManifestsResponse, + } as GetEpisodeManifestsResponse; + message.manifests = + object.manifests?.map((e) => Manifest.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + GetEpisodeManifestsResponse.$type, + GetEpisodeManifestsResponse +); + +/** Episode management service. */ +export const EpisodeServiceService = { + /** Returns the specific channel. */ + get: { + path: "/yandex.cloud.video.v1.EpisodeService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetEpisodeRequest) => + Buffer.from(GetEpisodeRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetEpisodeRequest.decode(value), + responseSerialize: (value: Episode) => + Buffer.from(Episode.encode(value).finish()), + responseDeserialize: (value: Buffer) => Episode.decode(value), + }, + /** List episodes for stream or line. */ + list: { + path: "/yandex.cloud.video.v1.EpisodeService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListEpisodesRequest) => + Buffer.from(ListEpisodesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListEpisodesRequest.decode(value), + responseSerialize: (value: ListEpisodesResponse) => + Buffer.from(ListEpisodesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListEpisodesResponse.decode(value), + }, + /** Create episode. */ + create: { + path: "/yandex.cloud.video.v1.EpisodeService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateEpisodeRequest) => + Buffer.from(CreateEpisodeRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateEpisodeRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Update episode. */ + update: { + path: "/yandex.cloud.video.v1.EpisodeService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateEpisodeRequest) => + Buffer.from(UpdateEpisodeRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateEpisodeRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Delete episode. */ + delete: { + path: "/yandex.cloud.video.v1.EpisodeService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteEpisodeRequest) => + Buffer.from(DeleteEpisodeRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteEpisodeRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Perform an action on the episode. */ + performAction: { + path: "/yandex.cloud.video.v1.EpisodeService/PerformAction", + requestStream: false, + responseStream: false, + requestSerialize: (value: PerformEpisodeActionRequest) => + Buffer.from(PerformEpisodeActionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + PerformEpisodeActionRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Returns url to the player. */ + getPlayerURL: { + path: "/yandex.cloud.video.v1.EpisodeService/GetPlayerURL", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetEpisodePlayerURLRequest) => + Buffer.from(GetEpisodePlayerURLRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetEpisodePlayerURLRequest.decode(value), + responseSerialize: (value: GetEpisodePlayerURLResponse) => + Buffer.from(GetEpisodePlayerURLResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + GetEpisodePlayerURLResponse.decode(value), + }, + /** Returns manifest urls. */ + getManifests: { + path: "/yandex.cloud.video.v1.EpisodeService/GetManifests", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetEpisodeManifestsRequest) => + Buffer.from(GetEpisodeManifestsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetEpisodeManifestsRequest.decode(value), + responseSerialize: (value: GetEpisodeManifestsResponse) => + Buffer.from(GetEpisodeManifestsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + GetEpisodeManifestsResponse.decode(value), + }, +} as const; + +export interface EpisodeServiceServer extends UntypedServiceImplementation { + /** Returns the specific channel. */ + get: handleUnaryCall; + /** List episodes for stream or line. */ + list: handleUnaryCall; + /** Create episode. */ + create: handleUnaryCall; + /** Update episode. */ + update: handleUnaryCall; + /** Delete episode. */ + delete: handleUnaryCall; + /** Perform an action on the episode. */ + performAction: handleUnaryCall; + /** Returns url to the player. */ + getPlayerURL: handleUnaryCall< + GetEpisodePlayerURLRequest, + GetEpisodePlayerURLResponse + >; + /** Returns manifest urls. */ + getManifests: handleUnaryCall< + GetEpisodeManifestsRequest, + GetEpisodeManifestsResponse + >; +} + +export interface EpisodeServiceClient extends Client { + /** Returns the specific channel. */ + get( + request: GetEpisodeRequest, + callback: (error: ServiceError | null, response: Episode) => void + ): ClientUnaryCall; + get( + request: GetEpisodeRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Episode) => void + ): ClientUnaryCall; + get( + request: GetEpisodeRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Episode) => void + ): ClientUnaryCall; + /** List episodes for stream or line. */ + list( + request: ListEpisodesRequest, + callback: ( + error: ServiceError | null, + response: ListEpisodesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListEpisodesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListEpisodesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListEpisodesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListEpisodesResponse + ) => void + ): ClientUnaryCall; + /** Create episode. */ + create( + request: CreateEpisodeRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateEpisodeRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateEpisodeRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Update episode. */ + update( + request: UpdateEpisodeRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateEpisodeRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateEpisodeRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Delete episode. */ + delete( + request: DeleteEpisodeRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteEpisodeRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteEpisodeRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Perform an action on the episode. */ + performAction( + request: PerformEpisodeActionRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + performAction( + request: PerformEpisodeActionRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + performAction( + request: PerformEpisodeActionRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Returns url to the player. */ + getPlayerURL( + request: GetEpisodePlayerURLRequest, + callback: ( + error: ServiceError | null, + response: GetEpisodePlayerURLResponse + ) => void + ): ClientUnaryCall; + getPlayerURL( + request: GetEpisodePlayerURLRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: GetEpisodePlayerURLResponse + ) => void + ): ClientUnaryCall; + getPlayerURL( + request: GetEpisodePlayerURLRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: GetEpisodePlayerURLResponse + ) => void + ): ClientUnaryCall; + /** Returns manifest urls. */ + getManifests( + request: GetEpisodeManifestsRequest, + callback: ( + error: ServiceError | null, + response: GetEpisodeManifestsResponse + ) => void + ): ClientUnaryCall; + getManifests( + request: GetEpisodeManifestsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: GetEpisodeManifestsResponse + ) => void + ): ClientUnaryCall; + getManifests( + request: GetEpisodeManifestsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: GetEpisodeManifestsResponse + ) => void + ): ClientUnaryCall; +} + +export const EpisodeServiceClient = makeGenericClientConstructor( + EpisodeServiceService, + "yandex.cloud.video.v1.EpisodeService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): EpisodeServiceClient; + service: typeof EpisodeServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/video/v1/manifest.ts b/src/generated/yandex/cloud/video/v1/manifest.ts new file mode 100644 index 00000000..c6890740 --- /dev/null +++ b/src/generated/yandex/cloud/video/v1/manifest.ts @@ -0,0 +1,162 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yandex.cloud.video.v1"; + +export interface Manifest { + $type: "yandex.cloud.video.v1.Manifest"; + url: string; + type: Manifest_ManifestType; +} + +/** + * TODO: CLOUDAPI-336 + * TODO: reserved 3; + */ +export enum Manifest_ManifestType { + MANIFEST_TYPE_UNSPECIFIED = 0, + DASH = 1, + HLS = 2, + UNRECOGNIZED = -1, +} + +export function manifest_ManifestTypeFromJSON( + object: any +): Manifest_ManifestType { + switch (object) { + case 0: + case "MANIFEST_TYPE_UNSPECIFIED": + return Manifest_ManifestType.MANIFEST_TYPE_UNSPECIFIED; + case 1: + case "DASH": + return Manifest_ManifestType.DASH; + case 2: + case "HLS": + return Manifest_ManifestType.HLS; + case -1: + case "UNRECOGNIZED": + default: + return Manifest_ManifestType.UNRECOGNIZED; + } +} + +export function manifest_ManifestTypeToJSON( + object: Manifest_ManifestType +): string { + switch (object) { + case Manifest_ManifestType.MANIFEST_TYPE_UNSPECIFIED: + return "MANIFEST_TYPE_UNSPECIFIED"; + case Manifest_ManifestType.DASH: + return "DASH"; + case Manifest_ManifestType.HLS: + return "HLS"; + default: + return "UNKNOWN"; + } +} + +const baseManifest: object = { + $type: "yandex.cloud.video.v1.Manifest", + url: "", + type: 0, +}; + +export const Manifest = { + $type: "yandex.cloud.video.v1.Manifest" as const, + + encode( + message: Manifest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(10).string(message.url); + } + if (message.type !== 0) { + writer.uint32(16).int32(message.type); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Manifest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseManifest } as Manifest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 2: + message.type = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Manifest { + const message = { ...baseManifest } as Manifest; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + message.type = + object.type !== undefined && object.type !== null + ? manifest_ManifestTypeFromJSON(object.type) + : 0; + return message; + }, + + toJSON(message: Manifest): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + message.type !== undefined && + (obj.type = manifest_ManifestTypeToJSON(message.type)); + return obj; + }, + + fromPartial, I>>(object: I): Manifest { + const message = { ...baseManifest } as Manifest; + message.url = object.url ?? ""; + message.type = object.type ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(Manifest.$type, Manifest); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/video/v1/stream.ts b/src/generated/yandex/cloud/video/v1/stream.ts new file mode 100644 index 00000000..39f3543b --- /dev/null +++ b/src/generated/yandex/cloud/video/v1/stream.ts @@ -0,0 +1,674 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.video.v1"; + +export interface Stream { + $type: "yandex.cloud.video.v1.Stream"; + /** ID of the stream. */ + id: string; + /** ID of the channel where the stream was created. */ + channelId: string; + /** ID of the line to which stream is linked. */ + lineId: string; + /** Stream title. */ + title: string; + /** Stream description. */ + description: string; + /** ID of the thumbnail. */ + thumbnailId: string; + /** Stream status. */ + status: Stream_StreamStatus; + /** Stream start time. */ + startTime?: Date; + /** Stream publish time. Time when stream switched to ONAIR status. */ + publishTime?: Date; + /** Stream finish time. */ + finishTime?: Date; + /** On demand stream. It starts immediately when a signal appears. */ + onDemand?: OnDemand | undefined; + /** Schedule stream. Determines when to start receiving the signal or finish time. */ + schedule?: Schedule | undefined; + /** Time when stream was created. */ + createdAt?: Date; + /** Time of last stream update. */ + updatedAt?: Date; + /** Custom labels as `` key:value `` pairs. Maximum 64 per resource. */ + labels: { [key: string]: string }; +} + +/** Stream status. */ +export enum Stream_StreamStatus { + /** STREAM_STATUS_UNSPECIFIED - Stream status unspecified. */ + STREAM_STATUS_UNSPECIFIED = 0, + /** OFFLINE - Stream offline. */ + OFFLINE = 1, + /** PREPARING - Preparing the infrastructure for receiving video signal. */ + PREPARING = 2, + /** READY - Everything is ready to launch stream. */ + READY = 3, + /** ONAIR - Stream onair. */ + ONAIR = 4, + /** FINISHED - Stream finished. */ + FINISHED = 5, + UNRECOGNIZED = -1, +} + +export function stream_StreamStatusFromJSON(object: any): Stream_StreamStatus { + switch (object) { + case 0: + case "STREAM_STATUS_UNSPECIFIED": + return Stream_StreamStatus.STREAM_STATUS_UNSPECIFIED; + case 1: + case "OFFLINE": + return Stream_StreamStatus.OFFLINE; + case 2: + case "PREPARING": + return Stream_StreamStatus.PREPARING; + case 3: + case "READY": + return Stream_StreamStatus.READY; + case 4: + case "ONAIR": + return Stream_StreamStatus.ONAIR; + case 5: + case "FINISHED": + return Stream_StreamStatus.FINISHED; + case -1: + case "UNRECOGNIZED": + default: + return Stream_StreamStatus.UNRECOGNIZED; + } +} + +export function stream_StreamStatusToJSON(object: Stream_StreamStatus): string { + switch (object) { + case Stream_StreamStatus.STREAM_STATUS_UNSPECIFIED: + return "STREAM_STATUS_UNSPECIFIED"; + case Stream_StreamStatus.OFFLINE: + return "OFFLINE"; + case Stream_StreamStatus.PREPARING: + return "PREPARING"; + case Stream_StreamStatus.READY: + return "READY"; + case Stream_StreamStatus.ONAIR: + return "ONAIR"; + case Stream_StreamStatus.FINISHED: + return "FINISHED"; + default: + return "UNKNOWN"; + } +} + +export interface Stream_LabelsEntry { + $type: "yandex.cloud.video.v1.Stream.LabelsEntry"; + key: string; + value: string; +} + +/** If "OnDemand" is used, client should start and finish explicitly. */ +export interface OnDemand { + $type: "yandex.cloud.video.v1.OnDemand"; +} + +/** If "Schedule" is used, stream automatically start and finish at this time. */ +export interface Schedule { + $type: "yandex.cloud.video.v1.Schedule"; + startTime?: Date; + finishTime?: Date; +} + +const baseStream: object = { + $type: "yandex.cloud.video.v1.Stream", + id: "", + channelId: "", + lineId: "", + title: "", + description: "", + thumbnailId: "", + status: 0, +}; + +export const Stream = { + $type: "yandex.cloud.video.v1.Stream" as const, + + encode( + message: Stream, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.lineId !== "") { + writer.uint32(26).string(message.lineId); + } + if (message.title !== "") { + writer.uint32(34).string(message.title); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + if (message.thumbnailId !== "") { + writer.uint32(50).string(message.thumbnailId); + } + if (message.status !== 0) { + writer.uint32(64).int32(message.status); + } + if (message.startTime !== undefined) { + Timestamp.encode( + toTimestamp(message.startTime), + writer.uint32(74).fork() + ).ldelim(); + } + if (message.publishTime !== undefined) { + Timestamp.encode( + toTimestamp(message.publishTime), + writer.uint32(82).fork() + ).ldelim(); + } + if (message.finishTime !== undefined) { + Timestamp.encode( + toTimestamp(message.finishTime), + writer.uint32(90).fork() + ).ldelim(); + } + if (message.onDemand !== undefined) { + OnDemand.encode(message.onDemand, writer.uint32(8002).fork()).ldelim(); + } + if (message.schedule !== undefined) { + Schedule.encode(message.schedule, writer.uint32(8010).fork()).ldelim(); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(802).fork() + ).ldelim(); + } + if (message.updatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.updatedAt), + writer.uint32(810).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + Stream_LabelsEntry.encode( + { + $type: "yandex.cloud.video.v1.Stream.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(1602).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Stream { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStream } as Stream; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.lineId = reader.string(); + break; + case 4: + message.title = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.thumbnailId = reader.string(); + break; + case 8: + message.status = reader.int32() as any; + break; + case 9: + message.startTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 10: + message.publishTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 11: + message.finishTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 1000: + message.onDemand = OnDemand.decode(reader, reader.uint32()); + break; + case 1001: + message.schedule = Schedule.decode(reader, reader.uint32()); + break; + case 100: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 101: + message.updatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 200: + const entry200 = Stream_LabelsEntry.decode(reader, reader.uint32()); + if (entry200.value !== undefined) { + message.labels[entry200.key] = entry200.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Stream { + const message = { ...baseStream } as Stream; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + message.lineId = + object.lineId !== undefined && object.lineId !== null + ? String(object.lineId) + : ""; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + message.status = + object.status !== undefined && object.status !== null + ? stream_StreamStatusFromJSON(object.status) + : 0; + message.startTime = + object.startTime !== undefined && object.startTime !== null + ? fromJsonTimestamp(object.startTime) + : undefined; + message.publishTime = + object.publishTime !== undefined && object.publishTime !== null + ? fromJsonTimestamp(object.publishTime) + : undefined; + message.finishTime = + object.finishTime !== undefined && object.finishTime !== null + ? fromJsonTimestamp(object.finishTime) + : undefined; + message.onDemand = + object.onDemand !== undefined && object.onDemand !== null + ? OnDemand.fromJSON(object.onDemand) + : undefined; + message.schedule = + object.schedule !== undefined && object.schedule !== null + ? Schedule.fromJSON(object.schedule) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.updatedAt = + object.updatedAt !== undefined && object.updatedAt !== null + ? fromJsonTimestamp(object.updatedAt) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: Stream): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.lineId !== undefined && (obj.lineId = message.lineId); + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + message.status !== undefined && + (obj.status = stream_StreamStatusToJSON(message.status)); + message.startTime !== undefined && + (obj.startTime = message.startTime.toISOString()); + message.publishTime !== undefined && + (obj.publishTime = message.publishTime.toISOString()); + message.finishTime !== undefined && + (obj.finishTime = message.finishTime.toISOString()); + message.onDemand !== undefined && + (obj.onDemand = message.onDemand + ? OnDemand.toJSON(message.onDemand) + : undefined); + message.schedule !== undefined && + (obj.schedule = message.schedule + ? Schedule.toJSON(message.schedule) + : undefined); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.updatedAt !== undefined && + (obj.updatedAt = message.updatedAt.toISOString()); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>(object: I): Stream { + const message = { ...baseStream } as Stream; + message.id = object.id ?? ""; + message.channelId = object.channelId ?? ""; + message.lineId = object.lineId ?? ""; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.thumbnailId = object.thumbnailId ?? ""; + message.status = object.status ?? 0; + message.startTime = object.startTime ?? undefined; + message.publishTime = object.publishTime ?? undefined; + message.finishTime = object.finishTime ?? undefined; + message.onDemand = + object.onDemand !== undefined && object.onDemand !== null + ? OnDemand.fromPartial(object.onDemand) + : undefined; + message.schedule = + object.schedule !== undefined && object.schedule !== null + ? Schedule.fromPartial(object.schedule) + : undefined; + message.createdAt = object.createdAt ?? undefined; + message.updatedAt = object.updatedAt ?? undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(Stream.$type, Stream); + +const baseStream_LabelsEntry: object = { + $type: "yandex.cloud.video.v1.Stream.LabelsEntry", + key: "", + value: "", +}; + +export const Stream_LabelsEntry = { + $type: "yandex.cloud.video.v1.Stream.LabelsEntry" as const, + + encode( + message: Stream_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Stream_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStream_LabelsEntry } as Stream_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Stream_LabelsEntry { + const message = { ...baseStream_LabelsEntry } as Stream_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Stream_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Stream_LabelsEntry { + const message = { ...baseStream_LabelsEntry } as Stream_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Stream_LabelsEntry.$type, Stream_LabelsEntry); + +const baseOnDemand: object = { $type: "yandex.cloud.video.v1.OnDemand" }; + +export const OnDemand = { + $type: "yandex.cloud.video.v1.OnDemand" as const, + + encode(_: OnDemand, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OnDemand { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOnDemand } as OnDemand; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): OnDemand { + const message = { ...baseOnDemand } as OnDemand; + return message; + }, + + toJSON(_: OnDemand): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): OnDemand { + const message = { ...baseOnDemand } as OnDemand; + return message; + }, +}; + +messageTypeRegistry.set(OnDemand.$type, OnDemand); + +const baseSchedule: object = { $type: "yandex.cloud.video.v1.Schedule" }; + +export const Schedule = { + $type: "yandex.cloud.video.v1.Schedule" as const, + + encode( + message: Schedule, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.startTime !== undefined) { + Timestamp.encode( + toTimestamp(message.startTime), + writer.uint32(10).fork() + ).ldelim(); + } + if (message.finishTime !== undefined) { + Timestamp.encode( + toTimestamp(message.finishTime), + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Schedule { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSchedule } as Schedule; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 2: + message.finishTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Schedule { + const message = { ...baseSchedule } as Schedule; + message.startTime = + object.startTime !== undefined && object.startTime !== null + ? fromJsonTimestamp(object.startTime) + : undefined; + message.finishTime = + object.finishTime !== undefined && object.finishTime !== null + ? fromJsonTimestamp(object.finishTime) + : undefined; + return message; + }, + + toJSON(message: Schedule): unknown { + const obj: any = {}; + message.startTime !== undefined && + (obj.startTime = message.startTime.toISOString()); + message.finishTime !== undefined && + (obj.finishTime = message.finishTime.toISOString()); + return obj; + }, + + fromPartial, I>>(object: I): Schedule { + const message = { ...baseSchedule } as Schedule; + message.startTime = object.startTime ?? undefined; + message.finishTime = object.finishTime ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Schedule.$type, Schedule); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/video/v1/stream_line.ts b/src/generated/yandex/cloud/video/v1/stream_line.ts new file mode 100644 index 00000000..b1b253d9 --- /dev/null +++ b/src/generated/yandex/cloud/video/v1/stream_line.ts @@ -0,0 +1,1134 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.video.v1"; + +/** Entity that is responsible for the incoming video signal settings. */ +export interface StreamLine { + $type: "yandex.cloud.video.v1.StreamLine"; + /** ID of the line. */ + id: string; + /** ID of the channel where the line was created. */ + channelId: string; + /** Line title. */ + title: string; + /** ID of the thumbnail. */ + thumbnailId: string; + /** RTMP push input type. */ + rtmpPush?: RTMPPushInput | undefined; + /** SRT push input type. */ + srtPush?: SRTPushInput | undefined; + /** RTMP pull input type. */ + rtmpPull?: RTMPPullInput | undefined; + /** SRT pull input type. */ + srtPull?: SRTPullInput | undefined; + /** TCP pull input type. */ + tcpPull?: TCPPullInput | undefined; + /** RTSP pull input type. */ + rtspPull?: RTSPPullInput | undefined; + /** Manual control of stream. */ + manualLine?: ManualLine | undefined; + /** Automatic control of stream. */ + autoLine?: AutoLine | undefined; + /** Time when line was created. */ + createdAt?: Date; + /** Time of last line update. */ + updatedAt?: Date; + /** Custom labels as `` key:value `` pairs. Maximum 64 per resource. */ + labels: { [key: string]: string }; +} + +export interface StreamLine_LabelsEntry { + $type: "yandex.cloud.video.v1.StreamLine.LabelsEntry"; + key: string; + value: string; +} + +/** Push stream key. */ +export interface PushStreamKey { + $type: "yandex.cloud.video.v1.PushStreamKey"; + /** Unique stream key. */ + key: string; +} + +export interface RTMPPushInput { + $type: "yandex.cloud.video.v1.RTMPPushInput"; + /** RTMP server url. */ + url: string; +} + +export interface SRTPushInput { + $type: "yandex.cloud.video.v1.SRTPushInput"; + /** SRT server url. */ + url: string; +} + +export interface RTMPPullInput { + $type: "yandex.cloud.video.v1.RTMPPullInput"; + /** RTMP url for receiving video signal. */ + url: string; +} + +export interface SRTPullInput { + $type: "yandex.cloud.video.v1.SRTPullInput"; + /** SRT url for receiving video signal. */ + url: string; +} + +export interface TCPPullInput { + $type: "yandex.cloud.video.v1.TCPPullInput"; + /** TCP url for receiving video signal. */ + url: string; +} + +export interface RTSPPullInput { + $type: "yandex.cloud.video.v1.RTSPPullInput"; + /** RTSP url for receiving video signal. */ + url: string; +} + +/** Manual line type. */ +export interface ManualLine { + $type: "yandex.cloud.video.v1.ManualLine"; +} + +/** Auto line type. */ +export interface AutoLine { + $type: "yandex.cloud.video.v1.AutoLine"; + /** Status of auto line. */ + status: AutoLine_AutoLineStatus; +} + +/** Auto line status. */ +export enum AutoLine_AutoLineStatus { + /** AUTO_LINE_STATUS_UNSPECIFIED - Auto line status unspecified. */ + AUTO_LINE_STATUS_UNSPECIFIED = 0, + /** DEACTIVATED - Auto line deactivated. */ + DEACTIVATED = 1, + /** ACTIVE - Auto line active. */ + ACTIVE = 2, + UNRECOGNIZED = -1, +} + +export function autoLine_AutoLineStatusFromJSON( + object: any +): AutoLine_AutoLineStatus { + switch (object) { + case 0: + case "AUTO_LINE_STATUS_UNSPECIFIED": + return AutoLine_AutoLineStatus.AUTO_LINE_STATUS_UNSPECIFIED; + case 1: + case "DEACTIVATED": + return AutoLine_AutoLineStatus.DEACTIVATED; + case 2: + case "ACTIVE": + return AutoLine_AutoLineStatus.ACTIVE; + case -1: + case "UNRECOGNIZED": + default: + return AutoLine_AutoLineStatus.UNRECOGNIZED; + } +} + +export function autoLine_AutoLineStatusToJSON( + object: AutoLine_AutoLineStatus +): string { + switch (object) { + case AutoLine_AutoLineStatus.AUTO_LINE_STATUS_UNSPECIFIED: + return "AUTO_LINE_STATUS_UNSPECIFIED"; + case AutoLine_AutoLineStatus.DEACTIVATED: + return "DEACTIVATED"; + case AutoLine_AutoLineStatus.ACTIVE: + return "ACTIVE"; + default: + return "UNKNOWN"; + } +} + +const baseStreamLine: object = { + $type: "yandex.cloud.video.v1.StreamLine", + id: "", + channelId: "", + title: "", + thumbnailId: "", +}; + +export const StreamLine = { + $type: "yandex.cloud.video.v1.StreamLine" as const, + + encode( + message: StreamLine, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.title !== "") { + writer.uint32(26).string(message.title); + } + if (message.thumbnailId !== "") { + writer.uint32(34).string(message.thumbnailId); + } + if (message.rtmpPush !== undefined) { + RTMPPushInput.encode( + message.rtmpPush, + writer.uint32(8002).fork() + ).ldelim(); + } + if (message.srtPush !== undefined) { + SRTPushInput.encode(message.srtPush, writer.uint32(8010).fork()).ldelim(); + } + if (message.rtmpPull !== undefined) { + RTMPPullInput.encode( + message.rtmpPull, + writer.uint32(8018).fork() + ).ldelim(); + } + if (message.srtPull !== undefined) { + SRTPullInput.encode(message.srtPull, writer.uint32(8026).fork()).ldelim(); + } + if (message.tcpPull !== undefined) { + TCPPullInput.encode(message.tcpPull, writer.uint32(8034).fork()).ldelim(); + } + if (message.rtspPull !== undefined) { + RTSPPullInput.encode( + message.rtspPull, + writer.uint32(8050).fork() + ).ldelim(); + } + if (message.manualLine !== undefined) { + ManualLine.encode( + message.manualLine, + writer.uint32(16002).fork() + ).ldelim(); + } + if (message.autoLine !== undefined) { + AutoLine.encode(message.autoLine, writer.uint32(16010).fork()).ldelim(); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(802).fork() + ).ldelim(); + } + if (message.updatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.updatedAt), + writer.uint32(810).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + StreamLine_LabelsEntry.encode( + { + $type: "yandex.cloud.video.v1.StreamLine.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(1602).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StreamLine { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStreamLine } as StreamLine; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.title = reader.string(); + break; + case 4: + message.thumbnailId = reader.string(); + break; + case 1000: + message.rtmpPush = RTMPPushInput.decode(reader, reader.uint32()); + break; + case 1001: + message.srtPush = SRTPushInput.decode(reader, reader.uint32()); + break; + case 1002: + message.rtmpPull = RTMPPullInput.decode(reader, reader.uint32()); + break; + case 1003: + message.srtPull = SRTPullInput.decode(reader, reader.uint32()); + break; + case 1004: + message.tcpPull = TCPPullInput.decode(reader, reader.uint32()); + break; + case 1006: + message.rtspPull = RTSPPullInput.decode(reader, reader.uint32()); + break; + case 2000: + message.manualLine = ManualLine.decode(reader, reader.uint32()); + break; + case 2001: + message.autoLine = AutoLine.decode(reader, reader.uint32()); + break; + case 100: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 101: + message.updatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 200: + const entry200 = StreamLine_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry200.value !== undefined) { + message.labels[entry200.key] = entry200.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StreamLine { + const message = { ...baseStreamLine } as StreamLine; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + message.rtmpPush = + object.rtmpPush !== undefined && object.rtmpPush !== null + ? RTMPPushInput.fromJSON(object.rtmpPush) + : undefined; + message.srtPush = + object.srtPush !== undefined && object.srtPush !== null + ? SRTPushInput.fromJSON(object.srtPush) + : undefined; + message.rtmpPull = + object.rtmpPull !== undefined && object.rtmpPull !== null + ? RTMPPullInput.fromJSON(object.rtmpPull) + : undefined; + message.srtPull = + object.srtPull !== undefined && object.srtPull !== null + ? SRTPullInput.fromJSON(object.srtPull) + : undefined; + message.tcpPull = + object.tcpPull !== undefined && object.tcpPull !== null + ? TCPPullInput.fromJSON(object.tcpPull) + : undefined; + message.rtspPull = + object.rtspPull !== undefined && object.rtspPull !== null + ? RTSPPullInput.fromJSON(object.rtspPull) + : undefined; + message.manualLine = + object.manualLine !== undefined && object.manualLine !== null + ? ManualLine.fromJSON(object.manualLine) + : undefined; + message.autoLine = + object.autoLine !== undefined && object.autoLine !== null + ? AutoLine.fromJSON(object.autoLine) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.updatedAt = + object.updatedAt !== undefined && object.updatedAt !== null + ? fromJsonTimestamp(object.updatedAt) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: StreamLine): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.title !== undefined && (obj.title = message.title); + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + message.rtmpPush !== undefined && + (obj.rtmpPush = message.rtmpPush + ? RTMPPushInput.toJSON(message.rtmpPush) + : undefined); + message.srtPush !== undefined && + (obj.srtPush = message.srtPush + ? SRTPushInput.toJSON(message.srtPush) + : undefined); + message.rtmpPull !== undefined && + (obj.rtmpPull = message.rtmpPull + ? RTMPPullInput.toJSON(message.rtmpPull) + : undefined); + message.srtPull !== undefined && + (obj.srtPull = message.srtPull + ? SRTPullInput.toJSON(message.srtPull) + : undefined); + message.tcpPull !== undefined && + (obj.tcpPull = message.tcpPull + ? TCPPullInput.toJSON(message.tcpPull) + : undefined); + message.rtspPull !== undefined && + (obj.rtspPull = message.rtspPull + ? RTSPPullInput.toJSON(message.rtspPull) + : undefined); + message.manualLine !== undefined && + (obj.manualLine = message.manualLine + ? ManualLine.toJSON(message.manualLine) + : undefined); + message.autoLine !== undefined && + (obj.autoLine = message.autoLine + ? AutoLine.toJSON(message.autoLine) + : undefined); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.updatedAt !== undefined && + (obj.updatedAt = message.updatedAt.toISOString()); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>( + object: I + ): StreamLine { + const message = { ...baseStreamLine } as StreamLine; + message.id = object.id ?? ""; + message.channelId = object.channelId ?? ""; + message.title = object.title ?? ""; + message.thumbnailId = object.thumbnailId ?? ""; + message.rtmpPush = + object.rtmpPush !== undefined && object.rtmpPush !== null + ? RTMPPushInput.fromPartial(object.rtmpPush) + : undefined; + message.srtPush = + object.srtPush !== undefined && object.srtPush !== null + ? SRTPushInput.fromPartial(object.srtPush) + : undefined; + message.rtmpPull = + object.rtmpPull !== undefined && object.rtmpPull !== null + ? RTMPPullInput.fromPartial(object.rtmpPull) + : undefined; + message.srtPull = + object.srtPull !== undefined && object.srtPull !== null + ? SRTPullInput.fromPartial(object.srtPull) + : undefined; + message.tcpPull = + object.tcpPull !== undefined && object.tcpPull !== null + ? TCPPullInput.fromPartial(object.tcpPull) + : undefined; + message.rtspPull = + object.rtspPull !== undefined && object.rtspPull !== null + ? RTSPPullInput.fromPartial(object.rtspPull) + : undefined; + message.manualLine = + object.manualLine !== undefined && object.manualLine !== null + ? ManualLine.fromPartial(object.manualLine) + : undefined; + message.autoLine = + object.autoLine !== undefined && object.autoLine !== null + ? AutoLine.fromPartial(object.autoLine) + : undefined; + message.createdAt = object.createdAt ?? undefined; + message.updatedAt = object.updatedAt ?? undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(StreamLine.$type, StreamLine); + +const baseStreamLine_LabelsEntry: object = { + $type: "yandex.cloud.video.v1.StreamLine.LabelsEntry", + key: "", + value: "", +}; + +export const StreamLine_LabelsEntry = { + $type: "yandex.cloud.video.v1.StreamLine.LabelsEntry" as const, + + encode( + message: StreamLine_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): StreamLine_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStreamLine_LabelsEntry } as StreamLine_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StreamLine_LabelsEntry { + const message = { ...baseStreamLine_LabelsEntry } as StreamLine_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: StreamLine_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): StreamLine_LabelsEntry { + const message = { ...baseStreamLine_LabelsEntry } as StreamLine_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(StreamLine_LabelsEntry.$type, StreamLine_LabelsEntry); + +const basePushStreamKey: object = { + $type: "yandex.cloud.video.v1.PushStreamKey", + key: "", +}; + +export const PushStreamKey = { + $type: "yandex.cloud.video.v1.PushStreamKey" as const, + + encode( + message: PushStreamKey, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PushStreamKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePushStreamKey } as PushStreamKey; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PushStreamKey { + const message = { ...basePushStreamKey } as PushStreamKey; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + return message; + }, + + toJSON(message: PushStreamKey): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + return obj; + }, + + fromPartial, I>>( + object: I + ): PushStreamKey { + const message = { ...basePushStreamKey } as PushStreamKey; + message.key = object.key ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(PushStreamKey.$type, PushStreamKey); + +const baseRTMPPushInput: object = { + $type: "yandex.cloud.video.v1.RTMPPushInput", + url: "", +}; + +export const RTMPPushInput = { + $type: "yandex.cloud.video.v1.RTMPPushInput" as const, + + encode( + message: RTMPPushInput, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(10).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RTMPPushInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRTMPPushInput } as RTMPPushInput; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RTMPPushInput { + const message = { ...baseRTMPPushInput } as RTMPPushInput; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: RTMPPushInput): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial, I>>( + object: I + ): RTMPPushInput { + const message = { ...baseRTMPPushInput } as RTMPPushInput; + message.url = object.url ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(RTMPPushInput.$type, RTMPPushInput); + +const baseSRTPushInput: object = { + $type: "yandex.cloud.video.v1.SRTPushInput", + url: "", +}; + +export const SRTPushInput = { + $type: "yandex.cloud.video.v1.SRTPushInput" as const, + + encode( + message: SRTPushInput, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(10).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SRTPushInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSRTPushInput } as SRTPushInput; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SRTPushInput { + const message = { ...baseSRTPushInput } as SRTPushInput; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: SRTPushInput): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial, I>>( + object: I + ): SRTPushInput { + const message = { ...baseSRTPushInput } as SRTPushInput; + message.url = object.url ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(SRTPushInput.$type, SRTPushInput); + +const baseRTMPPullInput: object = { + $type: "yandex.cloud.video.v1.RTMPPullInput", + url: "", +}; + +export const RTMPPullInput = { + $type: "yandex.cloud.video.v1.RTMPPullInput" as const, + + encode( + message: RTMPPullInput, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(10).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RTMPPullInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRTMPPullInput } as RTMPPullInput; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RTMPPullInput { + const message = { ...baseRTMPPullInput } as RTMPPullInput; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: RTMPPullInput): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial, I>>( + object: I + ): RTMPPullInput { + const message = { ...baseRTMPPullInput } as RTMPPullInput; + message.url = object.url ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(RTMPPullInput.$type, RTMPPullInput); + +const baseSRTPullInput: object = { + $type: "yandex.cloud.video.v1.SRTPullInput", + url: "", +}; + +export const SRTPullInput = { + $type: "yandex.cloud.video.v1.SRTPullInput" as const, + + encode( + message: SRTPullInput, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(10).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SRTPullInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSRTPullInput } as SRTPullInput; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SRTPullInput { + const message = { ...baseSRTPullInput } as SRTPullInput; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: SRTPullInput): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial, I>>( + object: I + ): SRTPullInput { + const message = { ...baseSRTPullInput } as SRTPullInput; + message.url = object.url ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(SRTPullInput.$type, SRTPullInput); + +const baseTCPPullInput: object = { + $type: "yandex.cloud.video.v1.TCPPullInput", + url: "", +}; + +export const TCPPullInput = { + $type: "yandex.cloud.video.v1.TCPPullInput" as const, + + encode( + message: TCPPullInput, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(10).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TCPPullInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTCPPullInput } as TCPPullInput; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TCPPullInput { + const message = { ...baseTCPPullInput } as TCPPullInput; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: TCPPullInput): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial, I>>( + object: I + ): TCPPullInput { + const message = { ...baseTCPPullInput } as TCPPullInput; + message.url = object.url ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(TCPPullInput.$type, TCPPullInput); + +const baseRTSPPullInput: object = { + $type: "yandex.cloud.video.v1.RTSPPullInput", + url: "", +}; + +export const RTSPPullInput = { + $type: "yandex.cloud.video.v1.RTSPPullInput" as const, + + encode( + message: RTSPPullInput, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(10).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RTSPPullInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRTSPPullInput } as RTSPPullInput; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RTSPPullInput { + const message = { ...baseRTSPPullInput } as RTSPPullInput; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: RTSPPullInput): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial, I>>( + object: I + ): RTSPPullInput { + const message = { ...baseRTSPPullInput } as RTSPPullInput; + message.url = object.url ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(RTSPPullInput.$type, RTSPPullInput); + +const baseManualLine: object = { $type: "yandex.cloud.video.v1.ManualLine" }; + +export const ManualLine = { + $type: "yandex.cloud.video.v1.ManualLine" as const, + + encode(_: ManualLine, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ManualLine { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseManualLine } as ManualLine; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): ManualLine { + const message = { ...baseManualLine } as ManualLine; + return message; + }, + + toJSON(_: ManualLine): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): ManualLine { + const message = { ...baseManualLine } as ManualLine; + return message; + }, +}; + +messageTypeRegistry.set(ManualLine.$type, ManualLine); + +const baseAutoLine: object = { + $type: "yandex.cloud.video.v1.AutoLine", + status: 0, +}; + +export const AutoLine = { + $type: "yandex.cloud.video.v1.AutoLine" as const, + + encode( + message: AutoLine, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AutoLine { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAutoLine } as AutoLine; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AutoLine { + const message = { ...baseAutoLine } as AutoLine; + message.status = + object.status !== undefined && object.status !== null + ? autoLine_AutoLineStatusFromJSON(object.status) + : 0; + return message; + }, + + toJSON(message: AutoLine): unknown { + const obj: any = {}; + message.status !== undefined && + (obj.status = autoLine_AutoLineStatusToJSON(message.status)); + return obj; + }, + + fromPartial, I>>(object: I): AutoLine { + const message = { ...baseAutoLine } as AutoLine; + message.status = object.status ?? 0; + return message; + }, +}; + +messageTypeRegistry.set(AutoLine.$type, AutoLine); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/video/v1/stream_line_service.ts b/src/generated/yandex/cloud/video/v1/stream_line_service.ts new file mode 100644 index 00000000..287e6650 --- /dev/null +++ b/src/generated/yandex/cloud/video/v1/stream_line_service.ts @@ -0,0 +1,2819 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { + StreamLine, + PushStreamKey, +} from "../../../../yandex/cloud/video/v1/stream_line"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.video.v1"; + +export interface GetStreamLineRequest { + $type: "yandex.cloud.video.v1.GetStreamLineRequest"; + /** ID of the line. */ + streamLineId: string; +} + +export interface ListStreamLinesRequest { + $type: "yandex.cloud.video.v1.ListStreamLinesRequest"; + /** ID of the channel. */ + channelId: string; + /** The maximum number of the results per page to return. Default value: 100. */ + pageSize: number; + /** Page token for getting the next page of the result. */ + pageToken: string; + /** + * By which column the listing should be ordered and in which direction, + * format is "createdAt desc". "id asc" if omitted. + * Possible fields: ["id", "title", "createdAt", "updatedAt"] + * Both snake_case and camelCase are supported for fields. + */ + orderBy: string; + /** + * Filter expression that filters resources listed in the response. + * Expressions are composed of terms connected by logic operators. + * Value in quotes: `'` or `"` + * Example: "key1='value' AND key2='value'" + * Supported operators: ["AND"]. + * Supported fields: ["title"] + * Both snake_case and camelCase are supported for fields. + */ + filter: string; +} + +export interface ListStreamLinesResponse { + $type: "yandex.cloud.video.v1.ListStreamLinesResponse"; + /** List of lines for channel. */ + streamLines: StreamLine[]; + /** Token for getting the next page. */ + nextPageToken: string; +} + +export interface CreateStreamLineRequest { + $type: "yandex.cloud.video.v1.CreateStreamLineRequest"; + /** ID of the channel. */ + channelId: string; + /** Line title. */ + title: string; + /** ID of the thumbnail. */ + thumbnailId: string; + /** Custom labels as `` key:value `` pairs. Maximum 64 per resource. */ + labels: { [key: string]: string }; + /** RTMP push input type. */ + rtmpPush?: RTMPPushParams | undefined; + /** SRT push input type. */ + srtPush?: SRTPushParams | undefined; + /** RTMP pull input type. */ + rtmpPull?: RTMPPullParams | undefined; + /** SRT pull input type. */ + srtPull?: SRTPullParams | undefined; + /** TCP pull input type. */ + tcpPull?: TCPPullParams | undefined; + /** RTSP pull input type. */ + rtspPull?: RTSPPullParams | undefined; + /** Manual control of stream. */ + manualLine?: ManualLineParams | undefined; + /** Automatic control of stream. */ + autoLine?: AutoLineParams | undefined; +} + +export interface CreateStreamLineRequest_LabelsEntry { + $type: "yandex.cloud.video.v1.CreateStreamLineRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface CreateStreamLineMetadata { + $type: "yandex.cloud.video.v1.CreateStreamLineMetadata"; + /** ID of the line. */ + streamLineId: string; +} + +export interface UpdateStreamLineRequest { + $type: "yandex.cloud.video.v1.UpdateStreamLineRequest"; + /** ID of the line. */ + streamLineId: string; + /** Field mask that specifies which fields of the line are going to be updated. */ + fieldMask?: FieldMask; + /** Line title. */ + title: string; + /** ID of the thumbnail. */ + thumbnailId: string; + /** Custom labels as `` key:value `` pairs. Maximum 64 per resource. */ + labels: { [key: string]: string }; + /** RTMP push input type. */ + rtmpPush?: RTMPPushParams | undefined; + /** SRT push input type. */ + srtPush?: SRTPushParams | undefined; + /** RTMP pull input type. */ + rtmpPull?: RTMPPullParams | undefined; + /** SRT pull input type. */ + srtPull?: SRTPullParams | undefined; + /** TCP pull input type. */ + tcpPull?: TCPPullParams | undefined; + /** RTSP pull input type. */ + rtspPull?: RTSPPullParams | undefined; +} + +export interface UpdateStreamLineRequest_LabelsEntry { + $type: "yandex.cloud.video.v1.UpdateStreamLineRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateStreamLineMetadata { + $type: "yandex.cloud.video.v1.UpdateStreamLineMetadata"; + /** ID of the line. */ + streamLineId: string; +} + +export interface DeleteStreamLineRequest { + $type: "yandex.cloud.video.v1.DeleteStreamLineRequest"; + /** ID of the line. */ + streamLineId: string; +} + +export interface DeleteStreamLineMetadata { + $type: "yandex.cloud.video.v1.DeleteStreamLineMetadata"; + /** ID of the line. */ + streamLineId: string; +} + +export interface PerformLineActionRequest { + $type: "yandex.cloud.video.v1.PerformLineActionRequest"; + /** ID of the line. */ + streamLineId: string; + activate?: ActivateAction | undefined; + deactivate?: DeactivateAction | undefined; +} + +export interface PerformLineActionMetadata { + $type: "yandex.cloud.video.v1.PerformLineActionMetadata"; + /** ID of the line. */ + streamLineId: string; +} + +export interface RTMPPushParams { + $type: "yandex.cloud.video.v1.RTMPPushParams"; +} + +export interface SRTPushParams { + $type: "yandex.cloud.video.v1.SRTPushParams"; +} + +export interface RTMPPullParams { + $type: "yandex.cloud.video.v1.RTMPPullParams"; + /** URL of a RTMP streaming server. */ + url: string; +} + +export interface SRTPullParams { + $type: "yandex.cloud.video.v1.SRTPullParams"; + /** URL of a SRT streaming server. */ + url: string; +} + +export interface TCPPullParams { + $type: "yandex.cloud.video.v1.TCPPullParams"; + /** URL of a TCP streaming server. */ + url: string; +} + +export interface RTSPPullParams { + $type: "yandex.cloud.video.v1.RTSPPullParams"; + /** URL of a RTSP streaming server. */ + url: string; +} + +export interface ManualLineParams { + $type: "yandex.cloud.video.v1.ManualLineParams"; +} + +export interface AutoLineParams { + $type: "yandex.cloud.video.v1.AutoLineParams"; +} + +export interface ActivateAction { + $type: "yandex.cloud.video.v1.ActivateAction"; +} + +export interface DeactivateAction { + $type: "yandex.cloud.video.v1.DeactivateAction"; +} + +export interface GetStreamKeyRequest { + $type: "yandex.cloud.video.v1.GetStreamKeyRequest"; + /** ID of the line. */ + streamLineId: string; +} + +export interface UpdateStreamKeyRequest { + $type: "yandex.cloud.video.v1.UpdateStreamKeyRequest"; + /** ID of the line. */ + streamLineId: string; +} + +export interface UpdateStreamKeyMetadata { + $type: "yandex.cloud.video.v1.UpdateStreamKeyMetadata"; + /** ID of the line. */ + streamLineId: string; +} + +const baseGetStreamLineRequest: object = { + $type: "yandex.cloud.video.v1.GetStreamLineRequest", + streamLineId: "", +}; + +export const GetStreamLineRequest = { + $type: "yandex.cloud.video.v1.GetStreamLineRequest" as const, + + encode( + message: GetStreamLineRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamLineId !== "") { + writer.uint32(10).string(message.streamLineId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetStreamLineRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetStreamLineRequest } as GetStreamLineRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamLineId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetStreamLineRequest { + const message = { ...baseGetStreamLineRequest } as GetStreamLineRequest; + message.streamLineId = + object.streamLineId !== undefined && object.streamLineId !== null + ? String(object.streamLineId) + : ""; + return message; + }, + + toJSON(message: GetStreamLineRequest): unknown { + const obj: any = {}; + message.streamLineId !== undefined && + (obj.streamLineId = message.streamLineId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetStreamLineRequest { + const message = { ...baseGetStreamLineRequest } as GetStreamLineRequest; + message.streamLineId = object.streamLineId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetStreamLineRequest.$type, GetStreamLineRequest); + +const baseListStreamLinesRequest: object = { + $type: "yandex.cloud.video.v1.ListStreamLinesRequest", + channelId: "", + pageSize: 0, + pageToken: "", + orderBy: "", + filter: "", +}; + +export const ListStreamLinesRequest = { + $type: "yandex.cloud.video.v1.ListStreamLinesRequest" as const, + + encode( + message: ListStreamLinesRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.pageSize !== 0) { + writer.uint32(800).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(810).string(message.pageToken); + } + if (message.orderBy !== "") { + writer.uint32(818).string(message.orderBy); + } + if (message.filter !== "") { + writer.uint32(826).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListStreamLinesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListStreamLinesRequest } as ListStreamLinesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 100: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 101: + message.pageToken = reader.string(); + break; + case 102: + message.orderBy = reader.string(); + break; + case 103: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListStreamLinesRequest { + const message = { ...baseListStreamLinesRequest } as ListStreamLinesRequest; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.orderBy = + object.orderBy !== undefined && object.orderBy !== null + ? String(object.orderBy) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListStreamLinesRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.orderBy !== undefined && (obj.orderBy = message.orderBy); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListStreamLinesRequest { + const message = { ...baseListStreamLinesRequest } as ListStreamLinesRequest; + message.channelId = object.channelId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.orderBy = object.orderBy ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListStreamLinesRequest.$type, ListStreamLinesRequest); + +const baseListStreamLinesResponse: object = { + $type: "yandex.cloud.video.v1.ListStreamLinesResponse", + nextPageToken: "", +}; + +export const ListStreamLinesResponse = { + $type: "yandex.cloud.video.v1.ListStreamLinesResponse" as const, + + encode( + message: ListStreamLinesResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.streamLines) { + StreamLine.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(802).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListStreamLinesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListStreamLinesResponse, + } as ListStreamLinesResponse; + message.streamLines = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamLines.push(StreamLine.decode(reader, reader.uint32())); + break; + case 100: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListStreamLinesResponse { + const message = { + ...baseListStreamLinesResponse, + } as ListStreamLinesResponse; + message.streamLines = (object.streamLines ?? []).map((e: any) => + StreamLine.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListStreamLinesResponse): unknown { + const obj: any = {}; + if (message.streamLines) { + obj.streamLines = message.streamLines.map((e) => + e ? StreamLine.toJSON(e) : undefined + ); + } else { + obj.streamLines = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListStreamLinesResponse { + const message = { + ...baseListStreamLinesResponse, + } as ListStreamLinesResponse; + message.streamLines = + object.streamLines?.map((e) => StreamLine.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListStreamLinesResponse.$type, ListStreamLinesResponse); + +const baseCreateStreamLineRequest: object = { + $type: "yandex.cloud.video.v1.CreateStreamLineRequest", + channelId: "", + title: "", + thumbnailId: "", +}; + +export const CreateStreamLineRequest = { + $type: "yandex.cloud.video.v1.CreateStreamLineRequest" as const, + + encode( + message: CreateStreamLineRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.title !== "") { + writer.uint32(18).string(message.title); + } + if (message.thumbnailId !== "") { + writer.uint32(26).string(message.thumbnailId); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateStreamLineRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.video.v1.CreateStreamLineRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(1602).fork() + ).ldelim(); + }); + if (message.rtmpPush !== undefined) { + RTMPPushParams.encode( + message.rtmpPush, + writer.uint32(8002).fork() + ).ldelim(); + } + if (message.srtPush !== undefined) { + SRTPushParams.encode( + message.srtPush, + writer.uint32(8010).fork() + ).ldelim(); + } + if (message.rtmpPull !== undefined) { + RTMPPullParams.encode( + message.rtmpPull, + writer.uint32(8018).fork() + ).ldelim(); + } + if (message.srtPull !== undefined) { + SRTPullParams.encode( + message.srtPull, + writer.uint32(8026).fork() + ).ldelim(); + } + if (message.tcpPull !== undefined) { + TCPPullParams.encode( + message.tcpPull, + writer.uint32(8034).fork() + ).ldelim(); + } + if (message.rtspPull !== undefined) { + RTSPPullParams.encode( + message.rtspPull, + writer.uint32(8050).fork() + ).ldelim(); + } + if (message.manualLine !== undefined) { + ManualLineParams.encode( + message.manualLine, + writer.uint32(16002).fork() + ).ldelim(); + } + if (message.autoLine !== undefined) { + AutoLineParams.encode( + message.autoLine, + writer.uint32(16010).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateStreamLineRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateStreamLineRequest, + } as CreateStreamLineRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.thumbnailId = reader.string(); + break; + case 200: + const entry200 = CreateStreamLineRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry200.value !== undefined) { + message.labels[entry200.key] = entry200.value; + } + break; + case 1000: + message.rtmpPush = RTMPPushParams.decode(reader, reader.uint32()); + break; + case 1001: + message.srtPush = SRTPushParams.decode(reader, reader.uint32()); + break; + case 1002: + message.rtmpPull = RTMPPullParams.decode(reader, reader.uint32()); + break; + case 1003: + message.srtPull = SRTPullParams.decode(reader, reader.uint32()); + break; + case 1004: + message.tcpPull = TCPPullParams.decode(reader, reader.uint32()); + break; + case 1006: + message.rtspPull = RTSPPullParams.decode(reader, reader.uint32()); + break; + case 2000: + message.manualLine = ManualLineParams.decode(reader, reader.uint32()); + break; + case 2001: + message.autoLine = AutoLineParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateStreamLineRequest { + const message = { + ...baseCreateStreamLineRequest, + } as CreateStreamLineRequest; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.rtmpPush = + object.rtmpPush !== undefined && object.rtmpPush !== null + ? RTMPPushParams.fromJSON(object.rtmpPush) + : undefined; + message.srtPush = + object.srtPush !== undefined && object.srtPush !== null + ? SRTPushParams.fromJSON(object.srtPush) + : undefined; + message.rtmpPull = + object.rtmpPull !== undefined && object.rtmpPull !== null + ? RTMPPullParams.fromJSON(object.rtmpPull) + : undefined; + message.srtPull = + object.srtPull !== undefined && object.srtPull !== null + ? SRTPullParams.fromJSON(object.srtPull) + : undefined; + message.tcpPull = + object.tcpPull !== undefined && object.tcpPull !== null + ? TCPPullParams.fromJSON(object.tcpPull) + : undefined; + message.rtspPull = + object.rtspPull !== undefined && object.rtspPull !== null + ? RTSPPullParams.fromJSON(object.rtspPull) + : undefined; + message.manualLine = + object.manualLine !== undefined && object.manualLine !== null + ? ManualLineParams.fromJSON(object.manualLine) + : undefined; + message.autoLine = + object.autoLine !== undefined && object.autoLine !== null + ? AutoLineParams.fromJSON(object.autoLine) + : undefined; + return message; + }, + + toJSON(message: CreateStreamLineRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.title !== undefined && (obj.title = message.title); + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.rtmpPush !== undefined && + (obj.rtmpPush = message.rtmpPush + ? RTMPPushParams.toJSON(message.rtmpPush) + : undefined); + message.srtPush !== undefined && + (obj.srtPush = message.srtPush + ? SRTPushParams.toJSON(message.srtPush) + : undefined); + message.rtmpPull !== undefined && + (obj.rtmpPull = message.rtmpPull + ? RTMPPullParams.toJSON(message.rtmpPull) + : undefined); + message.srtPull !== undefined && + (obj.srtPull = message.srtPull + ? SRTPullParams.toJSON(message.srtPull) + : undefined); + message.tcpPull !== undefined && + (obj.tcpPull = message.tcpPull + ? TCPPullParams.toJSON(message.tcpPull) + : undefined); + message.rtspPull !== undefined && + (obj.rtspPull = message.rtspPull + ? RTSPPullParams.toJSON(message.rtspPull) + : undefined); + message.manualLine !== undefined && + (obj.manualLine = message.manualLine + ? ManualLineParams.toJSON(message.manualLine) + : undefined); + message.autoLine !== undefined && + (obj.autoLine = message.autoLine + ? AutoLineParams.toJSON(message.autoLine) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateStreamLineRequest { + const message = { + ...baseCreateStreamLineRequest, + } as CreateStreamLineRequest; + message.channelId = object.channelId ?? ""; + message.title = object.title ?? ""; + message.thumbnailId = object.thumbnailId ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.rtmpPush = + object.rtmpPush !== undefined && object.rtmpPush !== null + ? RTMPPushParams.fromPartial(object.rtmpPush) + : undefined; + message.srtPush = + object.srtPush !== undefined && object.srtPush !== null + ? SRTPushParams.fromPartial(object.srtPush) + : undefined; + message.rtmpPull = + object.rtmpPull !== undefined && object.rtmpPull !== null + ? RTMPPullParams.fromPartial(object.rtmpPull) + : undefined; + message.srtPull = + object.srtPull !== undefined && object.srtPull !== null + ? SRTPullParams.fromPartial(object.srtPull) + : undefined; + message.tcpPull = + object.tcpPull !== undefined && object.tcpPull !== null + ? TCPPullParams.fromPartial(object.tcpPull) + : undefined; + message.rtspPull = + object.rtspPull !== undefined && object.rtspPull !== null + ? RTSPPullParams.fromPartial(object.rtspPull) + : undefined; + message.manualLine = + object.manualLine !== undefined && object.manualLine !== null + ? ManualLineParams.fromPartial(object.manualLine) + : undefined; + message.autoLine = + object.autoLine !== undefined && object.autoLine !== null + ? AutoLineParams.fromPartial(object.autoLine) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CreateStreamLineRequest.$type, CreateStreamLineRequest); + +const baseCreateStreamLineRequest_LabelsEntry: object = { + $type: "yandex.cloud.video.v1.CreateStreamLineRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateStreamLineRequest_LabelsEntry = { + $type: "yandex.cloud.video.v1.CreateStreamLineRequest.LabelsEntry" as const, + + encode( + message: CreateStreamLineRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateStreamLineRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateStreamLineRequest_LabelsEntry, + } as CreateStreamLineRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateStreamLineRequest_LabelsEntry { + const message = { + ...baseCreateStreamLineRequest_LabelsEntry, + } as CreateStreamLineRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateStreamLineRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreateStreamLineRequest_LabelsEntry { + const message = { + ...baseCreateStreamLineRequest_LabelsEntry, + } as CreateStreamLineRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateStreamLineRequest_LabelsEntry.$type, + CreateStreamLineRequest_LabelsEntry +); + +const baseCreateStreamLineMetadata: object = { + $type: "yandex.cloud.video.v1.CreateStreamLineMetadata", + streamLineId: "", +}; + +export const CreateStreamLineMetadata = { + $type: "yandex.cloud.video.v1.CreateStreamLineMetadata" as const, + + encode( + message: CreateStreamLineMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamLineId !== "") { + writer.uint32(10).string(message.streamLineId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateStreamLineMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateStreamLineMetadata, + } as CreateStreamLineMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamLineId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateStreamLineMetadata { + const message = { + ...baseCreateStreamLineMetadata, + } as CreateStreamLineMetadata; + message.streamLineId = + object.streamLineId !== undefined && object.streamLineId !== null + ? String(object.streamLineId) + : ""; + return message; + }, + + toJSON(message: CreateStreamLineMetadata): unknown { + const obj: any = {}; + message.streamLineId !== undefined && + (obj.streamLineId = message.streamLineId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateStreamLineMetadata { + const message = { + ...baseCreateStreamLineMetadata, + } as CreateStreamLineMetadata; + message.streamLineId = object.streamLineId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateStreamLineMetadata.$type, + CreateStreamLineMetadata +); + +const baseUpdateStreamLineRequest: object = { + $type: "yandex.cloud.video.v1.UpdateStreamLineRequest", + streamLineId: "", + title: "", + thumbnailId: "", +}; + +export const UpdateStreamLineRequest = { + $type: "yandex.cloud.video.v1.UpdateStreamLineRequest" as const, + + encode( + message: UpdateStreamLineRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamLineId !== "") { + writer.uint32(10).string(message.streamLineId); + } + if (message.fieldMask !== undefined) { + FieldMask.encode(message.fieldMask, writer.uint32(18).fork()).ldelim(); + } + if (message.title !== "") { + writer.uint32(26).string(message.title); + } + if (message.thumbnailId !== "") { + writer.uint32(34).string(message.thumbnailId); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateStreamLineRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.video.v1.UpdateStreamLineRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(1602).fork() + ).ldelim(); + }); + if (message.rtmpPush !== undefined) { + RTMPPushParams.encode( + message.rtmpPush, + writer.uint32(8002).fork() + ).ldelim(); + } + if (message.srtPush !== undefined) { + SRTPushParams.encode( + message.srtPush, + writer.uint32(8010).fork() + ).ldelim(); + } + if (message.rtmpPull !== undefined) { + RTMPPullParams.encode( + message.rtmpPull, + writer.uint32(8018).fork() + ).ldelim(); + } + if (message.srtPull !== undefined) { + SRTPullParams.encode( + message.srtPull, + writer.uint32(8026).fork() + ).ldelim(); + } + if (message.tcpPull !== undefined) { + TCPPullParams.encode( + message.tcpPull, + writer.uint32(8034).fork() + ).ldelim(); + } + if (message.rtspPull !== undefined) { + RTSPPullParams.encode( + message.rtspPull, + writer.uint32(8050).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateStreamLineRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateStreamLineRequest, + } as UpdateStreamLineRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamLineId = reader.string(); + break; + case 2: + message.fieldMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.title = reader.string(); + break; + case 4: + message.thumbnailId = reader.string(); + break; + case 200: + const entry200 = UpdateStreamLineRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry200.value !== undefined) { + message.labels[entry200.key] = entry200.value; + } + break; + case 1000: + message.rtmpPush = RTMPPushParams.decode(reader, reader.uint32()); + break; + case 1001: + message.srtPush = SRTPushParams.decode(reader, reader.uint32()); + break; + case 1002: + message.rtmpPull = RTMPPullParams.decode(reader, reader.uint32()); + break; + case 1003: + message.srtPull = SRTPullParams.decode(reader, reader.uint32()); + break; + case 1004: + message.tcpPull = TCPPullParams.decode(reader, reader.uint32()); + break; + case 1006: + message.rtspPull = RTSPPullParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateStreamLineRequest { + const message = { + ...baseUpdateStreamLineRequest, + } as UpdateStreamLineRequest; + message.streamLineId = + object.streamLineId !== undefined && object.streamLineId !== null + ? String(object.streamLineId) + : ""; + message.fieldMask = + object.fieldMask !== undefined && object.fieldMask !== null + ? FieldMask.fromJSON(object.fieldMask) + : undefined; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.rtmpPush = + object.rtmpPush !== undefined && object.rtmpPush !== null + ? RTMPPushParams.fromJSON(object.rtmpPush) + : undefined; + message.srtPush = + object.srtPush !== undefined && object.srtPush !== null + ? SRTPushParams.fromJSON(object.srtPush) + : undefined; + message.rtmpPull = + object.rtmpPull !== undefined && object.rtmpPull !== null + ? RTMPPullParams.fromJSON(object.rtmpPull) + : undefined; + message.srtPull = + object.srtPull !== undefined && object.srtPull !== null + ? SRTPullParams.fromJSON(object.srtPull) + : undefined; + message.tcpPull = + object.tcpPull !== undefined && object.tcpPull !== null + ? TCPPullParams.fromJSON(object.tcpPull) + : undefined; + message.rtspPull = + object.rtspPull !== undefined && object.rtspPull !== null + ? RTSPPullParams.fromJSON(object.rtspPull) + : undefined; + return message; + }, + + toJSON(message: UpdateStreamLineRequest): unknown { + const obj: any = {}; + message.streamLineId !== undefined && + (obj.streamLineId = message.streamLineId); + message.fieldMask !== undefined && + (obj.fieldMask = message.fieldMask + ? FieldMask.toJSON(message.fieldMask) + : undefined); + message.title !== undefined && (obj.title = message.title); + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.rtmpPush !== undefined && + (obj.rtmpPush = message.rtmpPush + ? RTMPPushParams.toJSON(message.rtmpPush) + : undefined); + message.srtPush !== undefined && + (obj.srtPush = message.srtPush + ? SRTPushParams.toJSON(message.srtPush) + : undefined); + message.rtmpPull !== undefined && + (obj.rtmpPull = message.rtmpPull + ? RTMPPullParams.toJSON(message.rtmpPull) + : undefined); + message.srtPull !== undefined && + (obj.srtPull = message.srtPull + ? SRTPullParams.toJSON(message.srtPull) + : undefined); + message.tcpPull !== undefined && + (obj.tcpPull = message.tcpPull + ? TCPPullParams.toJSON(message.tcpPull) + : undefined); + message.rtspPull !== undefined && + (obj.rtspPull = message.rtspPull + ? RTSPPullParams.toJSON(message.rtspPull) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateStreamLineRequest { + const message = { + ...baseUpdateStreamLineRequest, + } as UpdateStreamLineRequest; + message.streamLineId = object.streamLineId ?? ""; + message.fieldMask = + object.fieldMask !== undefined && object.fieldMask !== null + ? FieldMask.fromPartial(object.fieldMask) + : undefined; + message.title = object.title ?? ""; + message.thumbnailId = object.thumbnailId ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.rtmpPush = + object.rtmpPush !== undefined && object.rtmpPush !== null + ? RTMPPushParams.fromPartial(object.rtmpPush) + : undefined; + message.srtPush = + object.srtPush !== undefined && object.srtPush !== null + ? SRTPushParams.fromPartial(object.srtPush) + : undefined; + message.rtmpPull = + object.rtmpPull !== undefined && object.rtmpPull !== null + ? RTMPPullParams.fromPartial(object.rtmpPull) + : undefined; + message.srtPull = + object.srtPull !== undefined && object.srtPull !== null + ? SRTPullParams.fromPartial(object.srtPull) + : undefined; + message.tcpPull = + object.tcpPull !== undefined && object.tcpPull !== null + ? TCPPullParams.fromPartial(object.tcpPull) + : undefined; + message.rtspPull = + object.rtspPull !== undefined && object.rtspPull !== null + ? RTSPPullParams.fromPartial(object.rtspPull) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UpdateStreamLineRequest.$type, UpdateStreamLineRequest); + +const baseUpdateStreamLineRequest_LabelsEntry: object = { + $type: "yandex.cloud.video.v1.UpdateStreamLineRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateStreamLineRequest_LabelsEntry = { + $type: "yandex.cloud.video.v1.UpdateStreamLineRequest.LabelsEntry" as const, + + encode( + message: UpdateStreamLineRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateStreamLineRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateStreamLineRequest_LabelsEntry, + } as UpdateStreamLineRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateStreamLineRequest_LabelsEntry { + const message = { + ...baseUpdateStreamLineRequest_LabelsEntry, + } as UpdateStreamLineRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateStreamLineRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdateStreamLineRequest_LabelsEntry { + const message = { + ...baseUpdateStreamLineRequest_LabelsEntry, + } as UpdateStreamLineRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateStreamLineRequest_LabelsEntry.$type, + UpdateStreamLineRequest_LabelsEntry +); + +const baseUpdateStreamLineMetadata: object = { + $type: "yandex.cloud.video.v1.UpdateStreamLineMetadata", + streamLineId: "", +}; + +export const UpdateStreamLineMetadata = { + $type: "yandex.cloud.video.v1.UpdateStreamLineMetadata" as const, + + encode( + message: UpdateStreamLineMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamLineId !== "") { + writer.uint32(10).string(message.streamLineId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateStreamLineMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateStreamLineMetadata, + } as UpdateStreamLineMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamLineId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateStreamLineMetadata { + const message = { + ...baseUpdateStreamLineMetadata, + } as UpdateStreamLineMetadata; + message.streamLineId = + object.streamLineId !== undefined && object.streamLineId !== null + ? String(object.streamLineId) + : ""; + return message; + }, + + toJSON(message: UpdateStreamLineMetadata): unknown { + const obj: any = {}; + message.streamLineId !== undefined && + (obj.streamLineId = message.streamLineId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateStreamLineMetadata { + const message = { + ...baseUpdateStreamLineMetadata, + } as UpdateStreamLineMetadata; + message.streamLineId = object.streamLineId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateStreamLineMetadata.$type, + UpdateStreamLineMetadata +); + +const baseDeleteStreamLineRequest: object = { + $type: "yandex.cloud.video.v1.DeleteStreamLineRequest", + streamLineId: "", +}; + +export const DeleteStreamLineRequest = { + $type: "yandex.cloud.video.v1.DeleteStreamLineRequest" as const, + + encode( + message: DeleteStreamLineRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamLineId !== "") { + writer.uint32(10).string(message.streamLineId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteStreamLineRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteStreamLineRequest, + } as DeleteStreamLineRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamLineId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteStreamLineRequest { + const message = { + ...baseDeleteStreamLineRequest, + } as DeleteStreamLineRequest; + message.streamLineId = + object.streamLineId !== undefined && object.streamLineId !== null + ? String(object.streamLineId) + : ""; + return message; + }, + + toJSON(message: DeleteStreamLineRequest): unknown { + const obj: any = {}; + message.streamLineId !== undefined && + (obj.streamLineId = message.streamLineId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteStreamLineRequest { + const message = { + ...baseDeleteStreamLineRequest, + } as DeleteStreamLineRequest; + message.streamLineId = object.streamLineId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteStreamLineRequest.$type, DeleteStreamLineRequest); + +const baseDeleteStreamLineMetadata: object = { + $type: "yandex.cloud.video.v1.DeleteStreamLineMetadata", + streamLineId: "", +}; + +export const DeleteStreamLineMetadata = { + $type: "yandex.cloud.video.v1.DeleteStreamLineMetadata" as const, + + encode( + message: DeleteStreamLineMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamLineId !== "") { + writer.uint32(10).string(message.streamLineId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteStreamLineMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeleteStreamLineMetadata, + } as DeleteStreamLineMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamLineId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteStreamLineMetadata { + const message = { + ...baseDeleteStreamLineMetadata, + } as DeleteStreamLineMetadata; + message.streamLineId = + object.streamLineId !== undefined && object.streamLineId !== null + ? String(object.streamLineId) + : ""; + return message; + }, + + toJSON(message: DeleteStreamLineMetadata): unknown { + const obj: any = {}; + message.streamLineId !== undefined && + (obj.streamLineId = message.streamLineId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteStreamLineMetadata { + const message = { + ...baseDeleteStreamLineMetadata, + } as DeleteStreamLineMetadata; + message.streamLineId = object.streamLineId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeleteStreamLineMetadata.$type, + DeleteStreamLineMetadata +); + +const basePerformLineActionRequest: object = { + $type: "yandex.cloud.video.v1.PerformLineActionRequest", + streamLineId: "", +}; + +export const PerformLineActionRequest = { + $type: "yandex.cloud.video.v1.PerformLineActionRequest" as const, + + encode( + message: PerformLineActionRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamLineId !== "") { + writer.uint32(10).string(message.streamLineId); + } + if (message.activate !== undefined) { + ActivateAction.encode( + message.activate, + writer.uint32(8002).fork() + ).ldelim(); + } + if (message.deactivate !== undefined) { + DeactivateAction.encode( + message.deactivate, + writer.uint32(8010).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PerformLineActionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePerformLineActionRequest, + } as PerformLineActionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamLineId = reader.string(); + break; + case 1000: + message.activate = ActivateAction.decode(reader, reader.uint32()); + break; + case 1001: + message.deactivate = DeactivateAction.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PerformLineActionRequest { + const message = { + ...basePerformLineActionRequest, + } as PerformLineActionRequest; + message.streamLineId = + object.streamLineId !== undefined && object.streamLineId !== null + ? String(object.streamLineId) + : ""; + message.activate = + object.activate !== undefined && object.activate !== null + ? ActivateAction.fromJSON(object.activate) + : undefined; + message.deactivate = + object.deactivate !== undefined && object.deactivate !== null + ? DeactivateAction.fromJSON(object.deactivate) + : undefined; + return message; + }, + + toJSON(message: PerformLineActionRequest): unknown { + const obj: any = {}; + message.streamLineId !== undefined && + (obj.streamLineId = message.streamLineId); + message.activate !== undefined && + (obj.activate = message.activate + ? ActivateAction.toJSON(message.activate) + : undefined); + message.deactivate !== undefined && + (obj.deactivate = message.deactivate + ? DeactivateAction.toJSON(message.deactivate) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): PerformLineActionRequest { + const message = { + ...basePerformLineActionRequest, + } as PerformLineActionRequest; + message.streamLineId = object.streamLineId ?? ""; + message.activate = + object.activate !== undefined && object.activate !== null + ? ActivateAction.fromPartial(object.activate) + : undefined; + message.deactivate = + object.deactivate !== undefined && object.deactivate !== null + ? DeactivateAction.fromPartial(object.deactivate) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + PerformLineActionRequest.$type, + PerformLineActionRequest +); + +const basePerformLineActionMetadata: object = { + $type: "yandex.cloud.video.v1.PerformLineActionMetadata", + streamLineId: "", +}; + +export const PerformLineActionMetadata = { + $type: "yandex.cloud.video.v1.PerformLineActionMetadata" as const, + + encode( + message: PerformLineActionMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamLineId !== "") { + writer.uint32(10).string(message.streamLineId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PerformLineActionMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePerformLineActionMetadata, + } as PerformLineActionMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamLineId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PerformLineActionMetadata { + const message = { + ...basePerformLineActionMetadata, + } as PerformLineActionMetadata; + message.streamLineId = + object.streamLineId !== undefined && object.streamLineId !== null + ? String(object.streamLineId) + : ""; + return message; + }, + + toJSON(message: PerformLineActionMetadata): unknown { + const obj: any = {}; + message.streamLineId !== undefined && + (obj.streamLineId = message.streamLineId); + return obj; + }, + + fromPartial, I>>( + object: I + ): PerformLineActionMetadata { + const message = { + ...basePerformLineActionMetadata, + } as PerformLineActionMetadata; + message.streamLineId = object.streamLineId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + PerformLineActionMetadata.$type, + PerformLineActionMetadata +); + +const baseRTMPPushParams: object = { + $type: "yandex.cloud.video.v1.RTMPPushParams", +}; + +export const RTMPPushParams = { + $type: "yandex.cloud.video.v1.RTMPPushParams" as const, + + encode( + _: RTMPPushParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RTMPPushParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRTMPPushParams } as RTMPPushParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): RTMPPushParams { + const message = { ...baseRTMPPushParams } as RTMPPushParams; + return message; + }, + + toJSON(_: RTMPPushParams): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): RTMPPushParams { + const message = { ...baseRTMPPushParams } as RTMPPushParams; + return message; + }, +}; + +messageTypeRegistry.set(RTMPPushParams.$type, RTMPPushParams); + +const baseSRTPushParams: object = { + $type: "yandex.cloud.video.v1.SRTPushParams", +}; + +export const SRTPushParams = { + $type: "yandex.cloud.video.v1.SRTPushParams" as const, + + encode( + _: SRTPushParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SRTPushParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSRTPushParams } as SRTPushParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): SRTPushParams { + const message = { ...baseSRTPushParams } as SRTPushParams; + return message; + }, + + toJSON(_: SRTPushParams): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): SRTPushParams { + const message = { ...baseSRTPushParams } as SRTPushParams; + return message; + }, +}; + +messageTypeRegistry.set(SRTPushParams.$type, SRTPushParams); + +const baseRTMPPullParams: object = { + $type: "yandex.cloud.video.v1.RTMPPullParams", + url: "", +}; + +export const RTMPPullParams = { + $type: "yandex.cloud.video.v1.RTMPPullParams" as const, + + encode( + message: RTMPPullParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(10).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RTMPPullParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRTMPPullParams } as RTMPPullParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RTMPPullParams { + const message = { ...baseRTMPPullParams } as RTMPPullParams; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: RTMPPullParams): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial, I>>( + object: I + ): RTMPPullParams { + const message = { ...baseRTMPPullParams } as RTMPPullParams; + message.url = object.url ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(RTMPPullParams.$type, RTMPPullParams); + +const baseSRTPullParams: object = { + $type: "yandex.cloud.video.v1.SRTPullParams", + url: "", +}; + +export const SRTPullParams = { + $type: "yandex.cloud.video.v1.SRTPullParams" as const, + + encode( + message: SRTPullParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(10).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SRTPullParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSRTPullParams } as SRTPullParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SRTPullParams { + const message = { ...baseSRTPullParams } as SRTPullParams; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: SRTPullParams): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial, I>>( + object: I + ): SRTPullParams { + const message = { ...baseSRTPullParams } as SRTPullParams; + message.url = object.url ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(SRTPullParams.$type, SRTPullParams); + +const baseTCPPullParams: object = { + $type: "yandex.cloud.video.v1.TCPPullParams", + url: "", +}; + +export const TCPPullParams = { + $type: "yandex.cloud.video.v1.TCPPullParams" as const, + + encode( + message: TCPPullParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(18).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TCPPullParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTCPPullParams } as TCPPullParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TCPPullParams { + const message = { ...baseTCPPullParams } as TCPPullParams; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: TCPPullParams): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial, I>>( + object: I + ): TCPPullParams { + const message = { ...baseTCPPullParams } as TCPPullParams; + message.url = object.url ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(TCPPullParams.$type, TCPPullParams); + +const baseRTSPPullParams: object = { + $type: "yandex.cloud.video.v1.RTSPPullParams", + url: "", +}; + +export const RTSPPullParams = { + $type: "yandex.cloud.video.v1.RTSPPullParams" as const, + + encode( + message: RTSPPullParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(10).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RTSPPullParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRTSPPullParams } as RTSPPullParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RTSPPullParams { + const message = { ...baseRTSPPullParams } as RTSPPullParams; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: RTSPPullParams): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial, I>>( + object: I + ): RTSPPullParams { + const message = { ...baseRTSPPullParams } as RTSPPullParams; + message.url = object.url ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(RTSPPullParams.$type, RTSPPullParams); + +const baseManualLineParams: object = { + $type: "yandex.cloud.video.v1.ManualLineParams", +}; + +export const ManualLineParams = { + $type: "yandex.cloud.video.v1.ManualLineParams" as const, + + encode( + _: ManualLineParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ManualLineParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseManualLineParams } as ManualLineParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): ManualLineParams { + const message = { ...baseManualLineParams } as ManualLineParams; + return message; + }, + + toJSON(_: ManualLineParams): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): ManualLineParams { + const message = { ...baseManualLineParams } as ManualLineParams; + return message; + }, +}; + +messageTypeRegistry.set(ManualLineParams.$type, ManualLineParams); + +const baseAutoLineParams: object = { + $type: "yandex.cloud.video.v1.AutoLineParams", +}; + +export const AutoLineParams = { + $type: "yandex.cloud.video.v1.AutoLineParams" as const, + + encode( + _: AutoLineParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AutoLineParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAutoLineParams } as AutoLineParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): AutoLineParams { + const message = { ...baseAutoLineParams } as AutoLineParams; + return message; + }, + + toJSON(_: AutoLineParams): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): AutoLineParams { + const message = { ...baseAutoLineParams } as AutoLineParams; + return message; + }, +}; + +messageTypeRegistry.set(AutoLineParams.$type, AutoLineParams); + +const baseActivateAction: object = { + $type: "yandex.cloud.video.v1.ActivateAction", +}; + +export const ActivateAction = { + $type: "yandex.cloud.video.v1.ActivateAction" as const, + + encode( + _: ActivateAction, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ActivateAction { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseActivateAction } as ActivateAction; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): ActivateAction { + const message = { ...baseActivateAction } as ActivateAction; + return message; + }, + + toJSON(_: ActivateAction): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): ActivateAction { + const message = { ...baseActivateAction } as ActivateAction; + return message; + }, +}; + +messageTypeRegistry.set(ActivateAction.$type, ActivateAction); + +const baseDeactivateAction: object = { + $type: "yandex.cloud.video.v1.DeactivateAction", +}; + +export const DeactivateAction = { + $type: "yandex.cloud.video.v1.DeactivateAction" as const, + + encode( + _: DeactivateAction, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeactivateAction { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeactivateAction } as DeactivateAction; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): DeactivateAction { + const message = { ...baseDeactivateAction } as DeactivateAction; + return message; + }, + + toJSON(_: DeactivateAction): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): DeactivateAction { + const message = { ...baseDeactivateAction } as DeactivateAction; + return message; + }, +}; + +messageTypeRegistry.set(DeactivateAction.$type, DeactivateAction); + +const baseGetStreamKeyRequest: object = { + $type: "yandex.cloud.video.v1.GetStreamKeyRequest", + streamLineId: "", +}; + +export const GetStreamKeyRequest = { + $type: "yandex.cloud.video.v1.GetStreamKeyRequest" as const, + + encode( + message: GetStreamKeyRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamLineId !== "") { + writer.uint32(10).string(message.streamLineId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetStreamKeyRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetStreamKeyRequest } as GetStreamKeyRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamLineId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetStreamKeyRequest { + const message = { ...baseGetStreamKeyRequest } as GetStreamKeyRequest; + message.streamLineId = + object.streamLineId !== undefined && object.streamLineId !== null + ? String(object.streamLineId) + : ""; + return message; + }, + + toJSON(message: GetStreamKeyRequest): unknown { + const obj: any = {}; + message.streamLineId !== undefined && + (obj.streamLineId = message.streamLineId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetStreamKeyRequest { + const message = { ...baseGetStreamKeyRequest } as GetStreamKeyRequest; + message.streamLineId = object.streamLineId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetStreamKeyRequest.$type, GetStreamKeyRequest); + +const baseUpdateStreamKeyRequest: object = { + $type: "yandex.cloud.video.v1.UpdateStreamKeyRequest", + streamLineId: "", +}; + +export const UpdateStreamKeyRequest = { + $type: "yandex.cloud.video.v1.UpdateStreamKeyRequest" as const, + + encode( + message: UpdateStreamKeyRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamLineId !== "") { + writer.uint32(10).string(message.streamLineId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateStreamKeyRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateStreamKeyRequest } as UpdateStreamKeyRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamLineId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateStreamKeyRequest { + const message = { ...baseUpdateStreamKeyRequest } as UpdateStreamKeyRequest; + message.streamLineId = + object.streamLineId !== undefined && object.streamLineId !== null + ? String(object.streamLineId) + : ""; + return message; + }, + + toJSON(message: UpdateStreamKeyRequest): unknown { + const obj: any = {}; + message.streamLineId !== undefined && + (obj.streamLineId = message.streamLineId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateStreamKeyRequest { + const message = { ...baseUpdateStreamKeyRequest } as UpdateStreamKeyRequest; + message.streamLineId = object.streamLineId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateStreamKeyRequest.$type, UpdateStreamKeyRequest); + +const baseUpdateStreamKeyMetadata: object = { + $type: "yandex.cloud.video.v1.UpdateStreamKeyMetadata", + streamLineId: "", +}; + +export const UpdateStreamKeyMetadata = { + $type: "yandex.cloud.video.v1.UpdateStreamKeyMetadata" as const, + + encode( + message: UpdateStreamKeyMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamLineId !== "") { + writer.uint32(10).string(message.streamLineId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateStreamKeyMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateStreamKeyMetadata, + } as UpdateStreamKeyMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamLineId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateStreamKeyMetadata { + const message = { + ...baseUpdateStreamKeyMetadata, + } as UpdateStreamKeyMetadata; + message.streamLineId = + object.streamLineId !== undefined && object.streamLineId !== null + ? String(object.streamLineId) + : ""; + return message; + }, + + toJSON(message: UpdateStreamKeyMetadata): unknown { + const obj: any = {}; + message.streamLineId !== undefined && + (obj.streamLineId = message.streamLineId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateStreamKeyMetadata { + const message = { + ...baseUpdateStreamKeyMetadata, + } as UpdateStreamKeyMetadata; + message.streamLineId = object.streamLineId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateStreamKeyMetadata.$type, UpdateStreamKeyMetadata); + +/** Stream line management service. */ +export const StreamLineServiceService = { + /** Returns the specific stream line. */ + get: { + path: "/yandex.cloud.video.v1.StreamLineService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetStreamLineRequest) => + Buffer.from(GetStreamLineRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetStreamLineRequest.decode(value), + responseSerialize: (value: StreamLine) => + Buffer.from(StreamLine.encode(value).finish()), + responseDeserialize: (value: Buffer) => StreamLine.decode(value), + }, + /** List lines for channel. */ + list: { + path: "/yandex.cloud.video.v1.StreamLineService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListStreamLinesRequest) => + Buffer.from(ListStreamLinesRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListStreamLinesRequest.decode(value), + responseSerialize: (value: ListStreamLinesResponse) => + Buffer.from(ListStreamLinesResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListStreamLinesResponse.decode(value), + }, + /** Create stream line. */ + create: { + path: "/yandex.cloud.video.v1.StreamLineService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateStreamLineRequest) => + Buffer.from(CreateStreamLineRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CreateStreamLineRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Update stream line. */ + update: { + path: "/yandex.cloud.video.v1.StreamLineService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateStreamLineRequest) => + Buffer.from(UpdateStreamLineRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdateStreamLineRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Delete stream line. */ + delete: { + path: "/yandex.cloud.video.v1.StreamLineService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteStreamLineRequest) => + Buffer.from(DeleteStreamLineRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeleteStreamLineRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Perform an action on the line. */ + performAction: { + path: "/yandex.cloud.video.v1.StreamLineService/PerformAction", + requestStream: false, + responseStream: false, + requestSerialize: (value: PerformLineActionRequest) => + Buffer.from(PerformLineActionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + PerformLineActionRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Returns unique stream key. */ + getStreamKey: { + path: "/yandex.cloud.video.v1.StreamLineService/GetStreamKey", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetStreamKeyRequest) => + Buffer.from(GetStreamKeyRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetStreamKeyRequest.decode(value), + responseSerialize: (value: PushStreamKey) => + Buffer.from(PushStreamKey.encode(value).finish()), + responseDeserialize: (value: Buffer) => PushStreamKey.decode(value), + }, + /** Change stream key. */ + updateStreamKey: { + path: "/yandex.cloud.video.v1.StreamLineService/UpdateStreamKey", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateStreamKeyRequest) => + Buffer.from(UpdateStreamKeyRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateStreamKeyRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface StreamLineServiceServer extends UntypedServiceImplementation { + /** Returns the specific stream line. */ + get: handleUnaryCall; + /** List lines for channel. */ + list: handleUnaryCall; + /** Create stream line. */ + create: handleUnaryCall; + /** Update stream line. */ + update: handleUnaryCall; + /** Delete stream line. */ + delete: handleUnaryCall; + /** Perform an action on the line. */ + performAction: handleUnaryCall; + /** Returns unique stream key. */ + getStreamKey: handleUnaryCall; + /** Change stream key. */ + updateStreamKey: handleUnaryCall; +} + +export interface StreamLineServiceClient extends Client { + /** Returns the specific stream line. */ + get( + request: GetStreamLineRequest, + callback: (error: ServiceError | null, response: StreamLine) => void + ): ClientUnaryCall; + get( + request: GetStreamLineRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: StreamLine) => void + ): ClientUnaryCall; + get( + request: GetStreamLineRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: StreamLine) => void + ): ClientUnaryCall; + /** List lines for channel. */ + list( + request: ListStreamLinesRequest, + callback: ( + error: ServiceError | null, + response: ListStreamLinesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListStreamLinesRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListStreamLinesResponse + ) => void + ): ClientUnaryCall; + list( + request: ListStreamLinesRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListStreamLinesResponse + ) => void + ): ClientUnaryCall; + /** Create stream line. */ + create( + request: CreateStreamLineRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateStreamLineRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateStreamLineRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Update stream line. */ + update( + request: UpdateStreamLineRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateStreamLineRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateStreamLineRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Delete stream line. */ + delete( + request: DeleteStreamLineRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteStreamLineRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteStreamLineRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Perform an action on the line. */ + performAction( + request: PerformLineActionRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + performAction( + request: PerformLineActionRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + performAction( + request: PerformLineActionRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Returns unique stream key. */ + getStreamKey( + request: GetStreamKeyRequest, + callback: (error: ServiceError | null, response: PushStreamKey) => void + ): ClientUnaryCall; + getStreamKey( + request: GetStreamKeyRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: PushStreamKey) => void + ): ClientUnaryCall; + getStreamKey( + request: GetStreamKeyRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: PushStreamKey) => void + ): ClientUnaryCall; + /** Change stream key. */ + updateStreamKey( + request: UpdateStreamKeyRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateStreamKey( + request: UpdateStreamKeyRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + updateStreamKey( + request: UpdateStreamKeyRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const StreamLineServiceClient = makeGenericClientConstructor( + StreamLineServiceService, + "yandex.cloud.video.v1.StreamLineService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): StreamLineServiceClient; + service: typeof StreamLineServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/video/v1/stream_service.ts b/src/generated/yandex/cloud/video/v1/stream_service.ts new file mode 100644 index 00000000..fbc11cde --- /dev/null +++ b/src/generated/yandex/cloud/video/v1/stream_service.ts @@ -0,0 +1,1966 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { Stream } from "../../../../yandex/cloud/video/v1/stream"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.video.v1"; + +export interface GetStreamRequest { + $type: "yandex.cloud.video.v1.GetStreamRequest"; + /** ID of the stream. */ + streamId: string; +} + +export interface ListStreamsRequest { + $type: "yandex.cloud.video.v1.ListStreamsRequest"; + /** ID of the channel. */ + channelId: string; + /** The maximum number of the results per page to return. Default value: 100. */ + pageSize: number; + /** Page token for getting the next page of the result. */ + pageToken: string; + /** + * By which column the listing should be ordered and in which direction, + * format is "createdAt desc". "id asc" if omitted. + * Possible fields: ["id", "title", "startTime", "finishTime", "createdAt", "updatedAt"] + * Both snake_case and camelCase are supported for fields. + */ + orderBy: string; + /** + * Filter expression that filters resources listed in the response. + * Expressions are composed of terms connected by logic operators. + * Value in quotes: `'` or `"` + * Example: "key1='value' AND key2='value'" + * Supported operators: ["AND"]. + * Supported fields: ["title", "lineId", "status"] + * Both snake_case and camelCase are supported for fields. + */ + filter: string; +} + +export interface ListStreamsResponse { + $type: "yandex.cloud.video.v1.ListStreamsResponse"; + /** List of streams for channel. */ + streams: Stream[]; + /** Token for getting the next page. */ + nextPageToken: string; +} + +export interface CreateStreamRequest { + $type: "yandex.cloud.video.v1.CreateStreamRequest"; + /** ID of the channel. */ + channelId: string; + /** ID of the line. */ + lineId: string; + /** Stream title. */ + title: string; + /** Stream description. */ + description: string; + /** ID of the thumbnail. */ + thumbnailId: string; + /** Custom labels as `` key:value `` pairs. Maximum 64 per resource. */ + labels: { [key: string]: string }; + /** On demand stream. It starts immediately when a signal appears. */ + onDemand?: OnDemandParams | undefined; + /** Schedule stream. Determines when to start receiving the signal or finish time. */ + schedule?: ScheduleParams | undefined; +} + +export interface CreateStreamRequest_LabelsEntry { + $type: "yandex.cloud.video.v1.CreateStreamRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface OnDemandParams { + $type: "yandex.cloud.video.v1.OnDemandParams"; +} + +export interface ScheduleParams { + $type: "yandex.cloud.video.v1.ScheduleParams"; + startTime?: Date; + finishTime?: Date; +} + +export interface CreateStreamMetadata { + $type: "yandex.cloud.video.v1.CreateStreamMetadata"; + /** ID of the stream. */ + streamId: string; +} + +export interface UpdateStreamRequest { + $type: "yandex.cloud.video.v1.UpdateStreamRequest"; + /** ID of the stream. */ + streamId: string; + /** Field mask that specifies which fields of the stream are going to be updated. */ + fieldMask?: FieldMask; + /** ID of the line. */ + lineId: string; + /** Stream title. */ + title: string; + /** Stream description. */ + description: string; + /** ID of the thumbnail. */ + thumbnailId: string; + /** Custom labels as `` key:value `` pairs. Maximum 64 per resource. */ + labels: { [key: string]: string }; + /** On demand stream. It starts immediately when a signal appears. */ + onDemand?: OnDemandParams | undefined; + /** Schedule stream. Determines when to start receiving the signal or finish time. */ + schedule?: ScheduleParams | undefined; +} + +export interface UpdateStreamRequest_LabelsEntry { + $type: "yandex.cloud.video.v1.UpdateStreamRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateStreamMetadata { + $type: "yandex.cloud.video.v1.UpdateStreamMetadata"; + /** ID of the stream. */ + streamId: string; +} + +export interface DeleteStreamRequest { + $type: "yandex.cloud.video.v1.DeleteStreamRequest"; + /** ID of the stream. */ + streamId: string; +} + +export interface DeleteStreamMetadata { + $type: "yandex.cloud.video.v1.DeleteStreamMetadata"; + /** ID of the stream. */ + streamId: string; +} + +export interface PerformStreamActionRequest { + $type: "yandex.cloud.video.v1.PerformStreamActionRequest"; + /** ID of the stream. */ + streamId: string; + publish?: PublishAction | undefined; + stop?: StopAction | undefined; +} + +export interface PublishAction { + $type: "yandex.cloud.video.v1.PublishAction"; +} + +export interface StopAction { + $type: "yandex.cloud.video.v1.StopAction"; +} + +export interface PerformStreamActionMetadata { + $type: "yandex.cloud.video.v1.PerformStreamActionMetadata"; + /** ID of the stream. */ + streamId: string; +} + +const baseGetStreamRequest: object = { + $type: "yandex.cloud.video.v1.GetStreamRequest", + streamId: "", +}; + +export const GetStreamRequest = { + $type: "yandex.cloud.video.v1.GetStreamRequest" as const, + + encode( + message: GetStreamRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamId !== "") { + writer.uint32(10).string(message.streamId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetStreamRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetStreamRequest } as GetStreamRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetStreamRequest { + const message = { ...baseGetStreamRequest } as GetStreamRequest; + message.streamId = + object.streamId !== undefined && object.streamId !== null + ? String(object.streamId) + : ""; + return message; + }, + + toJSON(message: GetStreamRequest): unknown { + const obj: any = {}; + message.streamId !== undefined && (obj.streamId = message.streamId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetStreamRequest { + const message = { ...baseGetStreamRequest } as GetStreamRequest; + message.streamId = object.streamId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetStreamRequest.$type, GetStreamRequest); + +const baseListStreamsRequest: object = { + $type: "yandex.cloud.video.v1.ListStreamsRequest", + channelId: "", + pageSize: 0, + pageToken: "", + orderBy: "", + filter: "", +}; + +export const ListStreamsRequest = { + $type: "yandex.cloud.video.v1.ListStreamsRequest" as const, + + encode( + message: ListStreamsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.pageSize !== 0) { + writer.uint32(800).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(810).string(message.pageToken); + } + if (message.orderBy !== "") { + writer.uint32(818).string(message.orderBy); + } + if (message.filter !== "") { + writer.uint32(826).string(message.filter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListStreamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListStreamsRequest } as ListStreamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 100: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 101: + message.pageToken = reader.string(); + break; + case 102: + message.orderBy = reader.string(); + break; + case 103: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListStreamsRequest { + const message = { ...baseListStreamsRequest } as ListStreamsRequest; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.orderBy = + object.orderBy !== undefined && object.orderBy !== null + ? String(object.orderBy) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListStreamsRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.orderBy !== undefined && (obj.orderBy = message.orderBy); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListStreamsRequest { + const message = { ...baseListStreamsRequest } as ListStreamsRequest; + message.channelId = object.channelId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.orderBy = object.orderBy ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListStreamsRequest.$type, ListStreamsRequest); + +const baseListStreamsResponse: object = { + $type: "yandex.cloud.video.v1.ListStreamsResponse", + nextPageToken: "", +}; + +export const ListStreamsResponse = { + $type: "yandex.cloud.video.v1.ListStreamsResponse" as const, + + encode( + message: ListStreamsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.streams) { + Stream.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(802).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListStreamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListStreamsResponse } as ListStreamsResponse; + message.streams = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streams.push(Stream.decode(reader, reader.uint32())); + break; + case 100: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListStreamsResponse { + const message = { ...baseListStreamsResponse } as ListStreamsResponse; + message.streams = (object.streams ?? []).map((e: any) => + Stream.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListStreamsResponse): unknown { + const obj: any = {}; + if (message.streams) { + obj.streams = message.streams.map((e) => + e ? Stream.toJSON(e) : undefined + ); + } else { + obj.streams = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListStreamsResponse { + const message = { ...baseListStreamsResponse } as ListStreamsResponse; + message.streams = object.streams?.map((e) => Stream.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListStreamsResponse.$type, ListStreamsResponse); + +const baseCreateStreamRequest: object = { + $type: "yandex.cloud.video.v1.CreateStreamRequest", + channelId: "", + lineId: "", + title: "", + description: "", + thumbnailId: "", +}; + +export const CreateStreamRequest = { + $type: "yandex.cloud.video.v1.CreateStreamRequest" as const, + + encode( + message: CreateStreamRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.lineId !== "") { + writer.uint32(18).string(message.lineId); + } + if (message.title !== "") { + writer.uint32(26).string(message.title); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.thumbnailId !== "") { + writer.uint32(42).string(message.thumbnailId); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateStreamRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.video.v1.CreateStreamRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(1602).fork() + ).ldelim(); + }); + if (message.onDemand !== undefined) { + OnDemandParams.encode( + message.onDemand, + writer.uint32(8002).fork() + ).ldelim(); + } + if (message.schedule !== undefined) { + ScheduleParams.encode( + message.schedule, + writer.uint32(8010).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateStreamRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateStreamRequest } as CreateStreamRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.lineId = reader.string(); + break; + case 3: + message.title = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.thumbnailId = reader.string(); + break; + case 200: + const entry200 = CreateStreamRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry200.value !== undefined) { + message.labels[entry200.key] = entry200.value; + } + break; + case 1000: + message.onDemand = OnDemandParams.decode(reader, reader.uint32()); + break; + case 1001: + message.schedule = ScheduleParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateStreamRequest { + const message = { ...baseCreateStreamRequest } as CreateStreamRequest; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + message.lineId = + object.lineId !== undefined && object.lineId !== null + ? String(object.lineId) + : ""; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.onDemand = + object.onDemand !== undefined && object.onDemand !== null + ? OnDemandParams.fromJSON(object.onDemand) + : undefined; + message.schedule = + object.schedule !== undefined && object.schedule !== null + ? ScheduleParams.fromJSON(object.schedule) + : undefined; + return message; + }, + + toJSON(message: CreateStreamRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.lineId !== undefined && (obj.lineId = message.lineId); + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.onDemand !== undefined && + (obj.onDemand = message.onDemand + ? OnDemandParams.toJSON(message.onDemand) + : undefined); + message.schedule !== undefined && + (obj.schedule = message.schedule + ? ScheduleParams.toJSON(message.schedule) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateStreamRequest { + const message = { ...baseCreateStreamRequest } as CreateStreamRequest; + message.channelId = object.channelId ?? ""; + message.lineId = object.lineId ?? ""; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.thumbnailId = object.thumbnailId ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.onDemand = + object.onDemand !== undefined && object.onDemand !== null + ? OnDemandParams.fromPartial(object.onDemand) + : undefined; + message.schedule = + object.schedule !== undefined && object.schedule !== null + ? ScheduleParams.fromPartial(object.schedule) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CreateStreamRequest.$type, CreateStreamRequest); + +const baseCreateStreamRequest_LabelsEntry: object = { + $type: "yandex.cloud.video.v1.CreateStreamRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateStreamRequest_LabelsEntry = { + $type: "yandex.cloud.video.v1.CreateStreamRequest.LabelsEntry" as const, + + encode( + message: CreateStreamRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateStreamRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateStreamRequest_LabelsEntry, + } as CreateStreamRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateStreamRequest_LabelsEntry { + const message = { + ...baseCreateStreamRequest_LabelsEntry, + } as CreateStreamRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateStreamRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateStreamRequest_LabelsEntry { + const message = { + ...baseCreateStreamRequest_LabelsEntry, + } as CreateStreamRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateStreamRequest_LabelsEntry.$type, + CreateStreamRequest_LabelsEntry +); + +const baseOnDemandParams: object = { + $type: "yandex.cloud.video.v1.OnDemandParams", +}; + +export const OnDemandParams = { + $type: "yandex.cloud.video.v1.OnDemandParams" as const, + + encode( + _: OnDemandParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OnDemandParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOnDemandParams } as OnDemandParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): OnDemandParams { + const message = { ...baseOnDemandParams } as OnDemandParams; + return message; + }, + + toJSON(_: OnDemandParams): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): OnDemandParams { + const message = { ...baseOnDemandParams } as OnDemandParams; + return message; + }, +}; + +messageTypeRegistry.set(OnDemandParams.$type, OnDemandParams); + +const baseScheduleParams: object = { + $type: "yandex.cloud.video.v1.ScheduleParams", +}; + +export const ScheduleParams = { + $type: "yandex.cloud.video.v1.ScheduleParams" as const, + + encode( + message: ScheduleParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.startTime !== undefined) { + Timestamp.encode( + toTimestamp(message.startTime), + writer.uint32(10).fork() + ).ldelim(); + } + if (message.finishTime !== undefined) { + Timestamp.encode( + toTimestamp(message.finishTime), + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScheduleParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseScheduleParams } as ScheduleParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 2: + message.finishTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScheduleParams { + const message = { ...baseScheduleParams } as ScheduleParams; + message.startTime = + object.startTime !== undefined && object.startTime !== null + ? fromJsonTimestamp(object.startTime) + : undefined; + message.finishTime = + object.finishTime !== undefined && object.finishTime !== null + ? fromJsonTimestamp(object.finishTime) + : undefined; + return message; + }, + + toJSON(message: ScheduleParams): unknown { + const obj: any = {}; + message.startTime !== undefined && + (obj.startTime = message.startTime.toISOString()); + message.finishTime !== undefined && + (obj.finishTime = message.finishTime.toISOString()); + return obj; + }, + + fromPartial, I>>( + object: I + ): ScheduleParams { + const message = { ...baseScheduleParams } as ScheduleParams; + message.startTime = object.startTime ?? undefined; + message.finishTime = object.finishTime ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(ScheduleParams.$type, ScheduleParams); + +const baseCreateStreamMetadata: object = { + $type: "yandex.cloud.video.v1.CreateStreamMetadata", + streamId: "", +}; + +export const CreateStreamMetadata = { + $type: "yandex.cloud.video.v1.CreateStreamMetadata" as const, + + encode( + message: CreateStreamMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamId !== "") { + writer.uint32(10).string(message.streamId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateStreamMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateStreamMetadata } as CreateStreamMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateStreamMetadata { + const message = { ...baseCreateStreamMetadata } as CreateStreamMetadata; + message.streamId = + object.streamId !== undefined && object.streamId !== null + ? String(object.streamId) + : ""; + return message; + }, + + toJSON(message: CreateStreamMetadata): unknown { + const obj: any = {}; + message.streamId !== undefined && (obj.streamId = message.streamId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateStreamMetadata { + const message = { ...baseCreateStreamMetadata } as CreateStreamMetadata; + message.streamId = object.streamId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateStreamMetadata.$type, CreateStreamMetadata); + +const baseUpdateStreamRequest: object = { + $type: "yandex.cloud.video.v1.UpdateStreamRequest", + streamId: "", + lineId: "", + title: "", + description: "", + thumbnailId: "", +}; + +export const UpdateStreamRequest = { + $type: "yandex.cloud.video.v1.UpdateStreamRequest" as const, + + encode( + message: UpdateStreamRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamId !== "") { + writer.uint32(10).string(message.streamId); + } + if (message.fieldMask !== undefined) { + FieldMask.encode(message.fieldMask, writer.uint32(18).fork()).ldelim(); + } + if (message.lineId !== "") { + writer.uint32(26).string(message.lineId); + } + if (message.title !== "") { + writer.uint32(34).string(message.title); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + if (message.thumbnailId !== "") { + writer.uint32(50).string(message.thumbnailId); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateStreamRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.video.v1.UpdateStreamRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(1602).fork() + ).ldelim(); + }); + if (message.onDemand !== undefined) { + OnDemandParams.encode( + message.onDemand, + writer.uint32(8002).fork() + ).ldelim(); + } + if (message.schedule !== undefined) { + ScheduleParams.encode( + message.schedule, + writer.uint32(8010).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateStreamRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateStreamRequest } as UpdateStreamRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamId = reader.string(); + break; + case 2: + message.fieldMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.lineId = reader.string(); + break; + case 4: + message.title = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.thumbnailId = reader.string(); + break; + case 200: + const entry200 = UpdateStreamRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry200.value !== undefined) { + message.labels[entry200.key] = entry200.value; + } + break; + case 1000: + message.onDemand = OnDemandParams.decode(reader, reader.uint32()); + break; + case 1001: + message.schedule = ScheduleParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateStreamRequest { + const message = { ...baseUpdateStreamRequest } as UpdateStreamRequest; + message.streamId = + object.streamId !== undefined && object.streamId !== null + ? String(object.streamId) + : ""; + message.fieldMask = + object.fieldMask !== undefined && object.fieldMask !== null + ? FieldMask.fromJSON(object.fieldMask) + : undefined; + message.lineId = + object.lineId !== undefined && object.lineId !== null + ? String(object.lineId) + : ""; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.onDemand = + object.onDemand !== undefined && object.onDemand !== null + ? OnDemandParams.fromJSON(object.onDemand) + : undefined; + message.schedule = + object.schedule !== undefined && object.schedule !== null + ? ScheduleParams.fromJSON(object.schedule) + : undefined; + return message; + }, + + toJSON(message: UpdateStreamRequest): unknown { + const obj: any = {}; + message.streamId !== undefined && (obj.streamId = message.streamId); + message.fieldMask !== undefined && + (obj.fieldMask = message.fieldMask + ? FieldMask.toJSON(message.fieldMask) + : undefined); + message.lineId !== undefined && (obj.lineId = message.lineId); + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.onDemand !== undefined && + (obj.onDemand = message.onDemand + ? OnDemandParams.toJSON(message.onDemand) + : undefined); + message.schedule !== undefined && + (obj.schedule = message.schedule + ? ScheduleParams.toJSON(message.schedule) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateStreamRequest { + const message = { ...baseUpdateStreamRequest } as UpdateStreamRequest; + message.streamId = object.streamId ?? ""; + message.fieldMask = + object.fieldMask !== undefined && object.fieldMask !== null + ? FieldMask.fromPartial(object.fieldMask) + : undefined; + message.lineId = object.lineId ?? ""; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.thumbnailId = object.thumbnailId ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.onDemand = + object.onDemand !== undefined && object.onDemand !== null + ? OnDemandParams.fromPartial(object.onDemand) + : undefined; + message.schedule = + object.schedule !== undefined && object.schedule !== null + ? ScheduleParams.fromPartial(object.schedule) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UpdateStreamRequest.$type, UpdateStreamRequest); + +const baseUpdateStreamRequest_LabelsEntry: object = { + $type: "yandex.cloud.video.v1.UpdateStreamRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateStreamRequest_LabelsEntry = { + $type: "yandex.cloud.video.v1.UpdateStreamRequest.LabelsEntry" as const, + + encode( + message: UpdateStreamRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateStreamRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateStreamRequest_LabelsEntry, + } as UpdateStreamRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateStreamRequest_LabelsEntry { + const message = { + ...baseUpdateStreamRequest_LabelsEntry, + } as UpdateStreamRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateStreamRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateStreamRequest_LabelsEntry { + const message = { + ...baseUpdateStreamRequest_LabelsEntry, + } as UpdateStreamRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateStreamRequest_LabelsEntry.$type, + UpdateStreamRequest_LabelsEntry +); + +const baseUpdateStreamMetadata: object = { + $type: "yandex.cloud.video.v1.UpdateStreamMetadata", + streamId: "", +}; + +export const UpdateStreamMetadata = { + $type: "yandex.cloud.video.v1.UpdateStreamMetadata" as const, + + encode( + message: UpdateStreamMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamId !== "") { + writer.uint32(10).string(message.streamId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateStreamMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateStreamMetadata } as UpdateStreamMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateStreamMetadata { + const message = { ...baseUpdateStreamMetadata } as UpdateStreamMetadata; + message.streamId = + object.streamId !== undefined && object.streamId !== null + ? String(object.streamId) + : ""; + return message; + }, + + toJSON(message: UpdateStreamMetadata): unknown { + const obj: any = {}; + message.streamId !== undefined && (obj.streamId = message.streamId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateStreamMetadata { + const message = { ...baseUpdateStreamMetadata } as UpdateStreamMetadata; + message.streamId = object.streamId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateStreamMetadata.$type, UpdateStreamMetadata); + +const baseDeleteStreamRequest: object = { + $type: "yandex.cloud.video.v1.DeleteStreamRequest", + streamId: "", +}; + +export const DeleteStreamRequest = { + $type: "yandex.cloud.video.v1.DeleteStreamRequest" as const, + + encode( + message: DeleteStreamRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamId !== "") { + writer.uint32(10).string(message.streamId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteStreamRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteStreamRequest } as DeleteStreamRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteStreamRequest { + const message = { ...baseDeleteStreamRequest } as DeleteStreamRequest; + message.streamId = + object.streamId !== undefined && object.streamId !== null + ? String(object.streamId) + : ""; + return message; + }, + + toJSON(message: DeleteStreamRequest): unknown { + const obj: any = {}; + message.streamId !== undefined && (obj.streamId = message.streamId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteStreamRequest { + const message = { ...baseDeleteStreamRequest } as DeleteStreamRequest; + message.streamId = object.streamId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteStreamRequest.$type, DeleteStreamRequest); + +const baseDeleteStreamMetadata: object = { + $type: "yandex.cloud.video.v1.DeleteStreamMetadata", + streamId: "", +}; + +export const DeleteStreamMetadata = { + $type: "yandex.cloud.video.v1.DeleteStreamMetadata" as const, + + encode( + message: DeleteStreamMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamId !== "") { + writer.uint32(10).string(message.streamId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeleteStreamMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteStreamMetadata } as DeleteStreamMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteStreamMetadata { + const message = { ...baseDeleteStreamMetadata } as DeleteStreamMetadata; + message.streamId = + object.streamId !== undefined && object.streamId !== null + ? String(object.streamId) + : ""; + return message; + }, + + toJSON(message: DeleteStreamMetadata): unknown { + const obj: any = {}; + message.streamId !== undefined && (obj.streamId = message.streamId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteStreamMetadata { + const message = { ...baseDeleteStreamMetadata } as DeleteStreamMetadata; + message.streamId = object.streamId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteStreamMetadata.$type, DeleteStreamMetadata); + +const basePerformStreamActionRequest: object = { + $type: "yandex.cloud.video.v1.PerformStreamActionRequest", + streamId: "", +}; + +export const PerformStreamActionRequest = { + $type: "yandex.cloud.video.v1.PerformStreamActionRequest" as const, + + encode( + message: PerformStreamActionRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamId !== "") { + writer.uint32(10).string(message.streamId); + } + if (message.publish !== undefined) { + PublishAction.encode( + message.publish, + writer.uint32(8002).fork() + ).ldelim(); + } + if (message.stop !== undefined) { + StopAction.encode(message.stop, writer.uint32(8018).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PerformStreamActionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePerformStreamActionRequest, + } as PerformStreamActionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamId = reader.string(); + break; + case 1000: + message.publish = PublishAction.decode(reader, reader.uint32()); + break; + case 1002: + message.stop = StopAction.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PerformStreamActionRequest { + const message = { + ...basePerformStreamActionRequest, + } as PerformStreamActionRequest; + message.streamId = + object.streamId !== undefined && object.streamId !== null + ? String(object.streamId) + : ""; + message.publish = + object.publish !== undefined && object.publish !== null + ? PublishAction.fromJSON(object.publish) + : undefined; + message.stop = + object.stop !== undefined && object.stop !== null + ? StopAction.fromJSON(object.stop) + : undefined; + return message; + }, + + toJSON(message: PerformStreamActionRequest): unknown { + const obj: any = {}; + message.streamId !== undefined && (obj.streamId = message.streamId); + message.publish !== undefined && + (obj.publish = message.publish + ? PublishAction.toJSON(message.publish) + : undefined); + message.stop !== undefined && + (obj.stop = message.stop ? StopAction.toJSON(message.stop) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): PerformStreamActionRequest { + const message = { + ...basePerformStreamActionRequest, + } as PerformStreamActionRequest; + message.streamId = object.streamId ?? ""; + message.publish = + object.publish !== undefined && object.publish !== null + ? PublishAction.fromPartial(object.publish) + : undefined; + message.stop = + object.stop !== undefined && object.stop !== null + ? StopAction.fromPartial(object.stop) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + PerformStreamActionRequest.$type, + PerformStreamActionRequest +); + +const basePublishAction: object = { + $type: "yandex.cloud.video.v1.PublishAction", +}; + +export const PublishAction = { + $type: "yandex.cloud.video.v1.PublishAction" as const, + + encode( + _: PublishAction, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PublishAction { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublishAction } as PublishAction; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): PublishAction { + const message = { ...basePublishAction } as PublishAction; + return message; + }, + + toJSON(_: PublishAction): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): PublishAction { + const message = { ...basePublishAction } as PublishAction; + return message; + }, +}; + +messageTypeRegistry.set(PublishAction.$type, PublishAction); + +const baseStopAction: object = { $type: "yandex.cloud.video.v1.StopAction" }; + +export const StopAction = { + $type: "yandex.cloud.video.v1.StopAction" as const, + + encode(_: StopAction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StopAction { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStopAction } as StopAction; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): StopAction { + const message = { ...baseStopAction } as StopAction; + return message; + }, + + toJSON(_: StopAction): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>(_: I): StopAction { + const message = { ...baseStopAction } as StopAction; + return message; + }, +}; + +messageTypeRegistry.set(StopAction.$type, StopAction); + +const basePerformStreamActionMetadata: object = { + $type: "yandex.cloud.video.v1.PerformStreamActionMetadata", + streamId: "", +}; + +export const PerformStreamActionMetadata = { + $type: "yandex.cloud.video.v1.PerformStreamActionMetadata" as const, + + encode( + message: PerformStreamActionMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.streamId !== "") { + writer.uint32(10).string(message.streamId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PerformStreamActionMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePerformStreamActionMetadata, + } as PerformStreamActionMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.streamId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PerformStreamActionMetadata { + const message = { + ...basePerformStreamActionMetadata, + } as PerformStreamActionMetadata; + message.streamId = + object.streamId !== undefined && object.streamId !== null + ? String(object.streamId) + : ""; + return message; + }, + + toJSON(message: PerformStreamActionMetadata): unknown { + const obj: any = {}; + message.streamId !== undefined && (obj.streamId = message.streamId); + return obj; + }, + + fromPartial, I>>( + object: I + ): PerformStreamActionMetadata { + const message = { + ...basePerformStreamActionMetadata, + } as PerformStreamActionMetadata; + message.streamId = object.streamId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + PerformStreamActionMetadata.$type, + PerformStreamActionMetadata +); + +/** Stream management service. */ +export const StreamServiceService = { + /** Returns the specific stream. */ + get: { + path: "/yandex.cloud.video.v1.StreamService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetStreamRequest) => + Buffer.from(GetStreamRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetStreamRequest.decode(value), + responseSerialize: (value: Stream) => + Buffer.from(Stream.encode(value).finish()), + responseDeserialize: (value: Buffer) => Stream.decode(value), + }, + /** List streams for channel. */ + list: { + path: "/yandex.cloud.video.v1.StreamService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListStreamsRequest) => + Buffer.from(ListStreamsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListStreamsRequest.decode(value), + responseSerialize: (value: ListStreamsResponse) => + Buffer.from(ListStreamsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListStreamsResponse.decode(value), + }, + /** Create stream. */ + create: { + path: "/yandex.cloud.video.v1.StreamService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateStreamRequest) => + Buffer.from(CreateStreamRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateStreamRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Update stream. */ + update: { + path: "/yandex.cloud.video.v1.StreamService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateStreamRequest) => + Buffer.from(UpdateStreamRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateStreamRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Delete stream. */ + delete: { + path: "/yandex.cloud.video.v1.StreamService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteStreamRequest) => + Buffer.from(DeleteStreamRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteStreamRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Perform an action on the episode. */ + performAction: { + path: "/yandex.cloud.video.v1.StreamService/PerformAction", + requestStream: false, + responseStream: false, + requestSerialize: (value: PerformStreamActionRequest) => + Buffer.from(PerformStreamActionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + PerformStreamActionRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, +} as const; + +export interface StreamServiceServer extends UntypedServiceImplementation { + /** Returns the specific stream. */ + get: handleUnaryCall; + /** List streams for channel. */ + list: handleUnaryCall; + /** Create stream. */ + create: handleUnaryCall; + /** Update stream. */ + update: handleUnaryCall; + /** Delete stream. */ + delete: handleUnaryCall; + /** Perform an action on the episode. */ + performAction: handleUnaryCall; +} + +export interface StreamServiceClient extends Client { + /** Returns the specific stream. */ + get( + request: GetStreamRequest, + callback: (error: ServiceError | null, response: Stream) => void + ): ClientUnaryCall; + get( + request: GetStreamRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Stream) => void + ): ClientUnaryCall; + get( + request: GetStreamRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Stream) => void + ): ClientUnaryCall; + /** List streams for channel. */ + list( + request: ListStreamsRequest, + callback: ( + error: ServiceError | null, + response: ListStreamsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListStreamsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListStreamsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListStreamsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListStreamsResponse + ) => void + ): ClientUnaryCall; + /** Create stream. */ + create( + request: CreateStreamRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateStreamRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateStreamRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Update stream. */ + update( + request: UpdateStreamRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateStreamRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateStreamRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Delete stream. */ + delete( + request: DeleteStreamRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteStreamRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteStreamRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Perform an action on the episode. */ + performAction( + request: PerformStreamActionRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + performAction( + request: PerformStreamActionRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + performAction( + request: PerformStreamActionRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; +} + +export const StreamServiceClient = makeGenericClientConstructor( + StreamServiceService, + "yandex.cloud.video.v1.StreamService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): StreamServiceClient; + service: typeof StreamServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/video/v1/thumbnail.ts b/src/generated/yandex/cloud/video/v1/thumbnail.ts new file mode 100644 index 00000000..d36b13eb --- /dev/null +++ b/src/generated/yandex/cloud/video/v1/thumbnail.ts @@ -0,0 +1,162 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.video.v1"; + +export interface Thumbnail { + $type: "yandex.cloud.video.v1.Thumbnail"; + /** ID of the thumbnail. */ + id: string; + /** ID of the channel where the thumbnail was created. */ + channelId: string; + /** Time when thumbnail was created. */ + createdAt?: Date; +} + +const baseThumbnail: object = { + $type: "yandex.cloud.video.v1.Thumbnail", + id: "", + channelId: "", +}; + +export const Thumbnail = { + $type: "yandex.cloud.video.v1.Thumbnail" as const, + + encode( + message: Thumbnail, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(802).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Thumbnail { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseThumbnail } as Thumbnail; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 100: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Thumbnail { + const message = { ...baseThumbnail } as Thumbnail; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + return message; + }, + + toJSON(message: Thumbnail): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + return obj; + }, + + fromPartial, I>>( + object: I + ): Thumbnail { + const message = { ...baseThumbnail } as Thumbnail; + message.id = object.id ?? ""; + message.channelId = object.channelId ?? ""; + message.createdAt = object.createdAt ?? undefined; + return message; + }, +}; + +messageTypeRegistry.set(Thumbnail.$type, Thumbnail); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/video/v1/thumbnail_service.ts b/src/generated/yandex/cloud/video/v1/thumbnail_service.ts new file mode 100644 index 00000000..a2a1553d --- /dev/null +++ b/src/generated/yandex/cloud/video/v1/thumbnail_service.ts @@ -0,0 +1,1030 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { Thumbnail } from "../../../../yandex/cloud/video/v1/thumbnail"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.video.v1"; + +export interface ListThumbnailRequest { + $type: "yandex.cloud.video.v1.ListThumbnailRequest"; + /** ID of the channel. */ + channelId: string; + /** The maximum number of the results per page to return. Default value: 100. */ + pageSize: number; + /** Page token for getting the next page of the result. */ + pageToken: string; +} + +export interface ListThumbnailResponse { + $type: "yandex.cloud.video.v1.ListThumbnailResponse"; + /** List of thumbnails. */ + thumbnails: Thumbnail[]; + /** Token for getting the next page. */ + nextPageToken: string; +} + +export interface CreateThumbnailRequest { + $type: "yandex.cloud.video.v1.CreateThumbnailRequest"; + /** ID of the channel. */ + channelId: string; +} + +export interface CreateThumbnailMetadata { + $type: "yandex.cloud.video.v1.CreateThumbnailMetadata"; + /** ID of the thumbnail. */ + thumbnailId: string; +} + +export interface BatchGenerateDownloadURLsRequest { + $type: "yandex.cloud.video.v1.BatchGenerateDownloadURLsRequest"; + /** ID of the channel. */ + channelId: string; + /** List of thumbnails IDs. */ + thumbnailIds: string[]; +} + +export interface BatchGenerateDownloadURLsResponse { + $type: "yandex.cloud.video.v1.BatchGenerateDownloadURLsResponse"; + /** List of download urls. */ + downloadUrls: ThumbnailDownloadURL[]; +} + +export interface ThumbnailDownloadURL { + $type: "yandex.cloud.video.v1.ThumbnailDownloadURL"; + /** ID of the thumbnail. */ + thumbnailId: string; + /** Download url. */ + downloadUrl: string; +} + +export interface GenerateThumbnailUploadURLRequest { + $type: "yandex.cloud.video.v1.GenerateThumbnailUploadURLRequest"; + /** ID of the thumbnail. */ + thumbnailId: string; +} + +export interface GenerateThumbnailUploadURLResponse { + $type: "yandex.cloud.video.v1.GenerateThumbnailUploadURLResponse"; + /** Upload url. */ + uploadUrl: string; +} + +const baseListThumbnailRequest: object = { + $type: "yandex.cloud.video.v1.ListThumbnailRequest", + channelId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListThumbnailRequest = { + $type: "yandex.cloud.video.v1.ListThumbnailRequest" as const, + + encode( + message: ListThumbnailRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.pageSize !== 0) { + writer.uint32(800).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(810).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListThumbnailRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListThumbnailRequest } as ListThumbnailRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 100: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 101: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListThumbnailRequest { + const message = { ...baseListThumbnailRequest } as ListThumbnailRequest; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListThumbnailRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListThumbnailRequest { + const message = { ...baseListThumbnailRequest } as ListThumbnailRequest; + message.channelId = object.channelId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListThumbnailRequest.$type, ListThumbnailRequest); + +const baseListThumbnailResponse: object = { + $type: "yandex.cloud.video.v1.ListThumbnailResponse", + nextPageToken: "", +}; + +export const ListThumbnailResponse = { + $type: "yandex.cloud.video.v1.ListThumbnailResponse" as const, + + encode( + message: ListThumbnailResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.thumbnails) { + Thumbnail.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(802).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListThumbnailResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListThumbnailResponse } as ListThumbnailResponse; + message.thumbnails = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.thumbnails.push(Thumbnail.decode(reader, reader.uint32())); + break; + case 100: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListThumbnailResponse { + const message = { ...baseListThumbnailResponse } as ListThumbnailResponse; + message.thumbnails = (object.thumbnails ?? []).map((e: any) => + Thumbnail.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListThumbnailResponse): unknown { + const obj: any = {}; + if (message.thumbnails) { + obj.thumbnails = message.thumbnails.map((e) => + e ? Thumbnail.toJSON(e) : undefined + ); + } else { + obj.thumbnails = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListThumbnailResponse { + const message = { ...baseListThumbnailResponse } as ListThumbnailResponse; + message.thumbnails = + object.thumbnails?.map((e) => Thumbnail.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListThumbnailResponse.$type, ListThumbnailResponse); + +const baseCreateThumbnailRequest: object = { + $type: "yandex.cloud.video.v1.CreateThumbnailRequest", + channelId: "", +}; + +export const CreateThumbnailRequest = { + $type: "yandex.cloud.video.v1.CreateThumbnailRequest" as const, + + encode( + message: CreateThumbnailRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateThumbnailRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateThumbnailRequest } as CreateThumbnailRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateThumbnailRequest { + const message = { ...baseCreateThumbnailRequest } as CreateThumbnailRequest; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + return message; + }, + + toJSON(message: CreateThumbnailRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateThumbnailRequest { + const message = { ...baseCreateThumbnailRequest } as CreateThumbnailRequest; + message.channelId = object.channelId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateThumbnailRequest.$type, CreateThumbnailRequest); + +const baseCreateThumbnailMetadata: object = { + $type: "yandex.cloud.video.v1.CreateThumbnailMetadata", + thumbnailId: "", +}; + +export const CreateThumbnailMetadata = { + $type: "yandex.cloud.video.v1.CreateThumbnailMetadata" as const, + + encode( + message: CreateThumbnailMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.thumbnailId !== "") { + writer.uint32(10).string(message.thumbnailId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateThumbnailMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateThumbnailMetadata, + } as CreateThumbnailMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.thumbnailId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateThumbnailMetadata { + const message = { + ...baseCreateThumbnailMetadata, + } as CreateThumbnailMetadata; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + return message; + }, + + toJSON(message: CreateThumbnailMetadata): unknown { + const obj: any = {}; + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateThumbnailMetadata { + const message = { + ...baseCreateThumbnailMetadata, + } as CreateThumbnailMetadata; + message.thumbnailId = object.thumbnailId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateThumbnailMetadata.$type, CreateThumbnailMetadata); + +const baseBatchGenerateDownloadURLsRequest: object = { + $type: "yandex.cloud.video.v1.BatchGenerateDownloadURLsRequest", + channelId: "", + thumbnailIds: "", +}; + +export const BatchGenerateDownloadURLsRequest = { + $type: "yandex.cloud.video.v1.BatchGenerateDownloadURLsRequest" as const, + + encode( + message: BatchGenerateDownloadURLsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + for (const v of message.thumbnailIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): BatchGenerateDownloadURLsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseBatchGenerateDownloadURLsRequest, + } as BatchGenerateDownloadURLsRequest; + message.thumbnailIds = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.thumbnailIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BatchGenerateDownloadURLsRequest { + const message = { + ...baseBatchGenerateDownloadURLsRequest, + } as BatchGenerateDownloadURLsRequest; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + message.thumbnailIds = (object.thumbnailIds ?? []).map((e: any) => + String(e) + ); + return message; + }, + + toJSON(message: BatchGenerateDownloadURLsRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + if (message.thumbnailIds) { + obj.thumbnailIds = message.thumbnailIds.map((e) => e); + } else { + obj.thumbnailIds = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): BatchGenerateDownloadURLsRequest { + const message = { + ...baseBatchGenerateDownloadURLsRequest, + } as BatchGenerateDownloadURLsRequest; + message.channelId = object.channelId ?? ""; + message.thumbnailIds = object.thumbnailIds?.map((e) => e) || []; + return message; + }, +}; + +messageTypeRegistry.set( + BatchGenerateDownloadURLsRequest.$type, + BatchGenerateDownloadURLsRequest +); + +const baseBatchGenerateDownloadURLsResponse: object = { + $type: "yandex.cloud.video.v1.BatchGenerateDownloadURLsResponse", +}; + +export const BatchGenerateDownloadURLsResponse = { + $type: "yandex.cloud.video.v1.BatchGenerateDownloadURLsResponse" as const, + + encode( + message: BatchGenerateDownloadURLsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.downloadUrls) { + ThumbnailDownloadURL.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): BatchGenerateDownloadURLsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseBatchGenerateDownloadURLsResponse, + } as BatchGenerateDownloadURLsResponse; + message.downloadUrls = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.downloadUrls.push( + ThumbnailDownloadURL.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BatchGenerateDownloadURLsResponse { + const message = { + ...baseBatchGenerateDownloadURLsResponse, + } as BatchGenerateDownloadURLsResponse; + message.downloadUrls = (object.downloadUrls ?? []).map((e: any) => + ThumbnailDownloadURL.fromJSON(e) + ); + return message; + }, + + toJSON(message: BatchGenerateDownloadURLsResponse): unknown { + const obj: any = {}; + if (message.downloadUrls) { + obj.downloadUrls = message.downloadUrls.map((e) => + e ? ThumbnailDownloadURL.toJSON(e) : undefined + ); + } else { + obj.downloadUrls = []; + } + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): BatchGenerateDownloadURLsResponse { + const message = { + ...baseBatchGenerateDownloadURLsResponse, + } as BatchGenerateDownloadURLsResponse; + message.downloadUrls = + object.downloadUrls?.map((e) => ThumbnailDownloadURL.fromPartial(e)) || + []; + return message; + }, +}; + +messageTypeRegistry.set( + BatchGenerateDownloadURLsResponse.$type, + BatchGenerateDownloadURLsResponse +); + +const baseThumbnailDownloadURL: object = { + $type: "yandex.cloud.video.v1.ThumbnailDownloadURL", + thumbnailId: "", + downloadUrl: "", +}; + +export const ThumbnailDownloadURL = { + $type: "yandex.cloud.video.v1.ThumbnailDownloadURL" as const, + + encode( + message: ThumbnailDownloadURL, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.thumbnailId !== "") { + writer.uint32(10).string(message.thumbnailId); + } + if (message.downloadUrl !== "") { + writer.uint32(18).string(message.downloadUrl); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ThumbnailDownloadURL { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseThumbnailDownloadURL } as ThumbnailDownloadURL; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.thumbnailId = reader.string(); + break; + case 2: + message.downloadUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ThumbnailDownloadURL { + const message = { ...baseThumbnailDownloadURL } as ThumbnailDownloadURL; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + message.downloadUrl = + object.downloadUrl !== undefined && object.downloadUrl !== null + ? String(object.downloadUrl) + : ""; + return message; + }, + + toJSON(message: ThumbnailDownloadURL): unknown { + const obj: any = {}; + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + message.downloadUrl !== undefined && + (obj.downloadUrl = message.downloadUrl); + return obj; + }, + + fromPartial, I>>( + object: I + ): ThumbnailDownloadURL { + const message = { ...baseThumbnailDownloadURL } as ThumbnailDownloadURL; + message.thumbnailId = object.thumbnailId ?? ""; + message.downloadUrl = object.downloadUrl ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ThumbnailDownloadURL.$type, ThumbnailDownloadURL); + +const baseGenerateThumbnailUploadURLRequest: object = { + $type: "yandex.cloud.video.v1.GenerateThumbnailUploadURLRequest", + thumbnailId: "", +}; + +export const GenerateThumbnailUploadURLRequest = { + $type: "yandex.cloud.video.v1.GenerateThumbnailUploadURLRequest" as const, + + encode( + message: GenerateThumbnailUploadURLRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.thumbnailId !== "") { + writer.uint32(10).string(message.thumbnailId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GenerateThumbnailUploadURLRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGenerateThumbnailUploadURLRequest, + } as GenerateThumbnailUploadURLRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.thumbnailId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenerateThumbnailUploadURLRequest { + const message = { + ...baseGenerateThumbnailUploadURLRequest, + } as GenerateThumbnailUploadURLRequest; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + return message; + }, + + toJSON(message: GenerateThumbnailUploadURLRequest): unknown { + const obj: any = {}; + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): GenerateThumbnailUploadURLRequest { + const message = { + ...baseGenerateThumbnailUploadURLRequest, + } as GenerateThumbnailUploadURLRequest; + message.thumbnailId = object.thumbnailId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GenerateThumbnailUploadURLRequest.$type, + GenerateThumbnailUploadURLRequest +); + +const baseGenerateThumbnailUploadURLResponse: object = { + $type: "yandex.cloud.video.v1.GenerateThumbnailUploadURLResponse", + uploadUrl: "", +}; + +export const GenerateThumbnailUploadURLResponse = { + $type: "yandex.cloud.video.v1.GenerateThumbnailUploadURLResponse" as const, + + encode( + message: GenerateThumbnailUploadURLResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.uploadUrl !== "") { + writer.uint32(10).string(message.uploadUrl); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GenerateThumbnailUploadURLResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGenerateThumbnailUploadURLResponse, + } as GenerateThumbnailUploadURLResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uploadUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenerateThumbnailUploadURLResponse { + const message = { + ...baseGenerateThumbnailUploadURLResponse, + } as GenerateThumbnailUploadURLResponse; + message.uploadUrl = + object.uploadUrl !== undefined && object.uploadUrl !== null + ? String(object.uploadUrl) + : ""; + return message; + }, + + toJSON(message: GenerateThumbnailUploadURLResponse): unknown { + const obj: any = {}; + message.uploadUrl !== undefined && (obj.uploadUrl = message.uploadUrl); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): GenerateThumbnailUploadURLResponse { + const message = { + ...baseGenerateThumbnailUploadURLResponse, + } as GenerateThumbnailUploadURLResponse; + message.uploadUrl = object.uploadUrl ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GenerateThumbnailUploadURLResponse.$type, + GenerateThumbnailUploadURLResponse +); + +/** Thumbnail management service. */ +export const ThumbnailServiceService = { + /** List thumbnails for channel. */ + list: { + path: "/yandex.cloud.video.v1.ThumbnailService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListThumbnailRequest) => + Buffer.from(ListThumbnailRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListThumbnailRequest.decode(value), + responseSerialize: (value: ListThumbnailResponse) => + Buffer.from(ListThumbnailResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListThumbnailResponse.decode(value), + }, + /** Create thumbnail. */ + create: { + path: "/yandex.cloud.video.v1.ThumbnailService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateThumbnailRequest) => + Buffer.from(CreateThumbnailRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateThumbnailRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Generate urls for download images. */ + batchGenerateDownloadURLs: { + path: "/yandex.cloud.video.v1.ThumbnailService/BatchGenerateDownloadURLs", + requestStream: false, + responseStream: false, + requestSerialize: (value: BatchGenerateDownloadURLsRequest) => + Buffer.from(BatchGenerateDownloadURLsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + BatchGenerateDownloadURLsRequest.decode(value), + responseSerialize: (value: BatchGenerateDownloadURLsResponse) => + Buffer.from(BatchGenerateDownloadURLsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + BatchGenerateDownloadURLsResponse.decode(value), + }, + /** Generate url for upload image. */ + generateUploadURL: { + path: "/yandex.cloud.video.v1.ThumbnailService/GenerateUploadURL", + requestStream: false, + responseStream: false, + requestSerialize: (value: GenerateThumbnailUploadURLRequest) => + Buffer.from(GenerateThumbnailUploadURLRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GenerateThumbnailUploadURLRequest.decode(value), + responseSerialize: (value: GenerateThumbnailUploadURLResponse) => + Buffer.from(GenerateThumbnailUploadURLResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + GenerateThumbnailUploadURLResponse.decode(value), + }, +} as const; + +export interface ThumbnailServiceServer extends UntypedServiceImplementation { + /** List thumbnails for channel. */ + list: handleUnaryCall; + /** Create thumbnail. */ + create: handleUnaryCall; + /** Generate urls for download images. */ + batchGenerateDownloadURLs: handleUnaryCall< + BatchGenerateDownloadURLsRequest, + BatchGenerateDownloadURLsResponse + >; + /** Generate url for upload image. */ + generateUploadURL: handleUnaryCall< + GenerateThumbnailUploadURLRequest, + GenerateThumbnailUploadURLResponse + >; +} + +export interface ThumbnailServiceClient extends Client { + /** List thumbnails for channel. */ + list( + request: ListThumbnailRequest, + callback: ( + error: ServiceError | null, + response: ListThumbnailResponse + ) => void + ): ClientUnaryCall; + list( + request: ListThumbnailRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListThumbnailResponse + ) => void + ): ClientUnaryCall; + list( + request: ListThumbnailRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListThumbnailResponse + ) => void + ): ClientUnaryCall; + /** Create thumbnail. */ + create( + request: CreateThumbnailRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateThumbnailRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateThumbnailRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Generate urls for download images. */ + batchGenerateDownloadURLs( + request: BatchGenerateDownloadURLsRequest, + callback: ( + error: ServiceError | null, + response: BatchGenerateDownloadURLsResponse + ) => void + ): ClientUnaryCall; + batchGenerateDownloadURLs( + request: BatchGenerateDownloadURLsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: BatchGenerateDownloadURLsResponse + ) => void + ): ClientUnaryCall; + batchGenerateDownloadURLs( + request: BatchGenerateDownloadURLsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: BatchGenerateDownloadURLsResponse + ) => void + ): ClientUnaryCall; + /** Generate url for upload image. */ + generateUploadURL( + request: GenerateThumbnailUploadURLRequest, + callback: ( + error: ServiceError | null, + response: GenerateThumbnailUploadURLResponse + ) => void + ): ClientUnaryCall; + generateUploadURL( + request: GenerateThumbnailUploadURLRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: GenerateThumbnailUploadURLResponse + ) => void + ): ClientUnaryCall; + generateUploadURL( + request: GenerateThumbnailUploadURLRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: GenerateThumbnailUploadURLResponse + ) => void + ): ClientUnaryCall; +} + +export const ThumbnailServiceClient = makeGenericClientConstructor( + ThumbnailServiceService, + "yandex.cloud.video.v1.ThumbnailService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): ThumbnailServiceClient; + service: typeof ThumbnailServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/video/v1/video.ts b/src/generated/yandex/cloud/video/v1/video.ts new file mode 100644 index 00000000..57049c20 --- /dev/null +++ b/src/generated/yandex/cloud/video/v1/video.ts @@ -0,0 +1,762 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Duration } from "../../../../google/protobuf/duration"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.video.v1"; + +export interface Video { + $type: "yandex.cloud.video.v1.Video"; + /** ID of the video. */ + id: string; + /** ID of the channel where the video was created. */ + channelId: string; + /** Video title. */ + title: string; + /** Video description. */ + description: string; + /** ID of the thumbnail. */ + thumbnailId: string; + /** Video status. */ + status: Video_VideoStatus; + /** Video duration. Optional, may be empty until the transcoding result is ready. */ + duration?: Duration; + /** Video visibility status. */ + visibilityStatus: Video_VisibilityStatus; + /** Upload video using the tus protocol. */ + tusd?: VideoTUSDSource | undefined; + /** Video is available to everyone. */ + publicAccess?: VideoPublicAccessRights | undefined; + /** Checking access rights using the authorization system. */ + authSystemAccess?: VideoAuthSystemAccessRights | undefined; + /** Time when video was created. */ + createdAt?: Date; + /** Time of last video update. */ + updatedAt?: Date; + /** Custom labels as `` key:value `` pairs. Maximum 64 per resource. */ + labels: { [key: string]: string }; +} + +export enum Video_VideoStatus { + /** VIDEO_STATUS_UNSPECIFIED - Video status unspecified. */ + VIDEO_STATUS_UNSPECIFIED = 0, + /** WAIT_UPLOADING - Waiting for the whole number of bytes to be loaded. */ + WAIT_UPLOADING = 1, + /** PROCESSING - Video processing. */ + PROCESSING = 4, + /** READY - Video is ready, processing is completed. */ + READY = 5, + /** ERROR - An error occurred during video processing. */ + ERROR = 7, + UNRECOGNIZED = -1, +} + +export function video_VideoStatusFromJSON(object: any): Video_VideoStatus { + switch (object) { + case 0: + case "VIDEO_STATUS_UNSPECIFIED": + return Video_VideoStatus.VIDEO_STATUS_UNSPECIFIED; + case 1: + case "WAIT_UPLOADING": + return Video_VideoStatus.WAIT_UPLOADING; + case 4: + case "PROCESSING": + return Video_VideoStatus.PROCESSING; + case 5: + case "READY": + return Video_VideoStatus.READY; + case 7: + case "ERROR": + return Video_VideoStatus.ERROR; + case -1: + case "UNRECOGNIZED": + default: + return Video_VideoStatus.UNRECOGNIZED; + } +} + +export function video_VideoStatusToJSON(object: Video_VideoStatus): string { + switch (object) { + case Video_VideoStatus.VIDEO_STATUS_UNSPECIFIED: + return "VIDEO_STATUS_UNSPECIFIED"; + case Video_VideoStatus.WAIT_UPLOADING: + return "WAIT_UPLOADING"; + case Video_VideoStatus.PROCESSING: + return "PROCESSING"; + case Video_VideoStatus.READY: + return "READY"; + case Video_VideoStatus.ERROR: + return "ERROR"; + default: + return "UNKNOWN"; + } +} + +export enum Video_VisibilityStatus { + /** VISIBILITY_STATUS_UNSPECIFIED - Visibility status unspecified. */ + VISIBILITY_STATUS_UNSPECIFIED = 0, + /** PUBLISHED - Video is published and available for viewing. */ + PUBLISHED = 1, + /** UNPUBLISHED - Video is unpublished, only admin can watch. */ + UNPUBLISHED = 2, + UNRECOGNIZED = -1, +} + +export function video_VisibilityStatusFromJSON( + object: any +): Video_VisibilityStatus { + switch (object) { + case 0: + case "VISIBILITY_STATUS_UNSPECIFIED": + return Video_VisibilityStatus.VISIBILITY_STATUS_UNSPECIFIED; + case 1: + case "PUBLISHED": + return Video_VisibilityStatus.PUBLISHED; + case 2: + case "UNPUBLISHED": + return Video_VisibilityStatus.UNPUBLISHED; + case -1: + case "UNRECOGNIZED": + default: + return Video_VisibilityStatus.UNRECOGNIZED; + } +} + +export function video_VisibilityStatusToJSON( + object: Video_VisibilityStatus +): string { + switch (object) { + case Video_VisibilityStatus.VISIBILITY_STATUS_UNSPECIFIED: + return "VISIBILITY_STATUS_UNSPECIFIED"; + case Video_VisibilityStatus.PUBLISHED: + return "PUBLISHED"; + case Video_VisibilityStatus.UNPUBLISHED: + return "UNPUBLISHED"; + default: + return "UNKNOWN"; + } +} + +export interface Video_LabelsEntry { + $type: "yandex.cloud.video.v1.Video.LabelsEntry"; + key: string; + value: string; +} + +export interface VideoTUSDSource { + $type: "yandex.cloud.video.v1.VideoTUSDSource"; + /** URL for uploading video via the tus protocol. */ + url: string; +} + +export interface VideoPublicAccessRights { + $type: "yandex.cloud.video.v1.VideoPublicAccessRights"; +} + +export interface VideoAuthSystemAccessRights { + $type: "yandex.cloud.video.v1.VideoAuthSystemAccessRights"; +} + +const baseVideo: object = { + $type: "yandex.cloud.video.v1.Video", + id: "", + channelId: "", + title: "", + description: "", + thumbnailId: "", + status: 0, + visibilityStatus: 0, +}; + +export const Video = { + $type: "yandex.cloud.video.v1.Video" as const, + + encode(message: Video, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.title !== "") { + writer.uint32(26).string(message.title); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.thumbnailId !== "") { + writer.uint32(42).string(message.thumbnailId); + } + if (message.status !== 0) { + writer.uint32(48).int32(message.status); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(66).fork()).ldelim(); + } + if (message.visibilityStatus !== 0) { + writer.uint32(72).int32(message.visibilityStatus); + } + if (message.tusd !== undefined) { + VideoTUSDSource.encode(message.tusd, writer.uint32(8002).fork()).ldelim(); + } + if (message.publicAccess !== undefined) { + VideoPublicAccessRights.encode( + message.publicAccess, + writer.uint32(16002).fork() + ).ldelim(); + } + if (message.authSystemAccess !== undefined) { + VideoAuthSystemAccessRights.encode( + message.authSystemAccess, + writer.uint32(16018).fork() + ).ldelim(); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(802).fork() + ).ldelim(); + } + if (message.updatedAt !== undefined) { + Timestamp.encode( + toTimestamp(message.updatedAt), + writer.uint32(810).fork() + ).ldelim(); + } + Object.entries(message.labels).forEach(([key, value]) => { + Video_LabelsEntry.encode( + { + $type: "yandex.cloud.video.v1.Video.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(1602).fork() + ).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Video { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVideo } as Video; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.title = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.thumbnailId = reader.string(); + break; + case 6: + message.status = reader.int32() as any; + break; + case 8: + message.duration = Duration.decode(reader, reader.uint32()); + break; + case 9: + message.visibilityStatus = reader.int32() as any; + break; + case 1000: + message.tusd = VideoTUSDSource.decode(reader, reader.uint32()); + break; + case 2000: + message.publicAccess = VideoPublicAccessRights.decode( + reader, + reader.uint32() + ); + break; + case 2002: + message.authSystemAccess = VideoAuthSystemAccessRights.decode( + reader, + reader.uint32() + ); + break; + case 100: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 101: + message.updatedAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 200: + const entry200 = Video_LabelsEntry.decode(reader, reader.uint32()); + if (entry200.value !== undefined) { + message.labels[entry200.key] = entry200.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Video { + const message = { ...baseVideo } as Video; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + message.status = + object.status !== undefined && object.status !== null + ? video_VideoStatusFromJSON(object.status) + : 0; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromJSON(object.duration) + : undefined; + message.visibilityStatus = + object.visibilityStatus !== undefined && object.visibilityStatus !== null + ? video_VisibilityStatusFromJSON(object.visibilityStatus) + : 0; + message.tusd = + object.tusd !== undefined && object.tusd !== null + ? VideoTUSDSource.fromJSON(object.tusd) + : undefined; + message.publicAccess = + object.publicAccess !== undefined && object.publicAccess !== null + ? VideoPublicAccessRights.fromJSON(object.publicAccess) + : undefined; + message.authSystemAccess = + object.authSystemAccess !== undefined && object.authSystemAccess !== null + ? VideoAuthSystemAccessRights.fromJSON(object.authSystemAccess) + : undefined; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.updatedAt = + object.updatedAt !== undefined && object.updatedAt !== null + ? fromJsonTimestamp(object.updatedAt) + : undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + return message; + }, + + toJSON(message: Video): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + message.status !== undefined && + (obj.status = video_VideoStatusToJSON(message.status)); + message.duration !== undefined && + (obj.duration = message.duration + ? Duration.toJSON(message.duration) + : undefined); + message.visibilityStatus !== undefined && + (obj.visibilityStatus = video_VisibilityStatusToJSON( + message.visibilityStatus + )); + message.tusd !== undefined && + (obj.tusd = message.tusd + ? VideoTUSDSource.toJSON(message.tusd) + : undefined); + message.publicAccess !== undefined && + (obj.publicAccess = message.publicAccess + ? VideoPublicAccessRights.toJSON(message.publicAccess) + : undefined); + message.authSystemAccess !== undefined && + (obj.authSystemAccess = message.authSystemAccess + ? VideoAuthSystemAccessRights.toJSON(message.authSystemAccess) + : undefined); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.updatedAt !== undefined && + (obj.updatedAt = message.updatedAt.toISOString()); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + return obj; + }, + + fromPartial, I>>(object: I): Video { + const message = { ...baseVideo } as Video; + message.id = object.id ?? ""; + message.channelId = object.channelId ?? ""; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.thumbnailId = object.thumbnailId ?? ""; + message.status = object.status ?? 0; + message.duration = + object.duration !== undefined && object.duration !== null + ? Duration.fromPartial(object.duration) + : undefined; + message.visibilityStatus = object.visibilityStatus ?? 0; + message.tusd = + object.tusd !== undefined && object.tusd !== null + ? VideoTUSDSource.fromPartial(object.tusd) + : undefined; + message.publicAccess = + object.publicAccess !== undefined && object.publicAccess !== null + ? VideoPublicAccessRights.fromPartial(object.publicAccess) + : undefined; + message.authSystemAccess = + object.authSystemAccess !== undefined && object.authSystemAccess !== null + ? VideoAuthSystemAccessRights.fromPartial(object.authSystemAccess) + : undefined; + message.createdAt = object.createdAt ?? undefined; + message.updatedAt = object.updatedAt ?? undefined; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +messageTypeRegistry.set(Video.$type, Video); + +const baseVideo_LabelsEntry: object = { + $type: "yandex.cloud.video.v1.Video.LabelsEntry", + key: "", + value: "", +}; + +export const Video_LabelsEntry = { + $type: "yandex.cloud.video.v1.Video.LabelsEntry" as const, + + encode( + message: Video_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Video_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVideo_LabelsEntry } as Video_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Video_LabelsEntry { + const message = { ...baseVideo_LabelsEntry } as Video_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: Video_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): Video_LabelsEntry { + const message = { ...baseVideo_LabelsEntry } as Video_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(Video_LabelsEntry.$type, Video_LabelsEntry); + +const baseVideoTUSDSource: object = { + $type: "yandex.cloud.video.v1.VideoTUSDSource", + url: "", +}; + +export const VideoTUSDSource = { + $type: "yandex.cloud.video.v1.VideoTUSDSource" as const, + + encode( + message: VideoTUSDSource, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.url !== "") { + writer.uint32(10).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): VideoTUSDSource { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVideoTUSDSource } as VideoTUSDSource; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): VideoTUSDSource { + const message = { ...baseVideoTUSDSource } as VideoTUSDSource; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: VideoTUSDSource): unknown { + const obj: any = {}; + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial, I>>( + object: I + ): VideoTUSDSource { + const message = { ...baseVideoTUSDSource } as VideoTUSDSource; + message.url = object.url ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(VideoTUSDSource.$type, VideoTUSDSource); + +const baseVideoPublicAccessRights: object = { + $type: "yandex.cloud.video.v1.VideoPublicAccessRights", +}; + +export const VideoPublicAccessRights = { + $type: "yandex.cloud.video.v1.VideoPublicAccessRights" as const, + + encode( + _: VideoPublicAccessRights, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): VideoPublicAccessRights { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseVideoPublicAccessRights, + } as VideoPublicAccessRights; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): VideoPublicAccessRights { + const message = { + ...baseVideoPublicAccessRights, + } as VideoPublicAccessRights; + return message; + }, + + toJSON(_: VideoPublicAccessRights): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): VideoPublicAccessRights { + const message = { + ...baseVideoPublicAccessRights, + } as VideoPublicAccessRights; + return message; + }, +}; + +messageTypeRegistry.set(VideoPublicAccessRights.$type, VideoPublicAccessRights); + +const baseVideoAuthSystemAccessRights: object = { + $type: "yandex.cloud.video.v1.VideoAuthSystemAccessRights", +}; + +export const VideoAuthSystemAccessRights = { + $type: "yandex.cloud.video.v1.VideoAuthSystemAccessRights" as const, + + encode( + _: VideoAuthSystemAccessRights, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): VideoAuthSystemAccessRights { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseVideoAuthSystemAccessRights, + } as VideoAuthSystemAccessRights; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): VideoAuthSystemAccessRights { + const message = { + ...baseVideoAuthSystemAccessRights, + } as VideoAuthSystemAccessRights; + return message; + }, + + toJSON(_: VideoAuthSystemAccessRights): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): VideoAuthSystemAccessRights { + const message = { + ...baseVideoAuthSystemAccessRights, + } as VideoAuthSystemAccessRights; + return message; + }, +}; + +messageTypeRegistry.set( + VideoAuthSystemAccessRights.$type, + VideoAuthSystemAccessRights +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/video/v1/video_service.ts b/src/generated/yandex/cloud/video/v1/video_service.ts new file mode 100644 index 00000000..de0de135 --- /dev/null +++ b/src/generated/yandex/cloud/video/v1/video_service.ts @@ -0,0 +1,2554 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../../../google/protobuf/field_mask"; +import { Video } from "../../../../yandex/cloud/video/v1/video"; +import { Manifest } from "../../../../yandex/cloud/video/v1/manifest"; +import { Operation } from "../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.video.v1"; + +export interface GetVideoRequest { + $type: "yandex.cloud.video.v1.GetVideoRequest"; + /** ID of the video. */ + videoId: string; +} + +export interface ListVideoRequest { + $type: "yandex.cloud.video.v1.ListVideoRequest"; + /** ID of the channel. */ + channelId: string; + /** The maximum number of the results per page to return. Default value: 100. */ + pageSize: number; + /** Page token for getting the next page of the result. */ + pageToken: string; + /** + * By which column the listing should be ordered and in which direction, + * format is "createdAt desc". "id asc" if omitted. + * Possible fields: ["id", "createdAt", "updatedAt"] + * Both snake_case and camelCase are supported for fields. + */ + orderBy: string; + /** + * Filter expression that filters resources listed in the response. + * Expressions are composed of terms connected by logic operators. + * Value in quotes: `'` or `"` + * Example: "key1='value' AND key2='value'" + * Supported operators: ["AND"]. + * Supported fields: ["title", "status", "visibility_status"] + * Both snake_case and camelCase are supported for fields. + */ + filter: string; +} + +export interface ListVideoResponse { + $type: "yandex.cloud.video.v1.ListVideoResponse"; + videos: Video[]; + /** Token for getting the next page. */ + nextPageToken: string; +} + +export interface CreateVideoRequest { + $type: "yandex.cloud.video.v1.CreateVideoRequest"; + /** ID of the channel. */ + channelId: string; + /** Video title. */ + title: string; + /** Video description. */ + description: string; + /** ID of the thumbnail. */ + thumbnailId: string; + /** Custom labels as `` key:value `` pairs. Maximum 64 per resource. */ + labels: { [key: string]: string }; + /** Upload video using the tus protocol. */ + tusd?: VideoTUSDParams | undefined; + /** Video is available to everyone. */ + publicAccess?: VideoPublicAccessParams | undefined; + /** Checking access rights using the authorization system. */ + authSystemAccess?: VideoAuthSystemAccessParams | undefined; +} + +export interface CreateVideoRequest_LabelsEntry { + $type: "yandex.cloud.video.v1.CreateVideoRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface VideoTUSDParams { + $type: "yandex.cloud.video.v1.VideoTUSDParams"; + /** File size. */ + fileSize: number; + /** File name. */ + fileName: string; +} + +export interface VideoPublicAccessParams { + $type: "yandex.cloud.video.v1.VideoPublicAccessParams"; +} + +export interface VideoAuthSystemAccessParams { + $type: "yandex.cloud.video.v1.VideoAuthSystemAccessParams"; +} + +export interface CreateVideoMetadata { + $type: "yandex.cloud.video.v1.CreateVideoMetadata"; + /** ID of the video. */ + videoId: string; +} + +export interface UpdateVideoRequest { + $type: "yandex.cloud.video.v1.UpdateVideoRequest"; + /** ID of the video. */ + videoId: string; + /** Field mask that specifies which fields of the video are going to be updated. */ + fieldMask?: FieldMask; + /** Video title. */ + title: string; + /** Video description. */ + description: string; + /** ID of the thumbnail. */ + thumbnailId: string; + /** Custom labels as `` key:value `` pairs. Maximum 64 per resource. */ + labels: { [key: string]: string }; + publicAccess?: VideoPublicAccessParams | undefined; + authSystemAccess?: VideoAuthSystemAccessParams | undefined; +} + +export interface UpdateVideoRequest_LabelsEntry { + $type: "yandex.cloud.video.v1.UpdateVideoRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdateVideoMetadata { + $type: "yandex.cloud.video.v1.UpdateVideoMetadata"; + /** ID of the video. */ + videoId: string; +} + +export interface DeleteVideoRequest { + $type: "yandex.cloud.video.v1.DeleteVideoRequest"; + /** ID of the video. */ + videoId: string; +} + +export interface DeleteVideoMetadata { + $type: "yandex.cloud.video.v1.DeleteVideoMetadata"; + /** ID of the video. */ + videoId: string; +} + +export interface PerformVideoActionRequest { + $type: "yandex.cloud.video.v1.PerformVideoActionRequest"; + /** ID of the video. */ + videoId: string; + publish?: PublishVideoAction | undefined; + unpublish?: UnpublishVideoAction | undefined; +} + +export interface PublishVideoAction { + $type: "yandex.cloud.video.v1.PublishVideoAction"; +} + +export interface UnpublishVideoAction { + $type: "yandex.cloud.video.v1.UnpublishVideoAction"; +} + +export interface PerformVideoActionMetadata { + $type: "yandex.cloud.video.v1.PerformVideoActionMetadata"; + /** ID of the video. */ + videoId: string; +} + +export interface GetVideoPlayerURLRequest { + $type: "yandex.cloud.video.v1.GetVideoPlayerURLRequest"; + /** ID of the video. */ + videoId: string; + params?: VideoPlayerParams; +} + +export interface VideoPlayerParams { + $type: "yandex.cloud.video.v1.VideoPlayerParams"; + /** If true, a player will be muted by default. */ + mute: boolean; + /** If true, playback will start automatically. */ + autoplay: boolean; + /** If true, a player interface will be hidden by default. */ + hidden: boolean; +} + +export interface GetVideoPlayerURLResponse { + $type: "yandex.cloud.video.v1.GetVideoPlayerURLResponse"; + /** Direct link to the video. */ + playerUrl: string; + /** HTML embed code in Iframe format. */ + html: string; +} + +export interface GetVideoManifestsRequest { + $type: "yandex.cloud.video.v1.GetVideoManifestsRequest"; + /** ID of the video. */ + videoId: string; +} + +export interface GetVideoManifestsResponse { + $type: "yandex.cloud.video.v1.GetVideoManifestsResponse"; + manifests: Manifest[]; +} + +const baseGetVideoRequest: object = { + $type: "yandex.cloud.video.v1.GetVideoRequest", + videoId: "", +}; + +export const GetVideoRequest = { + $type: "yandex.cloud.video.v1.GetVideoRequest" as const, + + encode( + message: GetVideoRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.videoId !== "") { + writer.uint32(10).string(message.videoId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetVideoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetVideoRequest } as GetVideoRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.videoId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetVideoRequest { + const message = { ...baseGetVideoRequest } as GetVideoRequest; + message.videoId = + object.videoId !== undefined && object.videoId !== null + ? String(object.videoId) + : ""; + return message; + }, + + toJSON(message: GetVideoRequest): unknown { + const obj: any = {}; + message.videoId !== undefined && (obj.videoId = message.videoId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetVideoRequest { + const message = { ...baseGetVideoRequest } as GetVideoRequest; + message.videoId = object.videoId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(GetVideoRequest.$type, GetVideoRequest); + +const baseListVideoRequest: object = { + $type: "yandex.cloud.video.v1.ListVideoRequest", + channelId: "", + pageSize: 0, + pageToken: "", + orderBy: "", + filter: "", +}; + +export const ListVideoRequest = { + $type: "yandex.cloud.video.v1.ListVideoRequest" as const, + + encode( + message: ListVideoRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.pageSize !== 0) { + writer.uint32(800).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(810).string(message.pageToken); + } + if (message.orderBy !== "") { + writer.uint32(818).string(message.orderBy); + } + if (message.filter !== "") { + writer.uint32(826).string(message.filter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListVideoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListVideoRequest } as ListVideoRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 100: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 101: + message.pageToken = reader.string(); + break; + case 102: + message.orderBy = reader.string(); + break; + case 103: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListVideoRequest { + const message = { ...baseListVideoRequest } as ListVideoRequest; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.orderBy = + object.orderBy !== undefined && object.orderBy !== null + ? String(object.orderBy) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListVideoRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.orderBy !== undefined && (obj.orderBy = message.orderBy); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListVideoRequest { + const message = { ...baseListVideoRequest } as ListVideoRequest; + message.channelId = object.channelId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.orderBy = object.orderBy ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListVideoRequest.$type, ListVideoRequest); + +const baseListVideoResponse: object = { + $type: "yandex.cloud.video.v1.ListVideoResponse", + nextPageToken: "", +}; + +export const ListVideoResponse = { + $type: "yandex.cloud.video.v1.ListVideoResponse" as const, + + encode( + message: ListVideoResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.videos) { + Video.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(802).string(message.nextPageToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListVideoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListVideoResponse } as ListVideoResponse; + message.videos = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.videos.push(Video.decode(reader, reader.uint32())); + break; + case 100: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListVideoResponse { + const message = { ...baseListVideoResponse } as ListVideoResponse; + message.videos = (object.videos ?? []).map((e: any) => Video.fromJSON(e)); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListVideoResponse): unknown { + const obj: any = {}; + if (message.videos) { + obj.videos = message.videos.map((e) => (e ? Video.toJSON(e) : undefined)); + } else { + obj.videos = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListVideoResponse { + const message = { ...baseListVideoResponse } as ListVideoResponse; + message.videos = object.videos?.map((e) => Video.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(ListVideoResponse.$type, ListVideoResponse); + +const baseCreateVideoRequest: object = { + $type: "yandex.cloud.video.v1.CreateVideoRequest", + channelId: "", + title: "", + description: "", + thumbnailId: "", +}; + +export const CreateVideoRequest = { + $type: "yandex.cloud.video.v1.CreateVideoRequest" as const, + + encode( + message: CreateVideoRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.title !== "") { + writer.uint32(18).string(message.title); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.thumbnailId !== "") { + writer.uint32(34).string(message.thumbnailId); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreateVideoRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.video.v1.CreateVideoRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(1602).fork() + ).ldelim(); + }); + if (message.tusd !== undefined) { + VideoTUSDParams.encode(message.tusd, writer.uint32(8002).fork()).ldelim(); + } + if (message.publicAccess !== undefined) { + VideoPublicAccessParams.encode( + message.publicAccess, + writer.uint32(16002).fork() + ).ldelim(); + } + if (message.authSystemAccess !== undefined) { + VideoAuthSystemAccessParams.encode( + message.authSystemAccess, + writer.uint32(16018).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateVideoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateVideoRequest } as CreateVideoRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.thumbnailId = reader.string(); + break; + case 200: + const entry200 = CreateVideoRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry200.value !== undefined) { + message.labels[entry200.key] = entry200.value; + } + break; + case 1000: + message.tusd = VideoTUSDParams.decode(reader, reader.uint32()); + break; + case 2000: + message.publicAccess = VideoPublicAccessParams.decode( + reader, + reader.uint32() + ); + break; + case 2002: + message.authSystemAccess = VideoAuthSystemAccessParams.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateVideoRequest { + const message = { ...baseCreateVideoRequest } as CreateVideoRequest; + message.channelId = + object.channelId !== undefined && object.channelId !== null + ? String(object.channelId) + : ""; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.tusd = + object.tusd !== undefined && object.tusd !== null + ? VideoTUSDParams.fromJSON(object.tusd) + : undefined; + message.publicAccess = + object.publicAccess !== undefined && object.publicAccess !== null + ? VideoPublicAccessParams.fromJSON(object.publicAccess) + : undefined; + message.authSystemAccess = + object.authSystemAccess !== undefined && object.authSystemAccess !== null + ? VideoAuthSystemAccessParams.fromJSON(object.authSystemAccess) + : undefined; + return message; + }, + + toJSON(message: CreateVideoRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.tusd !== undefined && + (obj.tusd = message.tusd + ? VideoTUSDParams.toJSON(message.tusd) + : undefined); + message.publicAccess !== undefined && + (obj.publicAccess = message.publicAccess + ? VideoPublicAccessParams.toJSON(message.publicAccess) + : undefined); + message.authSystemAccess !== undefined && + (obj.authSystemAccess = message.authSystemAccess + ? VideoAuthSystemAccessParams.toJSON(message.authSystemAccess) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateVideoRequest { + const message = { ...baseCreateVideoRequest } as CreateVideoRequest; + message.channelId = object.channelId ?? ""; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.thumbnailId = object.thumbnailId ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.tusd = + object.tusd !== undefined && object.tusd !== null + ? VideoTUSDParams.fromPartial(object.tusd) + : undefined; + message.publicAccess = + object.publicAccess !== undefined && object.publicAccess !== null + ? VideoPublicAccessParams.fromPartial(object.publicAccess) + : undefined; + message.authSystemAccess = + object.authSystemAccess !== undefined && object.authSystemAccess !== null + ? VideoAuthSystemAccessParams.fromPartial(object.authSystemAccess) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(CreateVideoRequest.$type, CreateVideoRequest); + +const baseCreateVideoRequest_LabelsEntry: object = { + $type: "yandex.cloud.video.v1.CreateVideoRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreateVideoRequest_LabelsEntry = { + $type: "yandex.cloud.video.v1.CreateVideoRequest.LabelsEntry" as const, + + encode( + message: CreateVideoRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreateVideoRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreateVideoRequest_LabelsEntry, + } as CreateVideoRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateVideoRequest_LabelsEntry { + const message = { + ...baseCreateVideoRequest_LabelsEntry, + } as CreateVideoRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreateVideoRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateVideoRequest_LabelsEntry { + const message = { + ...baseCreateVideoRequest_LabelsEntry, + } as CreateVideoRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreateVideoRequest_LabelsEntry.$type, + CreateVideoRequest_LabelsEntry +); + +const baseVideoTUSDParams: object = { + $type: "yandex.cloud.video.v1.VideoTUSDParams", + fileSize: 0, + fileName: "", +}; + +export const VideoTUSDParams = { + $type: "yandex.cloud.video.v1.VideoTUSDParams" as const, + + encode( + message: VideoTUSDParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.fileSize !== 0) { + writer.uint32(8).int64(message.fileSize); + } + if (message.fileName !== "") { + writer.uint32(18).string(message.fileName); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): VideoTUSDParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVideoTUSDParams } as VideoTUSDParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fileSize = longToNumber(reader.int64() as Long); + break; + case 2: + message.fileName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): VideoTUSDParams { + const message = { ...baseVideoTUSDParams } as VideoTUSDParams; + message.fileSize = + object.fileSize !== undefined && object.fileSize !== null + ? Number(object.fileSize) + : 0; + message.fileName = + object.fileName !== undefined && object.fileName !== null + ? String(object.fileName) + : ""; + return message; + }, + + toJSON(message: VideoTUSDParams): unknown { + const obj: any = {}; + message.fileSize !== undefined && + (obj.fileSize = Math.round(message.fileSize)); + message.fileName !== undefined && (obj.fileName = message.fileName); + return obj; + }, + + fromPartial, I>>( + object: I + ): VideoTUSDParams { + const message = { ...baseVideoTUSDParams } as VideoTUSDParams; + message.fileSize = object.fileSize ?? 0; + message.fileName = object.fileName ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(VideoTUSDParams.$type, VideoTUSDParams); + +const baseVideoPublicAccessParams: object = { + $type: "yandex.cloud.video.v1.VideoPublicAccessParams", +}; + +export const VideoPublicAccessParams = { + $type: "yandex.cloud.video.v1.VideoPublicAccessParams" as const, + + encode( + _: VideoPublicAccessParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): VideoPublicAccessParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseVideoPublicAccessParams, + } as VideoPublicAccessParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): VideoPublicAccessParams { + const message = { + ...baseVideoPublicAccessParams, + } as VideoPublicAccessParams; + return message; + }, + + toJSON(_: VideoPublicAccessParams): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): VideoPublicAccessParams { + const message = { + ...baseVideoPublicAccessParams, + } as VideoPublicAccessParams; + return message; + }, +}; + +messageTypeRegistry.set(VideoPublicAccessParams.$type, VideoPublicAccessParams); + +const baseVideoAuthSystemAccessParams: object = { + $type: "yandex.cloud.video.v1.VideoAuthSystemAccessParams", +}; + +export const VideoAuthSystemAccessParams = { + $type: "yandex.cloud.video.v1.VideoAuthSystemAccessParams" as const, + + encode( + _: VideoAuthSystemAccessParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): VideoAuthSystemAccessParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseVideoAuthSystemAccessParams, + } as VideoAuthSystemAccessParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): VideoAuthSystemAccessParams { + const message = { + ...baseVideoAuthSystemAccessParams, + } as VideoAuthSystemAccessParams; + return message; + }, + + toJSON(_: VideoAuthSystemAccessParams): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): VideoAuthSystemAccessParams { + const message = { + ...baseVideoAuthSystemAccessParams, + } as VideoAuthSystemAccessParams; + return message; + }, +}; + +messageTypeRegistry.set( + VideoAuthSystemAccessParams.$type, + VideoAuthSystemAccessParams +); + +const baseCreateVideoMetadata: object = { + $type: "yandex.cloud.video.v1.CreateVideoMetadata", + videoId: "", +}; + +export const CreateVideoMetadata = { + $type: "yandex.cloud.video.v1.CreateVideoMetadata" as const, + + encode( + message: CreateVideoMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.videoId !== "") { + writer.uint32(10).string(message.videoId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateVideoMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCreateVideoMetadata } as CreateVideoMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.videoId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateVideoMetadata { + const message = { ...baseCreateVideoMetadata } as CreateVideoMetadata; + message.videoId = + object.videoId !== undefined && object.videoId !== null + ? String(object.videoId) + : ""; + return message; + }, + + toJSON(message: CreateVideoMetadata): unknown { + const obj: any = {}; + message.videoId !== undefined && (obj.videoId = message.videoId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreateVideoMetadata { + const message = { ...baseCreateVideoMetadata } as CreateVideoMetadata; + message.videoId = object.videoId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(CreateVideoMetadata.$type, CreateVideoMetadata); + +const baseUpdateVideoRequest: object = { + $type: "yandex.cloud.video.v1.UpdateVideoRequest", + videoId: "", + title: "", + description: "", + thumbnailId: "", +}; + +export const UpdateVideoRequest = { + $type: "yandex.cloud.video.v1.UpdateVideoRequest" as const, + + encode( + message: UpdateVideoRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.videoId !== "") { + writer.uint32(10).string(message.videoId); + } + if (message.fieldMask !== undefined) { + FieldMask.encode(message.fieldMask, writer.uint32(18).fork()).ldelim(); + } + if (message.title !== "") { + writer.uint32(26).string(message.title); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.thumbnailId !== "") { + writer.uint32(42).string(message.thumbnailId); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdateVideoRequest_LabelsEntry.encode( + { + $type: "yandex.cloud.video.v1.UpdateVideoRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(1602).fork() + ).ldelim(); + }); + if (message.publicAccess !== undefined) { + VideoPublicAccessParams.encode( + message.publicAccess, + writer.uint32(16002).fork() + ).ldelim(); + } + if (message.authSystemAccess !== undefined) { + VideoAuthSystemAccessParams.encode( + message.authSystemAccess, + writer.uint32(16018).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateVideoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateVideoRequest } as UpdateVideoRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.videoId = reader.string(); + break; + case 2: + message.fieldMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.title = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.thumbnailId = reader.string(); + break; + case 200: + const entry200 = UpdateVideoRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry200.value !== undefined) { + message.labels[entry200.key] = entry200.value; + } + break; + case 2000: + message.publicAccess = VideoPublicAccessParams.decode( + reader, + reader.uint32() + ); + break; + case 2002: + message.authSystemAccess = VideoAuthSystemAccessParams.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateVideoRequest { + const message = { ...baseUpdateVideoRequest } as UpdateVideoRequest; + message.videoId = + object.videoId !== undefined && object.videoId !== null + ? String(object.videoId) + : ""; + message.fieldMask = + object.fieldMask !== undefined && object.fieldMask !== null + ? FieldMask.fromJSON(object.fieldMask) + : undefined; + message.title = + object.title !== undefined && object.title !== null + ? String(object.title) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.thumbnailId = + object.thumbnailId !== undefined && object.thumbnailId !== null + ? String(object.thumbnailId) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.publicAccess = + object.publicAccess !== undefined && object.publicAccess !== null + ? VideoPublicAccessParams.fromJSON(object.publicAccess) + : undefined; + message.authSystemAccess = + object.authSystemAccess !== undefined && object.authSystemAccess !== null + ? VideoAuthSystemAccessParams.fromJSON(object.authSystemAccess) + : undefined; + return message; + }, + + toJSON(message: UpdateVideoRequest): unknown { + const obj: any = {}; + message.videoId !== undefined && (obj.videoId = message.videoId); + message.fieldMask !== undefined && + (obj.fieldMask = message.fieldMask + ? FieldMask.toJSON(message.fieldMask) + : undefined); + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && + (obj.description = message.description); + message.thumbnailId !== undefined && + (obj.thumbnailId = message.thumbnailId); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.publicAccess !== undefined && + (obj.publicAccess = message.publicAccess + ? VideoPublicAccessParams.toJSON(message.publicAccess) + : undefined); + message.authSystemAccess !== undefined && + (obj.authSystemAccess = message.authSystemAccess + ? VideoAuthSystemAccessParams.toJSON(message.authSystemAccess) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateVideoRequest { + const message = { ...baseUpdateVideoRequest } as UpdateVideoRequest; + message.videoId = object.videoId ?? ""; + message.fieldMask = + object.fieldMask !== undefined && object.fieldMask !== null + ? FieldMask.fromPartial(object.fieldMask) + : undefined; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.thumbnailId = object.thumbnailId ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.publicAccess = + object.publicAccess !== undefined && object.publicAccess !== null + ? VideoPublicAccessParams.fromPartial(object.publicAccess) + : undefined; + message.authSystemAccess = + object.authSystemAccess !== undefined && object.authSystemAccess !== null + ? VideoAuthSystemAccessParams.fromPartial(object.authSystemAccess) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(UpdateVideoRequest.$type, UpdateVideoRequest); + +const baseUpdateVideoRequest_LabelsEntry: object = { + $type: "yandex.cloud.video.v1.UpdateVideoRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdateVideoRequest_LabelsEntry = { + $type: "yandex.cloud.video.v1.UpdateVideoRequest.LabelsEntry" as const, + + encode( + message: UpdateVideoRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdateVideoRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdateVideoRequest_LabelsEntry, + } as UpdateVideoRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateVideoRequest_LabelsEntry { + const message = { + ...baseUpdateVideoRequest_LabelsEntry, + } as UpdateVideoRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdateVideoRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateVideoRequest_LabelsEntry { + const message = { + ...baseUpdateVideoRequest_LabelsEntry, + } as UpdateVideoRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdateVideoRequest_LabelsEntry.$type, + UpdateVideoRequest_LabelsEntry +); + +const baseUpdateVideoMetadata: object = { + $type: "yandex.cloud.video.v1.UpdateVideoMetadata", + videoId: "", +}; + +export const UpdateVideoMetadata = { + $type: "yandex.cloud.video.v1.UpdateVideoMetadata" as const, + + encode( + message: UpdateVideoMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.videoId !== "") { + writer.uint32(10).string(message.videoId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateVideoMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateVideoMetadata } as UpdateVideoMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.videoId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateVideoMetadata { + const message = { ...baseUpdateVideoMetadata } as UpdateVideoMetadata; + message.videoId = + object.videoId !== undefined && object.videoId !== null + ? String(object.videoId) + : ""; + return message; + }, + + toJSON(message: UpdateVideoMetadata): unknown { + const obj: any = {}; + message.videoId !== undefined && (obj.videoId = message.videoId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdateVideoMetadata { + const message = { ...baseUpdateVideoMetadata } as UpdateVideoMetadata; + message.videoId = object.videoId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(UpdateVideoMetadata.$type, UpdateVideoMetadata); + +const baseDeleteVideoRequest: object = { + $type: "yandex.cloud.video.v1.DeleteVideoRequest", + videoId: "", +}; + +export const DeleteVideoRequest = { + $type: "yandex.cloud.video.v1.DeleteVideoRequest" as const, + + encode( + message: DeleteVideoRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.videoId !== "") { + writer.uint32(10).string(message.videoId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteVideoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteVideoRequest } as DeleteVideoRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.videoId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteVideoRequest { + const message = { ...baseDeleteVideoRequest } as DeleteVideoRequest; + message.videoId = + object.videoId !== undefined && object.videoId !== null + ? String(object.videoId) + : ""; + return message; + }, + + toJSON(message: DeleteVideoRequest): unknown { + const obj: any = {}; + message.videoId !== undefined && (obj.videoId = message.videoId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteVideoRequest { + const message = { ...baseDeleteVideoRequest } as DeleteVideoRequest; + message.videoId = object.videoId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteVideoRequest.$type, DeleteVideoRequest); + +const baseDeleteVideoMetadata: object = { + $type: "yandex.cloud.video.v1.DeleteVideoMetadata", + videoId: "", +}; + +export const DeleteVideoMetadata = { + $type: "yandex.cloud.video.v1.DeleteVideoMetadata" as const, + + encode( + message: DeleteVideoMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.videoId !== "") { + writer.uint32(10).string(message.videoId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteVideoMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeleteVideoMetadata } as DeleteVideoMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.videoId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteVideoMetadata { + const message = { ...baseDeleteVideoMetadata } as DeleteVideoMetadata; + message.videoId = + object.videoId !== undefined && object.videoId !== null + ? String(object.videoId) + : ""; + return message; + }, + + toJSON(message: DeleteVideoMetadata): unknown { + const obj: any = {}; + message.videoId !== undefined && (obj.videoId = message.videoId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeleteVideoMetadata { + const message = { ...baseDeleteVideoMetadata } as DeleteVideoMetadata; + message.videoId = object.videoId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(DeleteVideoMetadata.$type, DeleteVideoMetadata); + +const basePerformVideoActionRequest: object = { + $type: "yandex.cloud.video.v1.PerformVideoActionRequest", + videoId: "", +}; + +export const PerformVideoActionRequest = { + $type: "yandex.cloud.video.v1.PerformVideoActionRequest" as const, + + encode( + message: PerformVideoActionRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.videoId !== "") { + writer.uint32(10).string(message.videoId); + } + if (message.publish !== undefined) { + PublishVideoAction.encode( + message.publish, + writer.uint32(8002).fork() + ).ldelim(); + } + if (message.unpublish !== undefined) { + UnpublishVideoAction.encode( + message.unpublish, + writer.uint32(8010).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PerformVideoActionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePerformVideoActionRequest, + } as PerformVideoActionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.videoId = reader.string(); + break; + case 1000: + message.publish = PublishVideoAction.decode(reader, reader.uint32()); + break; + case 1001: + message.unpublish = UnpublishVideoAction.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PerformVideoActionRequest { + const message = { + ...basePerformVideoActionRequest, + } as PerformVideoActionRequest; + message.videoId = + object.videoId !== undefined && object.videoId !== null + ? String(object.videoId) + : ""; + message.publish = + object.publish !== undefined && object.publish !== null + ? PublishVideoAction.fromJSON(object.publish) + : undefined; + message.unpublish = + object.unpublish !== undefined && object.unpublish !== null + ? UnpublishVideoAction.fromJSON(object.unpublish) + : undefined; + return message; + }, + + toJSON(message: PerformVideoActionRequest): unknown { + const obj: any = {}; + message.videoId !== undefined && (obj.videoId = message.videoId); + message.publish !== undefined && + (obj.publish = message.publish + ? PublishVideoAction.toJSON(message.publish) + : undefined); + message.unpublish !== undefined && + (obj.unpublish = message.unpublish + ? UnpublishVideoAction.toJSON(message.unpublish) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): PerformVideoActionRequest { + const message = { + ...basePerformVideoActionRequest, + } as PerformVideoActionRequest; + message.videoId = object.videoId ?? ""; + message.publish = + object.publish !== undefined && object.publish !== null + ? PublishVideoAction.fromPartial(object.publish) + : undefined; + message.unpublish = + object.unpublish !== undefined && object.unpublish !== null + ? UnpublishVideoAction.fromPartial(object.unpublish) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + PerformVideoActionRequest.$type, + PerformVideoActionRequest +); + +const basePublishVideoAction: object = { + $type: "yandex.cloud.video.v1.PublishVideoAction", +}; + +export const PublishVideoAction = { + $type: "yandex.cloud.video.v1.PublishVideoAction" as const, + + encode( + _: PublishVideoAction, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PublishVideoAction { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublishVideoAction } as PublishVideoAction; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): PublishVideoAction { + const message = { ...basePublishVideoAction } as PublishVideoAction; + return message; + }, + + toJSON(_: PublishVideoAction): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): PublishVideoAction { + const message = { ...basePublishVideoAction } as PublishVideoAction; + return message; + }, +}; + +messageTypeRegistry.set(PublishVideoAction.$type, PublishVideoAction); + +const baseUnpublishVideoAction: object = { + $type: "yandex.cloud.video.v1.UnpublishVideoAction", +}; + +export const UnpublishVideoAction = { + $type: "yandex.cloud.video.v1.UnpublishVideoAction" as const, + + encode( + _: UnpublishVideoAction, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UnpublishVideoAction { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUnpublishVideoAction } as UnpublishVideoAction; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): UnpublishVideoAction { + const message = { ...baseUnpublishVideoAction } as UnpublishVideoAction; + return message; + }, + + toJSON(_: UnpublishVideoAction): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): UnpublishVideoAction { + const message = { ...baseUnpublishVideoAction } as UnpublishVideoAction; + return message; + }, +}; + +messageTypeRegistry.set(UnpublishVideoAction.$type, UnpublishVideoAction); + +const basePerformVideoActionMetadata: object = { + $type: "yandex.cloud.video.v1.PerformVideoActionMetadata", + videoId: "", +}; + +export const PerformVideoActionMetadata = { + $type: "yandex.cloud.video.v1.PerformVideoActionMetadata" as const, + + encode( + message: PerformVideoActionMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.videoId !== "") { + writer.uint32(10).string(message.videoId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PerformVideoActionMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePerformVideoActionMetadata, + } as PerformVideoActionMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.videoId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PerformVideoActionMetadata { + const message = { + ...basePerformVideoActionMetadata, + } as PerformVideoActionMetadata; + message.videoId = + object.videoId !== undefined && object.videoId !== null + ? String(object.videoId) + : ""; + return message; + }, + + toJSON(message: PerformVideoActionMetadata): unknown { + const obj: any = {}; + message.videoId !== undefined && (obj.videoId = message.videoId); + return obj; + }, + + fromPartial, I>>( + object: I + ): PerformVideoActionMetadata { + const message = { + ...basePerformVideoActionMetadata, + } as PerformVideoActionMetadata; + message.videoId = object.videoId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + PerformVideoActionMetadata.$type, + PerformVideoActionMetadata +); + +const baseGetVideoPlayerURLRequest: object = { + $type: "yandex.cloud.video.v1.GetVideoPlayerURLRequest", + videoId: "", +}; + +export const GetVideoPlayerURLRequest = { + $type: "yandex.cloud.video.v1.GetVideoPlayerURLRequest" as const, + + encode( + message: GetVideoPlayerURLRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.videoId !== "") { + writer.uint32(10).string(message.videoId); + } + if (message.params !== undefined) { + VideoPlayerParams.encode( + message.params, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetVideoPlayerURLRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetVideoPlayerURLRequest, + } as GetVideoPlayerURLRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.videoId = reader.string(); + break; + case 2: + message.params = VideoPlayerParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetVideoPlayerURLRequest { + const message = { + ...baseGetVideoPlayerURLRequest, + } as GetVideoPlayerURLRequest; + message.videoId = + object.videoId !== undefined && object.videoId !== null + ? String(object.videoId) + : ""; + message.params = + object.params !== undefined && object.params !== null + ? VideoPlayerParams.fromJSON(object.params) + : undefined; + return message; + }, + + toJSON(message: GetVideoPlayerURLRequest): unknown { + const obj: any = {}; + message.videoId !== undefined && (obj.videoId = message.videoId); + message.params !== undefined && + (obj.params = message.params + ? VideoPlayerParams.toJSON(message.params) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetVideoPlayerURLRequest { + const message = { + ...baseGetVideoPlayerURLRequest, + } as GetVideoPlayerURLRequest; + message.videoId = object.videoId ?? ""; + message.params = + object.params !== undefined && object.params !== null + ? VideoPlayerParams.fromPartial(object.params) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + GetVideoPlayerURLRequest.$type, + GetVideoPlayerURLRequest +); + +const baseVideoPlayerParams: object = { + $type: "yandex.cloud.video.v1.VideoPlayerParams", + mute: false, + autoplay: false, + hidden: false, +}; + +export const VideoPlayerParams = { + $type: "yandex.cloud.video.v1.VideoPlayerParams" as const, + + encode( + message: VideoPlayerParams, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.mute === true) { + writer.uint32(8).bool(message.mute); + } + if (message.autoplay === true) { + writer.uint32(16).bool(message.autoplay); + } + if (message.hidden === true) { + writer.uint32(24).bool(message.hidden); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): VideoPlayerParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVideoPlayerParams } as VideoPlayerParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mute = reader.bool(); + break; + case 2: + message.autoplay = reader.bool(); + break; + case 3: + message.hidden = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): VideoPlayerParams { + const message = { ...baseVideoPlayerParams } as VideoPlayerParams; + message.mute = + object.mute !== undefined && object.mute !== null + ? Boolean(object.mute) + : false; + message.autoplay = + object.autoplay !== undefined && object.autoplay !== null + ? Boolean(object.autoplay) + : false; + message.hidden = + object.hidden !== undefined && object.hidden !== null + ? Boolean(object.hidden) + : false; + return message; + }, + + toJSON(message: VideoPlayerParams): unknown { + const obj: any = {}; + message.mute !== undefined && (obj.mute = message.mute); + message.autoplay !== undefined && (obj.autoplay = message.autoplay); + message.hidden !== undefined && (obj.hidden = message.hidden); + return obj; + }, + + fromPartial, I>>( + object: I + ): VideoPlayerParams { + const message = { ...baseVideoPlayerParams } as VideoPlayerParams; + message.mute = object.mute ?? false; + message.autoplay = object.autoplay ?? false; + message.hidden = object.hidden ?? false; + return message; + }, +}; + +messageTypeRegistry.set(VideoPlayerParams.$type, VideoPlayerParams); + +const baseGetVideoPlayerURLResponse: object = { + $type: "yandex.cloud.video.v1.GetVideoPlayerURLResponse", + playerUrl: "", + html: "", +}; + +export const GetVideoPlayerURLResponse = { + $type: "yandex.cloud.video.v1.GetVideoPlayerURLResponse" as const, + + encode( + message: GetVideoPlayerURLResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.playerUrl !== "") { + writer.uint32(10).string(message.playerUrl); + } + if (message.html !== "") { + writer.uint32(18).string(message.html); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetVideoPlayerURLResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetVideoPlayerURLResponse, + } as GetVideoPlayerURLResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.playerUrl = reader.string(); + break; + case 2: + message.html = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetVideoPlayerURLResponse { + const message = { + ...baseGetVideoPlayerURLResponse, + } as GetVideoPlayerURLResponse; + message.playerUrl = + object.playerUrl !== undefined && object.playerUrl !== null + ? String(object.playerUrl) + : ""; + message.html = + object.html !== undefined && object.html !== null + ? String(object.html) + : ""; + return message; + }, + + toJSON(message: GetVideoPlayerURLResponse): unknown { + const obj: any = {}; + message.playerUrl !== undefined && (obj.playerUrl = message.playerUrl); + message.html !== undefined && (obj.html = message.html); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetVideoPlayerURLResponse { + const message = { + ...baseGetVideoPlayerURLResponse, + } as GetVideoPlayerURLResponse; + message.playerUrl = object.playerUrl ?? ""; + message.html = object.html ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetVideoPlayerURLResponse.$type, + GetVideoPlayerURLResponse +); + +const baseGetVideoManifestsRequest: object = { + $type: "yandex.cloud.video.v1.GetVideoManifestsRequest", + videoId: "", +}; + +export const GetVideoManifestsRequest = { + $type: "yandex.cloud.video.v1.GetVideoManifestsRequest" as const, + + encode( + message: GetVideoManifestsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.videoId !== "") { + writer.uint32(10).string(message.videoId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetVideoManifestsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetVideoManifestsRequest, + } as GetVideoManifestsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.videoId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetVideoManifestsRequest { + const message = { + ...baseGetVideoManifestsRequest, + } as GetVideoManifestsRequest; + message.videoId = + object.videoId !== undefined && object.videoId !== null + ? String(object.videoId) + : ""; + return message; + }, + + toJSON(message: GetVideoManifestsRequest): unknown { + const obj: any = {}; + message.videoId !== undefined && (obj.videoId = message.videoId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetVideoManifestsRequest { + const message = { + ...baseGetVideoManifestsRequest, + } as GetVideoManifestsRequest; + message.videoId = object.videoId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetVideoManifestsRequest.$type, + GetVideoManifestsRequest +); + +const baseGetVideoManifestsResponse: object = { + $type: "yandex.cloud.video.v1.GetVideoManifestsResponse", +}; + +export const GetVideoManifestsResponse = { + $type: "yandex.cloud.video.v1.GetVideoManifestsResponse" as const, + + encode( + message: GetVideoManifestsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.manifests) { + Manifest.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetVideoManifestsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetVideoManifestsResponse, + } as GetVideoManifestsResponse; + message.manifests = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.manifests.push(Manifest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetVideoManifestsResponse { + const message = { + ...baseGetVideoManifestsResponse, + } as GetVideoManifestsResponse; + message.manifests = (object.manifests ?? []).map((e: any) => + Manifest.fromJSON(e) + ); + return message; + }, + + toJSON(message: GetVideoManifestsResponse): unknown { + const obj: any = {}; + if (message.manifests) { + obj.manifests = message.manifests.map((e) => + e ? Manifest.toJSON(e) : undefined + ); + } else { + obj.manifests = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): GetVideoManifestsResponse { + const message = { + ...baseGetVideoManifestsResponse, + } as GetVideoManifestsResponse; + message.manifests = + object.manifests?.map((e) => Manifest.fromPartial(e)) || []; + return message; + }, +}; + +messageTypeRegistry.set( + GetVideoManifestsResponse.$type, + GetVideoManifestsResponse +); + +/** Video management service. */ +export const VideoServiceService = { + /** Returns the specific video. */ + get: { + path: "/yandex.cloud.video.v1.VideoService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetVideoRequest) => + Buffer.from(GetVideoRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetVideoRequest.decode(value), + responseSerialize: (value: Video) => + Buffer.from(Video.encode(value).finish()), + responseDeserialize: (value: Buffer) => Video.decode(value), + }, + /** List videos for channel. */ + list: { + path: "/yandex.cloud.video.v1.VideoService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListVideoRequest) => + Buffer.from(ListVideoRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ListVideoRequest.decode(value), + responseSerialize: (value: ListVideoResponse) => + Buffer.from(ListVideoResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => ListVideoResponse.decode(value), + }, + /** Create video. */ + create: { + path: "/yandex.cloud.video.v1.VideoService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateVideoRequest) => + Buffer.from(CreateVideoRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateVideoRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Update video. */ + update: { + path: "/yandex.cloud.video.v1.VideoService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateVideoRequest) => + Buffer.from(UpdateVideoRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateVideoRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Delete video. */ + delete: { + path: "/yandex.cloud.video.v1.VideoService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteVideoRequest) => + Buffer.from(DeleteVideoRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteVideoRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Perform an action on the episode. */ + performAction: { + path: "/yandex.cloud.video.v1.VideoService/PerformAction", + requestStream: false, + responseStream: false, + requestSerialize: (value: PerformVideoActionRequest) => + Buffer.from(PerformVideoActionRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + PerformVideoActionRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Returns url to the player. */ + getPlayerURL: { + path: "/yandex.cloud.video.v1.VideoService/GetPlayerURL", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetVideoPlayerURLRequest) => + Buffer.from(GetVideoPlayerURLRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetVideoPlayerURLRequest.decode(value), + responseSerialize: (value: GetVideoPlayerURLResponse) => + Buffer.from(GetVideoPlayerURLResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + GetVideoPlayerURLResponse.decode(value), + }, + /** Returns manifest urls. */ + getManifests: { + path: "/yandex.cloud.video.v1.VideoService/GetManifests", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetVideoManifestsRequest) => + Buffer.from(GetVideoManifestsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetVideoManifestsRequest.decode(value), + responseSerialize: (value: GetVideoManifestsResponse) => + Buffer.from(GetVideoManifestsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + GetVideoManifestsResponse.decode(value), + }, +} as const; + +export interface VideoServiceServer extends UntypedServiceImplementation { + /** Returns the specific video. */ + get: handleUnaryCall; + /** List videos for channel. */ + list: handleUnaryCall; + /** Create video. */ + create: handleUnaryCall; + /** Update video. */ + update: handleUnaryCall; + /** Delete video. */ + delete: handleUnaryCall; + /** Perform an action on the episode. */ + performAction: handleUnaryCall; + /** Returns url to the player. */ + getPlayerURL: handleUnaryCall< + GetVideoPlayerURLRequest, + GetVideoPlayerURLResponse + >; + /** Returns manifest urls. */ + getManifests: handleUnaryCall< + GetVideoManifestsRequest, + GetVideoManifestsResponse + >; +} + +export interface VideoServiceClient extends Client { + /** Returns the specific video. */ + get( + request: GetVideoRequest, + callback: (error: ServiceError | null, response: Video) => void + ): ClientUnaryCall; + get( + request: GetVideoRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Video) => void + ): ClientUnaryCall; + get( + request: GetVideoRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Video) => void + ): ClientUnaryCall; + /** List videos for channel. */ + list( + request: ListVideoRequest, + callback: (error: ServiceError | null, response: ListVideoResponse) => void + ): ClientUnaryCall; + list( + request: ListVideoRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: ListVideoResponse) => void + ): ClientUnaryCall; + list( + request: ListVideoRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: ListVideoResponse) => void + ): ClientUnaryCall; + /** Create video. */ + create( + request: CreateVideoRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateVideoRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreateVideoRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Update video. */ + update( + request: UpdateVideoRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateVideoRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdateVideoRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Delete video. */ + delete( + request: DeleteVideoRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteVideoRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeleteVideoRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Perform an action on the episode. */ + performAction( + request: PerformVideoActionRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + performAction( + request: PerformVideoActionRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + performAction( + request: PerformVideoActionRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Returns url to the player. */ + getPlayerURL( + request: GetVideoPlayerURLRequest, + callback: ( + error: ServiceError | null, + response: GetVideoPlayerURLResponse + ) => void + ): ClientUnaryCall; + getPlayerURL( + request: GetVideoPlayerURLRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: GetVideoPlayerURLResponse + ) => void + ): ClientUnaryCall; + getPlayerURL( + request: GetVideoPlayerURLRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: GetVideoPlayerURLResponse + ) => void + ): ClientUnaryCall; + /** Returns manifest urls. */ + getManifests( + request: GetVideoManifestsRequest, + callback: ( + error: ServiceError | null, + response: GetVideoManifestsResponse + ) => void + ): ClientUnaryCall; + getManifests( + request: GetVideoManifestsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: GetVideoManifestsResponse + ) => void + ): ClientUnaryCall; + getManifests( + request: GetVideoManifestsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: GetVideoManifestsResponse + ) => void + ): ClientUnaryCall; +} + +export const VideoServiceClient = makeGenericClientConstructor( + VideoServiceService, + "yandex.cloud.video.v1.VideoService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): VideoServiceClient; + service: typeof VideoServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/vpc/index.ts b/src/generated/yandex/cloud/vpc/index.ts index 729ef520..8dd1d45c 100644 --- a/src/generated/yandex/cloud/vpc/index.ts +++ b/src/generated/yandex/cloud/vpc/index.ts @@ -1,12 +1,14 @@ -export * as address from './v1/address' -export * as address_service from './v1/address_service' -export * as gateway from './v1/gateway' -export * as gateway_service from './v1/gateway_service' -export * as network from './v1/network' -export * as network_service from './v1/network_service' -export * as route_table from './v1/route_table' -export * as route_table_service from './v1/route_table_service' -export * as security_group from './v1/security_group' -export * as security_group_service from './v1/security_group_service' -export * as subnet from './v1/subnet' -export * as subnet_service from './v1/subnet_service' \ No newline at end of file +export * as v1_address from './v1/address' +export * as v1_address_service from './v1/address_service' +export * as v1_gateway from './v1/gateway' +export * as v1_gateway_service from './v1/gateway_service' +export * as v1_network from './v1/network' +export * as v1_network_service from './v1/network_service' +export * as v1_route_table from './v1/route_table' +export * as v1_route_table_service from './v1/route_table_service' +export * as v1_security_group from './v1/security_group' +export * as v1_security_group_service from './v1/security_group_service' +export * as v1_subnet from './v1/subnet' +export * as v1_subnet_service from './v1/subnet_service' +export * as v1_privatelink_private_endpoint from './v1/privatelink/private_endpoint' +export * as v1_privatelink_private_endpoint_service from './v1/privatelink/private_endpoint_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/vpc/v1/address.ts b/src/generated/yandex/cloud/vpc/v1/address.ts index e0853e9a..22eeebbc 100644 --- a/src/generated/yandex/cloud/vpc/v1/address.ts +++ b/src/generated/yandex/cloud/vpc/v1/address.ts @@ -18,11 +18,19 @@ export interface Address { /** * Name of the address. * The name is unique within the folder. + * Value must match the regular expression ``\|[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])?``. */ name: string; - /** Description of the address. */ + /** Description of the address. 0-256 characters long. */ description: string; - /** Resource labels as `key:value` pairs. */ + /** + * Address labels as `key:value` pairs. + * No more than 64 per resource. + * The maximum string length in characters for each value is 63. + * Each value must match the regular expression `[-_0-9a-z]*`. + * The string length in characters for each key must be 1-63. + * Each key must match the regular expression `[a-z][-_0-9a-z]*`. + */ labels: { [key: string]: string }; externalIpv4Address?: ExternalIpv4Address | undefined; /** Specifies if address is reserved or not. */ @@ -31,10 +39,12 @@ export interface Address { used: boolean; /** Type of the IP address. */ type: Address_Type; - /** Vervion of the IP address. */ + /** Version of the IP address. */ ipVersion: Address_IpVersion; /** Specifies if address protected from deletion. */ deletionProtection: boolean; + /** Optional DNS record specifications */ + dnsRecords: DnsRecord[]; } export enum Address_Type { @@ -141,6 +151,18 @@ export interface AddressRequirements { outgoingSmtpCapability: string; } +export interface DnsRecord { + $type: "yandex.cloud.vpc.v1.DnsRecord"; + /** DNS record name (absolute or relative to the DNS zone in use). */ + fqdn: string; + /** ID of the public DNS zone. */ + dnsZoneId: string; + /** TTL of record. */ + ttl: number; + /** If the PTR record is required, this parameter must be set to "true". */ + ptr: boolean; +} + const baseAddress: object = { $type: "yandex.cloud.vpc.v1.Address", id: "", @@ -210,6 +232,9 @@ export const Address = { if (message.deletionProtection === true) { writer.uint32(152).bool(message.deletionProtection); } + for (const v of message.dnsRecords) { + DnsRecord.encode(v!, writer.uint32(162).fork()).ldelim(); + } return writer; }, @@ -218,6 +243,7 @@ export const Address = { let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseAddress } as Address; message.labels = {}; + message.dnsRecords = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -265,6 +291,9 @@ export const Address = { case 19: message.deletionProtection = reader.bool(); break; + case 20: + message.dnsRecords.push(DnsRecord.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -325,6 +354,9 @@ export const Address = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : false; + message.dnsRecords = (object.dnsRecords ?? []).map((e: any) => + DnsRecord.fromJSON(e) + ); return message; }, @@ -354,6 +386,13 @@ export const Address = { (obj.ipVersion = address_IpVersionToJSON(message.ipVersion)); message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + if (message.dnsRecords) { + obj.dnsRecords = message.dnsRecords.map((e) => + e ? DnsRecord.toJSON(e) : undefined + ); + } else { + obj.dnsRecords = []; + } return obj; }, @@ -382,6 +421,8 @@ export const Address = { message.type = object.type ?? 0; message.ipVersion = object.ipVersion ?? 0; message.deletionProtection = object.deletionProtection ?? false; + message.dnsRecords = + object.dnsRecords?.map((e) => DnsRecord.fromPartial(e)) || []; return message; }, }; @@ -639,6 +680,116 @@ export const AddressRequirements = { messageTypeRegistry.set(AddressRequirements.$type, AddressRequirements); +const baseDnsRecord: object = { + $type: "yandex.cloud.vpc.v1.DnsRecord", + fqdn: "", + dnsZoneId: "", + ttl: 0, + ptr: false, +}; + +export const DnsRecord = { + $type: "yandex.cloud.vpc.v1.DnsRecord" as const, + + encode( + message: DnsRecord, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.fqdn !== "") { + writer.uint32(10).string(message.fqdn); + } + if (message.dnsZoneId !== "") { + writer.uint32(18).string(message.dnsZoneId); + } + if (message.ttl !== 0) { + writer.uint32(24).int64(message.ttl); + } + if (message.ptr === true) { + writer.uint32(32).bool(message.ptr); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DnsRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDnsRecord } as DnsRecord; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fqdn = reader.string(); + break; + case 2: + message.dnsZoneId = reader.string(); + break; + case 3: + message.ttl = longToNumber(reader.int64() as Long); + break; + case 4: + message.ptr = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DnsRecord { + const message = { ...baseDnsRecord } as DnsRecord; + message.fqdn = + object.fqdn !== undefined && object.fqdn !== null + ? String(object.fqdn) + : ""; + message.dnsZoneId = + object.dnsZoneId !== undefined && object.dnsZoneId !== null + ? String(object.dnsZoneId) + : ""; + message.ttl = + object.ttl !== undefined && object.ttl !== null ? Number(object.ttl) : 0; + message.ptr = + object.ptr !== undefined && object.ptr !== null + ? Boolean(object.ptr) + : false; + return message; + }, + + toJSON(message: DnsRecord): unknown { + const obj: any = {}; + message.fqdn !== undefined && (obj.fqdn = message.fqdn); + message.dnsZoneId !== undefined && (obj.dnsZoneId = message.dnsZoneId); + message.ttl !== undefined && (obj.ttl = Math.round(message.ttl)); + message.ptr !== undefined && (obj.ptr = message.ptr); + return obj; + }, + + fromPartial, I>>( + object: I + ): DnsRecord { + const message = { ...baseDnsRecord } as DnsRecord; + message.fqdn = object.fqdn ?? ""; + message.dnsZoneId = object.dnsZoneId ?? ""; + message.ttl = object.ttl ?? 0; + message.ptr = object.ptr ?? false; + return message; + }, +}; + +messageTypeRegistry.set(DnsRecord.$type, DnsRecord); + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + type Builtin = | Date | Function @@ -688,6 +839,13 @@ function fromJsonTimestamp(o: any): Date { } } +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); diff --git a/src/generated/yandex/cloud/vpc/v1/address_service.ts b/src/generated/yandex/cloud/vpc/v1/address_service.ts index 6281757e..ff079fab 100644 --- a/src/generated/yandex/cloud/vpc/v1/address_service.ts +++ b/src/generated/yandex/cloud/vpc/v1/address_service.ts @@ -104,6 +104,8 @@ export interface CreateAddressRequest { externalIpv4AddressSpec?: ExternalIpv4AddressSpec | undefined; /** Specifies if address protected from deletion. */ deletionProtection: boolean; + /** Optional DNS record specifications */ + dnsRecordSpecs: DnsRecordSpec[]; } export interface CreateAddressRequest_LabelsEntry { @@ -122,6 +124,18 @@ export interface ExternalIpv4AddressSpec { requirements?: AddressRequirements; } +export interface DnsRecordSpec { + $type: "yandex.cloud.vpc.v1.DnsRecordSpec"; + /** Required. DNS record name (absolute or relative to the DNS zone in use). */ + fqdn: string; + /** Required. ID of the public DNS zone. The maximum string length in characters is 20. */ + dnsZoneId: string; + /** TTL of record. Acceptable values are 0 to 86400, inclusive. */ + ttl: number; + /** Optional. If the PTR record is required, this parameter must be set to "true". */ + ptr: boolean; +} + export interface CreateAddressMetadata { $type: "yandex.cloud.vpc.v1.CreateAddressMetadata"; /** ID of the address that is being created. */ @@ -159,6 +173,8 @@ export interface UpdateAddressRequest { reserved: boolean; /** Specifies if address protected from deletion. */ deletionProtection: boolean; + /** Optional DNS record specifications */ + dnsRecordSpecs: DnsRecordSpec[]; } export interface UpdateAddressRequest_LabelsEntry { @@ -227,12 +243,15 @@ export interface ListAddressOperationsResponse { export interface MoveAddressRequest { $type: "yandex.cloud.vpc.v1.MoveAddressRequest"; + /** ID of the address that is being moved. */ addressId: string; + /** ID of the folder to move address to. */ destinationFolderId: string; } export interface MoveAddressMetadata { $type: "yandex.cloud.vpc.v1.MoveAddressMetadata"; + /** ID of the address that is being moved. */ addressId: string; } @@ -606,6 +625,9 @@ export const CreateAddressRequest = { if (message.deletionProtection === true) { writer.uint32(80).bool(message.deletionProtection); } + for (const v of message.dnsRecordSpecs) { + DnsRecordSpec.encode(v!, writer.uint32(90).fork()).ldelim(); + } return writer; }, @@ -617,6 +639,7 @@ export const CreateAddressRequest = { let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseCreateAddressRequest } as CreateAddressRequest; message.labels = {}; + message.dnsRecordSpecs = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -647,6 +670,11 @@ export const CreateAddressRequest = { case 10: message.deletionProtection = reader.bool(); break; + case 11: + message.dnsRecordSpecs.push( + DnsRecordSpec.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -685,6 +713,9 @@ export const CreateAddressRequest = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : false; + message.dnsRecordSpecs = (object.dnsRecordSpecs ?? []).map((e: any) => + DnsRecordSpec.fromJSON(e) + ); return message; }, @@ -706,6 +737,13 @@ export const CreateAddressRequest = { : undefined); message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + if (message.dnsRecordSpecs) { + obj.dnsRecordSpecs = message.dnsRecordSpecs.map((e) => + e ? DnsRecordSpec.toJSON(e) : undefined + ); + } else { + obj.dnsRecordSpecs = []; + } return obj; }, @@ -730,6 +768,8 @@ export const CreateAddressRequest = { ? ExternalIpv4AddressSpec.fromPartial(object.externalIpv4AddressSpec) : undefined; message.deletionProtection = object.deletionProtection ?? false; + message.dnsRecordSpecs = + object.dnsRecordSpecs?.map((e) => DnsRecordSpec.fromPartial(e)) || []; return message; }, }; @@ -929,6 +969,105 @@ export const ExternalIpv4AddressSpec = { messageTypeRegistry.set(ExternalIpv4AddressSpec.$type, ExternalIpv4AddressSpec); +const baseDnsRecordSpec: object = { + $type: "yandex.cloud.vpc.v1.DnsRecordSpec", + fqdn: "", + dnsZoneId: "", + ttl: 0, + ptr: false, +}; + +export const DnsRecordSpec = { + $type: "yandex.cloud.vpc.v1.DnsRecordSpec" as const, + + encode( + message: DnsRecordSpec, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.fqdn !== "") { + writer.uint32(10).string(message.fqdn); + } + if (message.dnsZoneId !== "") { + writer.uint32(18).string(message.dnsZoneId); + } + if (message.ttl !== 0) { + writer.uint32(24).int64(message.ttl); + } + if (message.ptr === true) { + writer.uint32(32).bool(message.ptr); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DnsRecordSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDnsRecordSpec } as DnsRecordSpec; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fqdn = reader.string(); + break; + case 2: + message.dnsZoneId = reader.string(); + break; + case 3: + message.ttl = longToNumber(reader.int64() as Long); + break; + case 4: + message.ptr = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DnsRecordSpec { + const message = { ...baseDnsRecordSpec } as DnsRecordSpec; + message.fqdn = + object.fqdn !== undefined && object.fqdn !== null + ? String(object.fqdn) + : ""; + message.dnsZoneId = + object.dnsZoneId !== undefined && object.dnsZoneId !== null + ? String(object.dnsZoneId) + : ""; + message.ttl = + object.ttl !== undefined && object.ttl !== null ? Number(object.ttl) : 0; + message.ptr = + object.ptr !== undefined && object.ptr !== null + ? Boolean(object.ptr) + : false; + return message; + }, + + toJSON(message: DnsRecordSpec): unknown { + const obj: any = {}; + message.fqdn !== undefined && (obj.fqdn = message.fqdn); + message.dnsZoneId !== undefined && (obj.dnsZoneId = message.dnsZoneId); + message.ttl !== undefined && (obj.ttl = Math.round(message.ttl)); + message.ptr !== undefined && (obj.ptr = message.ptr); + return obj; + }, + + fromPartial, I>>( + object: I + ): DnsRecordSpec { + const message = { ...baseDnsRecordSpec } as DnsRecordSpec; + message.fqdn = object.fqdn ?? ""; + message.dnsZoneId = object.dnsZoneId ?? ""; + message.ttl = object.ttl ?? 0; + message.ptr = object.ptr ?? false; + return message; + }, +}; + +messageTypeRegistry.set(DnsRecordSpec.$type, DnsRecordSpec); + const baseCreateAddressMetadata: object = { $type: "yandex.cloud.vpc.v1.CreateAddressMetadata", addressId: "", @@ -1038,6 +1177,9 @@ export const UpdateAddressRequest = { if (message.deletionProtection === true) { writer.uint32(56).bool(message.deletionProtection); } + for (const v of message.dnsRecordSpecs) { + DnsRecordSpec.encode(v!, writer.uint32(66).fork()).ldelim(); + } return writer; }, @@ -1049,6 +1191,7 @@ export const UpdateAddressRequest = { let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseUpdateAddressRequest } as UpdateAddressRequest; message.labels = {}; + message.dnsRecordSpecs = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1079,6 +1222,11 @@ export const UpdateAddressRequest = { case 7: message.deletionProtection = reader.bool(); break; + case 8: + message.dnsRecordSpecs.push( + DnsRecordSpec.decode(reader, reader.uint32()) + ); + break; default: reader.skipType(tag & 7); break; @@ -1120,6 +1268,9 @@ export const UpdateAddressRequest = { object.deletionProtection !== null ? Boolean(object.deletionProtection) : false; + message.dnsRecordSpecs = (object.dnsRecordSpecs ?? []).map((e: any) => + DnsRecordSpec.fromJSON(e) + ); return message; }, @@ -1142,6 +1293,13 @@ export const UpdateAddressRequest = { message.reserved !== undefined && (obj.reserved = message.reserved); message.deletionProtection !== undefined && (obj.deletionProtection = message.deletionProtection); + if (message.dnsRecordSpecs) { + obj.dnsRecordSpecs = message.dnsRecordSpecs.map((e) => + e ? DnsRecordSpec.toJSON(e) : undefined + ); + } else { + obj.dnsRecordSpecs = []; + } return obj; }, @@ -1166,6 +1324,8 @@ export const UpdateAddressRequest = { }, {}); message.reserved = object.reserved ?? false; message.deletionProtection = object.deletionProtection ?? false; + message.dnsRecordSpecs = + object.dnsRecordSpecs?.map((e) => DnsRecordSpec.fromPartial(e)) || []; return message; }, }; diff --git a/src/generated/yandex/cloud/vpc/v1/gateway.ts b/src/generated/yandex/cloud/vpc/v1/gateway.ts index b3bd5dd3..a8c0f1fc 100644 --- a/src/generated/yandex/cloud/vpc/v1/gateway.ts +++ b/src/generated/yandex/cloud/vpc/v1/gateway.ts @@ -18,11 +18,19 @@ export interface Gateway { /** * Name of the gateway. * The name is unique within the folder. + * Value must match the regular expression ``\|[a-z]([-a-z0-9]{0,61}[a-z0-9])?``. */ name: string; - /** Description of the gateway. */ + /** Description of the gateway. 0-256 characters long. */ description: string; - /** Resource labels as `key:value` pairs. */ + /** + * Gateway labels as `key:value` pairs. + * No more than 64 per resource. + * The maximum string length in characters for each value is 63. + * Each value must match the regular expression `[-_./\\@0-9a-z]*`. + * The string length in characters for each key must be 1-63. + * Each key must match the regular expression `[a-z][-_./\\@0-9a-z]*`. + */ labels: { [key: string]: string }; sharedEgressGateway?: SharedEgressGateway | undefined; } diff --git a/src/generated/yandex/cloud/vpc/v1/network.ts b/src/generated/yandex/cloud/vpc/v1/network.ts index 6b6b6226..d7f07cdc 100644 --- a/src/generated/yandex/cloud/vpc/v1/network.ts +++ b/src/generated/yandex/cloud/vpc/v1/network.ts @@ -17,12 +17,20 @@ export interface Network { createdAt?: Date; /** * Name of the network. - * The name is unique within the folder. 3-63 characters long. + * The name is unique within the folder. + * Value must match the regular expression ``\|[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])?``. */ name: string; /** Optional description of the network. 0-256 characters long. */ description: string; - /** Resource labels as `` key:value `` pairs. Maximum of 64 per resource. */ + /** + * Resource labels as `key:value` pairs. + * No more than 64 per resource. + * The maximum string length in characters for each value is 63. + * Each value must match the regular expression `[-_0-9a-z]*`. + * The string length in characters for each key must be 1-63. + * Each key must match the regular expression `[a-z][-_0-9a-z]*`. + */ labels: { [key: string]: string }; /** ID of default security group for network. */ defaultSecurityGroupId: string; diff --git a/src/generated/yandex/cloud/vpc/v1/privatelink/private_endpoint.ts b/src/generated/yandex/cloud/vpc/v1/privatelink/private_endpoint.ts new file mode 100644 index 00000000..15c9b251 --- /dev/null +++ b/src/generated/yandex/cloud/vpc/v1/privatelink/private_endpoint.ts @@ -0,0 +1,760 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../../../google/protobuf/timestamp"; + +export const protobufPackage = "yandex.cloud.vpc.v1.privatelink"; + +export interface PrivateEndpoint { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint"; + /** ID of the private endpoint. Generated at creation time. */ + id: string; + /** ID of the folder that the private endpoint belongs to. */ + folderId: string; + /** Creation timestamp. */ + createdAt?: Date; + /** + * Name of the private endpoint. + * The name is unique within the folder. + * Value must match the regular expression + * ``\|[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])?``. + */ + name: string; + /** Description of the private endpoint. 0-256 characters long. */ + description: string; + /** + * Private endpoint labels as `key:value` pairs. + * No more than 64 per resource. + * The maximum string length in characters for each value is 63. + * Each value must match the regular expression `[-_0-9a-z]*`. + * The string length in characters for each key must be 1-63. + * Each key must match the regular expression `[a-z][-_0-9a-z]*`. + */ + labels: { [key: string]: string }; + /** ID of the network that the private endpoint belongs to. */ + networkId: string; + /** Status of the private endpoint. */ + status: PrivateEndpoint_Status; + /** Private endpoint ip address details. */ + address?: PrivateEndpoint_EndpointAddress; + /** Private endpoint dns options. */ + dnsOptions?: PrivateEndpoint_DnsOptions; + /** Yandex Cloud Object Storage. */ + objectStorage?: PrivateEndpoint_ObjectStorage | undefined; +} + +/** Status of the private endpoint. */ +export enum PrivateEndpoint_Status { + STATUS_UNSPECIFIED = 0, + /** PENDING - Private endpoint is still creating / updating. */ + PENDING = 1, + /** AVAILABLE - Private endpoint is available. */ + AVAILABLE = 2, + /** DELETING - Private endpoint is deleting. */ + DELETING = 3, + UNRECOGNIZED = -1, +} + +export function privateEndpoint_StatusFromJSON( + object: any +): PrivateEndpoint_Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return PrivateEndpoint_Status.STATUS_UNSPECIFIED; + case 1: + case "PENDING": + return PrivateEndpoint_Status.PENDING; + case 2: + case "AVAILABLE": + return PrivateEndpoint_Status.AVAILABLE; + case 3: + case "DELETING": + return PrivateEndpoint_Status.DELETING; + case -1: + case "UNRECOGNIZED": + default: + return PrivateEndpoint_Status.UNRECOGNIZED; + } +} + +export function privateEndpoint_StatusToJSON( + object: PrivateEndpoint_Status +): string { + switch (object) { + case PrivateEndpoint_Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case PrivateEndpoint_Status.PENDING: + return "PENDING"; + case PrivateEndpoint_Status.AVAILABLE: + return "AVAILABLE"; + case PrivateEndpoint_Status.DELETING: + return "DELETING"; + default: + return "UNKNOWN"; + } +} + +export interface PrivateEndpoint_LabelsEntry { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint.LabelsEntry"; + key: string; + value: string; +} + +/** Yandex Cloud Object Storage. */ +export interface PrivateEndpoint_ObjectStorage { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint.ObjectStorage"; +} + +export interface PrivateEndpoint_DnsOptions { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint.DnsOptions"; + /** If enabled - vpc will create private dns records for specified service. */ + privateDnsRecordsEnabled: boolean; +} + +/** Private endpoint ip address details. */ +export interface PrivateEndpoint_EndpointAddress { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint.EndpointAddress"; + /** ID of the subnet that the private endpoint address belongs to. */ + subnetId: string; + /** IP address of the private endpoint. */ + address: string; + /** ID of the private endpoint address. */ + addressId: string; +} + +const basePrivateEndpoint: object = { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint", + id: "", + folderId: "", + name: "", + description: "", + networkId: "", + status: 0, +}; + +export const PrivateEndpoint = { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint" as const, + + encode( + message: PrivateEndpoint, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.folderId !== "") { + writer.uint32(18).string(message.folderId); + } + if (message.createdAt !== undefined) { + Timestamp.encode( + toTimestamp(message.createdAt), + writer.uint32(26).fork() + ).ldelim(); + } + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + PrivateEndpoint_LabelsEntry.encode( + { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(50).fork() + ).ldelim(); + }); + if (message.networkId !== "") { + writer.uint32(58).string(message.networkId); + } + if (message.status !== 0) { + writer.uint32(64).int32(message.status); + } + if (message.address !== undefined) { + PrivateEndpoint_EndpointAddress.encode( + message.address, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.dnsOptions !== undefined) { + PrivateEndpoint_DnsOptions.encode( + message.dnsOptions, + writer.uint32(82).fork() + ).ldelim(); + } + if (message.objectStorage !== undefined) { + PrivateEndpoint_ObjectStorage.encode( + message.objectStorage, + writer.uint32(90).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PrivateEndpoint { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePrivateEndpoint } as PrivateEndpoint; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.folderId = reader.string(); + break; + case 3: + message.createdAt = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ); + break; + case 4: + message.name = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + const entry6 = PrivateEndpoint_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } + break; + case 7: + message.networkId = reader.string(); + break; + case 8: + message.status = reader.int32() as any; + break; + case 9: + message.address = PrivateEndpoint_EndpointAddress.decode( + reader, + reader.uint32() + ); + break; + case 10: + message.dnsOptions = PrivateEndpoint_DnsOptions.decode( + reader, + reader.uint32() + ); + break; + case 11: + message.objectStorage = PrivateEndpoint_ObjectStorage.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PrivateEndpoint { + const message = { ...basePrivateEndpoint } as PrivateEndpoint; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.createdAt = + object.createdAt !== undefined && object.createdAt !== null + ? fromJsonTimestamp(object.createdAt) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; + message.status = + object.status !== undefined && object.status !== null + ? privateEndpoint_StatusFromJSON(object.status) + : 0; + message.address = + object.address !== undefined && object.address !== null + ? PrivateEndpoint_EndpointAddress.fromJSON(object.address) + : undefined; + message.dnsOptions = + object.dnsOptions !== undefined && object.dnsOptions !== null + ? PrivateEndpoint_DnsOptions.fromJSON(object.dnsOptions) + : undefined; + message.objectStorage = + object.objectStorage !== undefined && object.objectStorage !== null + ? PrivateEndpoint_ObjectStorage.fromJSON(object.objectStorage) + : undefined; + return message; + }, + + toJSON(message: PrivateEndpoint): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.folderId !== undefined && (obj.folderId = message.folderId); + message.createdAt !== undefined && + (obj.createdAt = message.createdAt.toISOString()); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.networkId !== undefined && (obj.networkId = message.networkId); + message.status !== undefined && + (obj.status = privateEndpoint_StatusToJSON(message.status)); + message.address !== undefined && + (obj.address = message.address + ? PrivateEndpoint_EndpointAddress.toJSON(message.address) + : undefined); + message.dnsOptions !== undefined && + (obj.dnsOptions = message.dnsOptions + ? PrivateEndpoint_DnsOptions.toJSON(message.dnsOptions) + : undefined); + message.objectStorage !== undefined && + (obj.objectStorage = message.objectStorage + ? PrivateEndpoint_ObjectStorage.toJSON(message.objectStorage) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): PrivateEndpoint { + const message = { ...basePrivateEndpoint } as PrivateEndpoint; + message.id = object.id ?? ""; + message.folderId = object.folderId ?? ""; + message.createdAt = object.createdAt ?? undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.networkId = object.networkId ?? ""; + message.status = object.status ?? 0; + message.address = + object.address !== undefined && object.address !== null + ? PrivateEndpoint_EndpointAddress.fromPartial(object.address) + : undefined; + message.dnsOptions = + object.dnsOptions !== undefined && object.dnsOptions !== null + ? PrivateEndpoint_DnsOptions.fromPartial(object.dnsOptions) + : undefined; + message.objectStorage = + object.objectStorage !== undefined && object.objectStorage !== null + ? PrivateEndpoint_ObjectStorage.fromPartial(object.objectStorage) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(PrivateEndpoint.$type, PrivateEndpoint); + +const basePrivateEndpoint_LabelsEntry: object = { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint.LabelsEntry", + key: "", + value: "", +}; + +export const PrivateEndpoint_LabelsEntry = { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint.LabelsEntry" as const, + + encode( + message: PrivateEndpoint_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PrivateEndpoint_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePrivateEndpoint_LabelsEntry, + } as PrivateEndpoint_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PrivateEndpoint_LabelsEntry { + const message = { + ...basePrivateEndpoint_LabelsEntry, + } as PrivateEndpoint_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: PrivateEndpoint_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial, I>>( + object: I + ): PrivateEndpoint_LabelsEntry { + const message = { + ...basePrivateEndpoint_LabelsEntry, + } as PrivateEndpoint_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + PrivateEndpoint_LabelsEntry.$type, + PrivateEndpoint_LabelsEntry +); + +const basePrivateEndpoint_ObjectStorage: object = { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint.ObjectStorage", +}; + +export const PrivateEndpoint_ObjectStorage = { + $type: + "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint.ObjectStorage" as const, + + encode( + _: PrivateEndpoint_ObjectStorage, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PrivateEndpoint_ObjectStorage { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePrivateEndpoint_ObjectStorage, + } as PrivateEndpoint_ObjectStorage; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): PrivateEndpoint_ObjectStorage { + const message = { + ...basePrivateEndpoint_ObjectStorage, + } as PrivateEndpoint_ObjectStorage; + return message; + }, + + toJSON(_: PrivateEndpoint_ObjectStorage): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I + ): PrivateEndpoint_ObjectStorage { + const message = { + ...basePrivateEndpoint_ObjectStorage, + } as PrivateEndpoint_ObjectStorage; + return message; + }, +}; + +messageTypeRegistry.set( + PrivateEndpoint_ObjectStorage.$type, + PrivateEndpoint_ObjectStorage +); + +const basePrivateEndpoint_DnsOptions: object = { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint.DnsOptions", + privateDnsRecordsEnabled: false, +}; + +export const PrivateEndpoint_DnsOptions = { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint.DnsOptions" as const, + + encode( + message: PrivateEndpoint_DnsOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.privateDnsRecordsEnabled === true) { + writer.uint32(8).bool(message.privateDnsRecordsEnabled); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PrivateEndpoint_DnsOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePrivateEndpoint_DnsOptions, + } as PrivateEndpoint_DnsOptions; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privateDnsRecordsEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PrivateEndpoint_DnsOptions { + const message = { + ...basePrivateEndpoint_DnsOptions, + } as PrivateEndpoint_DnsOptions; + message.privateDnsRecordsEnabled = + object.privateDnsRecordsEnabled !== undefined && + object.privateDnsRecordsEnabled !== null + ? Boolean(object.privateDnsRecordsEnabled) + : false; + return message; + }, + + toJSON(message: PrivateEndpoint_DnsOptions): unknown { + const obj: any = {}; + message.privateDnsRecordsEnabled !== undefined && + (obj.privateDnsRecordsEnabled = message.privateDnsRecordsEnabled); + return obj; + }, + + fromPartial, I>>( + object: I + ): PrivateEndpoint_DnsOptions { + const message = { + ...basePrivateEndpoint_DnsOptions, + } as PrivateEndpoint_DnsOptions; + message.privateDnsRecordsEnabled = object.privateDnsRecordsEnabled ?? false; + return message; + }, +}; + +messageTypeRegistry.set( + PrivateEndpoint_DnsOptions.$type, + PrivateEndpoint_DnsOptions +); + +const basePrivateEndpoint_EndpointAddress: object = { + $type: "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint.EndpointAddress", + subnetId: "", + address: "", + addressId: "", +}; + +export const PrivateEndpoint_EndpointAddress = { + $type: + "yandex.cloud.vpc.v1.privatelink.PrivateEndpoint.EndpointAddress" as const, + + encode( + message: PrivateEndpoint_EndpointAddress, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.subnetId !== "") { + writer.uint32(10).string(message.subnetId); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + if (message.addressId !== "") { + writer.uint32(26).string(message.addressId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): PrivateEndpoint_EndpointAddress { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...basePrivateEndpoint_EndpointAddress, + } as PrivateEndpoint_EndpointAddress; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subnetId = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.addressId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PrivateEndpoint_EndpointAddress { + const message = { + ...basePrivateEndpoint_EndpointAddress, + } as PrivateEndpoint_EndpointAddress; + message.subnetId = + object.subnetId !== undefined && object.subnetId !== null + ? String(object.subnetId) + : ""; + message.address = + object.address !== undefined && object.address !== null + ? String(object.address) + : ""; + message.addressId = + object.addressId !== undefined && object.addressId !== null + ? String(object.addressId) + : ""; + return message; + }, + + toJSON(message: PrivateEndpoint_EndpointAddress): unknown { + const obj: any = {}; + message.subnetId !== undefined && (obj.subnetId = message.subnetId); + message.address !== undefined && (obj.address = message.address); + message.addressId !== undefined && (obj.addressId = message.addressId); + return obj; + }, + + fromPartial, I>>( + object: I + ): PrivateEndpoint_EndpointAddress { + const message = { + ...basePrivateEndpoint_EndpointAddress, + } as PrivateEndpoint_EndpointAddress; + message.subnetId = object.subnetId ?? ""; + message.address = object.address ?? ""; + message.addressId = object.addressId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + PrivateEndpoint_EndpointAddress.$type, + PrivateEndpoint_EndpointAddress +); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { $type: "google.protobuf.Timestamp", seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/vpc/v1/privatelink/private_endpoint_service.ts b/src/generated/yandex/cloud/vpc/v1/privatelink/private_endpoint_service.ts new file mode 100644 index 00000000..fb999426 --- /dev/null +++ b/src/generated/yandex/cloud/vpc/v1/privatelink/private_endpoint_service.ts @@ -0,0 +1,2124 @@ +/* eslint-disable */ +import { messageTypeRegistry } from "../../../../../typeRegistry"; +import Long from "long"; +import { + makeGenericClientConstructor, + ChannelCredentials, + ChannelOptions, + UntypedServiceImplementation, + handleUnaryCall, + Client, + ClientUnaryCall, + Metadata, + CallOptions, + ServiceError, +} from "@grpc/grpc-js"; +import _m0 from "protobufjs/minimal"; +import { + PrivateEndpoint_DnsOptions, + PrivateEndpoint_ObjectStorage, + PrivateEndpoint, +} from "../../../../../yandex/cloud/vpc/v1/privatelink/private_endpoint"; +import { FieldMask } from "../../../../../google/protobuf/field_mask"; +import { Operation } from "../../../../../yandex/cloud/operation/operation"; + +export const protobufPackage = "yandex.cloud.vpc.v1.privatelink"; + +export interface GetPrivateEndpointRequest { + $type: "yandex.cloud.vpc.v1.privatelink.GetPrivateEndpointRequest"; + /** + * ID of the PrivateEndpoint resource to return. + * + * To get PrivateEndpoint resource ID make a [PrivateEndpointService.List] + * request. + */ + privateEndpointId: string; +} + +export interface InternalIpv4AddressSpec { + $type: "yandex.cloud.vpc.v1.privatelink.InternalIpv4AddressSpec"; + /** ID of the subnet that address belongs to. */ + subnetId: string; + /** Value of address. */ + address: string; +} + +export interface AddressSpec { + $type: "yandex.cloud.vpc.v1.privatelink.AddressSpec"; + /** ID of IP address to associate with private endpoint. */ + addressId: string | undefined; + /** Internal ipv4 address specification. */ + internalIpv4AddressSpec?: InternalIpv4AddressSpec | undefined; +} + +export interface CreatePrivateEndpointRequest { + $type: "yandex.cloud.vpc.v1.privatelink.CreatePrivateEndpointRequest"; + /** + * ID of the folder to create a private endpoint in. + * + * To get a folder ID make a + * [yandex.cloud.resourcemanager.v1.FolderService.List] request. + */ + folderId: string; + /** + * Name of the private endpoint. + * The name must be unique within the folder. + */ + name: string; + /** Description of the private endpoint. */ + description: string; + /** Private endpoint labels as `key:value` pairs. */ + labels: { [key: string]: string }; + /** ID of the network to create a private endpoint in. */ + networkId: string; + /** Private endpoint address specification. */ + addressSpec?: AddressSpec; + /** Private endpoint dns options. */ + dnsOptions?: PrivateEndpoint_DnsOptions; + /** Yandex Cloud Object Storage. */ + objectStorage?: PrivateEndpoint_ObjectStorage | undefined; +} + +export interface CreatePrivateEndpointRequest_LabelsEntry { + $type: "yandex.cloud.vpc.v1.privatelink.CreatePrivateEndpointRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface CreatePrivateEndpointMetadata { + $type: "yandex.cloud.vpc.v1.privatelink.CreatePrivateEndpointMetadata"; + /** ID of the private endpoint that is being created. */ + privateEndpointId: string; +} + +export interface UpdatePrivateEndpointRequest { + $type: "yandex.cloud.vpc.v1.privatelink.UpdatePrivateEndpointRequest"; + /** + * ID of the private endpoint to update. + * + * To get the private endpoint ID make a [PrivateEndpointService.List] + * request. + */ + privateEndpointId: string; + /** + * Field mask that specifies which attributes of the PrivateEndpoint should be + * updated. + */ + updateMask?: FieldMask; + /** + * New name for the private endpoint. + * The name must be unique within the folder. + */ + name: string; + /** New description of the private endpoint. */ + description: string; + /** + * Private endpoint labels as `key:value` pairs. + * + * Existing set of labels is completely replaced by the provided set, so if + * you just want to add or remove a label: + * 1. Get the current set of labels with a [PrivateEndpointService.Get] + * request. + * 2. Add or remove a label in this set. + * 3. Send the new set in this field. + */ + labels: { [key: string]: string }; + /** Private endpoint address specification. */ + addressSpec?: AddressSpec; + /** Private endpoint dns options. */ + dnsOptions?: PrivateEndpoint_DnsOptions; +} + +export interface UpdatePrivateEndpointRequest_LabelsEntry { + $type: "yandex.cloud.vpc.v1.privatelink.UpdatePrivateEndpointRequest.LabelsEntry"; + key: string; + value: string; +} + +export interface UpdatePrivateEndpointMetadata { + $type: "yandex.cloud.vpc.v1.privatelink.UpdatePrivateEndpointMetadata"; + /** ID of the private endpoint that is being updated. */ + privateEndpointId: string; +} + +export interface DeletePrivateEndpointRequest { + $type: "yandex.cloud.vpc.v1.privatelink.DeletePrivateEndpointRequest"; + /** + * ID of the private endpoint to delete. + * + * To get a private endpoint ID make a [PrivateEndpointService.List] request. + */ + privateEndpointId: string; +} + +export interface DeletePrivateEndpointMetadata { + $type: "yandex.cloud.vpc.v1.privatelink.DeletePrivateEndpointMetadata"; + /** ID of the private endpoint that is being deleted. */ + privateEndpointId: string; +} + +export interface ListPrivateEndpointsRequest { + $type: "yandex.cloud.vpc.v1.privatelink.ListPrivateEndpointsRequest"; + /** + * ID of the folder to list private endpoints in. + * + * To get the folder ID use a + * [yandex.cloud.resourcemanager.v1.FolderService.List] request. + */ + folderId: string | undefined; + /** + * The maximum number of results per page to return. If the number of + * available results is larger than `page_size`, the service returns a + * [ListPrivateEndpointsResponse.next_page_token] that can be used to get the + * next page of results in subsequent list requests. Default value: 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set `page_token` to the + * [ListPrivateEndpointsResponse.next_page_token] returned by a previous list + * request. + */ + pageToken: string; + /** + * A filter expression that filters PrivateEndpoint listed in the response. + * + * The expression must specify: + * 1. The field name. Currently you can use filtering only on + * [PrivateEndpoint.name] field. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). Must be 3-63 characters long and match + * the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. Example of a filter: + * `name=my-private-endpoint`. + */ + filter: string; +} + +export interface ListPrivateEndpointsResponse { + $type: "yandex.cloud.vpc.v1.privatelink.ListPrivateEndpointsResponse"; + /** List of private endpoints. */ + privateEndpoints: PrivateEndpoint[]; + /** + * Token for getting the next page of the list. If the number of results is + * greater than the specified [ListPrivateEndpointsRequest.page_size], use + * `next_page_token` as the value for the + * [ListPrivateEndpointsRequest.page_token] parameter in the next list + * request. + * + * Each subsequent page will have its own `next_page_token` to continue paging + * through the results. + */ + nextPageToken: string; +} + +export interface ListPrivateEndpointOperationsRequest { + $type: "yandex.cloud.vpc.v1.privatelink.ListPrivateEndpointOperationsRequest"; + /** + * ID of the private endpoint to list operations for. + * + * To get a private endpoint ID make a [PrivateEndpointService.List] request. + */ + privateEndpointId: string; + /** + * The maximum number of results per page to return. If the number of + * available results is larger than [page_size], the service returns a + * [ListPrivateEndpointOperationsResponse.next_page_token] that can be used to + * get the next page of results in subsequent list requests. Default value: + * 100. + */ + pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] to the + * [ListPrivateEndpointOperationsResponse.next_page_token] returned by a + * previous list request. + */ + pageToken: string; +} + +export interface ListPrivateEndpointOperationsResponse { + $type: "yandex.cloud.vpc.v1.privatelink.ListPrivateEndpointOperationsResponse"; + /** List of operations for the specified private endpoint. */ + operations: Operation[]; + /** + * Token for getting the next page of the list. If the number of results is + * greater than the specified + * [ListPrivateEndpointOperationsRequest.page_size], use `next_page_token` as + * the value for the [ListPrivateEndpointOperationsRequest.page_token] + * parameter in the next list request. + * + * Each subsequent page will have its own `next_page_token` to continue paging + * through the results. + */ + nextPageToken: string; +} + +const baseGetPrivateEndpointRequest: object = { + $type: "yandex.cloud.vpc.v1.privatelink.GetPrivateEndpointRequest", + privateEndpointId: "", +}; + +export const GetPrivateEndpointRequest = { + $type: "yandex.cloud.vpc.v1.privatelink.GetPrivateEndpointRequest" as const, + + encode( + message: GetPrivateEndpointRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.privateEndpointId !== "") { + writer.uint32(10).string(message.privateEndpointId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetPrivateEndpointRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetPrivateEndpointRequest, + } as GetPrivateEndpointRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privateEndpointId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetPrivateEndpointRequest { + const message = { + ...baseGetPrivateEndpointRequest, + } as GetPrivateEndpointRequest; + message.privateEndpointId = + object.privateEndpointId !== undefined && + object.privateEndpointId !== null + ? String(object.privateEndpointId) + : ""; + return message; + }, + + toJSON(message: GetPrivateEndpointRequest): unknown { + const obj: any = {}; + message.privateEndpointId !== undefined && + (obj.privateEndpointId = message.privateEndpointId); + return obj; + }, + + fromPartial, I>>( + object: I + ): GetPrivateEndpointRequest { + const message = { + ...baseGetPrivateEndpointRequest, + } as GetPrivateEndpointRequest; + message.privateEndpointId = object.privateEndpointId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + GetPrivateEndpointRequest.$type, + GetPrivateEndpointRequest +); + +const baseInternalIpv4AddressSpec: object = { + $type: "yandex.cloud.vpc.v1.privatelink.InternalIpv4AddressSpec", + subnetId: "", + address: "", +}; + +export const InternalIpv4AddressSpec = { + $type: "yandex.cloud.vpc.v1.privatelink.InternalIpv4AddressSpec" as const, + + encode( + message: InternalIpv4AddressSpec, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.subnetId !== "") { + writer.uint32(10).string(message.subnetId); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): InternalIpv4AddressSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseInternalIpv4AddressSpec, + } as InternalIpv4AddressSpec; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subnetId = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InternalIpv4AddressSpec { + const message = { + ...baseInternalIpv4AddressSpec, + } as InternalIpv4AddressSpec; + message.subnetId = + object.subnetId !== undefined && object.subnetId !== null + ? String(object.subnetId) + : ""; + message.address = + object.address !== undefined && object.address !== null + ? String(object.address) + : ""; + return message; + }, + + toJSON(message: InternalIpv4AddressSpec): unknown { + const obj: any = {}; + message.subnetId !== undefined && (obj.subnetId = message.subnetId); + message.address !== undefined && (obj.address = message.address); + return obj; + }, + + fromPartial, I>>( + object: I + ): InternalIpv4AddressSpec { + const message = { + ...baseInternalIpv4AddressSpec, + } as InternalIpv4AddressSpec; + message.subnetId = object.subnetId ?? ""; + message.address = object.address ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(InternalIpv4AddressSpec.$type, InternalIpv4AddressSpec); + +const baseAddressSpec: object = { + $type: "yandex.cloud.vpc.v1.privatelink.AddressSpec", +}; + +export const AddressSpec = { + $type: "yandex.cloud.vpc.v1.privatelink.AddressSpec" as const, + + encode( + message: AddressSpec, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.addressId !== undefined) { + writer.uint32(10).string(message.addressId); + } + if (message.internalIpv4AddressSpec !== undefined) { + InternalIpv4AddressSpec.encode( + message.internalIpv4AddressSpec, + writer.uint32(18).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AddressSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAddressSpec } as AddressSpec; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressId = reader.string(); + break; + case 2: + message.internalIpv4AddressSpec = InternalIpv4AddressSpec.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AddressSpec { + const message = { ...baseAddressSpec } as AddressSpec; + message.addressId = + object.addressId !== undefined && object.addressId !== null + ? String(object.addressId) + : undefined; + message.internalIpv4AddressSpec = + object.internalIpv4AddressSpec !== undefined && + object.internalIpv4AddressSpec !== null + ? InternalIpv4AddressSpec.fromJSON(object.internalIpv4AddressSpec) + : undefined; + return message; + }, + + toJSON(message: AddressSpec): unknown { + const obj: any = {}; + message.addressId !== undefined && (obj.addressId = message.addressId); + message.internalIpv4AddressSpec !== undefined && + (obj.internalIpv4AddressSpec = message.internalIpv4AddressSpec + ? InternalIpv4AddressSpec.toJSON(message.internalIpv4AddressSpec) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): AddressSpec { + const message = { ...baseAddressSpec } as AddressSpec; + message.addressId = object.addressId ?? undefined; + message.internalIpv4AddressSpec = + object.internalIpv4AddressSpec !== undefined && + object.internalIpv4AddressSpec !== null + ? InternalIpv4AddressSpec.fromPartial(object.internalIpv4AddressSpec) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set(AddressSpec.$type, AddressSpec); + +const baseCreatePrivateEndpointRequest: object = { + $type: "yandex.cloud.vpc.v1.privatelink.CreatePrivateEndpointRequest", + folderId: "", + name: "", + description: "", + networkId: "", +}; + +export const CreatePrivateEndpointRequest = { + $type: + "yandex.cloud.vpc.v1.privatelink.CreatePrivateEndpointRequest" as const, + + encode( + message: CreatePrivateEndpointRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== "") { + writer.uint32(10).string(message.folderId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + CreatePrivateEndpointRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.vpc.v1.privatelink.CreatePrivateEndpointRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(34).fork() + ).ldelim(); + }); + if (message.networkId !== "") { + writer.uint32(42).string(message.networkId); + } + if (message.addressSpec !== undefined) { + AddressSpec.encode( + message.addressSpec, + writer.uint32(50).fork() + ).ldelim(); + } + if (message.dnsOptions !== undefined) { + PrivateEndpoint_DnsOptions.encode( + message.dnsOptions, + writer.uint32(66).fork() + ).ldelim(); + } + if (message.objectStorage !== undefined) { + PrivateEndpoint_ObjectStorage.encode( + message.objectStorage, + writer.uint32(74).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreatePrivateEndpointRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreatePrivateEndpointRequest, + } as CreatePrivateEndpointRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + const entry4 = CreatePrivateEndpointRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry4.value !== undefined) { + message.labels[entry4.key] = entry4.value; + } + break; + case 5: + message.networkId = reader.string(); + break; + case 6: + message.addressSpec = AddressSpec.decode(reader, reader.uint32()); + break; + case 8: + message.dnsOptions = PrivateEndpoint_DnsOptions.decode( + reader, + reader.uint32() + ); + break; + case 9: + message.objectStorage = PrivateEndpoint_ObjectStorage.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreatePrivateEndpointRequest { + const message = { + ...baseCreatePrivateEndpointRequest, + } as CreatePrivateEndpointRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : ""; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.networkId = + object.networkId !== undefined && object.networkId !== null + ? String(object.networkId) + : ""; + message.addressSpec = + object.addressSpec !== undefined && object.addressSpec !== null + ? AddressSpec.fromJSON(object.addressSpec) + : undefined; + message.dnsOptions = + object.dnsOptions !== undefined && object.dnsOptions !== null + ? PrivateEndpoint_DnsOptions.fromJSON(object.dnsOptions) + : undefined; + message.objectStorage = + object.objectStorage !== undefined && object.objectStorage !== null + ? PrivateEndpoint_ObjectStorage.fromJSON(object.objectStorage) + : undefined; + return message; + }, + + toJSON(message: CreatePrivateEndpointRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.networkId !== undefined && (obj.networkId = message.networkId); + message.addressSpec !== undefined && + (obj.addressSpec = message.addressSpec + ? AddressSpec.toJSON(message.addressSpec) + : undefined); + message.dnsOptions !== undefined && + (obj.dnsOptions = message.dnsOptions + ? PrivateEndpoint_DnsOptions.toJSON(message.dnsOptions) + : undefined); + message.objectStorage !== undefined && + (obj.objectStorage = message.objectStorage + ? PrivateEndpoint_ObjectStorage.toJSON(message.objectStorage) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreatePrivateEndpointRequest { + const message = { + ...baseCreatePrivateEndpointRequest, + } as CreatePrivateEndpointRequest; + message.folderId = object.folderId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.networkId = object.networkId ?? ""; + message.addressSpec = + object.addressSpec !== undefined && object.addressSpec !== null + ? AddressSpec.fromPartial(object.addressSpec) + : undefined; + message.dnsOptions = + object.dnsOptions !== undefined && object.dnsOptions !== null + ? PrivateEndpoint_DnsOptions.fromPartial(object.dnsOptions) + : undefined; + message.objectStorage = + object.objectStorage !== undefined && object.objectStorage !== null + ? PrivateEndpoint_ObjectStorage.fromPartial(object.objectStorage) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + CreatePrivateEndpointRequest.$type, + CreatePrivateEndpointRequest +); + +const baseCreatePrivateEndpointRequest_LabelsEntry: object = { + $type: + "yandex.cloud.vpc.v1.privatelink.CreatePrivateEndpointRequest.LabelsEntry", + key: "", + value: "", +}; + +export const CreatePrivateEndpointRequest_LabelsEntry = { + $type: + "yandex.cloud.vpc.v1.privatelink.CreatePrivateEndpointRequest.LabelsEntry" as const, + + encode( + message: CreatePrivateEndpointRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreatePrivateEndpointRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreatePrivateEndpointRequest_LabelsEntry, + } as CreatePrivateEndpointRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreatePrivateEndpointRequest_LabelsEntry { + const message = { + ...baseCreatePrivateEndpointRequest_LabelsEntry, + } as CreatePrivateEndpointRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: CreatePrivateEndpointRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): CreatePrivateEndpointRequest_LabelsEntry { + const message = { + ...baseCreatePrivateEndpointRequest_LabelsEntry, + } as CreatePrivateEndpointRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreatePrivateEndpointRequest_LabelsEntry.$type, + CreatePrivateEndpointRequest_LabelsEntry +); + +const baseCreatePrivateEndpointMetadata: object = { + $type: "yandex.cloud.vpc.v1.privatelink.CreatePrivateEndpointMetadata", + privateEndpointId: "", +}; + +export const CreatePrivateEndpointMetadata = { + $type: + "yandex.cloud.vpc.v1.privatelink.CreatePrivateEndpointMetadata" as const, + + encode( + message: CreatePrivateEndpointMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.privateEndpointId !== "") { + writer.uint32(10).string(message.privateEndpointId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): CreatePrivateEndpointMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseCreatePrivateEndpointMetadata, + } as CreatePrivateEndpointMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privateEndpointId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreatePrivateEndpointMetadata { + const message = { + ...baseCreatePrivateEndpointMetadata, + } as CreatePrivateEndpointMetadata; + message.privateEndpointId = + object.privateEndpointId !== undefined && + object.privateEndpointId !== null + ? String(object.privateEndpointId) + : ""; + return message; + }, + + toJSON(message: CreatePrivateEndpointMetadata): unknown { + const obj: any = {}; + message.privateEndpointId !== undefined && + (obj.privateEndpointId = message.privateEndpointId); + return obj; + }, + + fromPartial, I>>( + object: I + ): CreatePrivateEndpointMetadata { + const message = { + ...baseCreatePrivateEndpointMetadata, + } as CreatePrivateEndpointMetadata; + message.privateEndpointId = object.privateEndpointId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + CreatePrivateEndpointMetadata.$type, + CreatePrivateEndpointMetadata +); + +const baseUpdatePrivateEndpointRequest: object = { + $type: "yandex.cloud.vpc.v1.privatelink.UpdatePrivateEndpointRequest", + privateEndpointId: "", + name: "", + description: "", +}; + +export const UpdatePrivateEndpointRequest = { + $type: + "yandex.cloud.vpc.v1.privatelink.UpdatePrivateEndpointRequest" as const, + + encode( + message: UpdatePrivateEndpointRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.privateEndpointId !== "") { + writer.uint32(10).string(message.privateEndpointId); + } + if (message.updateMask !== undefined) { + FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + Object.entries(message.labels).forEach(([key, value]) => { + UpdatePrivateEndpointRequest_LabelsEntry.encode( + { + $type: + "yandex.cloud.vpc.v1.privatelink.UpdatePrivateEndpointRequest.LabelsEntry", + key: key as any, + value, + }, + writer.uint32(42).fork() + ).ldelim(); + }); + if (message.addressSpec !== undefined) { + AddressSpec.encode( + message.addressSpec, + writer.uint32(50).fork() + ).ldelim(); + } + if (message.dnsOptions !== undefined) { + PrivateEndpoint_DnsOptions.encode( + message.dnsOptions, + writer.uint32(66).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdatePrivateEndpointRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdatePrivateEndpointRequest, + } as UpdatePrivateEndpointRequest; + message.labels = {}; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privateEndpointId = reader.string(); + break; + case 2: + message.updateMask = FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + const entry5 = UpdatePrivateEndpointRequest_LabelsEntry.decode( + reader, + reader.uint32() + ); + if (entry5.value !== undefined) { + message.labels[entry5.key] = entry5.value; + } + break; + case 6: + message.addressSpec = AddressSpec.decode(reader, reader.uint32()); + break; + case 8: + message.dnsOptions = PrivateEndpoint_DnsOptions.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdatePrivateEndpointRequest { + const message = { + ...baseUpdatePrivateEndpointRequest, + } as UpdatePrivateEndpointRequest; + message.privateEndpointId = + object.privateEndpointId !== undefined && + object.privateEndpointId !== null + ? String(object.privateEndpointId) + : ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromJSON(object.updateMask) + : undefined; + message.name = + object.name !== undefined && object.name !== null + ? String(object.name) + : ""; + message.description = + object.description !== undefined && object.description !== null + ? String(object.description) + : ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}); + message.addressSpec = + object.addressSpec !== undefined && object.addressSpec !== null + ? AddressSpec.fromJSON(object.addressSpec) + : undefined; + message.dnsOptions = + object.dnsOptions !== undefined && object.dnsOptions !== null + ? PrivateEndpoint_DnsOptions.fromJSON(object.dnsOptions) + : undefined; + return message; + }, + + toJSON(message: UpdatePrivateEndpointRequest): unknown { + const obj: any = {}; + message.privateEndpointId !== undefined && + (obj.privateEndpointId = message.privateEndpointId); + message.updateMask !== undefined && + (obj.updateMask = message.updateMask + ? FieldMask.toJSON(message.updateMask) + : undefined); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && + (obj.description = message.description); + obj.labels = {}; + if (message.labels) { + Object.entries(message.labels).forEach(([k, v]) => { + obj.labels[k] = v; + }); + } + message.addressSpec !== undefined && + (obj.addressSpec = message.addressSpec + ? AddressSpec.toJSON(message.addressSpec) + : undefined); + message.dnsOptions !== undefined && + (obj.dnsOptions = message.dnsOptions + ? PrivateEndpoint_DnsOptions.toJSON(message.dnsOptions) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdatePrivateEndpointRequest { + const message = { + ...baseUpdatePrivateEndpointRequest, + } as UpdatePrivateEndpointRequest; + message.privateEndpointId = object.privateEndpointId ?? ""; + message.updateMask = + object.updateMask !== undefined && object.updateMask !== null + ? FieldMask.fromPartial(object.updateMask) + : undefined; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.labels = Object.entries(object.labels ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + message.addressSpec = + object.addressSpec !== undefined && object.addressSpec !== null + ? AddressSpec.fromPartial(object.addressSpec) + : undefined; + message.dnsOptions = + object.dnsOptions !== undefined && object.dnsOptions !== null + ? PrivateEndpoint_DnsOptions.fromPartial(object.dnsOptions) + : undefined; + return message; + }, +}; + +messageTypeRegistry.set( + UpdatePrivateEndpointRequest.$type, + UpdatePrivateEndpointRequest +); + +const baseUpdatePrivateEndpointRequest_LabelsEntry: object = { + $type: + "yandex.cloud.vpc.v1.privatelink.UpdatePrivateEndpointRequest.LabelsEntry", + key: "", + value: "", +}; + +export const UpdatePrivateEndpointRequest_LabelsEntry = { + $type: + "yandex.cloud.vpc.v1.privatelink.UpdatePrivateEndpointRequest.LabelsEntry" as const, + + encode( + message: UpdatePrivateEndpointRequest_LabelsEntry, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdatePrivateEndpointRequest_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdatePrivateEndpointRequest_LabelsEntry, + } as UpdatePrivateEndpointRequest_LabelsEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdatePrivateEndpointRequest_LabelsEntry { + const message = { + ...baseUpdatePrivateEndpointRequest_LabelsEntry, + } as UpdatePrivateEndpointRequest_LabelsEntry; + message.key = + object.key !== undefined && object.key !== null ? String(object.key) : ""; + message.value = + object.value !== undefined && object.value !== null + ? String(object.value) + : ""; + return message; + }, + + toJSON(message: UpdatePrivateEndpointRequest_LabelsEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): UpdatePrivateEndpointRequest_LabelsEntry { + const message = { + ...baseUpdatePrivateEndpointRequest_LabelsEntry, + } as UpdatePrivateEndpointRequest_LabelsEntry; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdatePrivateEndpointRequest_LabelsEntry.$type, + UpdatePrivateEndpointRequest_LabelsEntry +); + +const baseUpdatePrivateEndpointMetadata: object = { + $type: "yandex.cloud.vpc.v1.privatelink.UpdatePrivateEndpointMetadata", + privateEndpointId: "", +}; + +export const UpdatePrivateEndpointMetadata = { + $type: + "yandex.cloud.vpc.v1.privatelink.UpdatePrivateEndpointMetadata" as const, + + encode( + message: UpdatePrivateEndpointMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.privateEndpointId !== "") { + writer.uint32(10).string(message.privateEndpointId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UpdatePrivateEndpointMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseUpdatePrivateEndpointMetadata, + } as UpdatePrivateEndpointMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privateEndpointId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdatePrivateEndpointMetadata { + const message = { + ...baseUpdatePrivateEndpointMetadata, + } as UpdatePrivateEndpointMetadata; + message.privateEndpointId = + object.privateEndpointId !== undefined && + object.privateEndpointId !== null + ? String(object.privateEndpointId) + : ""; + return message; + }, + + toJSON(message: UpdatePrivateEndpointMetadata): unknown { + const obj: any = {}; + message.privateEndpointId !== undefined && + (obj.privateEndpointId = message.privateEndpointId); + return obj; + }, + + fromPartial, I>>( + object: I + ): UpdatePrivateEndpointMetadata { + const message = { + ...baseUpdatePrivateEndpointMetadata, + } as UpdatePrivateEndpointMetadata; + message.privateEndpointId = object.privateEndpointId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + UpdatePrivateEndpointMetadata.$type, + UpdatePrivateEndpointMetadata +); + +const baseDeletePrivateEndpointRequest: object = { + $type: "yandex.cloud.vpc.v1.privatelink.DeletePrivateEndpointRequest", + privateEndpointId: "", +}; + +export const DeletePrivateEndpointRequest = { + $type: + "yandex.cloud.vpc.v1.privatelink.DeletePrivateEndpointRequest" as const, + + encode( + message: DeletePrivateEndpointRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.privateEndpointId !== "") { + writer.uint32(10).string(message.privateEndpointId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeletePrivateEndpointRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeletePrivateEndpointRequest, + } as DeletePrivateEndpointRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privateEndpointId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeletePrivateEndpointRequest { + const message = { + ...baseDeletePrivateEndpointRequest, + } as DeletePrivateEndpointRequest; + message.privateEndpointId = + object.privateEndpointId !== undefined && + object.privateEndpointId !== null + ? String(object.privateEndpointId) + : ""; + return message; + }, + + toJSON(message: DeletePrivateEndpointRequest): unknown { + const obj: any = {}; + message.privateEndpointId !== undefined && + (obj.privateEndpointId = message.privateEndpointId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeletePrivateEndpointRequest { + const message = { + ...baseDeletePrivateEndpointRequest, + } as DeletePrivateEndpointRequest; + message.privateEndpointId = object.privateEndpointId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeletePrivateEndpointRequest.$type, + DeletePrivateEndpointRequest +); + +const baseDeletePrivateEndpointMetadata: object = { + $type: "yandex.cloud.vpc.v1.privatelink.DeletePrivateEndpointMetadata", + privateEndpointId: "", +}; + +export const DeletePrivateEndpointMetadata = { + $type: + "yandex.cloud.vpc.v1.privatelink.DeletePrivateEndpointMetadata" as const, + + encode( + message: DeletePrivateEndpointMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.privateEndpointId !== "") { + writer.uint32(10).string(message.privateEndpointId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DeletePrivateEndpointMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseDeletePrivateEndpointMetadata, + } as DeletePrivateEndpointMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privateEndpointId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeletePrivateEndpointMetadata { + const message = { + ...baseDeletePrivateEndpointMetadata, + } as DeletePrivateEndpointMetadata; + message.privateEndpointId = + object.privateEndpointId !== undefined && + object.privateEndpointId !== null + ? String(object.privateEndpointId) + : ""; + return message; + }, + + toJSON(message: DeletePrivateEndpointMetadata): unknown { + const obj: any = {}; + message.privateEndpointId !== undefined && + (obj.privateEndpointId = message.privateEndpointId); + return obj; + }, + + fromPartial, I>>( + object: I + ): DeletePrivateEndpointMetadata { + const message = { + ...baseDeletePrivateEndpointMetadata, + } as DeletePrivateEndpointMetadata; + message.privateEndpointId = object.privateEndpointId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + DeletePrivateEndpointMetadata.$type, + DeletePrivateEndpointMetadata +); + +const baseListPrivateEndpointsRequest: object = { + $type: "yandex.cloud.vpc.v1.privatelink.ListPrivateEndpointsRequest", + pageSize: 0, + pageToken: "", + filter: "", +}; + +export const ListPrivateEndpointsRequest = { + $type: "yandex.cloud.vpc.v1.privatelink.ListPrivateEndpointsRequest" as const, + + encode( + message: ListPrivateEndpointsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.folderId !== undefined) { + writer.uint32(10).string(message.folderId); + } + if (message.pageSize !== 0) { + writer.uint32(24).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(34).string(message.pageToken); + } + if (message.filter !== "") { + writer.uint32(42).string(message.filter); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListPrivateEndpointsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListPrivateEndpointsRequest, + } as ListPrivateEndpointsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.folderId = reader.string(); + break; + case 3: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 4: + message.pageToken = reader.string(); + break; + case 5: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPrivateEndpointsRequest { + const message = { + ...baseListPrivateEndpointsRequest, + } as ListPrivateEndpointsRequest; + message.folderId = + object.folderId !== undefined && object.folderId !== null + ? String(object.folderId) + : undefined; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + message.filter = + object.filter !== undefined && object.filter !== null + ? String(object.filter) + : ""; + return message; + }, + + toJSON(message: ListPrivateEndpointsRequest): unknown { + const obj: any = {}; + message.folderId !== undefined && (obj.folderId = message.folderId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + message.filter !== undefined && (obj.filter = message.filter); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListPrivateEndpointsRequest { + const message = { + ...baseListPrivateEndpointsRequest, + } as ListPrivateEndpointsRequest; + message.folderId = object.folderId ?? undefined; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + message.filter = object.filter ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListPrivateEndpointsRequest.$type, + ListPrivateEndpointsRequest +); + +const baseListPrivateEndpointsResponse: object = { + $type: "yandex.cloud.vpc.v1.privatelink.ListPrivateEndpointsResponse", + nextPageToken: "", +}; + +export const ListPrivateEndpointsResponse = { + $type: + "yandex.cloud.vpc.v1.privatelink.ListPrivateEndpointsResponse" as const, + + encode( + message: ListPrivateEndpointsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.privateEndpoints) { + PrivateEndpoint.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListPrivateEndpointsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListPrivateEndpointsResponse, + } as ListPrivateEndpointsResponse; + message.privateEndpoints = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privateEndpoints.push( + PrivateEndpoint.decode(reader, reader.uint32()) + ); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPrivateEndpointsResponse { + const message = { + ...baseListPrivateEndpointsResponse, + } as ListPrivateEndpointsResponse; + message.privateEndpoints = (object.privateEndpoints ?? []).map((e: any) => + PrivateEndpoint.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListPrivateEndpointsResponse): unknown { + const obj: any = {}; + if (message.privateEndpoints) { + obj.privateEndpoints = message.privateEndpoints.map((e) => + e ? PrivateEndpoint.toJSON(e) : undefined + ); + } else { + obj.privateEndpoints = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial, I>>( + object: I + ): ListPrivateEndpointsResponse { + const message = { + ...baseListPrivateEndpointsResponse, + } as ListPrivateEndpointsResponse; + message.privateEndpoints = + object.privateEndpoints?.map((e) => PrivateEndpoint.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListPrivateEndpointsResponse.$type, + ListPrivateEndpointsResponse +); + +const baseListPrivateEndpointOperationsRequest: object = { + $type: "yandex.cloud.vpc.v1.privatelink.ListPrivateEndpointOperationsRequest", + privateEndpointId: "", + pageSize: 0, + pageToken: "", +}; + +export const ListPrivateEndpointOperationsRequest = { + $type: + "yandex.cloud.vpc.v1.privatelink.ListPrivateEndpointOperationsRequest" as const, + + encode( + message: ListPrivateEndpointOperationsRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.privateEndpointId !== "") { + writer.uint32(10).string(message.privateEndpointId); + } + if (message.pageSize !== 0) { + writer.uint32(16).int64(message.pageSize); + } + if (message.pageToken !== "") { + writer.uint32(26).string(message.pageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListPrivateEndpointOperationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListPrivateEndpointOperationsRequest, + } as ListPrivateEndpointOperationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privateEndpointId = reader.string(); + break; + case 2: + message.pageSize = longToNumber(reader.int64() as Long); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPrivateEndpointOperationsRequest { + const message = { + ...baseListPrivateEndpointOperationsRequest, + } as ListPrivateEndpointOperationsRequest; + message.privateEndpointId = + object.privateEndpointId !== undefined && + object.privateEndpointId !== null + ? String(object.privateEndpointId) + : ""; + message.pageSize = + object.pageSize !== undefined && object.pageSize !== null + ? Number(object.pageSize) + : 0; + message.pageToken = + object.pageToken !== undefined && object.pageToken !== null + ? String(object.pageToken) + : ""; + return message; + }, + + toJSON(message: ListPrivateEndpointOperationsRequest): unknown { + const obj: any = {}; + message.privateEndpointId !== undefined && + (obj.privateEndpointId = message.privateEndpointId); + message.pageSize !== undefined && + (obj.pageSize = Math.round(message.pageSize)); + message.pageToken !== undefined && (obj.pageToken = message.pageToken); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): ListPrivateEndpointOperationsRequest { + const message = { + ...baseListPrivateEndpointOperationsRequest, + } as ListPrivateEndpointOperationsRequest; + message.privateEndpointId = object.privateEndpointId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.pageToken = object.pageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListPrivateEndpointOperationsRequest.$type, + ListPrivateEndpointOperationsRequest +); + +const baseListPrivateEndpointOperationsResponse: object = { + $type: + "yandex.cloud.vpc.v1.privatelink.ListPrivateEndpointOperationsResponse", + nextPageToken: "", +}; + +export const ListPrivateEndpointOperationsResponse = { + $type: + "yandex.cloud.vpc.v1.privatelink.ListPrivateEndpointOperationsResponse" as const, + + encode( + message: ListPrivateEndpointOperationsResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.operations) { + Operation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nextPageToken !== "") { + writer.uint32(18).string(message.nextPageToken); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ListPrivateEndpointOperationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseListPrivateEndpointOperationsResponse, + } as ListPrivateEndpointOperationsResponse; + message.operations = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operations.push(Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListPrivateEndpointOperationsResponse { + const message = { + ...baseListPrivateEndpointOperationsResponse, + } as ListPrivateEndpointOperationsResponse; + message.operations = (object.operations ?? []).map((e: any) => + Operation.fromJSON(e) + ); + message.nextPageToken = + object.nextPageToken !== undefined && object.nextPageToken !== null + ? String(object.nextPageToken) + : ""; + return message; + }, + + toJSON(message: ListPrivateEndpointOperationsResponse): unknown { + const obj: any = {}; + if (message.operations) { + obj.operations = message.operations.map((e) => + e ? Operation.toJSON(e) : undefined + ); + } else { + obj.operations = []; + } + message.nextPageToken !== undefined && + (obj.nextPageToken = message.nextPageToken); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): ListPrivateEndpointOperationsResponse { + const message = { + ...baseListPrivateEndpointOperationsResponse, + } as ListPrivateEndpointOperationsResponse; + message.operations = + object.operations?.map((e) => Operation.fromPartial(e)) || []; + message.nextPageToken = object.nextPageToken ?? ""; + return message; + }, +}; + +messageTypeRegistry.set( + ListPrivateEndpointOperationsResponse.$type, + ListPrivateEndpointOperationsResponse +); + +/** A set of methods for managing PrivateEndpoint resources. */ +export const PrivateEndpointServiceService = { + /** + * Returns the specified Private Endpoint resource. + * + * To get the list of all available PrivateEndpoint resources, make a [List] + * request. + */ + get: { + path: "/yandex.cloud.vpc.v1.privatelink.PrivateEndpointService/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetPrivateEndpointRequest) => + Buffer.from(GetPrivateEndpointRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + GetPrivateEndpointRequest.decode(value), + responseSerialize: (value: PrivateEndpoint) => + Buffer.from(PrivateEndpoint.encode(value).finish()), + responseDeserialize: (value: Buffer) => PrivateEndpoint.decode(value), + }, + /** Retrieves the list of PrivateEndpoint resources in the specified folder. */ + list: { + path: "/yandex.cloud.vpc.v1.privatelink.PrivateEndpointService/List", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListPrivateEndpointsRequest) => + Buffer.from(ListPrivateEndpointsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListPrivateEndpointsRequest.decode(value), + responseSerialize: (value: ListPrivateEndpointsResponse) => + Buffer.from(ListPrivateEndpointsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListPrivateEndpointsResponse.decode(value), + }, + /** Creates an private endpoint in the specified folder and network. */ + create: { + path: "/yandex.cloud.vpc.v1.privatelink.PrivateEndpointService/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreatePrivateEndpointRequest) => + Buffer.from(CreatePrivateEndpointRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + CreatePrivateEndpointRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Updates the specified private endpoint. */ + update: { + path: "/yandex.cloud.vpc.v1.privatelink.PrivateEndpointService/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdatePrivateEndpointRequest) => + Buffer.from(UpdatePrivateEndpointRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + UpdatePrivateEndpointRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** Deletes the specified private endpoint. */ + delete: { + path: "/yandex.cloud.vpc.v1.privatelink.PrivateEndpointService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeletePrivateEndpointRequest) => + Buffer.from(DeletePrivateEndpointRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + DeletePrivateEndpointRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, + /** List operations for the specified private endpoint. */ + listOperations: { + path: "/yandex.cloud.vpc.v1.privatelink.PrivateEndpointService/ListOperations", + requestStream: false, + responseStream: false, + requestSerialize: (value: ListPrivateEndpointOperationsRequest) => + Buffer.from(ListPrivateEndpointOperationsRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => + ListPrivateEndpointOperationsRequest.decode(value), + responseSerialize: (value: ListPrivateEndpointOperationsResponse) => + Buffer.from(ListPrivateEndpointOperationsResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => + ListPrivateEndpointOperationsResponse.decode(value), + }, +} as const; + +export interface PrivateEndpointServiceServer + extends UntypedServiceImplementation { + /** + * Returns the specified Private Endpoint resource. + * + * To get the list of all available PrivateEndpoint resources, make a [List] + * request. + */ + get: handleUnaryCall; + /** Retrieves the list of PrivateEndpoint resources in the specified folder. */ + list: handleUnaryCall< + ListPrivateEndpointsRequest, + ListPrivateEndpointsResponse + >; + /** Creates an private endpoint in the specified folder and network. */ + create: handleUnaryCall; + /** Updates the specified private endpoint. */ + update: handleUnaryCall; + /** Deletes the specified private endpoint. */ + delete: handleUnaryCall; + /** List operations for the specified private endpoint. */ + listOperations: handleUnaryCall< + ListPrivateEndpointOperationsRequest, + ListPrivateEndpointOperationsResponse + >; +} + +export interface PrivateEndpointServiceClient extends Client { + /** + * Returns the specified Private Endpoint resource. + * + * To get the list of all available PrivateEndpoint resources, make a [List] + * request. + */ + get( + request: GetPrivateEndpointRequest, + callback: (error: ServiceError | null, response: PrivateEndpoint) => void + ): ClientUnaryCall; + get( + request: GetPrivateEndpointRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: PrivateEndpoint) => void + ): ClientUnaryCall; + get( + request: GetPrivateEndpointRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: PrivateEndpoint) => void + ): ClientUnaryCall; + /** Retrieves the list of PrivateEndpoint resources in the specified folder. */ + list( + request: ListPrivateEndpointsRequest, + callback: ( + error: ServiceError | null, + response: ListPrivateEndpointsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListPrivateEndpointsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListPrivateEndpointsResponse + ) => void + ): ClientUnaryCall; + list( + request: ListPrivateEndpointsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListPrivateEndpointsResponse + ) => void + ): ClientUnaryCall; + /** Creates an private endpoint in the specified folder and network. */ + create( + request: CreatePrivateEndpointRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreatePrivateEndpointRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + create( + request: CreatePrivateEndpointRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Updates the specified private endpoint. */ + update( + request: UpdatePrivateEndpointRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdatePrivateEndpointRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + update( + request: UpdatePrivateEndpointRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** Deletes the specified private endpoint. */ + delete( + request: DeletePrivateEndpointRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeletePrivateEndpointRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + delete( + request: DeletePrivateEndpointRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + /** List operations for the specified private endpoint. */ + listOperations( + request: ListPrivateEndpointOperationsRequest, + callback: ( + error: ServiceError | null, + response: ListPrivateEndpointOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListPrivateEndpointOperationsRequest, + metadata: Metadata, + callback: ( + error: ServiceError | null, + response: ListPrivateEndpointOperationsResponse + ) => void + ): ClientUnaryCall; + listOperations( + request: ListPrivateEndpointOperationsRequest, + metadata: Metadata, + options: Partial, + callback: ( + error: ServiceError | null, + response: ListPrivateEndpointOperationsResponse + ) => void + ): ClientUnaryCall; +} + +export const PrivateEndpointServiceClient = makeGenericClientConstructor( + PrivateEndpointServiceService, + "yandex.cloud.vpc.v1.privatelink.PrivateEndpointService" +) as unknown as { + new ( + address: string, + credentials: ChannelCredentials, + options?: Partial + ): PrivateEndpointServiceClient; + service: typeof PrivateEndpointServiceService; +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in Exclude]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & Record< + Exclude | "$type">, + never + >; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/generated/yandex/cloud/vpc/v1/route_table.ts b/src/generated/yandex/cloud/vpc/v1/route_table.ts index 16f590bf..e81a364d 100644 --- a/src/generated/yandex/cloud/vpc/v1/route_table.ts +++ b/src/generated/yandex/cloud/vpc/v1/route_table.ts @@ -6,7 +6,7 @@ import { Timestamp } from "../../../../google/protobuf/timestamp"; export const protobufPackage = "yandex.cloud.vpc.v1"; -/** A RouteTable resource. For more information, see [Static Routes](/docs/vpc/concepts/static-routes). */ +/** A RouteTable resource. For more information, see [Static Routes](/docs/vpc/concepts/routing). */ export interface RouteTable { $type: "yandex.cloud.vpc.v1.RouteTable"; /** ID of the route table. */ @@ -15,11 +15,21 @@ export interface RouteTable { folderId: string; /** Creation timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. */ createdAt?: Date; - /** Name of the route table. The name is unique within the project. 3-63 characters long. */ + /** + * Name of the route table. + * The name must be unique within the folder. + * Value must match the regular expression `|[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])?`. + */ name: string; /** Optional description of the route table. 0-256 characters long. */ description: string; - /** Resource labels as `` key:value `` pairs. Maximum of 64 per resource. */ + /** + * Resource labels, `key:value` pairs. + * No more than 64 per resource. + * The string length in characters for each key must be 1-63. + * Each value must match the regular expression `[-_0-9a-z]*`. + * Each key must match the regular expression `[a-z][-_0-9a-z]*`. + */ labels: { [key: string]: string }; /** ID of the network the route table belongs to. */ networkId: string; @@ -33,7 +43,7 @@ export interface RouteTable_LabelsEntry { value: string; } -/** A StaticRoute resource. For more information, see [Static Routes](/docs/vpc/concepts/static-routes). */ +/** A StaticRoute resource. For more information, see [Static Routes](/docs/vpc/concepts/routing). */ export interface StaticRoute { $type: "yandex.cloud.vpc.v1.StaticRoute"; /** Destination subnet in CIDR notation */ diff --git a/src/generated/yandex/cloud/vpc/v1/security_group.ts b/src/generated/yandex/cloud/vpc/v1/security_group.ts index 7480deab..f01b86eb 100644 --- a/src/generated/yandex/cloud/vpc/v1/security_group.ts +++ b/src/generated/yandex/cloud/vpc/v1/security_group.ts @@ -8,24 +8,48 @@ export const protobufPackage = "yandex.cloud.vpc.v1"; export interface SecurityGroup { $type: "yandex.cloud.vpc.v1.SecurityGroup"; + /** ID of the security group. */ id: string; + /** ID of the folder that the security group belongs to. */ folderId: string; + /** Creation timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. */ createdAt?: Date; + /** + * Name of the security group. + * The name must be unique within the folder. + * Value must match the regular expression ``\|[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])?``. + */ name: string; + /** Description of the security group. 0-256 characters long. */ description: string; + /** + * Resource labels as `key:value` pairs. + * No more than 64 per resource. + * The maximum string length in characters for each value is 63. + * Each value must match the regular expression `[-_./\\@0-9a-z]*`. + * The string length in characters for each key must be 1-63. + * Each key must match the regular expression `[a-z][-_./\\@0-9a-z]*`. + */ labels: { [key: string]: string }; + /** ID of the network that the security group belongs to. */ networkId: string; + /** Security group status. */ status: SecurityGroup_Status; + /** List of the security group rules. */ rules: SecurityGroupRule[]; + /** Flag that indicates that the security group is the default for the network. */ defaultForNetwork: boolean; } export enum SecurityGroup_Status { STATUS_UNSPECIFIED = 0, + /** CREATING - Security group is being created. */ CREATING = 1, + /** ACTIVE - Security is active and it's rules are applied to the network interfaces. */ ACTIVE = 2, - /** UPDATING - updating is a long operation because we must update all instances in SG */ + /** UPDATING - Security group is updating. Updating is a long operation because we must update all instances in SG. */ UPDATING = 3, + /** DELETING - Instance is being deleted. */ DELETING = 4, UNRECOGNIZED = -1, } @@ -83,27 +107,36 @@ export interface SecurityGroup_LabelsEntry { export interface SecurityGroupRule { $type: "yandex.cloud.vpc.v1.SecurityGroupRule"; - /** generated by api server after rule creation */ + /** ID of the rule. */ id: string; + /** Description of the rule. 0-256 characters long. */ description: string; + /** Resource labels as `` key:value `` pairs. Maximum of 64 per resource. */ labels: { [key: string]: string }; + /** The direction of network traffic allowed by this rule. */ direction: SecurityGroupRule_Direction; - /** null value means any */ + /** The range of ports that allow traffic to pass through. Null value means any. */ ports?: PortRange; /** - * null value means any protocol - * values from https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml + * Protocol name. Null value means any protocol. + * Values from [IANA](https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). */ protocolName: string; + /** Protocol number from [IANA protocol numbers](https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). */ protocolNumber: number; + /** CIDR blocks to allow to recieve or send traffic. */ cidrBlocks?: CidrBlocks | undefined; + /** ID of the security group to add rule to. */ securityGroupId: string | undefined; + /** Predefined target. See [security groups rules](/docs/vpc/concepts/security-groups#security-groups-rules) for more information. */ predefinedTarget: string | undefined; } export enum SecurityGroupRule_Direction { DIRECTION_UNSPECIFIED = 0, + /** INGRESS - Allows ingress traffic. */ INGRESS = 1, + /** EGRESS - Allows egress traffic. */ EGRESS = 2, UNRECOGNIZED = -1, } @@ -151,13 +184,17 @@ export interface SecurityGroupRule_LabelsEntry { export interface PortRange { $type: "yandex.cloud.vpc.v1.PortRange"; + /** The lowest port in the range. */ fromPort: number; + /** The highest port in the range. */ toPort: number; } export interface CidrBlocks { $type: "yandex.cloud.vpc.v1.CidrBlocks"; + /** IPv4 CIDR blocks to allow traffic to. */ v4CidrBlocks: string[]; + /** IPv6 CIDR blocks to allow traffic to. */ v6CidrBlocks: string[]; } diff --git a/src/generated/yandex/cloud/vpc/v1/security_group_service.ts b/src/generated/yandex/cloud/vpc/v1/security_group_service.ts index 756b4e6c..4c955ba2 100644 --- a/src/generated/yandex/cloud/vpc/v1/security_group_service.ts +++ b/src/generated/yandex/cloud/vpc/v1/security_group_service.ts @@ -29,31 +29,76 @@ export const protobufPackage = "yandex.cloud.vpc.v1"; export interface GetSecurityGroupRequest { $type: "yandex.cloud.vpc.v1.GetSecurityGroupRequest"; + /** + * ID of the Security Group resource to return. + * To get the security group ID, use a [SecurityGroup.List] request. + */ securityGroupId: string; } export interface ListSecurityGroupsRequest { $type: "yandex.cloud.vpc.v1.ListSecurityGroupsRequest"; + /** + * ID of the folder to list security groups in. + * To get the folder ID, use a [yandex.cloud.resourcemanager.v1.FolderService.List] request. + */ folderId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], + * the service returns a [ListSecurityGroupsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. Default value: 100. + */ pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] to the + * [ListSecurityGroupsResponse.next_page_token] returned by a previous list request. + */ pageToken: string; - /** filter by network_id is here */ + /** + * A filter expression that filters resources listed in the response. + * The expression must specify: + * 1. The field name. Currently you can use filtering only on the [SecurityGroup.name] field. + * 2. An `=` operator. + * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. + */ filter: string; } export interface ListSecurityGroupsResponse { $type: "yandex.cloud.vpc.v1.ListSecurityGroupsResponse"; + /** List of SecurityGroup resources. */ securityGroups: SecurityGroup[]; + /** + * This token allows you to get the next page of results for list requests. If the number of results + * is larger than [ListNetworksRequest.page_size], use + * the [next_page_token] as the value + * for the [ListNetworksRequest.page_token] query parameter + * in the next list request. Subsequent list requests will have their own + * [next_page_token] to continue paging through the results. + */ nextPageToken: string; } export interface CreateSecurityGroupRequest { $type: "yandex.cloud.vpc.v1.CreateSecurityGroupRequest"; + /** + * ID of the folder for this request to create a security group in. + * To get the folder ID, use a [yandex.cloud.resourcemanager.v1.FolderService.List] request. + */ folderId: string; + /** + * Name of the security group. + * The name must be unique within the folder. + */ name: string; + /** Description of the security group. */ description: string; + /** Resource labels as `` key:value `` pairs. */ labels: { [key: string]: string }; + /** ID of the Network to create security group for. */ networkId: string; + /** Security rules specifications. */ ruleSpecs: SecurityGroupRuleSpec[]; } @@ -65,16 +110,23 @@ export interface CreateSecurityGroupRequest_LabelsEntry { export interface SecurityGroupRuleSpec { $type: "yandex.cloud.vpc.v1.SecurityGroupRuleSpec"; + /** Description of the security rule. */ description: string; + /** Rule labels as `` key:value `` pairs. */ labels: { [key: string]: string }; + /** The direction of network traffic allowed by this rule. */ direction: SecurityGroupRule_Direction; - /** null value means any port */ + /** The range of ports that allow traffic to pass through. Null value means any port. */ ports?: PortRange; + /** Protocol name. */ protocolName: string | undefined; + /** Protocol number from [IANA protocol numbers](https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). */ protocolNumber: number | undefined; + /** CIDR blocks to allow to recieve or send traffic. */ cidrBlocks?: CidrBlocks | undefined; + /** ID of the security group to add rule to. */ securityGroupId: string | undefined; - /** string subnet_id = .. ; */ + /** Predefined target. See [security groups rules](/docs/vpc/concepts/security-groups#security-groups-rules) for more information. */ predefinedTarget: string | undefined; } @@ -86,17 +138,38 @@ export interface SecurityGroupRuleSpec_LabelsEntry { export interface CreateSecurityGroupMetadata { $type: "yandex.cloud.vpc.v1.CreateSecurityGroupMetadata"; + /** ID of the security group that is being created. */ securityGroupId: string; } export interface UpdateSecurityGroupRequest { $type: "yandex.cloud.vpc.v1.UpdateSecurityGroupRequest"; + /** + * ID of the security group to update. + * + * To get the security group ID make a [SecurityGroupService.List] request. + */ securityGroupId: string; + /** Field mask that specifies which attributes of the Address should be updated. */ updateMask?: FieldMask; + /** + * New name for the security group. + * The name must be unique within the folder. + */ name: string; + /** New description of the security group. */ description: string; + /** + * Security group labels as `key:value` pairs. + * + * Existing set of labels is completely replaced by the provided set, so if you just want + * to add or remove a label: + * 1. Get the current set of labels with a [SecurityGroupService.Get] request. + * 2. Add or remove a label in this set. + * 3. Send the new set in this field. + */ labels: { [key: string]: string }; - /** all existing rules will be replaced with given list */ + /** Updated rule list. All existing rules will be replaced with given list. */ ruleSpecs: SecurityGroupRuleSpec[]; } @@ -108,24 +181,41 @@ export interface UpdateSecurityGroupRequest_LabelsEntry { export interface UpdateSecurityGroupMetadata { $type: "yandex.cloud.vpc.v1.UpdateSecurityGroupMetadata"; + /** ID of the SecurityGroup that is being updated. */ securityGroupId: string; + /** List of added security rules IDs. */ addedRuleIds: string[]; } export interface UpdateSecurityGroupRulesRequest { $type: "yandex.cloud.vpc.v1.UpdateSecurityGroupRulesRequest"; + /** ID of the SecurityGroup that is being updated with new rules. */ securityGroupId: string; - /** list of rules ids to delete */ + /** List of rules IDs to delete. */ deletionRuleIds: string[]; + /** Security rules specifications. */ additionRuleSpecs: SecurityGroupRuleSpec[]; } export interface UpdateSecurityGroupRuleRequest { $type: "yandex.cloud.vpc.v1.UpdateSecurityGroupRuleRequest"; + /** ID of the SecurityGroup to update rule in. */ securityGroupId: string; + /** ID of the rule to update. */ ruleId: string; + /** Field mask that specifies which attributes of the Address should be updated. */ updateMask?: FieldMask; + /** New description of the rule. */ description: string; + /** + * Rule labels as `key:value` pairs. + * + * Existing set of labels is completely replaced by the provided set, so if you just want + * to add or remove a label: + * 1. Get the current set of labels with a [AddressService.Get] request. + * 2. Add or remove a label in this set. + * 3. Send the new set in this field. + */ labels: { [key: string]: string }; } @@ -137,41 +227,75 @@ export interface UpdateSecurityGroupRuleRequest_LabelsEntry { export interface UpdateSecurityGroupRuleMetadata { $type: "yandex.cloud.vpc.v1.UpdateSecurityGroupRuleMetadata"; + /** ID of the SecurityGroup that is being updated with new rules. */ securityGroupId: string; + /** ID of the rule that is being updated. */ ruleId: string; } export interface DeleteSecurityGroupRequest { $type: "yandex.cloud.vpc.v1.DeleteSecurityGroupRequest"; + /** + * ID of the security group to delete. + * + * To get a address ID make a [SecurityGroup.List] request. + */ securityGroupId: string; } export interface DeleteSecurityGroupMetadata { $type: "yandex.cloud.vpc.v1.DeleteSecurityGroupMetadata"; + /** ID of the SecurityGroup that is being deleted. */ securityGroupId: string; } export interface ListSecurityGroupOperationsRequest { $type: "yandex.cloud.vpc.v1.ListSecurityGroupOperationsRequest"; + /** + * ID of the address to list operations for. + * + * To get a address ID make a [SecurityGroup.List] request. + */ securityGroupId: string; + /** + * The maximum number of results per page to return. If the number of available + * results is larger than [page_size], the service returns a [ListSecurityGroupOperationsResponse.next_page_token] + * that can be used to get the next page of results in subsequent list requests. + * Default value: 100. + */ pageSize: number; + /** + * Page token. To get the next page of results, set [page_token] to the + * [ListSecurityGroupOperationsResponse.next_page_token] returned by a previous list request. + */ pageToken: string; } export interface ListSecurityGroupOperationsResponse { $type: "yandex.cloud.vpc.v1.ListSecurityGroupOperationsResponse"; + /** List of operations for the specified security group. */ operations: Operation[]; + /** + * Token for getting the next page of the list. If the number of results is greater than + * the specified [ListSecurityGroupOperationsRequest.page_size], use `next_page_token` as the value + * for the [ListSecurityGroupOperationsRequest.page_token] parameter in the next list request. + * + * Each subsequent page will have its own `next_page_token` to continue paging through the results. + */ nextPageToken: string; } export interface MoveSecurityGroupRequest { $type: "yandex.cloud.vpc.v1.MoveSecurityGroupRequest"; + /** ID of the security group to move. */ securityGroupId: string; + /** ID of the folder to move security group to. */ destinationFolderId: string; } export interface MoveSecurityGroupMetadata { $type: "yandex.cloud.vpc.v1.MoveSecurityGroupMetadata"; + /** ID of the security group that is being moved. */ securityGroupId: string; } @@ -2402,7 +2526,13 @@ messageTypeRegistry.set( MoveSecurityGroupMetadata ); +/** A set of methods for managing SecurityGroup resources. */ export const SecurityGroupServiceService = { + /** + * Returns the specified SecurityGroup resource. + * + * To get the list of all available SecurityGroup resources, make a [List] request. + */ get: { path: "/yandex.cloud.vpc.v1.SecurityGroupService/Get", requestStream: false, @@ -2415,6 +2545,7 @@ export const SecurityGroupServiceService = { Buffer.from(SecurityGroup.encode(value).finish()), responseDeserialize: (value: Buffer) => SecurityGroup.decode(value), }, + /** Retrieves the list of SecurityGroup resources in the specified folder. */ list: { path: "/yandex.cloud.vpc.v1.SecurityGroupService/List", requestStream: false, @@ -2428,6 +2559,7 @@ export const SecurityGroupServiceService = { responseDeserialize: (value: Buffer) => ListSecurityGroupsResponse.decode(value), }, + /** Creates a security group in the specified folder and network. */ create: { path: "/yandex.cloud.vpc.v1.SecurityGroupService/Create", requestStream: false, @@ -2440,6 +2572,10 @@ export const SecurityGroupServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** + * Updates the specified security group. + * Method starts an asynchronous operation that can be cancelled while it is in progress. + */ update: { path: "/yandex.cloud.vpc.v1.SecurityGroupService/Update", requestStream: false, @@ -2452,6 +2588,7 @@ export const SecurityGroupServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Updates the rules of the specified security group. */ updateRules: { path: "/yandex.cloud.vpc.v1.SecurityGroupService/UpdateRules", requestStream: false, @@ -2464,7 +2601,7 @@ export const SecurityGroupServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, - /** update rule description or labels */ + /** Updates the specified rule. */ updateRule: { path: "/yandex.cloud.vpc.v1.SecurityGroupService/UpdateRule", requestStream: false, @@ -2477,6 +2614,7 @@ export const SecurityGroupServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Deletes the specified security group. */ delete: { path: "/yandex.cloud.vpc.v1.SecurityGroupService/Delete", requestStream: false, @@ -2489,6 +2627,7 @@ export const SecurityGroupServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Moves security groups to another folder. */ move: { path: "/yandex.cloud.vpc.v1.SecurityGroupService/Move", requestStream: false, @@ -2501,6 +2640,7 @@ export const SecurityGroupServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + /** Lists operations for the specified security groups. */ listOperations: { path: "/yandex.cloud.vpc.v1.SecurityGroupService/ListOperations", requestStream: false, @@ -2518,15 +2658,30 @@ export const SecurityGroupServiceService = { export interface SecurityGroupServiceServer extends UntypedServiceImplementation { + /** + * Returns the specified SecurityGroup resource. + * + * To get the list of all available SecurityGroup resources, make a [List] request. + */ get: handleUnaryCall; + /** Retrieves the list of SecurityGroup resources in the specified folder. */ list: handleUnaryCall; + /** Creates a security group in the specified folder and network. */ create: handleUnaryCall; + /** + * Updates the specified security group. + * Method starts an asynchronous operation that can be cancelled while it is in progress. + */ update: handleUnaryCall; + /** Updates the rules of the specified security group. */ updateRules: handleUnaryCall; - /** update rule description or labels */ + /** Updates the specified rule. */ updateRule: handleUnaryCall; + /** Deletes the specified security group. */ delete: handleUnaryCall; + /** Moves security groups to another folder. */ move: handleUnaryCall; + /** Lists operations for the specified security groups. */ listOperations: handleUnaryCall< ListSecurityGroupOperationsRequest, ListSecurityGroupOperationsResponse @@ -2534,6 +2689,11 @@ export interface SecurityGroupServiceServer } export interface SecurityGroupServiceClient extends Client { + /** + * Returns the specified SecurityGroup resource. + * + * To get the list of all available SecurityGroup resources, make a [List] request. + */ get( request: GetSecurityGroupRequest, callback: (error: ServiceError | null, response: SecurityGroup) => void @@ -2549,6 +2709,7 @@ export interface SecurityGroupServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: SecurityGroup) => void ): ClientUnaryCall; + /** Retrieves the list of SecurityGroup resources in the specified folder. */ list( request: ListSecurityGroupsRequest, callback: ( @@ -2573,6 +2734,7 @@ export interface SecurityGroupServiceClient extends Client { response: ListSecurityGroupsResponse ) => void ): ClientUnaryCall; + /** Creates a security group in the specified folder and network. */ create( request: CreateSecurityGroupRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -2588,6 +2750,10 @@ export interface SecurityGroupServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** + * Updates the specified security group. + * Method starts an asynchronous operation that can be cancelled while it is in progress. + */ update( request: UpdateSecurityGroupRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -2603,6 +2769,7 @@ export interface SecurityGroupServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Updates the rules of the specified security group. */ updateRules( request: UpdateSecurityGroupRulesRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -2618,7 +2785,7 @@ export interface SecurityGroupServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; - /** update rule description or labels */ + /** Updates the specified rule. */ updateRule( request: UpdateSecurityGroupRuleRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -2634,6 +2801,7 @@ export interface SecurityGroupServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Deletes the specified security group. */ delete( request: DeleteSecurityGroupRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -2649,6 +2817,7 @@ export interface SecurityGroupServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Moves security groups to another folder. */ move( request: MoveSecurityGroupRequest, callback: (error: ServiceError | null, response: Operation) => void @@ -2664,6 +2833,7 @@ export interface SecurityGroupServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + /** Lists operations for the specified security groups. */ listOperations( request: ListSecurityGroupOperationsRequest, callback: ( diff --git a/src/generated/yandex/cloud/vpc/v1/subnet.ts b/src/generated/yandex/cloud/vpc/v1/subnet.ts index 2fdb4b27..53decb7c 100644 --- a/src/generated/yandex/cloud/vpc/v1/subnet.ts +++ b/src/generated/yandex/cloud/vpc/v1/subnet.ts @@ -53,11 +53,22 @@ export interface Subnet { folderId: string; /** Creation timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. */ createdAt?: Date; - /** Name of the subnet. The name is unique within the project. 3-63 characters long. */ + /** + * Name of the subnet. + * The name must be unique within the folder. + * Value must match the regular expression ``\|[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])?``. + */ name: string; /** Optional description of the subnet. 0-256 characters long. */ description: string; - /** Resource labels as `` key:value `` pairs. Maximum of 64 per resource. */ + /** + * Resource labels, `key:value` pairs. + * No more than 64 per resource. + * The maximum string length in characters for each value is 63. + * Each value must match the regular expression `[-_0-9a-z]*`. + * The string length in characters for each key must be 1-63. + * Each key must match the regular expression `[a-z][-_0-9a-z]*`. + */ labels: { [key: string]: string }; /** ID of the network the subnet belongs to. */ networkId: string; @@ -75,6 +86,7 @@ export interface Subnet { v6CidrBlocks: string[]; /** ID of route table the subnet is linked to. */ routeTableId: string; + /** DHCP options for the subnet. */ dhcpOptions?: DhcpOptions; } @@ -86,8 +98,11 @@ export interface Subnet_LabelsEntry { export interface DhcpOptions { $type: "yandex.cloud.vpc.v1.DhcpOptions"; + /** A list of DHCP servers for this subnet. */ domainNameServers: string[]; + /** A domain name to us as a suffix when resolving host names in this subnet. */ domainName: string; + /** List of NTP servers for this subnet. */ ntpServers: string[]; } diff --git a/src/generated/yandex/cloud/vpc/v1/subnet_service.ts b/src/generated/yandex/cloud/vpc/v1/subnet_service.ts index 74e6dc57..146d2666 100644 --- a/src/generated/yandex/cloud/vpc/v1/subnet_service.ts +++ b/src/generated/yandex/cloud/vpc/v1/subnet_service.ts @@ -106,7 +106,6 @@ export interface CreateSubnetRequest { /** * CIDR block. * The range of internal addresses that are defined for this subnet. - * This field can be set only at Subnet resource creation time and cannot be changed. * For example, 10.0.0.0/22 or 192.168.0.0/24. * Minimum subnet size is /28, maximum subnet size is /16. */ @@ -146,6 +145,8 @@ export interface UpdateSubnetRequest { /** ID of route table the subnet is linked to. */ routeTableId: string; dhcpOptions?: DhcpOptions; + /** New CIDR blocks which will overwrite the existing ones. */ + v4CidrBlocks: string[]; } export interface UpdateSubnetRequest_LabelsEntry { @@ -276,6 +277,17 @@ export interface UsedAddress { references: Reference[]; } +export interface RelocateSubnetRequest { + $type: "yandex.cloud.vpc.v1.RelocateSubnetRequest"; + subnetId: string; + destinationZoneId: string; +} + +export interface RelocateSubnetMetadata { + $type: "yandex.cloud.vpc.v1.RelocateSubnetMetadata"; + subnetId: string; +} + const baseGetSubnetRequest: object = { $type: "yandex.cloud.vpc.v1.GetSubnetRequest", subnetId: "", @@ -884,6 +896,7 @@ const baseUpdateSubnetRequest: object = { name: "", description: "", routeTableId: "", + v4CidrBlocks: "", }; export const UpdateSubnetRequest = { @@ -924,6 +937,9 @@ export const UpdateSubnetRequest = { writer.uint32(58).fork() ).ldelim(); } + for (const v of message.v4CidrBlocks) { + writer.uint32(66).string(v!); + } return writer; }, @@ -932,6 +948,7 @@ export const UpdateSubnetRequest = { let end = length === undefined ? reader.len : reader.pos + length; const message = { ...baseUpdateSubnetRequest } as UpdateSubnetRequest; message.labels = {}; + message.v4CidrBlocks = []; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -962,6 +979,9 @@ export const UpdateSubnetRequest = { case 7: message.dhcpOptions = DhcpOptions.decode(reader, reader.uint32()); break; + case 8: + message.v4CidrBlocks.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -1002,6 +1022,9 @@ export const UpdateSubnetRequest = { object.dhcpOptions !== undefined && object.dhcpOptions !== null ? DhcpOptions.fromJSON(object.dhcpOptions) : undefined; + message.v4CidrBlocks = (object.v4CidrBlocks ?? []).map((e: any) => + String(e) + ); return message; }, @@ -1027,6 +1050,11 @@ export const UpdateSubnetRequest = { (obj.dhcpOptions = message.dhcpOptions ? DhcpOptions.toJSON(message.dhcpOptions) : undefined); + if (message.v4CidrBlocks) { + obj.v4CidrBlocks = message.v4CidrBlocks.map((e) => e); + } else { + obj.v4CidrBlocks = []; + } return obj; }, @@ -1054,6 +1082,7 @@ export const UpdateSubnetRequest = { object.dhcpOptions !== undefined && object.dhcpOptions !== null ? DhcpOptions.fromPartial(object.dhcpOptions) : undefined; + message.v4CidrBlocks = object.v4CidrBlocks?.map((e) => e) || []; return message; }, }; @@ -2304,6 +2333,151 @@ export const UsedAddress = { messageTypeRegistry.set(UsedAddress.$type, UsedAddress); +const baseRelocateSubnetRequest: object = { + $type: "yandex.cloud.vpc.v1.RelocateSubnetRequest", + subnetId: "", + destinationZoneId: "", +}; + +export const RelocateSubnetRequest = { + $type: "yandex.cloud.vpc.v1.RelocateSubnetRequest" as const, + + encode( + message: RelocateSubnetRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.subnetId !== "") { + writer.uint32(10).string(message.subnetId); + } + if (message.destinationZoneId !== "") { + writer.uint32(18).string(message.destinationZoneId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RelocateSubnetRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRelocateSubnetRequest } as RelocateSubnetRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subnetId = reader.string(); + break; + case 2: + message.destinationZoneId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RelocateSubnetRequest { + const message = { ...baseRelocateSubnetRequest } as RelocateSubnetRequest; + message.subnetId = + object.subnetId !== undefined && object.subnetId !== null + ? String(object.subnetId) + : ""; + message.destinationZoneId = + object.destinationZoneId !== undefined && + object.destinationZoneId !== null + ? String(object.destinationZoneId) + : ""; + return message; + }, + + toJSON(message: RelocateSubnetRequest): unknown { + const obj: any = {}; + message.subnetId !== undefined && (obj.subnetId = message.subnetId); + message.destinationZoneId !== undefined && + (obj.destinationZoneId = message.destinationZoneId); + return obj; + }, + + fromPartial, I>>( + object: I + ): RelocateSubnetRequest { + const message = { ...baseRelocateSubnetRequest } as RelocateSubnetRequest; + message.subnetId = object.subnetId ?? ""; + message.destinationZoneId = object.destinationZoneId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(RelocateSubnetRequest.$type, RelocateSubnetRequest); + +const baseRelocateSubnetMetadata: object = { + $type: "yandex.cloud.vpc.v1.RelocateSubnetMetadata", + subnetId: "", +}; + +export const RelocateSubnetMetadata = { + $type: "yandex.cloud.vpc.v1.RelocateSubnetMetadata" as const, + + encode( + message: RelocateSubnetMetadata, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.subnetId !== "") { + writer.uint32(10).string(message.subnetId); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): RelocateSubnetMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRelocateSubnetMetadata } as RelocateSubnetMetadata; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subnetId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RelocateSubnetMetadata { + const message = { ...baseRelocateSubnetMetadata } as RelocateSubnetMetadata; + message.subnetId = + object.subnetId !== undefined && object.subnetId !== null + ? String(object.subnetId) + : ""; + return message; + }, + + toJSON(message: RelocateSubnetMetadata): unknown { + const obj: any = {}; + message.subnetId !== undefined && (obj.subnetId = message.subnetId); + return obj; + }, + + fromPartial, I>>( + object: I + ): RelocateSubnetMetadata { + const message = { ...baseRelocateSubnetMetadata } as RelocateSubnetMetadata; + message.subnetId = object.subnetId ?? ""; + return message; + }, +}; + +messageTypeRegistry.set(RelocateSubnetMetadata.$type, RelocateSubnetMetadata); + /** A set of methods for managing Subnet resources. */ export const SubnetServiceService = { /** @@ -2434,6 +2608,17 @@ export const SubnetServiceService = { Buffer.from(Operation.encode(value).finish()), responseDeserialize: (value: Buffer) => Operation.decode(value), }, + relocate: { + path: "/yandex.cloud.vpc.v1.SubnetService/Relocate", + requestStream: false, + responseStream: false, + requestSerialize: (value: RelocateSubnetRequest) => + Buffer.from(RelocateSubnetRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => RelocateSubnetRequest.decode(value), + responseSerialize: (value: Operation) => + Buffer.from(Operation.encode(value).finish()), + responseDeserialize: (value: Buffer) => Operation.decode(value), + }, /** List used addresses in specified subnet. */ listUsedAddresses: { path: "/yandex.cloud.vpc.v1.SubnetService/ListUsedAddresses", @@ -2488,6 +2673,7 @@ export interface SubnetServiceServer extends UntypedServiceImplementation { >; /** Move subnet to another folder. */ move: handleUnaryCall; + relocate: handleUnaryCall; /** List used addresses in specified subnet. */ listUsedAddresses: handleUnaryCall< ListUsedAddressesRequest, @@ -2674,6 +2860,21 @@ export interface SubnetServiceClient extends Client { options: Partial, callback: (error: ServiceError | null, response: Operation) => void ): ClientUnaryCall; + relocate( + request: RelocateSubnetRequest, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + relocate( + request: RelocateSubnetRequest, + metadata: Metadata, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; + relocate( + request: RelocateSubnetRequest, + metadata: Metadata, + options: Partial, + callback: (error: ServiceError | null, response: Operation) => void + ): ClientUnaryCall; /** List used addresses in specified subnet. */ listUsedAddresses( request: ListUsedAddressesRequest, diff --git a/src/generated/yandex/cloud/ydb/index.ts b/src/generated/yandex/cloud/ydb/index.ts index ade14f2a..a5ab6ddd 100644 --- a/src/generated/yandex/cloud/ydb/index.ts +++ b/src/generated/yandex/cloud/ydb/index.ts @@ -1,10 +1,10 @@ -export * as backup from './v1/backup' -export * as backup_service from './v1/backup_service' -export * as database from './v1/database' -export * as database_service from './v1/database_service' -export * as location from './v1/location' -export * as location_service from './v1/location_service' -export * as resource_preset from './v1/resource_preset' -export * as resource_preset_service from './v1/resource_preset_service' -export * as storage_type from './v1/storage_type' -export * as storage_type_service from './v1/storage_type_service' \ No newline at end of file +export * as v1_backup from './v1/backup' +export * as v1_backup_service from './v1/backup_service' +export * as v1_database from './v1/database' +export * as v1_database_service from './v1/database_service' +export * as v1_location from './v1/location' +export * as v1_location_service from './v1/location_service' +export * as v1_resource_preset from './v1/resource_preset' +export * as v1_resource_preset_service from './v1/resource_preset_service' +export * as v1_storage_type from './v1/storage_type' +export * as v1_storage_type_service from './v1/storage_type_service' \ No newline at end of file diff --git a/src/service-endpoints.ts b/src/service-endpoints.ts index fed86681..6e9425f3 100644 --- a/src/service-endpoints.ts +++ b/src/service-endpoints.ts @@ -431,6 +431,15 @@ export const SERVICE_ENDPOINTS_LIST: ServiceEndpointsList = [ ], endpoint: 'stt.api.cloud.yandex.net:443', }, + { + serviceIds: [ + 'yandex.cloud.ai.assistants.v1.AssistantService', + 'yandex.cloud.ai.assistants.v1.threads.MessageService', + 'yandex.cloud.ai.assistants.v1.threads.ThreadService', + 'yandex.cloud.ai.assistants.v1.runs.RunService', + ], + endpoint: 'assistant.api.cloud.yandex.net:443', + }, ]; export const getServiceClientEndpoint = (generatedClientCtor: GeneratedServiceClientCtor): string => { diff --git a/src/session.ts b/src/session.ts index c88cf599..153a09ac 100644 --- a/src/session.ts +++ b/src/session.ts @@ -24,10 +24,10 @@ const isIamToken = (config: SessionConfig): config is IamTokenCredentialsConfig const isServiceAccount = (config: SessionConfig): config is ServiceAccountCredentialsConfig => 'serviceAccountJson' in config; -const createIamToken = async (iamEndpoint: string, req: Partial) => { +const createIamToken = async (iamEndpoint: string, req: Partial) => { const channel = createChannel(iamEndpoint, credentials.createSsl()); const client = clientFactory.create(serviceClients.IamTokenServiceClient.service, channel); - const resp = await client.create(cloudApi.iam.iam_token_service.CreateIamTokenRequest.fromPartial(req)); + const resp = await client.create(cloudApi.iam.v1_iam_token_service.CreateIamTokenRequest.fromPartial(req)); return resp.iamToken; }; diff --git a/src/token-service/iam-token-service.ts b/src/token-service/iam-token-service.ts index 06edef5d..8af24d72 100644 --- a/src/token-service/iam-token-service.ts +++ b/src/token-service/iam-token-service.ts @@ -76,11 +76,11 @@ export class IamTokenService implements TokenService { } } - private async requestToken(): Promise { + private async requestToken(): Promise { const deadline = DateTime.now().plus({ millisecond: this.tokenRequestTimeout }).toJSDate(); return this.client().create( - cloudApi.iam.iam_token_service.CreateIamTokenRequest.fromPartial({ + cloudApi.iam.v1_iam_token_service.CreateIamTokenRequest.fromPartial({ jwt: this.getJwtRequest(), }), { deadline }, diff --git a/src/utils/operation/wait-for.ts b/src/utils/operation/wait-for.ts index fef09752..f929db9d 100644 --- a/src/utils/operation/wait-for.ts +++ b/src/utils/operation/wait-for.ts @@ -1,11 +1,12 @@ -import { - cloudApi, - serviceClients, -} from '../..'; +import { cloudApi, serviceClients } from '../..'; import { Operation } from '../../generated/yandex/cloud/operation/operation'; import { Session } from '../../session'; -const { operation: { operation_service: { GetOperationRequest } } } = cloudApi; +const { + operation: { + operation_service: { GetOperationRequest }, + }, +} = cloudApi; const DEFAULT_TIMEOUT_MS = 10 * 60 * 1000; // 10 minutes @@ -15,7 +16,10 @@ export const waitForOperation = ( timeoutMs: number = DEFAULT_TIMEOUT_MS, operationServiceEndpoint?: string, ): Promise => { - const client = session.client(serviceClients.OperationServiceClient, operationServiceEndpoint); + const client = session.client( + serviceClients.OperationServiceClient, + operationServiceEndpoint, + ); const maxChecksCount = Math.ceil(timeoutMs / session.pollInterval); let checksCount = 0; diff --git a/tsconfig.json b/tsconfig.json index 128f8902..2e5f6bbb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,8 @@ "strict": true, "skipLibCheck": true, "resolveJsonModule": true, - "lib": ["es6"] + "lib": ["es6"], + "disableSizeLimit": true, }, "include": [ "./src" From d562dda0d5fd91583d5380e769c4c7b3ec300411 Mon Sep 17 00:00:00 2001 From: GermanVor Date: Fri, 11 Oct 2024 13:45:53 +0200 Subject: [PATCH 2/4] chore: return scripts --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index df737e25..39498ec3 100644 --- a/package.json +++ b/package.json @@ -66,9 +66,9 @@ "typescript": "^4.5.4" }, "scripts": { - "test": "jest -c config/jest.ts --passWithNoTests '.*\\.test\\.ts$'", - "lint": "eslint src/ --quiet --fix", - "build": "tsc -p .", + "test": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" jest -c config/jest.ts --passWithNoTests '.*\\.test\\.ts$'", + "lint": "eslint src config", + "build": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" tsc -p .", "generate-code": "ts-node scripts/generate-code.ts", "check-endpoints": "ts-node scripts/check-endpoints.ts", "prepare": "husky install", From 89a35de2d0d3d5017c72d07204672c9b295b0887 Mon Sep 17 00:00:00 2001 From: GermanVor Date: Fri, 11 Oct 2024 15:40:23 +0200 Subject: [PATCH 3/4] chore: ignore v1 --- scripts/exceptions.ts | 4 + scripts/generate-code.ts | 26 +- scripts/services.ts | 360 +++++++++--------- src/generated/yandex/cloud/ai/index.ts | 66 ++-- src/generated/yandex/cloud/airflow/index.ts | 6 +- .../yandex/cloud/apploadbalancer/index.ts | 26 +- .../yandex/cloud/audittrails/index.ts | 4 +- src/generated/yandex/cloud/backup/index.ts | 14 +- src/generated/yandex/cloud/billing/index.ts | 22 +- src/generated/yandex/cloud/cdn/index.ts | 24 +- .../yandex/cloud/certificatemanager/index.ts | 6 +- src/generated/yandex/cloud/cic/index.ts | 28 +- src/generated/yandex/cloud/cloudapps/index.ts | 4 +- .../yandex/cloud/cloudrouter/index.ts | 4 +- src/generated/yandex/cloud/compute/index.ts | 60 +-- .../yandex/cloud/containerregistry/index.ts | 28 +- src/generated/yandex/cloud/dataproc/index.ts | 24 +- .../yandex/cloud/datasphere/index.ts | 14 +- .../yandex/cloud/datatransfer/index.ts | 30 +- src/generated/yandex/cloud/dns/index.ts | 4 +- src/generated/yandex/cloud/iam/index.ts | 46 +-- src/generated/yandex/cloud/iot/index.ts | 18 +- src/generated/yandex/cloud/k8s/index.ts | 20 +- src/generated/yandex/cloud/kms/index.ts | 18 +- .../yandex/cloud/loadbalancer/index.ts | 10 +- .../yandex/cloud/loadtesting/index.ts | 72 ++-- src/generated/yandex/cloud/lockbox/index.ts | 8 +- src/generated/yandex/cloud/logging/index.ts | 20 +- .../yandex/cloud/marketplace/index.ts | 18 +- src/generated/yandex/cloud/mdb/index.ts | 336 ++++++++-------- .../cloud/mdb/mongodb/v1/cluster_service.ts | 2 +- .../yandex/cloud/mdb/postgresql/v1/cluster.ts | 2 +- .../mdb/postgresql/v1/cluster_service.ts | 2 +- .../yandex/cloud/organizationmanager/index.ts | 32 +- .../yandex/cloud/resourcemanager/index.ts | 8 +- .../yandex/cloud/serverless/index.ts | 52 +-- src/generated/yandex/cloud/service_clients.ts | 360 +++++++++--------- .../yandex/cloud/smartcaptcha/index.ts | 4 +- .../yandex/cloud/smartwebsecurity/index.ts | 16 +- .../yandex/cloud/speechsense/index.ts | 38 +- src/generated/yandex/cloud/storage/index.ts | 6 +- src/generated/yandex/cloud/video/index.ts | 26 +- src/generated/yandex/cloud/vpc/index.ts | 28 +- src/generated/yandex/cloud/ydb/index.ts | 20 +- src/session.ts | 4 +- src/token-service/iam-token-service.ts | 4 +- 46 files changed, 967 insertions(+), 957 deletions(-) create mode 100644 scripts/exceptions.ts diff --git a/scripts/exceptions.ts b/scripts/exceptions.ts new file mode 100644 index 00000000..ad04065f --- /dev/null +++ b/scripts/exceptions.ts @@ -0,0 +1,4 @@ +export const exportAliasExceptions: Record = { + 'v1/metering/usage_record': 'v1_metering_usage_record', + 'v1/metering/image_product_usage_service': 'v1_metering_image_product_usage_service', +}; diff --git a/scripts/generate-code.ts b/scripts/generate-code.ts index cb11436a..1b25849d 100644 --- a/scripts/generate-code.ts +++ b/scripts/generate-code.ts @@ -7,6 +7,8 @@ import * as _ from 'lodash'; import { logger } from '../src/utils/logger'; import { servicesConfig } from './services'; +import { exportAliasExceptions } from './exceptions'; + const GENERATED_CODE_DIR = path.resolve('./src/generated'); const GENERATED_PROJECTS_DIR = path.join(GENERATED_CODE_DIR, 'yandex', 'cloud'); const PROTO_DIR = path.resolve('./cloudapi'); @@ -56,6 +58,12 @@ interface ProjectMeta { const projectsMeta: Record = {}; +const getExportAlias = (relativePath: string) => exportAliasExceptions[relativePath] + || relativePath + .split(path.sep) + .filter((str) => str !== 'v1') + .join('_'); + for (const projectDir of projectsDirs) { logger.debug(`Processing project directory ${projectDir}`); @@ -82,22 +90,18 @@ for (const projectDir of projectsDirs) { .relative(projectDir, modulePath) .replace('.ts', ''); - const relativePathSegments = relativePath.split(path.sep); - const moduleName = path.basename(modulePath); + const exportAlias = getExportAlias(relativePath); - const moduleAlias = relativePathSegments.join('_'); + if (relativePath.endsWith('_service')) { + const name = path.basename(modulePath); - const { ext } = path.parse(modulePath); - const moduleWithoutExt = relativePath.replace(ext, ''); - - if (moduleWithoutExt.endsWith('_service')) { projectsMeta[indexModulePath].services.push({ - name: moduleName, - exportAlias: moduleAlias, + name, + exportAlias, }); } - return `export * as ${moduleAlias} from './${moduleWithoutExt}'`; + return `export * as ${exportAlias} from './${relativePath}'`; }); const indexModuleContent = exportStatements.join('\n'); @@ -162,6 +166,8 @@ for (const [indexModulePath, projectMeta] of Object.entries(projectsMeta)) { logger.debug(`Writing result to ${rootIndexModulePath} module`); logger.debug(`Writing result to ${serviceClientsModulePath} module`); +logger.debug('\n\n\n'); + for (const serviceName of Object.keys(servicesConfig)) { const obj = servicesConfig[serviceName]; const keys = Object.keys(obj); diff --git a/scripts/services.ts b/scripts/services.ts index 51c4451e..199c1ecf 100644 --- a/scripts/services.ts +++ b/scripts/services.ts @@ -6,203 +6,203 @@ export const servicesConfig: ServicesConfig = { stt_v2_stt_service: { importClassName: 'SttServiceClient' }, translate_v2_translation_service: { importClassName: 'TranslationServiceClient' }, tts_v3_tts_service: { importClassName: 'SynthesizerClient' }, - vision_v1_vision_service: { importClassName: 'VisionServiceClient' }, + vision_vision_service: { importClassName: 'VisionServiceClient' }, vision_v2_image_classifier_service: { importClassName: 'ImageClassifierServiceClient' }, - ocr_v1_ocr_service: { importClassName: 'TextRecognitionServiceClient' }, - assistants_v1_assistant_service: { importClassName: 'AssistantServiceClient' }, - assistants_v1_runs_run_service: { importClassName: 'RunServiceClient', exportClassName: 'AssistantRunServiceClient' }, - assistants_v1_threads_message_service: { importClassName: 'MessageServiceClient', exportClassName: 'AssistantMessageServiceClient' }, - assistants_v1_threads_thread_service: { importClassName: 'ThreadServiceClient', exportClassName: 'AssistantThreadServiceClient' }, + ocr_ocr_service: { importClassName: 'TextRecognitionServiceClient' }, + assistants_assistant_service: { importClassName: 'AssistantServiceClient' }, + assistants_runs_run_service: { importClassName: 'RunServiceClient', exportClassName: 'AssistantRunServiceClient' }, + assistants_threads_message_service: { importClassName: 'MessageServiceClient', exportClassName: 'AssistantMessageServiceClient' }, + assistants_threads_thread_service: { importClassName: 'ThreadServiceClient', exportClassName: 'AssistantThreadServiceClient' }, }, apploadbalancer: { - v1_backend_group_service: { importClassName: 'BackendGroupServiceClient' }, - v1_http_router_service: { importClassName: 'HttpRouterServiceClient' }, - v1_load_balancer_service: { importClassName: 'LoadBalancerServiceClient' }, - v1_target_group_service: { importClassName: 'TargetGroupServiceClient', exportClassName: 'AlbTargetGroupServiceClient' }, - v1_virtual_host_service: { importClassName: 'VirtualHostServiceClient' }, + backend_group_service: { importClassName: 'BackendGroupServiceClient' }, + http_router_service: { importClassName: 'HttpRouterServiceClient' }, + load_balancer_service: { importClassName: 'LoadBalancerServiceClient' }, + target_group_service: { importClassName: 'TargetGroupServiceClient', exportClassName: 'AlbTargetGroupServiceClient' }, + virtual_host_service: { importClassName: 'VirtualHostServiceClient' }, }, backup: { - v1_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'BackupBackupServiceClient' }, - v1_policy_service: { importClassName: 'PolicyServiceClient', exportClassName: 'BackupPolicyServiceClient' }, - v1_provider_service: { importClassName: 'ProviderServiceClient', exportClassName: 'BackupProviderServiceClient' }, - v1_resource_service: { importClassName: 'ResourceServiceClient', exportClassName: 'BackupResourceServiceClient' }, + backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'BackupBackupServiceClient' }, + policy_service: { importClassName: 'PolicyServiceClient', exportClassName: 'BackupPolicyServiceClient' }, + provider_service: { importClassName: 'ProviderServiceClient', exportClassName: 'BackupProviderServiceClient' }, + resource_service: { importClassName: 'ResourceServiceClient', exportClassName: 'BackupResourceServiceClient' }, }, billing: { - v1_billing_account_service: { importClassName: 'BillingAccountServiceClient' }, - v1_budget_service: { importClassName: 'BudgetServiceClient' }, - v1_customer_service: { importClassName: 'CustomerServiceClient' }, - v1_service_service: { importClassName: 'ServiceServiceClient' }, - v1_sku_service: { importClassName: 'SkuServiceClient' }, + billing_account_service: { importClassName: 'BillingAccountServiceClient' }, + budget_service: { importClassName: 'BudgetServiceClient' }, + customer_service: { importClassName: 'CustomerServiceClient' }, + service_service: { importClassName: 'ServiceServiceClient' }, + sku_service: { importClassName: 'SkuServiceClient' }, }, cdn: { - v1_cache_service: { importClassName: 'CacheServiceClient', exportClassName: 'CDNCacheServiceClient' }, - v1_origin_group_service: { importClassName: 'OriginGroupServiceClient', exportClassName: 'CDNOriginGroupServiceClient' }, - v1_origin_service: { importClassName: 'OriginServiceClient', exportClassName: 'CDNOriginServiceClient' }, - v1_provider_service: { importClassName: 'ProviderServiceClient', exportClassName: 'CDNProviderServiceClient' }, - v1_raw_logs_service: { importClassName: 'RawLogsServiceClient', exportClassName: 'CDNRawLogsServiceClient' }, - v1_resource_service: { importClassName: 'ResourceServiceClient', exportClassName: 'CDNResourceServiceClient' }, + cache_service: { importClassName: 'CacheServiceClient', exportClassName: 'CDNCacheServiceClient' }, + origin_group_service: { importClassName: 'OriginGroupServiceClient', exportClassName: 'CDNOriginGroupServiceClient' }, + origin_service: { importClassName: 'OriginServiceClient', exportClassName: 'CDNOriginServiceClient' }, + provider_service: { importClassName: 'ProviderServiceClient', exportClassName: 'CDNProviderServiceClient' }, + raw_logs_service: { importClassName: 'RawLogsServiceClient', exportClassName: 'CDNRawLogsServiceClient' }, + resource_service: { importClassName: 'ResourceServiceClient', exportClassName: 'CDNResourceServiceClient' }, }, certificatemanager: { - v1_certificate_content_service: { importClassName: 'CertificateContentServiceClient' }, - v1_certificate_service: { importClassName: 'CertificateServiceClient' }, + certificate_content_service: { importClassName: 'CertificateContentServiceClient' }, + certificate_service: { importClassName: 'CertificateServiceClient' }, }, compute: { - v1_disk_placement_group_service: { importClassName: 'DiskPlacementGroupServiceClient' }, - v1_disk_service: { importClassName: 'DiskServiceClient' }, - v1_disk_type_service: { importClassName: 'DiskTypeServiceClient' }, - v1_filesystem_service: { importClassName: 'FilesystemServiceClient' }, - v1_host_group_service: { importClassName: 'HostGroupServiceClient' }, - v1_host_type_service: { importClassName: 'HostTypeServiceClient' }, - v1_image_service: { importClassName: 'ImageServiceClient', exportClassName: 'ComputeImageServiceClient' }, - v1_instance_service: { importClassName: 'InstanceServiceClient' }, - v1_placement_group_service: { importClassName: 'PlacementGroupServiceClient' }, - v1_snapshot_service: { importClassName: 'SnapshotServiceClient' }, - v1_zone_service: { importClassName: 'ZoneServiceClient' }, - v1_instancegroup_instance_group_service: { importClassName: 'InstanceGroupServiceClient' }, - v1_snapshot_schedule_service: { importClassName: 'SnapshotScheduleServiceClient' }, - v1_gpu_cluster_service: { importClassName: 'GpuClusterServiceClient' }, + disk_placement_group_service: { importClassName: 'DiskPlacementGroupServiceClient' }, + disk_service: { importClassName: 'DiskServiceClient' }, + disk_type_service: { importClassName: 'DiskTypeServiceClient' }, + filesystem_service: { importClassName: 'FilesystemServiceClient' }, + host_group_service: { importClassName: 'HostGroupServiceClient' }, + host_type_service: { importClassName: 'HostTypeServiceClient' }, + image_service: { importClassName: 'ImageServiceClient', exportClassName: 'ComputeImageServiceClient' }, + instance_service: { importClassName: 'InstanceServiceClient' }, + placement_group_service: { importClassName: 'PlacementGroupServiceClient' }, + snapshot_service: { importClassName: 'SnapshotServiceClient' }, + zone_service: { importClassName: 'ZoneServiceClient' }, + instancegroup_instance_group_service: { importClassName: 'InstanceGroupServiceClient' }, + snapshot_schedule_service: { importClassName: 'SnapshotScheduleServiceClient' }, + gpu_cluster_service: { importClassName: 'GpuClusterServiceClient' }, }, containerregistry: { - v1_image_service: { importClassName: 'ImageServiceClient', exportClassName: 'CrImageServiceClient' }, - v1_lifecycle_policy_service: { importClassName: 'LifecyclePolicyServiceClient' }, - v1_registry_service: { importClassName: 'RegistryServiceClient' }, - v1_repository_service: { importClassName: 'RepositoryServiceClient' }, - v1_scanner_service: { importClassName: 'ScannerServiceClient' }, - v1_scan_policy_service: { importClassName: 'ScanPolicyServiceClient' }, + image_service: { importClassName: 'ImageServiceClient', exportClassName: 'CrImageServiceClient' }, + lifecycle_policy_service: { importClassName: 'LifecyclePolicyServiceClient' }, + registry_service: { importClassName: 'RegistryServiceClient' }, + repository_service: { importClassName: 'RepositoryServiceClient' }, + scanner_service: { importClassName: 'ScannerServiceClient' }, + scan_policy_service: { importClassName: 'ScanPolicyServiceClient' }, }, dataproc: { - v1_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'DataProcClusterServiceClient' }, - v1_job_service: { importClassName: 'JobServiceClient' }, - v1_resource_preset_service: { importClassName: 'ResourcePresetServiceClient' }, - v1_subcluster_service: { importClassName: 'SubclusterServiceClient' }, - manager_v1_job_service: { importClassName: 'JobServiceClient', exportClassName: 'ManagerJobServiceClient' }, - manager_v1_manager_service: { importClassName: 'DataprocManagerServiceClient' }, + cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'DataProcClusterServiceClient' }, + job_service: { importClassName: 'JobServiceClient' }, + resource_preset_service: { importClassName: 'ResourcePresetServiceClient' }, + subcluster_service: { importClassName: 'SubclusterServiceClient' }, + manager_job_service: { importClassName: 'JobServiceClient', exportClassName: 'ManagerJobServiceClient' }, + manager_manager_service: { importClassName: 'DataprocManagerServiceClient' }, }, datasphere: { - v1_app_token_service: { importClassName: 'AppTokenServiceClient' }, - v1_folder_budget_service: { importClassName: 'FolderBudgetServiceClient' }, - v1_node_service: { importClassName: 'NodeServiceClient' }, - v1_project_data_service: { importClassName: 'ProjectDataServiceClient' }, - v1_project_service: { importClassName: 'ProjectServiceClient' }, + app_token_service: { importClassName: 'AppTokenServiceClient' }, + folder_budget_service: { importClassName: 'FolderBudgetServiceClient' }, + node_service: { importClassName: 'NodeServiceClient' }, + project_data_service: { importClassName: 'ProjectDataServiceClient' }, + project_service: { importClassName: 'ProjectServiceClient' }, v2_community_service: { importClassName: 'CommunityServiceClient' }, }, datatransfer: { - v1_endpoint_service: { importClassName: 'EndpointServiceClient' }, - v1_transfer_service: { importClassName: 'TransferServiceClient' }, + endpoint_service: { importClassName: 'EndpointServiceClient' }, + transfer_service: { importClassName: 'TransferServiceClient' }, }, - dns: { v1_dns_zone_service: { importClassName: 'DnsZoneServiceClient' } }, + dns: { dns_zone_service: { importClassName: 'DnsZoneServiceClient' } }, iam: { - v1_api_key_service: { importClassName: 'ApiKeyServiceClient' }, - v1_iam_token_service: { importClassName: 'IamTokenServiceClient' }, - v1_key_service: { importClassName: 'KeyServiceClient' }, - v1_role_service: { importClassName: 'RoleServiceClient' }, - v1_service_account_service: { importClassName: 'ServiceAccountServiceClient' }, - v1_user_account_service: { importClassName: 'UserAccountServiceClient' }, - v1_yandex_passport_user_account_service: { importClassName: 'YandexPassportUserAccountServiceClient' }, - v1_awscompatibility_access_key_service: { importClassName: 'AccessKeyServiceClient' }, + api_key_service: { importClassName: 'ApiKeyServiceClient' }, + iam_token_service: { importClassName: 'IamTokenServiceClient' }, + key_service: { importClassName: 'KeyServiceClient' }, + role_service: { importClassName: 'RoleServiceClient' }, + service_account_service: { importClassName: 'ServiceAccountServiceClient' }, + user_account_service: { importClassName: 'UserAccountServiceClient' }, + yandex_passport_user_account_service: { importClassName: 'YandexPassportUserAccountServiceClient' }, + awscompatibility_access_key_service: { importClassName: 'AccessKeyServiceClient' }, }, iot: { - broker_v1_broker_data_service: { importClassName: 'BrokerDataServiceClient' }, - broker_v1_broker_service: { importClassName: 'BrokerServiceClient' }, - devices_v1_device_data_service: { importClassName: 'DeviceDataServiceClient' }, - devices_v1_device_service: { importClassName: 'DeviceServiceClient' }, - devices_v1_registry_data_service: { importClassName: 'RegistryDataServiceClient' }, - devices_v1_registry_service: { importClassName: 'RegistryServiceClient', exportClassName: 'IotRegistryServiceClient' }, + broker_broker_data_service: { importClassName: 'BrokerDataServiceClient' }, + broker_broker_service: { importClassName: 'BrokerServiceClient' }, + devices_device_data_service: { importClassName: 'DeviceDataServiceClient' }, + devices_device_service: { importClassName: 'DeviceServiceClient' }, + devices_registry_data_service: { importClassName: 'RegistryDataServiceClient' }, + devices_registry_service: { importClassName: 'RegistryServiceClient', exportClassName: 'IotRegistryServiceClient' }, }, k8s: { - v1_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'K8sClusterServiceClient' }, - v1_node_group_service: { importClassName: 'NodeGroupServiceClient' }, - v1_version_service: { importClassName: 'VersionServiceClient' }, + cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'K8sClusterServiceClient' }, + node_group_service: { importClassName: 'NodeGroupServiceClient' }, + version_service: { importClassName: 'VersionServiceClient' }, }, kms: { - v1_symmetric_crypto_service: { importClassName: 'SymmetricCryptoServiceClient' }, - v1_symmetric_key_service: { importClassName: 'SymmetricKeyServiceClient' }, - v1_asymmetricencryption_asymmetric_encryption_crypto_service: { importClassName: 'AsymmetricEncryptionCryptoServiceClient' }, - v1_asymmetricencryption_asymmetric_encryption_key_service: { importClassName: 'AsymmetricEncryptionKeyServiceClient' }, - v1_asymmetricsignature_asymmetric_signature_crypto_service: { importClassName: 'AsymmetricSignatureCryptoServiceClient' }, - v1_asymmetricsignature_asymmetric_signature_key_service: { importClassName: 'AsymmetricSignatureKeyServiceClient' }, + symmetric_crypto_service: { importClassName: 'SymmetricCryptoServiceClient' }, + symmetric_key_service: { importClassName: 'SymmetricKeyServiceClient' }, + asymmetricencryption_asymmetric_encryption_crypto_service: { importClassName: 'AsymmetricEncryptionCryptoServiceClient' }, + asymmetricencryption_asymmetric_encryption_key_service: { importClassName: 'AsymmetricEncryptionKeyServiceClient' }, + asymmetricsignature_asymmetric_signature_crypto_service: { importClassName: 'AsymmetricSignatureCryptoServiceClient' }, + asymmetricsignature_asymmetric_signature_key_service: { importClassName: 'AsymmetricSignatureKeyServiceClient' }, }, loadtesting: { - agent_v1_agent_registration_service: { importClassName: 'AgentRegistrationServiceClient', exportClassName: 'LoadTestingAgentRegistrationServiceClient' }, - agent_v1_agent_service: { importClassName: 'AgentServiceClient', exportClassName: 'LoadTestingAgentServiceClient' }, - agent_v1_job_service: { importClassName: 'JobServiceClient', exportClassName: 'LoadTestingJobServiceClient' }, - agent_v1_monitoring_service: { importClassName: 'MonitoringServiceClient', exportClassName: 'LoadTestingMonitoringServiceClient' }, - agent_v1_test_service: { importClassName: 'TestServiceClient', exportClassName: 'LoadTestingTestServiceClient' }, - agent_v1_trail_service: { importClassName: 'TrailServiceClient', exportClassName: 'LoadTestingTrailServiceClient' }, - api_v1_agent_service: { importClassName: 'AgentServiceClient', exportClassName: 'LoadTestingApiAgentServiceClient' }, + agent_agent_registration_service: { importClassName: 'AgentRegistrationServiceClient', exportClassName: 'LoadTestingAgentRegistrationServiceClient' }, + agent_agent_service: { importClassName: 'AgentServiceClient', exportClassName: 'LoadTestingAgentServiceClient' }, + agent_job_service: { importClassName: 'JobServiceClient', exportClassName: 'LoadTestingJobServiceClient' }, + agent_monitoring_service: { importClassName: 'MonitoringServiceClient', exportClassName: 'LoadTestingMonitoringServiceClient' }, + agent_test_service: { importClassName: 'TestServiceClient', exportClassName: 'LoadTestingTestServiceClient' }, + agent_trail_service: { importClassName: 'TrailServiceClient', exportClassName: 'LoadTestingTrailServiceClient' }, + api_agent_service: { importClassName: 'AgentServiceClient', exportClassName: 'LoadTestingApiAgentServiceClient' }, }, loadbalancer: { - v1_network_load_balancer_service: { importClassName: 'NetworkLoadBalancerServiceClient' }, - v1_target_group_service: { importClassName: 'TargetGroupServiceClient' }, + network_load_balancer_service: { importClassName: 'NetworkLoadBalancerServiceClient' }, + target_group_service: { importClassName: 'TargetGroupServiceClient' }, }, lockbox: { - v1_payload_service: { importClassName: 'PayloadServiceClient' }, - v1_secret_service: { importClassName: 'SecretServiceClient' }, + payload_service: { importClassName: 'PayloadServiceClient' }, + secret_service: { importClassName: 'SecretServiceClient' }, }, logging: { - v1_log_group_service: { importClassName: 'LogGroupServiceClient' }, - v1_log_ingestion_service: { importClassName: 'LogIngestionServiceClient' }, - v1_log_reading_service: { importClassName: 'LogReadingServiceClient' }, - v1_export_service: { importClassName: 'ExportServiceClient' }, - v1_sink_service: { importClassName: 'SinkServiceClient' }, + log_group_service: { importClassName: 'LogGroupServiceClient' }, + log_ingestion_service: { importClassName: 'LogIngestionServiceClient' }, + log_reading_service: { importClassName: 'LogReadingServiceClient' }, + export_service: { importClassName: 'ExportServiceClient' }, + sink_service: { importClassName: 'SinkServiceClient' }, }, marketplace: { - metering_v1_image_product_usage_service: { importClassName: 'ImageProductUsageServiceClient', exportClassName: 'MarketplaceImageProductUsageServiceClient' }, - licensemanager_v1_instance_service: { importClassName: 'InstanceServiceClient', exportClassName: 'MarketplaceInstanceServiceClient' }, - licensemanager_v1_lock_service: { importClassName: 'LockServiceClient', exportClassName: 'MarketplaceLockServiceClient' }, + metering_image_product_usage_service: { importClassName: 'ImageProductUsageServiceClient', exportClassName: 'MarketplaceImageProductUsageServiceClient' }, + licensemanager_instance_service: { importClassName: 'InstanceServiceClient', exportClassName: 'MarketplaceInstanceServiceClient' }, + licensemanager_lock_service: { importClassName: 'LockServiceClient', exportClassName: 'MarketplaceLockServiceClient' }, v1_metering_image_product_usage_service: { importClassName: 'ImageProductUsageServiceClient', exportClassName: 'MarketplaceMeteringImageProductUsageServiceClient' }, }, mdb: { - clickhouse_v1_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'ClickHouseBackupServiceClient' }, - clickhouse_v1_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'ClickHouseClusterServiceClient' }, - clickhouse_v1_database_service: { importClassName: 'DatabaseServiceClient' }, - clickhouse_v1_format_schema_service: { importClassName: 'FormatSchemaServiceClient' }, - clickhouse_v1_ml_model_service: { importClassName: 'MlModelServiceClient' }, - clickhouse_v1_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'ClickHouseResourcePresetServiceClient' }, - clickhouse_v1_user_service: { importClassName: 'UserServiceClient', exportClassName: 'ClickHouseUserServiceClient' }, - clickhouse_v1_versions_service: { importClassName: 'VersionsServiceClient' }, - elasticsearch_v1_auth_service: { importClassName: 'AuthServiceClient' }, - elasticsearch_v1_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'ElasticBackupServiceClient' }, - elasticsearch_v1_extension_service: { importClassName: 'ExtensionServiceClient', exportClassName: 'ElasticExtensionServiceClient' }, - elasticsearch_v1_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'ElasticClusterServiceClient' }, - elasticsearch_v1_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'ElasticResourcePresetServiceClient' }, - elasticsearch_v1_user_service: { importClassName: 'UserServiceClient', exportClassName: 'ElasticUserServiceClient' }, - greenplum_v1_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'GreenplumClusterServiceClient' }, - greenplum_v1_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'GreenplumBackupServiceClient' }, - greenplum_v1_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'GreenplumResourcePresetServiceClient' }, - kafka_v1_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'KafkaClusterServiceClient' }, - kafka_v1_connector_service: { importClassName: 'ConnectorServiceClient' }, - kafka_v1_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'KafkaResourcePresetServiceClient' }, - kafka_v1_topic_service: { importClassName: 'TopicServiceClient' }, - kafka_v1_user_service: { importClassName: 'UserServiceClient', exportClassName: 'KafkaUserServiceClient' }, - mongodb_v1_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'MongoBackupServiceClient' }, - mongodb_v1_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'MongoClusterServiceClient' }, - mongodb_v1_database_service: { importClassName: 'DatabaseServiceClient', exportClassName: 'MongoDatabaseServiceClient' }, - mongodb_v1_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'MongoResourcePresetServiceClient' }, - mongodb_v1_user_service: { importClassName: 'UserServiceClient', exportClassName: 'MongoUserServiceClient' }, - mysql_v1_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'MysqlBackupServiceClient' }, - mysql_v1_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'MysqlClusterServiceClient' }, - mysql_v1_database_service: { importClassName: 'DatabaseServiceClient', exportClassName: 'MysqlDatabaseServiceClient' }, - mysql_v1_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'MysqlResourcePresetServiceClient' }, - mysql_v1_user_service: { importClassName: 'UserServiceClient', exportClassName: 'MysqlUserServiceClient' }, - opensearch_v1_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'OpenSearchBackupServiceClient' }, - opensearch_v1_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'OpenSearchClusterServiceClient' }, - opensearch_v1_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'OpenSearchResourcePresetServiceClient' }, - postgresql_v1_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'PgsqlBackupServiceClient' }, - postgresql_v1_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'PgsqlClusterServiceClient' }, - postgresql_v1_database_service: { importClassName: 'DatabaseServiceClient', exportClassName: 'PgsqlDatabaseServiceClient' }, - postgresql_v1_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'PgsqlResourcePresetServiceClient' }, - postgresql_v1_user_service: { importClassName: 'UserServiceClient', exportClassName: 'PgsqlUserServiceClient' }, - postgresql_v1_perf_diag_service: { importClassName: 'PerformanceDiagnosticsServiceClient', exportClassName: 'PgsqlPerformanceDiagnosticsServiceClient' }, - redis_v1_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'RedisBackupServiceClient' }, - redis_v1_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'RedisClusterServiceClient' }, - redis_v1_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'RedisResourcePresetServiceClient' }, - sqlserver_v1_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'SqlServerBackupServiceClient' }, - sqlserver_v1_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'SqlServerClusterServiceClient' }, - sqlserver_v1_database_service: { importClassName: 'DatabaseServiceClient', exportClassName: 'SqlServerDatabaseServiceClient' }, - sqlserver_v1_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'SqlServerResourcePresetServiceClient' }, - sqlserver_v1_user_service: { importClassName: 'UserServiceClient', exportClassName: 'SqlServerUserServiceClient' }, + clickhouse_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'ClickHouseBackupServiceClient' }, + clickhouse_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'ClickHouseClusterServiceClient' }, + clickhouse_database_service: { importClassName: 'DatabaseServiceClient' }, + clickhouse_format_schema_service: { importClassName: 'FormatSchemaServiceClient' }, + clickhouse_ml_model_service: { importClassName: 'MlModelServiceClient' }, + clickhouse_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'ClickHouseResourcePresetServiceClient' }, + clickhouse_user_service: { importClassName: 'UserServiceClient', exportClassName: 'ClickHouseUserServiceClient' }, + clickhouse_versions_service: { importClassName: 'VersionsServiceClient' }, + elasticsearch_auth_service: { importClassName: 'AuthServiceClient' }, + elasticsearch_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'ElasticBackupServiceClient' }, + elasticsearch_extension_service: { importClassName: 'ExtensionServiceClient', exportClassName: 'ElasticExtensionServiceClient' }, + elasticsearch_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'ElasticClusterServiceClient' }, + elasticsearch_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'ElasticResourcePresetServiceClient' }, + elasticsearch_user_service: { importClassName: 'UserServiceClient', exportClassName: 'ElasticUserServiceClient' }, + greenplum_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'GreenplumClusterServiceClient' }, + greenplum_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'GreenplumBackupServiceClient' }, + greenplum_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'GreenplumResourcePresetServiceClient' }, + kafka_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'KafkaClusterServiceClient' }, + kafka_connector_service: { importClassName: 'ConnectorServiceClient' }, + kafka_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'KafkaResourcePresetServiceClient' }, + kafka_topic_service: { importClassName: 'TopicServiceClient' }, + kafka_user_service: { importClassName: 'UserServiceClient', exportClassName: 'KafkaUserServiceClient' }, + mongodb_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'MongoBackupServiceClient' }, + mongodb_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'MongoClusterServiceClient' }, + mongodb_database_service: { importClassName: 'DatabaseServiceClient', exportClassName: 'MongoDatabaseServiceClient' }, + mongodb_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'MongoResourcePresetServiceClient' }, + mongodb_user_service: { importClassName: 'UserServiceClient', exportClassName: 'MongoUserServiceClient' }, + mysql_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'MysqlBackupServiceClient' }, + mysql_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'MysqlClusterServiceClient' }, + mysql_database_service: { importClassName: 'DatabaseServiceClient', exportClassName: 'MysqlDatabaseServiceClient' }, + mysql_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'MysqlResourcePresetServiceClient' }, + mysql_user_service: { importClassName: 'UserServiceClient', exportClassName: 'MysqlUserServiceClient' }, + opensearch_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'OpenSearchBackupServiceClient' }, + opensearch_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'OpenSearchClusterServiceClient' }, + opensearch_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'OpenSearchResourcePresetServiceClient' }, + postgresql_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'PgsqlBackupServiceClient' }, + postgresql_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'PgsqlClusterServiceClient' }, + postgresql_database_service: { importClassName: 'DatabaseServiceClient', exportClassName: 'PgsqlDatabaseServiceClient' }, + postgresql_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'PgsqlResourcePresetServiceClient' }, + postgresql_user_service: { importClassName: 'UserServiceClient', exportClassName: 'PgsqlUserServiceClient' }, + postgresql_perf_diag_service: { importClassName: 'PerformanceDiagnosticsServiceClient', exportClassName: 'PgsqlPerformanceDiagnosticsServiceClient' }, + redis_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'RedisBackupServiceClient' }, + redis_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'RedisClusterServiceClient' }, + redis_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'RedisResourcePresetServiceClient' }, + sqlserver_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'SqlServerBackupServiceClient' }, + sqlserver_cluster_service: { importClassName: 'ClusterServiceClient', exportClassName: 'SqlServerClusterServiceClient' }, + sqlserver_database_service: { importClassName: 'DatabaseServiceClient', exportClassName: 'SqlServerDatabaseServiceClient' }, + sqlserver_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'SqlServerResourcePresetServiceClient' }, + sqlserver_user_service: { importClassName: 'UserServiceClient', exportClassName: 'SqlServerUserServiceClient' }, }, monitoring: { v3_dashboard_service: { importClassName: 'DashboardServiceClient' }, @@ -211,42 +211,42 @@ export const servicesConfig: ServicesConfig = { operation_service: { importClassName: 'OperationServiceClient' }, }, organizationmanager: { - v1_group_service: { importClassName: 'GroupServiceClient' }, - v1_organization_service: { importClassName: 'OrganizationServiceClient' }, - v1_user_service: { importClassName: 'UserServiceClient' }, - v1_saml_certificate_service: { importClassName: 'CertificateServiceClient', exportClassName: 'OmCertificateServiceClient' }, - v1_saml_federation_service: { importClassName: 'FederationServiceClient' }, - v1_group_mapping_service: { importClassName: 'GroupMappingServiceClient' }, - v1_ssh_certificate_service: { importClassName: 'SshCertificateServiceClient' }, + group_service: { importClassName: 'GroupServiceClient' }, + organization_service: { importClassName: 'OrganizationServiceClient' }, + user_service: { importClassName: 'UserServiceClient' }, + saml_certificate_service: { importClassName: 'CertificateServiceClient', exportClassName: 'OmCertificateServiceClient' }, + saml_federation_service: { importClassName: 'FederationServiceClient' }, + group_mapping_service: { importClassName: 'GroupMappingServiceClient' }, + ssh_certificate_service: { importClassName: 'SshCertificateServiceClient' }, }, resourcemanager: { - v1_cloud_service: { importClassName: 'CloudServiceClient' }, - v1_folder_service: { importClassName: 'FolderServiceClient' }, + cloud_service: { importClassName: 'CloudServiceClient' }, + folder_service: { importClassName: 'FolderServiceClient' }, }, serverless: { - apigateway_v1_apigateway_service: { importClassName: 'ApiGatewayServiceClient' }, - containers_v1_container_service: { importClassName: 'ContainerServiceClient' }, - functions_v1_function_service: { importClassName: 'FunctionServiceClient' }, - mdbproxy_v1_proxy_service: { importClassName: 'ProxyServiceClient' }, - triggers_v1_trigger_service: { importClassName: 'TriggerServiceClient' }, - apigateway_websocket_v1_connection_service: { importClassName: 'ConnectionServiceClient', exportClassName: 'WebSocketConnectionServiceClient' }, + apigateway_apigateway_service: { importClassName: 'ApiGatewayServiceClient' }, + containers_container_service: { importClassName: 'ContainerServiceClient' }, + functions_function_service: { importClassName: 'FunctionServiceClient' }, + mdbproxy_proxy_service: { importClassName: 'ProxyServiceClient' }, + triggers_trigger_service: { importClassName: 'TriggerServiceClient' }, + apigateway_websocket_connection_service: { importClassName: 'ConnectionServiceClient', exportClassName: 'WebSocketConnectionServiceClient' }, }, storage: { - v1_bucket_service: { importClassName: 'BucketServiceClient' }, + bucket_service: { importClassName: 'BucketServiceClient' }, }, vpc: { - v1_address_service: { importClassName: 'AddressServiceClient' }, - v1_network_service: { importClassName: 'NetworkServiceClient' }, - v1_route_table_service: { importClassName: 'RouteTableServiceClient' }, - v1_security_group_service: { importClassName: 'SecurityGroupServiceClient' }, - v1_subnet_service: { importClassName: 'SubnetServiceClient' }, - v1_gateway_service: { importClassName: 'GatewayServiceClient' }, + address_service: { importClassName: 'AddressServiceClient' }, + network_service: { importClassName: 'NetworkServiceClient' }, + route_table_service: { importClassName: 'RouteTableServiceClient' }, + security_group_service: { importClassName: 'SecurityGroupServiceClient' }, + subnet_service: { importClassName: 'SubnetServiceClient' }, + gateway_service: { importClassName: 'GatewayServiceClient' }, }, ydb: { - v1_backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'YdbBackupServiceClient' }, - v1_database_service: { importClassName: 'DatabaseServiceClient', exportClassName: 'YdbDatabaseServiceClient' }, - v1_location_service: { importClassName: 'LocationServiceClient' }, - v1_resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'YdbResourcePresetServiceClient' }, - v1_storage_type_service: { importClassName: 'StorageTypeServiceClient' }, + backup_service: { importClassName: 'BackupServiceClient', exportClassName: 'YdbBackupServiceClient' }, + database_service: { importClassName: 'DatabaseServiceClient', exportClassName: 'YdbDatabaseServiceClient' }, + location_service: { importClassName: 'LocationServiceClient' }, + resource_preset_service: { importClassName: 'ResourcePresetServiceClient', exportClassName: 'YdbResourcePresetServiceClient' }, + storage_type_service: { importClassName: 'StorageTypeServiceClient' }, }, }; diff --git a/src/generated/yandex/cloud/ai/index.ts b/src/generated/yandex/cloud/ai/index.ts index 2810b1b3..8bd22a52 100644 --- a/src/generated/yandex/cloud/ai/index.ts +++ b/src/generated/yandex/cloud/ai/index.ts @@ -1,12 +1,12 @@ export * as common_common from './common/common' -export * as assistants_v1_assistant from './assistants/v1/assistant' -export * as assistants_v1_assistant_service from './assistants/v1/assistant_service' -export * as assistants_v1_common from './assistants/v1/common' -export * as files_v1_file from './files/v1/file' -export * as files_v1_file_service from './files/v1/file_service' -export * as foundation_models_v1_text_common from './foundation_models/v1/text_common' -export * as ocr_v1_ocr from './ocr/v1/ocr' -export * as ocr_v1_ocr_service from './ocr/v1/ocr_service' +export * as assistants_assistant from './assistants/v1/assistant' +export * as assistants_assistant_service from './assistants/v1/assistant_service' +export * as assistants_common from './assistants/v1/common' +export * as files_file from './files/v1/file' +export * as files_file_service from './files/v1/file_service' +export * as foundation_models_text_common from './foundation_models/v1/text_common' +export * as ocr_ocr from './ocr/v1/ocr' +export * as ocr_ocr_service from './ocr/v1/ocr_service' export * as stt_v2_stt_service from './stt/v2/stt_service' export * as stt_v3_stt from './stt/v3/stt' export * as stt_v3_stt_service from './stt/v3/stt_service' @@ -14,31 +14,31 @@ export * as translate_v2_translation from './translate/v2/translation' export * as translate_v2_translation_service from './translate/v2/translation_service' export * as tts_v3_tts from './tts/v3/tts' export * as tts_v3_tts_service from './tts/v3/tts_service' -export * as vision_v1_classification from './vision/v1/classification' -export * as vision_v1_face_detection from './vision/v1/face_detection' -export * as vision_v1_image_copy_search from './vision/v1/image_copy_search' -export * as vision_v1_primitives from './vision/v1/primitives' -export * as vision_v1_text_detection from './vision/v1/text_detection' -export * as vision_v1_vision_service from './vision/v1/vision_service' +export * as vision_classification from './vision/v1/classification' +export * as vision_face_detection from './vision/v1/face_detection' +export * as vision_image_copy_search from './vision/v1/image_copy_search' +export * as vision_primitives from './vision/v1/primitives' +export * as vision_text_detection from './vision/v1/text_detection' +export * as vision_vision_service from './vision/v1/vision_service' export * as vision_v2_image from './vision/v2/image' export * as vision_v2_image_classifier from './vision/v2/image_classifier' export * as vision_v2_image_classifier_service from './vision/v2/image_classifier_service' -export * as assistants_v1_runs_run from './assistants/v1/runs/run' -export * as assistants_v1_runs_run_service from './assistants/v1/runs/run_service' -export * as assistants_v1_searchindex_common from './assistants/v1/searchindex/common' -export * as assistants_v1_searchindex_search_index from './assistants/v1/searchindex/search_index' -export * as assistants_v1_searchindex_search_index_file from './assistants/v1/searchindex/search_index_file' -export * as assistants_v1_searchindex_search_index_file_service from './assistants/v1/searchindex/search_index_file_service' -export * as assistants_v1_searchindex_search_index_service from './assistants/v1/searchindex/search_index_service' -export * as assistants_v1_threads_message from './assistants/v1/threads/message' -export * as assistants_v1_threads_message_service from './assistants/v1/threads/message_service' -export * as assistants_v1_threads_thread from './assistants/v1/threads/thread' -export * as assistants_v1_threads_thread_service from './assistants/v1/threads/thread_service' -export * as assistants_v1_users_user from './assistants/v1/users/user' -export * as assistants_v1_users_user_service from './assistants/v1/users/user_service' -export * as foundation_models_v1_embedding_embedding_service from './foundation_models/v1/embedding/embedding_service' -export * as foundation_models_v1_image_generation_image_generation from './foundation_models/v1/image_generation/image_generation' -export * as foundation_models_v1_image_generation_image_generation_service from './foundation_models/v1/image_generation/image_generation_service' -export * as foundation_models_v1_text_classification_text_classification from './foundation_models/v1/text_classification/text_classification' -export * as foundation_models_v1_text_classification_text_classification_service from './foundation_models/v1/text_classification/text_classification_service' -export * as foundation_models_v1_text_generation_text_generation_service from './foundation_models/v1/text_generation/text_generation_service' \ No newline at end of file +export * as assistants_runs_run from './assistants/v1/runs/run' +export * as assistants_runs_run_service from './assistants/v1/runs/run_service' +export * as assistants_searchindex_common from './assistants/v1/searchindex/common' +export * as assistants_searchindex_search_index from './assistants/v1/searchindex/search_index' +export * as assistants_searchindex_search_index_file from './assistants/v1/searchindex/search_index_file' +export * as assistants_searchindex_search_index_file_service from './assistants/v1/searchindex/search_index_file_service' +export * as assistants_searchindex_search_index_service from './assistants/v1/searchindex/search_index_service' +export * as assistants_threads_message from './assistants/v1/threads/message' +export * as assistants_threads_message_service from './assistants/v1/threads/message_service' +export * as assistants_threads_thread from './assistants/v1/threads/thread' +export * as assistants_threads_thread_service from './assistants/v1/threads/thread_service' +export * as assistants_users_user from './assistants/v1/users/user' +export * as assistants_users_user_service from './assistants/v1/users/user_service' +export * as foundation_models_embedding_embedding_service from './foundation_models/v1/embedding/embedding_service' +export * as foundation_models_image_generation_image_generation from './foundation_models/v1/image_generation/image_generation' +export * as foundation_models_image_generation_image_generation_service from './foundation_models/v1/image_generation/image_generation_service' +export * as foundation_models_text_classification_text_classification from './foundation_models/v1/text_classification/text_classification' +export * as foundation_models_text_classification_text_classification_service from './foundation_models/v1/text_classification/text_classification_service' +export * as foundation_models_text_generation_text_generation_service from './foundation_models/v1/text_generation/text_generation_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/airflow/index.ts b/src/generated/yandex/cloud/airflow/index.ts index 62a779ed..1e33b554 100644 --- a/src/generated/yandex/cloud/airflow/index.ts +++ b/src/generated/yandex/cloud/airflow/index.ts @@ -1,3 +1,3 @@ -export * as v1_cluster from './v1/cluster' -export * as v1_cluster_service from './v1/cluster_service' -export * as v1_common from './v1/common' \ No newline at end of file +export * as cluster from './v1/cluster' +export * as cluster_service from './v1/cluster_service' +export * as common from './v1/common' \ No newline at end of file diff --git a/src/generated/yandex/cloud/apploadbalancer/index.ts b/src/generated/yandex/cloud/apploadbalancer/index.ts index 3877c391..2f8de2fe 100644 --- a/src/generated/yandex/cloud/apploadbalancer/index.ts +++ b/src/generated/yandex/cloud/apploadbalancer/index.ts @@ -1,13 +1,13 @@ -export * as v1_backend_group from './v1/backend_group' -export * as v1_backend_group_service from './v1/backend_group_service' -export * as v1_http_router from './v1/http_router' -export * as v1_http_router_service from './v1/http_router_service' -export * as v1_load_balancer from './v1/load_balancer' -export * as v1_load_balancer_service from './v1/load_balancer_service' -export * as v1_logging from './v1/logging' -export * as v1_payload from './v1/payload' -export * as v1_target_group from './v1/target_group' -export * as v1_target_group_service from './v1/target_group_service' -export * as v1_tls from './v1/tls' -export * as v1_virtual_host from './v1/virtual_host' -export * as v1_virtual_host_service from './v1/virtual_host_service' \ No newline at end of file +export * as backend_group from './v1/backend_group' +export * as backend_group_service from './v1/backend_group_service' +export * as http_router from './v1/http_router' +export * as http_router_service from './v1/http_router_service' +export * as load_balancer from './v1/load_balancer' +export * as load_balancer_service from './v1/load_balancer_service' +export * as logging from './v1/logging' +export * as payload from './v1/payload' +export * as target_group from './v1/target_group' +export * as target_group_service from './v1/target_group_service' +export * as tls from './v1/tls' +export * as virtual_host from './v1/virtual_host' +export * as virtual_host_service from './v1/virtual_host_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/audittrails/index.ts b/src/generated/yandex/cloud/audittrails/index.ts index 7fece359..9561a702 100644 --- a/src/generated/yandex/cloud/audittrails/index.ts +++ b/src/generated/yandex/cloud/audittrails/index.ts @@ -1,2 +1,2 @@ -export * as v1_trail from './v1/trail' -export * as v1_trail_service from './v1/trail_service' \ No newline at end of file +export * as trail from './v1/trail' +export * as trail_service from './v1/trail_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/backup/index.ts b/src/generated/yandex/cloud/backup/index.ts index 50390be2..1b05d72e 100644 --- a/src/generated/yandex/cloud/backup/index.ts +++ b/src/generated/yandex/cloud/backup/index.ts @@ -1,7 +1,7 @@ -export * as v1_backup from './v1/backup' -export * as v1_backup_service from './v1/backup_service' -export * as v1_policy from './v1/policy' -export * as v1_policy_service from './v1/policy_service' -export * as v1_provider_service from './v1/provider_service' -export * as v1_resource from './v1/resource' -export * as v1_resource_service from './v1/resource_service' \ No newline at end of file +export * as backup from './v1/backup' +export * as backup_service from './v1/backup_service' +export * as policy from './v1/policy' +export * as policy_service from './v1/policy_service' +export * as provider_service from './v1/provider_service' +export * as resource from './v1/resource' +export * as resource_service from './v1/resource_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/billing/index.ts b/src/generated/yandex/cloud/billing/index.ts index c5672a3c..1567d331 100644 --- a/src/generated/yandex/cloud/billing/index.ts +++ b/src/generated/yandex/cloud/billing/index.ts @@ -1,11 +1,11 @@ -export * as v1_billable_object from './v1/billable_object' -export * as v1_billing_account from './v1/billing_account' -export * as v1_billing_account_service from './v1/billing_account_service' -export * as v1_budget from './v1/budget' -export * as v1_budget_service from './v1/budget_service' -export * as v1_customer from './v1/customer' -export * as v1_customer_service from './v1/customer_service' -export * as v1_service from './v1/service' -export * as v1_service_service from './v1/service_service' -export * as v1_sku from './v1/sku' -export * as v1_sku_service from './v1/sku_service' \ No newline at end of file +export * as billable_object from './v1/billable_object' +export * as billing_account from './v1/billing_account' +export * as billing_account_service from './v1/billing_account_service' +export * as budget from './v1/budget' +export * as budget_service from './v1/budget_service' +export * as customer from './v1/customer' +export * as customer_service from './v1/customer_service' +export * as service from './v1/service' +export * as service_service from './v1/service_service' +export * as sku from './v1/sku' +export * as sku_service from './v1/sku_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/cdn/index.ts b/src/generated/yandex/cloud/cdn/index.ts index 85b3f49b..dbf2a643 100644 --- a/src/generated/yandex/cloud/cdn/index.ts +++ b/src/generated/yandex/cloud/cdn/index.ts @@ -1,12 +1,12 @@ -export * as v1_cache_service from './v1/cache_service' -export * as v1_origin from './v1/origin' -export * as v1_origin_group from './v1/origin_group' -export * as v1_origin_group_service from './v1/origin_group_service' -export * as v1_origin_service from './v1/origin_service' -export * as v1_provider_service from './v1/provider_service' -export * as v1_raw_logs from './v1/raw_logs' -export * as v1_raw_logs_service from './v1/raw_logs_service' -export * as v1_resource from './v1/resource' -export * as v1_resource_service from './v1/resource_service' -export * as v1_rule from './v1/rule' -export * as v1_rule_service from './v1/rule_service' \ No newline at end of file +export * as cache_service from './v1/cache_service' +export * as origin from './v1/origin' +export * as origin_group from './v1/origin_group' +export * as origin_group_service from './v1/origin_group_service' +export * as origin_service from './v1/origin_service' +export * as provider_service from './v1/provider_service' +export * as raw_logs from './v1/raw_logs' +export * as raw_logs_service from './v1/raw_logs_service' +export * as resource from './v1/resource' +export * as resource_service from './v1/resource_service' +export * as rule from './v1/rule' +export * as rule_service from './v1/rule_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/certificatemanager/index.ts b/src/generated/yandex/cloud/certificatemanager/index.ts index 995ea89a..8af2db83 100644 --- a/src/generated/yandex/cloud/certificatemanager/index.ts +++ b/src/generated/yandex/cloud/certificatemanager/index.ts @@ -1,3 +1,3 @@ -export * as v1_certificate from './v1/certificate' -export * as v1_certificate_content_service from './v1/certificate_content_service' -export * as v1_certificate_service from './v1/certificate_service' \ No newline at end of file +export * as certificate from './v1/certificate' +export * as certificate_content_service from './v1/certificate_content_service' +export * as certificate_service from './v1/certificate_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/cic/index.ts b/src/generated/yandex/cloud/cic/index.ts index 5774becd..59ad2231 100644 --- a/src/generated/yandex/cloud/cic/index.ts +++ b/src/generated/yandex/cloud/cic/index.ts @@ -1,14 +1,14 @@ -export * as v1_partner from './v1/partner' -export * as v1_partner_service from './v1/partner_service' -export * as v1_peering from './v1/peering' -export * as v1_point_of_presence from './v1/point_of_presence' -export * as v1_point_of_presence_service from './v1/point_of_presence_service' -export * as v1_private_connection from './v1/private_connection' -export * as v1_private_connection_service from './v1/private_connection_service' -export * as v1_public_connection from './v1/public_connection' -export * as v1_public_connection_service from './v1/public_connection_service' -export * as v1_trunk_connection from './v1/trunk_connection' -export * as v1_trunk_connection_service from './v1/trunk_connection_service' -export * as v1_common_lag_allocation_settings from './v1/common/lag_allocation_settings' -export * as v1_common_lag_info from './v1/common/lag_info' -export * as v1_common_transceiver_type from './v1/common/transceiver_type' \ No newline at end of file +export * as partner from './v1/partner' +export * as partner_service from './v1/partner_service' +export * as peering from './v1/peering' +export * as point_of_presence from './v1/point_of_presence' +export * as point_of_presence_service from './v1/point_of_presence_service' +export * as private_connection from './v1/private_connection' +export * as private_connection_service from './v1/private_connection_service' +export * as public_connection from './v1/public_connection' +export * as public_connection_service from './v1/public_connection_service' +export * as trunk_connection from './v1/trunk_connection' +export * as trunk_connection_service from './v1/trunk_connection_service' +export * as common_lag_allocation_settings from './v1/common/lag_allocation_settings' +export * as common_lag_info from './v1/common/lag_info' +export * as common_transceiver_type from './v1/common/transceiver_type' \ No newline at end of file diff --git a/src/generated/yandex/cloud/cloudapps/index.ts b/src/generated/yandex/cloud/cloudapps/index.ts index 37f6f277..e79bc186 100644 --- a/src/generated/yandex/cloud/cloudapps/index.ts +++ b/src/generated/yandex/cloud/cloudapps/index.ts @@ -1,2 +1,2 @@ -export * as workload_v1_cloud_application from './workload/v1/cloud_application' -export * as workload_v1_cloud_application_service from './workload/v1/cloud_application_service' \ No newline at end of file +export * as workload_cloud_application from './workload/v1/cloud_application' +export * as workload_cloud_application_service from './workload/v1/cloud_application_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/cloudrouter/index.ts b/src/generated/yandex/cloud/cloudrouter/index.ts index 8989a93f..e96ba1bd 100644 --- a/src/generated/yandex/cloud/cloudrouter/index.ts +++ b/src/generated/yandex/cloud/cloudrouter/index.ts @@ -1,2 +1,2 @@ -export * as v1_routing_instance from './v1/routing_instance' -export * as v1_routing_instance_service from './v1/routing_instance_service' \ No newline at end of file +export * as routing_instance from './v1/routing_instance' +export * as routing_instance_service from './v1/routing_instance_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/compute/index.ts b/src/generated/yandex/cloud/compute/index.ts index 62e95453..5897b1c1 100644 --- a/src/generated/yandex/cloud/compute/index.ts +++ b/src/generated/yandex/cloud/compute/index.ts @@ -1,30 +1,30 @@ -export * as v1_disk from './v1/disk' -export * as v1_disk_placement_group from './v1/disk_placement_group' -export * as v1_disk_placement_group_service from './v1/disk_placement_group_service' -export * as v1_disk_service from './v1/disk_service' -export * as v1_disk_type from './v1/disk_type' -export * as v1_disk_type_service from './v1/disk_type_service' -export * as v1_filesystem from './v1/filesystem' -export * as v1_filesystem_service from './v1/filesystem_service' -export * as v1_gpu_cluster from './v1/gpu_cluster' -export * as v1_gpu_cluster_service from './v1/gpu_cluster_service' -export * as v1_hardware_generation from './v1/hardware_generation' -export * as v1_host_group from './v1/host_group' -export * as v1_host_group_service from './v1/host_group_service' -export * as v1_host_type from './v1/host_type' -export * as v1_host_type_service from './v1/host_type_service' -export * as v1_image from './v1/image' -export * as v1_image_service from './v1/image_service' -export * as v1_instance from './v1/instance' -export * as v1_instance_service from './v1/instance_service' -export * as v1_maintenance from './v1/maintenance' -export * as v1_placement_group from './v1/placement_group' -export * as v1_placement_group_service from './v1/placement_group_service' -export * as v1_snapshot from './v1/snapshot' -export * as v1_snapshot_schedule from './v1/snapshot_schedule' -export * as v1_snapshot_schedule_service from './v1/snapshot_schedule_service' -export * as v1_snapshot_service from './v1/snapshot_service' -export * as v1_zone from './v1/zone' -export * as v1_zone_service from './v1/zone_service' -export * as v1_instancegroup_instance_group from './v1/instancegroup/instance_group' -export * as v1_instancegroup_instance_group_service from './v1/instancegroup/instance_group_service' \ No newline at end of file +export * as disk from './v1/disk' +export * as disk_placement_group from './v1/disk_placement_group' +export * as disk_placement_group_service from './v1/disk_placement_group_service' +export * as disk_service from './v1/disk_service' +export * as disk_type from './v1/disk_type' +export * as disk_type_service from './v1/disk_type_service' +export * as filesystem from './v1/filesystem' +export * as filesystem_service from './v1/filesystem_service' +export * as gpu_cluster from './v1/gpu_cluster' +export * as gpu_cluster_service from './v1/gpu_cluster_service' +export * as hardware_generation from './v1/hardware_generation' +export * as host_group from './v1/host_group' +export * as host_group_service from './v1/host_group_service' +export * as host_type from './v1/host_type' +export * as host_type_service from './v1/host_type_service' +export * as image from './v1/image' +export * as image_service from './v1/image_service' +export * as instance from './v1/instance' +export * as instance_service from './v1/instance_service' +export * as maintenance from './v1/maintenance' +export * as placement_group from './v1/placement_group' +export * as placement_group_service from './v1/placement_group_service' +export * as snapshot from './v1/snapshot' +export * as snapshot_schedule from './v1/snapshot_schedule' +export * as snapshot_schedule_service from './v1/snapshot_schedule_service' +export * as snapshot_service from './v1/snapshot_service' +export * as zone from './v1/zone' +export * as zone_service from './v1/zone_service' +export * as instancegroup_instance_group from './v1/instancegroup/instance_group' +export * as instancegroup_instance_group_service from './v1/instancegroup/instance_group_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/containerregistry/index.ts b/src/generated/yandex/cloud/containerregistry/index.ts index 21e3f45a..a185598e 100644 --- a/src/generated/yandex/cloud/containerregistry/index.ts +++ b/src/generated/yandex/cloud/containerregistry/index.ts @@ -1,14 +1,14 @@ -export * as v1_blob from './v1/blob' -export * as v1_image from './v1/image' -export * as v1_image_service from './v1/image_service' -export * as v1_ip_permission from './v1/ip_permission' -export * as v1_lifecycle_policy from './v1/lifecycle_policy' -export * as v1_lifecycle_policy_service from './v1/lifecycle_policy_service' -export * as v1_registry from './v1/registry' -export * as v1_registry_service from './v1/registry_service' -export * as v1_repository from './v1/repository' -export * as v1_repository_service from './v1/repository_service' -export * as v1_scan_policy from './v1/scan_policy' -export * as v1_scan_policy_service from './v1/scan_policy_service' -export * as v1_scanner from './v1/scanner' -export * as v1_scanner_service from './v1/scanner_service' \ No newline at end of file +export * as blob from './v1/blob' +export * as image from './v1/image' +export * as image_service from './v1/image_service' +export * as ip_permission from './v1/ip_permission' +export * as lifecycle_policy from './v1/lifecycle_policy' +export * as lifecycle_policy_service from './v1/lifecycle_policy_service' +export * as registry from './v1/registry' +export * as registry_service from './v1/registry_service' +export * as repository from './v1/repository' +export * as repository_service from './v1/repository_service' +export * as scan_policy from './v1/scan_policy' +export * as scan_policy_service from './v1/scan_policy_service' +export * as scanner from './v1/scanner' +export * as scanner_service from './v1/scanner_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/dataproc/index.ts b/src/generated/yandex/cloud/dataproc/index.ts index 92d2579a..80ade450 100644 --- a/src/generated/yandex/cloud/dataproc/index.ts +++ b/src/generated/yandex/cloud/dataproc/index.ts @@ -1,12 +1,12 @@ -export * as v1_cluster from './v1/cluster' -export * as v1_cluster_service from './v1/cluster_service' -export * as v1_common from './v1/common' -export * as v1_job from './v1/job' -export * as v1_job_service from './v1/job_service' -export * as v1_resource_preset from './v1/resource_preset' -export * as v1_resource_preset_service from './v1/resource_preset_service' -export * as v1_subcluster from './v1/subcluster' -export * as v1_subcluster_service from './v1/subcluster_service' -export * as manager_v1_job from './manager/v1/job' -export * as manager_v1_job_service from './manager/v1/job_service' -export * as manager_v1_manager_service from './manager/v1/manager_service' \ No newline at end of file +export * as cluster from './v1/cluster' +export * as cluster_service from './v1/cluster_service' +export * as common from './v1/common' +export * as job from './v1/job' +export * as job_service from './v1/job_service' +export * as resource_preset from './v1/resource_preset' +export * as resource_preset_service from './v1/resource_preset_service' +export * as subcluster from './v1/subcluster' +export * as subcluster_service from './v1/subcluster_service' +export * as manager_job from './manager/v1/job' +export * as manager_job_service from './manager/v1/job_service' +export * as manager_manager_service from './manager/v1/manager_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/datasphere/index.ts b/src/generated/yandex/cloud/datasphere/index.ts index 76f3e65f..803250ed 100644 --- a/src/generated/yandex/cloud/datasphere/index.ts +++ b/src/generated/yandex/cloud/datasphere/index.ts @@ -1,10 +1,10 @@ -export * as v1_app_token_service from './v1/app_token_service' -export * as v1_folder_budget_service from './v1/folder_budget_service' -export * as v1_node_execution_error_details from './v1/node_execution_error_details' -export * as v1_node_service from './v1/node_service' -export * as v1_project from './v1/project' -export * as v1_project_data_service from './v1/project_data_service' -export * as v1_project_service from './v1/project_service' +export * as app_token_service from './v1/app_token_service' +export * as folder_budget_service from './v1/folder_budget_service' +export * as node_execution_error_details from './v1/node_execution_error_details' +export * as node_service from './v1/node_service' +export * as project from './v1/project' +export * as project_data_service from './v1/project_data_service' +export * as project_service from './v1/project_service' export * as v2_community from './v2/community' export * as v2_community_service from './v2/community_service' export * as v2_dataset from './v2/dataset' diff --git a/src/generated/yandex/cloud/datatransfer/index.ts b/src/generated/yandex/cloud/datatransfer/index.ts index 79793a70..91df0f77 100644 --- a/src/generated/yandex/cloud/datatransfer/index.ts +++ b/src/generated/yandex/cloud/datatransfer/index.ts @@ -1,15 +1,15 @@ -export * as v1_endpoint from './v1/endpoint' -export * as v1_endpoint_service from './v1/endpoint_service' -export * as v1_transfer from './v1/transfer' -export * as v1_transfer_service from './v1/transfer_service' -export * as v1_endpoint_clickhouse from './v1/endpoint/clickhouse' -export * as v1_endpoint_common from './v1/endpoint/common' -export * as v1_endpoint_kafka from './v1/endpoint/kafka' -export * as v1_endpoint_metrika from './v1/endpoint/metrika' -export * as v1_endpoint_mongo from './v1/endpoint/mongo' -export * as v1_endpoint_mysql from './v1/endpoint/mysql' -export * as v1_endpoint_parsers from './v1/endpoint/parsers' -export * as v1_endpoint_postgres from './v1/endpoint/postgres' -export * as v1_endpoint_serializers from './v1/endpoint/serializers' -export * as v1_endpoint_ydb from './v1/endpoint/ydb' -export * as v1_endpoint_yds from './v1/endpoint/yds' \ No newline at end of file +export * as endpoint from './v1/endpoint' +export * as endpoint_service from './v1/endpoint_service' +export * as transfer from './v1/transfer' +export * as transfer_service from './v1/transfer_service' +export * as endpoint_clickhouse from './v1/endpoint/clickhouse' +export * as endpoint_common from './v1/endpoint/common' +export * as endpoint_kafka from './v1/endpoint/kafka' +export * as endpoint_metrika from './v1/endpoint/metrika' +export * as endpoint_mongo from './v1/endpoint/mongo' +export * as endpoint_mysql from './v1/endpoint/mysql' +export * as endpoint_parsers from './v1/endpoint/parsers' +export * as endpoint_postgres from './v1/endpoint/postgres' +export * as endpoint_serializers from './v1/endpoint/serializers' +export * as endpoint_ydb from './v1/endpoint/ydb' +export * as endpoint_yds from './v1/endpoint/yds' \ No newline at end of file diff --git a/src/generated/yandex/cloud/dns/index.ts b/src/generated/yandex/cloud/dns/index.ts index f62c8b7f..f67da9ef 100644 --- a/src/generated/yandex/cloud/dns/index.ts +++ b/src/generated/yandex/cloud/dns/index.ts @@ -1,2 +1,2 @@ -export * as v1_dns_zone from './v1/dns_zone' -export * as v1_dns_zone_service from './v1/dns_zone_service' \ No newline at end of file +export * as dns_zone from './v1/dns_zone' +export * as dns_zone_service from './v1/dns_zone_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/iam/index.ts b/src/generated/yandex/cloud/iam/index.ts index 2506f5ae..2f51d79d 100644 --- a/src/generated/yandex/cloud/iam/index.ts +++ b/src/generated/yandex/cloud/iam/index.ts @@ -1,23 +1,23 @@ -export * as v1_api_key from './v1/api_key' -export * as v1_api_key_service from './v1/api_key_service' -export * as v1_iam_token_service from './v1/iam_token_service' -export * as v1_key from './v1/key' -export * as v1_key_service from './v1/key_service' -export * as v1_refresh_token from './v1/refresh_token' -export * as v1_refresh_token_service from './v1/refresh_token_service' -export * as v1_resource from './v1/resource' -export * as v1_role from './v1/role' -export * as v1_role_service from './v1/role_service' -export * as v1_service_account from './v1/service_account' -export * as v1_service_account_service from './v1/service_account_service' -export * as v1_service_control from './v1/service_control' -export * as v1_service_control_service from './v1/service_control_service' -export * as v1_user_account from './v1/user_account' -export * as v1_user_account_service from './v1/user_account_service' -export * as v1_yandex_passport_user_account_service from './v1/yandex_passport_user_account_service' -export * as v1_awscompatibility_access_key from './v1/awscompatibility/access_key' -export * as v1_awscompatibility_access_key_service from './v1/awscompatibility/access_key_service' -export * as v1_workload_federated_credential from './v1/workload/federated_credential' -export * as v1_workload_federated_credential_service from './v1/workload/federated_credential_service' -export * as v1_workload_oidc_federation from './v1/workload/oidc/federation' -export * as v1_workload_oidc_federation_service from './v1/workload/oidc/federation_service' \ No newline at end of file +export * as api_key from './v1/api_key' +export * as api_key_service from './v1/api_key_service' +export * as iam_token_service from './v1/iam_token_service' +export * as key from './v1/key' +export * as key_service from './v1/key_service' +export * as refresh_token from './v1/refresh_token' +export * as refresh_token_service from './v1/refresh_token_service' +export * as resource from './v1/resource' +export * as role from './v1/role' +export * as role_service from './v1/role_service' +export * as service_account from './v1/service_account' +export * as service_account_service from './v1/service_account_service' +export * as service_control from './v1/service_control' +export * as service_control_service from './v1/service_control_service' +export * as user_account from './v1/user_account' +export * as user_account_service from './v1/user_account_service' +export * as yandex_passport_user_account_service from './v1/yandex_passport_user_account_service' +export * as awscompatibility_access_key from './v1/awscompatibility/access_key' +export * as awscompatibility_access_key_service from './v1/awscompatibility/access_key_service' +export * as workload_federated_credential from './v1/workload/federated_credential' +export * as workload_federated_credential_service from './v1/workload/federated_credential_service' +export * as workload_oidc_federation from './v1/workload/oidc/federation' +export * as workload_oidc_federation_service from './v1/workload/oidc/federation_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/iot/index.ts b/src/generated/yandex/cloud/iot/index.ts index 933e25e3..b4d399f4 100644 --- a/src/generated/yandex/cloud/iot/index.ts +++ b/src/generated/yandex/cloud/iot/index.ts @@ -1,9 +1,9 @@ -export * as broker_v1_broker from './broker/v1/broker' -export * as broker_v1_broker_data_service from './broker/v1/broker_data_service' -export * as broker_v1_broker_service from './broker/v1/broker_service' -export * as devices_v1_device from './devices/v1/device' -export * as devices_v1_device_data_service from './devices/v1/device_data_service' -export * as devices_v1_device_service from './devices/v1/device_service' -export * as devices_v1_registry from './devices/v1/registry' -export * as devices_v1_registry_data_service from './devices/v1/registry_data_service' -export * as devices_v1_registry_service from './devices/v1/registry_service' \ No newline at end of file +export * as broker_broker from './broker/v1/broker' +export * as broker_broker_data_service from './broker/v1/broker_data_service' +export * as broker_broker_service from './broker/v1/broker_service' +export * as devices_device from './devices/v1/device' +export * as devices_device_data_service from './devices/v1/device_data_service' +export * as devices_device_service from './devices/v1/device_service' +export * as devices_registry from './devices/v1/registry' +export * as devices_registry_data_service from './devices/v1/registry_data_service' +export * as devices_registry_service from './devices/v1/registry_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/k8s/index.ts b/src/generated/yandex/cloud/k8s/index.ts index 371cf37a..c93a9f2a 100644 --- a/src/generated/yandex/cloud/k8s/index.ts +++ b/src/generated/yandex/cloud/k8s/index.ts @@ -1,10 +1,10 @@ -export * as v1_cluster from './v1/cluster' -export * as v1_cluster_service from './v1/cluster_service' -export * as v1_maintenance from './v1/maintenance' -export * as v1_node from './v1/node' -export * as v1_node_group from './v1/node_group' -export * as v1_node_group_service from './v1/node_group_service' -export * as v1_version from './v1/version' -export * as v1_version_service from './v1/version_service' -export * as marketplace_v1_helm_release from './marketplace/v1/helm_release' -export * as marketplace_v1_helm_release_service from './marketplace/v1/helm_release_service' \ No newline at end of file +export * as cluster from './v1/cluster' +export * as cluster_service from './v1/cluster_service' +export * as maintenance from './v1/maintenance' +export * as node from './v1/node' +export * as node_group from './v1/node_group' +export * as node_group_service from './v1/node_group_service' +export * as version from './v1/version' +export * as version_service from './v1/version_service' +export * as marketplace_helm_release from './marketplace/v1/helm_release' +export * as marketplace_helm_release_service from './marketplace/v1/helm_release_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/kms/index.ts b/src/generated/yandex/cloud/kms/index.ts index 718425f4..2ef06d78 100644 --- a/src/generated/yandex/cloud/kms/index.ts +++ b/src/generated/yandex/cloud/kms/index.ts @@ -1,9 +1,9 @@ -export * as v1_symmetric_crypto_service from './v1/symmetric_crypto_service' -export * as v1_symmetric_key from './v1/symmetric_key' -export * as v1_symmetric_key_service from './v1/symmetric_key_service' -export * as v1_asymmetricencryption_asymmetric_encryption_crypto_service from './v1/asymmetricencryption/asymmetric_encryption_crypto_service' -export * as v1_asymmetricencryption_asymmetric_encryption_key from './v1/asymmetricencryption/asymmetric_encryption_key' -export * as v1_asymmetricencryption_asymmetric_encryption_key_service from './v1/asymmetricencryption/asymmetric_encryption_key_service' -export * as v1_asymmetricsignature_asymmetric_signature_crypto_service from './v1/asymmetricsignature/asymmetric_signature_crypto_service' -export * as v1_asymmetricsignature_asymmetric_signature_key from './v1/asymmetricsignature/asymmetric_signature_key' -export * as v1_asymmetricsignature_asymmetric_signature_key_service from './v1/asymmetricsignature/asymmetric_signature_key_service' \ No newline at end of file +export * as symmetric_crypto_service from './v1/symmetric_crypto_service' +export * as symmetric_key from './v1/symmetric_key' +export * as symmetric_key_service from './v1/symmetric_key_service' +export * as asymmetricencryption_asymmetric_encryption_crypto_service from './v1/asymmetricencryption/asymmetric_encryption_crypto_service' +export * as asymmetricencryption_asymmetric_encryption_key from './v1/asymmetricencryption/asymmetric_encryption_key' +export * as asymmetricencryption_asymmetric_encryption_key_service from './v1/asymmetricencryption/asymmetric_encryption_key_service' +export * as asymmetricsignature_asymmetric_signature_crypto_service from './v1/asymmetricsignature/asymmetric_signature_crypto_service' +export * as asymmetricsignature_asymmetric_signature_key from './v1/asymmetricsignature/asymmetric_signature_key' +export * as asymmetricsignature_asymmetric_signature_key_service from './v1/asymmetricsignature/asymmetric_signature_key_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/loadbalancer/index.ts b/src/generated/yandex/cloud/loadbalancer/index.ts index 368dbfd3..917233d4 100644 --- a/src/generated/yandex/cloud/loadbalancer/index.ts +++ b/src/generated/yandex/cloud/loadbalancer/index.ts @@ -1,5 +1,5 @@ -export * as v1_health_check from './v1/health_check' -export * as v1_network_load_balancer from './v1/network_load_balancer' -export * as v1_network_load_balancer_service from './v1/network_load_balancer_service' -export * as v1_target_group from './v1/target_group' -export * as v1_target_group_service from './v1/target_group_service' \ No newline at end of file +export * as health_check from './v1/health_check' +export * as network_load_balancer from './v1/network_load_balancer' +export * as network_load_balancer_service from './v1/network_load_balancer_service' +export * as target_group from './v1/target_group' +export * as target_group_service from './v1/target_group_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/loadtesting/index.ts b/src/generated/yandex/cloud/loadtesting/index.ts index 7d3fe9c2..ae05a2ee 100644 --- a/src/generated/yandex/cloud/loadtesting/index.ts +++ b/src/generated/yandex/cloud/loadtesting/index.ts @@ -1,36 +1,36 @@ -export * as agent_v1_agent from './agent/v1/agent' -export * as agent_v1_agent_registration_service from './agent/v1/agent_registration_service' -export * as agent_v1_agent_service from './agent/v1/agent_service' -export * as agent_v1_job_service from './agent/v1/job_service' -export * as agent_v1_monitoring_service from './agent/v1/monitoring_service' -export * as agent_v1_test from './agent/v1/test' -export * as agent_v1_test_service from './agent/v1/test_service' -export * as agent_v1_trail_service from './agent/v1/trail_service' -export * as api_v1_agent_service from './api/v1/agent_service' -export * as api_v1_config_service from './api/v1/config_service' -export * as api_v1_regression_dashboard_service from './api/v1/regression_dashboard_service' -export * as api_v1_report_service from './api/v1/report_service' -export * as api_v1_test_service from './api/v1/test_service' -export * as api_v1_agent_agent from './api/v1/agent/agent' -export * as api_v1_agent_create_compute_instance from './api/v1/agent/create_compute_instance' -export * as api_v1_agent_log_settings from './api/v1/agent/log_settings' -export * as api_v1_agent_status from './api/v1/agent/status' -export * as api_v1_common_quantiles from './api/v1/common/quantiles' -export * as api_v1_common_tag from './api/v1/common/tag' -export * as api_v1_config_config from './api/v1/config/config' -export * as api_v1_regression_dashboard from './api/v1/regression/dashboard' -export * as api_v1_regression_widget from './api/v1/regression/widget' -export * as api_v1_report_kpi from './api/v1/report/kpi' -export * as api_v1_report_kpi_value from './api/v1/report/kpi_value' -export * as api_v1_report_status from './api/v1/report/status' -export * as api_v1_test_agent_selector from './api/v1/test/agent_selector' -export * as api_v1_test_artifact_settings from './api/v1/test/artifact_settings' -export * as api_v1_test_details from './api/v1/test/details' -export * as api_v1_test_file_pointer from './api/v1/test/file_pointer' -export * as api_v1_test_imbalance_point from './api/v1/test/imbalance_point' -export * as api_v1_test_object_storage from './api/v1/test/object_storage' -export * as api_v1_test_single_agent_configuration from './api/v1/test/single_agent_configuration' -export * as api_v1_test_status from './api/v1/test/status' -export * as api_v1_test_summary from './api/v1/test/summary' -export * as api_v1_test_test from './api/v1/test/test' -export * as api_v1_report_table_report from './api/v1/report/table/report' \ No newline at end of file +export * as agent_agent from './agent/v1/agent' +export * as agent_agent_registration_service from './agent/v1/agent_registration_service' +export * as agent_agent_service from './agent/v1/agent_service' +export * as agent_job_service from './agent/v1/job_service' +export * as agent_monitoring_service from './agent/v1/monitoring_service' +export * as agent_test from './agent/v1/test' +export * as agent_test_service from './agent/v1/test_service' +export * as agent_trail_service from './agent/v1/trail_service' +export * as api_agent_service from './api/v1/agent_service' +export * as api_config_service from './api/v1/config_service' +export * as api_regression_dashboard_service from './api/v1/regression_dashboard_service' +export * as api_report_service from './api/v1/report_service' +export * as api_test_service from './api/v1/test_service' +export * as api_agent_agent from './api/v1/agent/agent' +export * as api_agent_create_compute_instance from './api/v1/agent/create_compute_instance' +export * as api_agent_log_settings from './api/v1/agent/log_settings' +export * as api_agent_status from './api/v1/agent/status' +export * as api_common_quantiles from './api/v1/common/quantiles' +export * as api_common_tag from './api/v1/common/tag' +export * as api_config_config from './api/v1/config/config' +export * as api_regression_dashboard from './api/v1/regression/dashboard' +export * as api_regression_widget from './api/v1/regression/widget' +export * as api_report_kpi from './api/v1/report/kpi' +export * as api_report_kpi_value from './api/v1/report/kpi_value' +export * as api_report_status from './api/v1/report/status' +export * as api_test_agent_selector from './api/v1/test/agent_selector' +export * as api_test_artifact_settings from './api/v1/test/artifact_settings' +export * as api_test_details from './api/v1/test/details' +export * as api_test_file_pointer from './api/v1/test/file_pointer' +export * as api_test_imbalance_point from './api/v1/test/imbalance_point' +export * as api_test_object_storage from './api/v1/test/object_storage' +export * as api_test_single_agent_configuration from './api/v1/test/single_agent_configuration' +export * as api_test_status from './api/v1/test/status' +export * as api_test_summary from './api/v1/test/summary' +export * as api_test_test from './api/v1/test/test' +export * as api_report_table_report from './api/v1/report/table/report' \ No newline at end of file diff --git a/src/generated/yandex/cloud/lockbox/index.ts b/src/generated/yandex/cloud/lockbox/index.ts index cd297404..f80cf698 100644 --- a/src/generated/yandex/cloud/lockbox/index.ts +++ b/src/generated/yandex/cloud/lockbox/index.ts @@ -1,4 +1,4 @@ -export * as v1_payload from './v1/payload' -export * as v1_payload_service from './v1/payload_service' -export * as v1_secret from './v1/secret' -export * as v1_secret_service from './v1/secret_service' \ No newline at end of file +export * as payload from './v1/payload' +export * as payload_service from './v1/payload_service' +export * as secret from './v1/secret' +export * as secret_service from './v1/secret_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/logging/index.ts b/src/generated/yandex/cloud/logging/index.ts index a03c7b88..56cf6eae 100644 --- a/src/generated/yandex/cloud/logging/index.ts +++ b/src/generated/yandex/cloud/logging/index.ts @@ -1,10 +1,10 @@ -export * as v1_export from './v1/export' -export * as v1_export_service from './v1/export_service' -export * as v1_log_entry from './v1/log_entry' -export * as v1_log_group from './v1/log_group' -export * as v1_log_group_service from './v1/log_group_service' -export * as v1_log_ingestion_service from './v1/log_ingestion_service' -export * as v1_log_reading_service from './v1/log_reading_service' -export * as v1_log_resource from './v1/log_resource' -export * as v1_sink from './v1/sink' -export * as v1_sink_service from './v1/sink_service' \ No newline at end of file +export * as export from './v1/export' +export * as export_service from './v1/export_service' +export * as log_entry from './v1/log_entry' +export * as log_group from './v1/log_group' +export * as log_group_service from './v1/log_group_service' +export * as log_ingestion_service from './v1/log_ingestion_service' +export * as log_reading_service from './v1/log_reading_service' +export * as log_resource from './v1/log_resource' +export * as sink from './v1/sink' +export * as sink_service from './v1/sink_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/marketplace/index.ts b/src/generated/yandex/cloud/marketplace/index.ts index ba2821b3..518716a9 100644 --- a/src/generated/yandex/cloud/marketplace/index.ts +++ b/src/generated/yandex/cloud/marketplace/index.ts @@ -1,11 +1,11 @@ -export * as licensemanager_v1_instance from './licensemanager/v1/instance' -export * as licensemanager_v1_instance_service from './licensemanager/v1/instance_service' -export * as licensemanager_v1_lock from './licensemanager/v1/lock' -export * as licensemanager_v1_lock_service from './licensemanager/v1/lock_service' -export * as licensemanager_v1_template from './licensemanager/v1/template' -export * as metering_v1_image_product_usage_service from './metering/v1/image_product_usage_service' -export * as metering_v1_usage_record from './metering/v1/usage_record' +export * as licensemanager_instance from './licensemanager/v1/instance' +export * as licensemanager_instance_service from './licensemanager/v1/instance_service' +export * as licensemanager_lock from './licensemanager/v1/lock' +export * as licensemanager_lock_service from './licensemanager/v1/lock_service' +export * as licensemanager_template from './licensemanager/v1/template' +export * as metering_image_product_usage_service from './metering/v1/image_product_usage_service' +export * as metering_usage_record from './metering/v1/usage_record' export * as v1_metering_image_product_usage_service from './v1/metering/image_product_usage_service' export * as v1_metering_usage_record from './v1/metering/usage_record' -export * as licensemanager_saas_v1_instance_service from './licensemanager/saas/v1/instance_service' -export * as licensemanager_saas_v1_lock_service from './licensemanager/saas/v1/lock_service' \ No newline at end of file +export * as licensemanager_saas_instance_service from './licensemanager/saas/v1/instance_service' +export * as licensemanager_saas_lock_service from './licensemanager/saas/v1/lock_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/mdb/index.ts b/src/generated/yandex/cloud/mdb/index.ts index 8d0b3a89..75ff7574 100644 --- a/src/generated/yandex/cloud/mdb/index.ts +++ b/src/generated/yandex/cloud/mdb/index.ts @@ -1,168 +1,168 @@ -export * as clickhouse_v1_backup from './clickhouse/v1/backup' -export * as clickhouse_v1_backup_service from './clickhouse/v1/backup_service' -export * as clickhouse_v1_cluster from './clickhouse/v1/cluster' -export * as clickhouse_v1_cluster_service from './clickhouse/v1/cluster_service' -export * as clickhouse_v1_database from './clickhouse/v1/database' -export * as clickhouse_v1_database_service from './clickhouse/v1/database_service' -export * as clickhouse_v1_format_schema from './clickhouse/v1/format_schema' -export * as clickhouse_v1_format_schema_service from './clickhouse/v1/format_schema_service' -export * as clickhouse_v1_maintenance from './clickhouse/v1/maintenance' -export * as clickhouse_v1_ml_model from './clickhouse/v1/ml_model' -export * as clickhouse_v1_ml_model_service from './clickhouse/v1/ml_model_service' -export * as clickhouse_v1_resource_preset from './clickhouse/v1/resource_preset' -export * as clickhouse_v1_resource_preset_service from './clickhouse/v1/resource_preset_service' -export * as clickhouse_v1_user from './clickhouse/v1/user' -export * as clickhouse_v1_user_service from './clickhouse/v1/user_service' -export * as clickhouse_v1_version from './clickhouse/v1/version' -export * as clickhouse_v1_versions_service from './clickhouse/v1/versions_service' -export * as elasticsearch_v1_auth from './elasticsearch/v1/auth' -export * as elasticsearch_v1_auth_service from './elasticsearch/v1/auth_service' -export * as elasticsearch_v1_backup from './elasticsearch/v1/backup' -export * as elasticsearch_v1_backup_service from './elasticsearch/v1/backup_service' -export * as elasticsearch_v1_cluster from './elasticsearch/v1/cluster' -export * as elasticsearch_v1_cluster_service from './elasticsearch/v1/cluster_service' -export * as elasticsearch_v1_extension from './elasticsearch/v1/extension' -export * as elasticsearch_v1_extension_service from './elasticsearch/v1/extension_service' -export * as elasticsearch_v1_maintenance from './elasticsearch/v1/maintenance' -export * as elasticsearch_v1_resource_preset from './elasticsearch/v1/resource_preset' -export * as elasticsearch_v1_resource_preset_service from './elasticsearch/v1/resource_preset_service' -export * as elasticsearch_v1_user from './elasticsearch/v1/user' -export * as elasticsearch_v1_user_service from './elasticsearch/v1/user_service' -export * as greenplum_v1_backup from './greenplum/v1/backup' -export * as greenplum_v1_backup_service from './greenplum/v1/backup_service' -export * as greenplum_v1_cluster from './greenplum/v1/cluster' -export * as greenplum_v1_cluster_service from './greenplum/v1/cluster_service' -export * as greenplum_v1_config from './greenplum/v1/config' -export * as greenplum_v1_hba_rule from './greenplum/v1/hba_rule' -export * as greenplum_v1_hba_rule_service from './greenplum/v1/hba_rule_service' -export * as greenplum_v1_host from './greenplum/v1/host' -export * as greenplum_v1_maintenance from './greenplum/v1/maintenance' -export * as greenplum_v1_pxf from './greenplum/v1/pxf' -export * as greenplum_v1_pxf_service from './greenplum/v1/pxf_service' -export * as greenplum_v1_resource_preset from './greenplum/v1/resource_preset' -export * as greenplum_v1_resource_preset_service from './greenplum/v1/resource_preset_service' -export * as kafka_v1_cluster from './kafka/v1/cluster' -export * as kafka_v1_cluster_service from './kafka/v1/cluster_service' -export * as kafka_v1_common from './kafka/v1/common' -export * as kafka_v1_connector from './kafka/v1/connector' -export * as kafka_v1_connector_service from './kafka/v1/connector_service' -export * as kafka_v1_maintenance from './kafka/v1/maintenance' -export * as kafka_v1_resource_preset from './kafka/v1/resource_preset' -export * as kafka_v1_resource_preset_service from './kafka/v1/resource_preset_service' -export * as kafka_v1_topic from './kafka/v1/topic' -export * as kafka_v1_topic_service from './kafka/v1/topic_service' -export * as kafka_v1_user from './kafka/v1/user' -export * as kafka_v1_user_service from './kafka/v1/user_service' -export * as mongodb_v1_backup from './mongodb/v1/backup' -export * as mongodb_v1_backup_service from './mongodb/v1/backup_service' -export * as mongodb_v1_cluster from './mongodb/v1/cluster' -export * as mongodb_v1_cluster_service from './mongodb/v1/cluster_service' -export * as mongodb_v1_database from './mongodb/v1/database' -export * as mongodb_v1_database_service from './mongodb/v1/database_service' -export * as mongodb_v1_maintenance from './mongodb/v1/maintenance' -export * as mongodb_v1_resource_preset from './mongodb/v1/resource_preset' -export * as mongodb_v1_resource_preset_service from './mongodb/v1/resource_preset_service' -export * as mongodb_v1_user from './mongodb/v1/user' -export * as mongodb_v1_user_service from './mongodb/v1/user_service' -export * as mysql_v1_backup from './mysql/v1/backup' -export * as mysql_v1_backup_service from './mysql/v1/backup_service' -export * as mysql_v1_cluster from './mysql/v1/cluster' -export * as mysql_v1_cluster_service from './mysql/v1/cluster_service' -export * as mysql_v1_database from './mysql/v1/database' -export * as mysql_v1_database_service from './mysql/v1/database_service' -export * as mysql_v1_maintenance from './mysql/v1/maintenance' -export * as mysql_v1_resource_preset from './mysql/v1/resource_preset' -export * as mysql_v1_resource_preset_service from './mysql/v1/resource_preset_service' -export * as mysql_v1_user from './mysql/v1/user' -export * as mysql_v1_user_service from './mysql/v1/user_service' -export * as opensearch_v1_auth from './opensearch/v1/auth' -export * as opensearch_v1_backup from './opensearch/v1/backup' -export * as opensearch_v1_backup_service from './opensearch/v1/backup_service' -export * as opensearch_v1_cluster from './opensearch/v1/cluster' -export * as opensearch_v1_cluster_service from './opensearch/v1/cluster_service' -export * as opensearch_v1_maintenance from './opensearch/v1/maintenance' -export * as opensearch_v1_resource_preset from './opensearch/v1/resource_preset' -export * as opensearch_v1_resource_preset_service from './opensearch/v1/resource_preset_service' -export * as postgresql_v1_backup from './postgresql/v1/backup' -export * as postgresql_v1_backup_service from './postgresql/v1/backup_service' -export * as postgresql_v1_cluster from './postgresql/v1/cluster' -export * as postgresql_v1_cluster_service from './postgresql/v1/cluster_service' -export * as postgresql_v1_database from './postgresql/v1/database' -export * as postgresql_v1_database_service from './postgresql/v1/database_service' -export * as postgresql_v1_maintenance from './postgresql/v1/maintenance' -export * as postgresql_v1_perf_diag from './postgresql/v1/perf_diag' -export * as postgresql_v1_perf_diag_service from './postgresql/v1/perf_diag_service' -export * as postgresql_v1_resource_preset from './postgresql/v1/resource_preset' -export * as postgresql_v1_resource_preset_service from './postgresql/v1/resource_preset_service' -export * as postgresql_v1_user from './postgresql/v1/user' -export * as postgresql_v1_user_service from './postgresql/v1/user_service' -export * as redis_v1_backup from './redis/v1/backup' -export * as redis_v1_backup_service from './redis/v1/backup_service' -export * as redis_v1_cluster from './redis/v1/cluster' -export * as redis_v1_cluster_service from './redis/v1/cluster_service' -export * as redis_v1_maintenance from './redis/v1/maintenance' -export * as redis_v1_resource_preset from './redis/v1/resource_preset' -export * as redis_v1_resource_preset_service from './redis/v1/resource_preset_service' -export * as sqlserver_v1_backup from './sqlserver/v1/backup' -export * as sqlserver_v1_backup_service from './sqlserver/v1/backup_service' -export * as sqlserver_v1_cluster from './sqlserver/v1/cluster' -export * as sqlserver_v1_cluster_service from './sqlserver/v1/cluster_service' -export * as sqlserver_v1_database from './sqlserver/v1/database' -export * as sqlserver_v1_database_service from './sqlserver/v1/database_service' -export * as sqlserver_v1_resource_preset from './sqlserver/v1/resource_preset' -export * as sqlserver_v1_resource_preset_service from './sqlserver/v1/resource_preset_service' -export * as sqlserver_v1_user from './sqlserver/v1/user' -export * as sqlserver_v1_user_service from './sqlserver/v1/user_service' -export * as clickhouse_v1_config_clickhouse from './clickhouse/v1/config/clickhouse' -export * as elasticsearch_v1_config_elasticsearch from './elasticsearch/v1/config/elasticsearch' -export * as mongodb_v1_config_mongodb from './mongodb/v1/config/mongodb' -export * as mongodb_v1_config_mongodb3_6 from './mongodb/v1/config/mongodb3_6' -export * as mongodb_v1_config_mongodb4_0 from './mongodb/v1/config/mongodb4_0' -export * as mongodb_v1_config_mongodb4_2 from './mongodb/v1/config/mongodb4_2' -export * as mongodb_v1_config_mongodb4_4 from './mongodb/v1/config/mongodb4_4' -export * as mongodb_v1_config_mongodb4_4_enterprise from './mongodb/v1/config/mongodb4_4_enterprise' -export * as mongodb_v1_config_mongodb5_0 from './mongodb/v1/config/mongodb5_0' -export * as mongodb_v1_config_mongodb5_0_enterprise from './mongodb/v1/config/mongodb5_0_enterprise' -export * as mongodb_v1_config_mongodb6_0 from './mongodb/v1/config/mongodb6_0' -export * as mongodb_v1_config_mongodb6_0_enterprise from './mongodb/v1/config/mongodb6_0_enterprise' -export * as mysql_v1_config_mysql5_7 from './mysql/v1/config/mysql5_7' -export * as mysql_v1_config_mysql8_0 from './mysql/v1/config/mysql8_0' -export * as opensearch_v1_config_opensearch from './opensearch/v1/config/opensearch' -export * as postgresql_v1_config_host10 from './postgresql/v1/config/host10' -export * as postgresql_v1_config_host10_1c from './postgresql/v1/config/host10_1c' -export * as postgresql_v1_config_host11 from './postgresql/v1/config/host11' -export * as postgresql_v1_config_host11_1c from './postgresql/v1/config/host11_1c' -export * as postgresql_v1_config_host12 from './postgresql/v1/config/host12' -export * as postgresql_v1_config_host12_1c from './postgresql/v1/config/host12_1c' -export * as postgresql_v1_config_host13 from './postgresql/v1/config/host13' -export * as postgresql_v1_config_host13_1c from './postgresql/v1/config/host13_1c' -export * as postgresql_v1_config_host14 from './postgresql/v1/config/host14' -export * as postgresql_v1_config_host14_1c from './postgresql/v1/config/host14_1c' -export * as postgresql_v1_config_host15 from './postgresql/v1/config/host15' -export * as postgresql_v1_config_host15_1c from './postgresql/v1/config/host15_1c' -export * as postgresql_v1_config_host16 from './postgresql/v1/config/host16' -export * as postgresql_v1_config_host16_1c from './postgresql/v1/config/host16_1c' -export * as postgresql_v1_config_host9_6 from './postgresql/v1/config/host9_6' -export * as postgresql_v1_config_postgresql10 from './postgresql/v1/config/postgresql10' -export * as postgresql_v1_config_postgresql10_1c from './postgresql/v1/config/postgresql10_1c' -export * as postgresql_v1_config_postgresql11 from './postgresql/v1/config/postgresql11' -export * as postgresql_v1_config_postgresql11_1c from './postgresql/v1/config/postgresql11_1c' -export * as postgresql_v1_config_postgresql12 from './postgresql/v1/config/postgresql12' -export * as postgresql_v1_config_postgresql12_1c from './postgresql/v1/config/postgresql12_1c' -export * as postgresql_v1_config_postgresql13 from './postgresql/v1/config/postgresql13' -export * as postgresql_v1_config_postgresql13_1c from './postgresql/v1/config/postgresql13_1c' -export * as postgresql_v1_config_postgresql14 from './postgresql/v1/config/postgresql14' -export * as postgresql_v1_config_postgresql14_1c from './postgresql/v1/config/postgresql14_1c' -export * as postgresql_v1_config_postgresql15 from './postgresql/v1/config/postgresql15' -export * as postgresql_v1_config_postgresql15_1c from './postgresql/v1/config/postgresql15_1c' -export * as postgresql_v1_config_postgresql16 from './postgresql/v1/config/postgresql16' -export * as postgresql_v1_config_postgresql16_1c from './postgresql/v1/config/postgresql16_1c' -export * as postgresql_v1_config_postgresql9_6 from './postgresql/v1/config/postgresql9_6' -export * as redis_v1_config_redis from './redis/v1/config/redis' -export * as redis_v1_config_redis5_0 from './redis/v1/config/redis5_0' -export * as redis_v1_config_redis6_0 from './redis/v1/config/redis6_0' -export * as redis_v1_config_redis6_2 from './redis/v1/config/redis6_2' -export * as redis_v1_config_redis7_0 from './redis/v1/config/redis7_0' -export * as sqlserver_v1_config_sqlserver2016sp2 from './sqlserver/v1/config/sqlserver2016sp2' -export * as sqlserver_v1_config_sqlserver2017 from './sqlserver/v1/config/sqlserver2017' -export * as sqlserver_v1_config_sqlserver2019 from './sqlserver/v1/config/sqlserver2019' \ No newline at end of file +export * as clickhouse_backup from './clickhouse/v1/backup' +export * as clickhouse_backup_service from './clickhouse/v1/backup_service' +export * as clickhouse_cluster from './clickhouse/v1/cluster' +export * as clickhouse_cluster_service from './clickhouse/v1/cluster_service' +export * as clickhouse_database from './clickhouse/v1/database' +export * as clickhouse_database_service from './clickhouse/v1/database_service' +export * as clickhouse_format_schema from './clickhouse/v1/format_schema' +export * as clickhouse_format_schema_service from './clickhouse/v1/format_schema_service' +export * as clickhouse_maintenance from './clickhouse/v1/maintenance' +export * as clickhouse_ml_model from './clickhouse/v1/ml_model' +export * as clickhouse_ml_model_service from './clickhouse/v1/ml_model_service' +export * as clickhouse_resource_preset from './clickhouse/v1/resource_preset' +export * as clickhouse_resource_preset_service from './clickhouse/v1/resource_preset_service' +export * as clickhouse_user from './clickhouse/v1/user' +export * as clickhouse_user_service from './clickhouse/v1/user_service' +export * as clickhouse_version from './clickhouse/v1/version' +export * as clickhouse_versions_service from './clickhouse/v1/versions_service' +export * as elasticsearch_auth from './elasticsearch/v1/auth' +export * as elasticsearch_auth_service from './elasticsearch/v1/auth_service' +export * as elasticsearch_backup from './elasticsearch/v1/backup' +export * as elasticsearch_backup_service from './elasticsearch/v1/backup_service' +export * as elasticsearch_cluster from './elasticsearch/v1/cluster' +export * as elasticsearch_cluster_service from './elasticsearch/v1/cluster_service' +export * as elasticsearch_extension from './elasticsearch/v1/extension' +export * as elasticsearch_extension_service from './elasticsearch/v1/extension_service' +export * as elasticsearch_maintenance from './elasticsearch/v1/maintenance' +export * as elasticsearch_resource_preset from './elasticsearch/v1/resource_preset' +export * as elasticsearch_resource_preset_service from './elasticsearch/v1/resource_preset_service' +export * as elasticsearch_user from './elasticsearch/v1/user' +export * as elasticsearch_user_service from './elasticsearch/v1/user_service' +export * as greenplum_backup from './greenplum/v1/backup' +export * as greenplum_backup_service from './greenplum/v1/backup_service' +export * as greenplum_cluster from './greenplum/v1/cluster' +export * as greenplum_cluster_service from './greenplum/v1/cluster_service' +export * as greenplum_config from './greenplum/v1/config' +export * as greenplum_hba_rule from './greenplum/v1/hba_rule' +export * as greenplum_hba_rule_service from './greenplum/v1/hba_rule_service' +export * as greenplum_host from './greenplum/v1/host' +export * as greenplum_maintenance from './greenplum/v1/maintenance' +export * as greenplum_pxf from './greenplum/v1/pxf' +export * as greenplum_pxf_service from './greenplum/v1/pxf_service' +export * as greenplum_resource_preset from './greenplum/v1/resource_preset' +export * as greenplum_resource_preset_service from './greenplum/v1/resource_preset_service' +export * as kafka_cluster from './kafka/v1/cluster' +export * as kafka_cluster_service from './kafka/v1/cluster_service' +export * as kafka_common from './kafka/v1/common' +export * as kafka_connector from './kafka/v1/connector' +export * as kafka_connector_service from './kafka/v1/connector_service' +export * as kafka_maintenance from './kafka/v1/maintenance' +export * as kafka_resource_preset from './kafka/v1/resource_preset' +export * as kafka_resource_preset_service from './kafka/v1/resource_preset_service' +export * as kafka_topic from './kafka/v1/topic' +export * as kafka_topic_service from './kafka/v1/topic_service' +export * as kafka_user from './kafka/v1/user' +export * as kafka_user_service from './kafka/v1/user_service' +export * as mongodb_backup from './mongodb/v1/backup' +export * as mongodb_backup_service from './mongodb/v1/backup_service' +export * as mongodb_cluster from './mongodb/v1/cluster' +export * as mongodb_cluster_service from './mongodb/v1/cluster_service' +export * as mongodb_database from './mongodb/v1/database' +export * as mongodb_database_service from './mongodb/v1/database_service' +export * as mongodb_maintenance from './mongodb/v1/maintenance' +export * as mongodb_resource_preset from './mongodb/v1/resource_preset' +export * as mongodb_resource_preset_service from './mongodb/v1/resource_preset_service' +export * as mongodb_user from './mongodb/v1/user' +export * as mongodb_user_service from './mongodb/v1/user_service' +export * as mysql_backup from './mysql/v1/backup' +export * as mysql_backup_service from './mysql/v1/backup_service' +export * as mysql_cluster from './mysql/v1/cluster' +export * as mysql_cluster_service from './mysql/v1/cluster_service' +export * as mysql_database from './mysql/v1/database' +export * as mysql_database_service from './mysql/v1/database_service' +export * as mysql_maintenance from './mysql/v1/maintenance' +export * as mysql_resource_preset from './mysql/v1/resource_preset' +export * as mysql_resource_preset_service from './mysql/v1/resource_preset_service' +export * as mysql_user from './mysql/v1/user' +export * as mysql_user_service from './mysql/v1/user_service' +export * as opensearch_auth from './opensearch/v1/auth' +export * as opensearch_backup from './opensearch/v1/backup' +export * as opensearch_backup_service from './opensearch/v1/backup_service' +export * as opensearch_cluster from './opensearch/v1/cluster' +export * as opensearch_cluster_service from './opensearch/v1/cluster_service' +export * as opensearch_maintenance from './opensearch/v1/maintenance' +export * as opensearch_resource_preset from './opensearch/v1/resource_preset' +export * as opensearch_resource_preset_service from './opensearch/v1/resource_preset_service' +export * as postgresql_backup from './postgresql/v1/backup' +export * as postgresql_backup_service from './postgresql/v1/backup_service' +export * as postgresql_cluster from './postgresql/v1/cluster' +export * as postgresql_cluster_service from './postgresql/v1/cluster_service' +export * as postgresql_database from './postgresql/v1/database' +export * as postgresql_database_service from './postgresql/v1/database_service' +export * as postgresql_maintenance from './postgresql/v1/maintenance' +export * as postgresql_perf_diag from './postgresql/v1/perf_diag' +export * as postgresql_perf_diag_service from './postgresql/v1/perf_diag_service' +export * as postgresql_resource_preset from './postgresql/v1/resource_preset' +export * as postgresql_resource_preset_service from './postgresql/v1/resource_preset_service' +export * as postgresql_user from './postgresql/v1/user' +export * as postgresql_user_service from './postgresql/v1/user_service' +export * as redis_backup from './redis/v1/backup' +export * as redis_backup_service from './redis/v1/backup_service' +export * as redis_cluster from './redis/v1/cluster' +export * as redis_cluster_service from './redis/v1/cluster_service' +export * as redis_maintenance from './redis/v1/maintenance' +export * as redis_resource_preset from './redis/v1/resource_preset' +export * as redis_resource_preset_service from './redis/v1/resource_preset_service' +export * as sqlserver_backup from './sqlserver/v1/backup' +export * as sqlserver_backup_service from './sqlserver/v1/backup_service' +export * as sqlserver_cluster from './sqlserver/v1/cluster' +export * as sqlserver_cluster_service from './sqlserver/v1/cluster_service' +export * as sqlserver_database from './sqlserver/v1/database' +export * as sqlserver_database_service from './sqlserver/v1/database_service' +export * as sqlserver_resource_preset from './sqlserver/v1/resource_preset' +export * as sqlserver_resource_preset_service from './sqlserver/v1/resource_preset_service' +export * as sqlserver_user from './sqlserver/v1/user' +export * as sqlserver_user_service from './sqlserver/v1/user_service' +export * as clickhouse_config_clickhouse from './clickhouse/v1/config/clickhouse' +export * as elasticsearch_config_elasticsearch from './elasticsearch/v1/config/elasticsearch' +export * as mongodb_config_mongodb from './mongodb/v1/config/mongodb' +export * as mongodb_config_mongodb3_6 from './mongodb/v1/config/mongodb3_6' +export * as mongodb_config_mongodb4_0 from './mongodb/v1/config/mongodb4_0' +export * as mongodb_config_mongodb4_2 from './mongodb/v1/config/mongodb4_2' +export * as mongodb_config_mongodb4_4 from './mongodb/v1/config/mongodb4_4' +export * as mongodb_config_mongodb4_4_enterprise from './mongodb/v1/config/mongodb4_4_enterprise' +export * as mongodb_config_mongodb5_0 from './mongodb/v1/config/mongodb5_0' +export * as mongodb_config_mongodb5_0_enterprise from './mongodb/v1/config/mongodb5_0_enterprise' +export * as mongodb_config_mongodb6_0 from './mongodb/v1/config/mongodb6_0' +export * as mongodb_config_mongodb6_0_enterprise from './mongodb/v1/config/mongodb6_0_enterprise' +export * as mysql_config_mysql5_7 from './mysql/v1/config/mysql5_7' +export * as mysql_config_mysql8_0 from './mysql/v1/config/mysql8_0' +export * as opensearch_config_opensearch from './opensearch/v1/config/opensearch' +export * as postgresql_config_host10 from './postgresql/v1/config/host10' +export * as postgresql_config_host10_1c from './postgresql/v1/config/host10_1c' +export * as postgresql_config_host11 from './postgresql/v1/config/host11' +export * as postgresql_config_host11_1c from './postgresql/v1/config/host11_1c' +export * as postgresql_config_host12 from './postgresql/v1/config/host12' +export * as postgresql_config_host12_1c from './postgresql/v1/config/host12_1c' +export * as postgresql_config_host13 from './postgresql/v1/config/host13' +export * as postgresql_config_host13_1c from './postgresql/v1/config/host13_1c' +export * as postgresql_config_host14 from './postgresql/v1/config/host14' +export * as postgresql_config_host14_1c from './postgresql/v1/config/host14_1c' +export * as postgresql_config_host15 from './postgresql/v1/config/host15' +export * as postgresql_config_host15_1c from './postgresql/v1/config/host15_1c' +export * as postgresql_config_host16 from './postgresql/v1/config/host16' +export * as postgresql_config_host16_1c from './postgresql/v1/config/host16_1c' +export * as postgresql_config_host9_6 from './postgresql/v1/config/host9_6' +export * as postgresql_config_postgresql10 from './postgresql/v1/config/postgresql10' +export * as postgresql_config_postgresql10_1c from './postgresql/v1/config/postgresql10_1c' +export * as postgresql_config_postgresql11 from './postgresql/v1/config/postgresql11' +export * as postgresql_config_postgresql11_1c from './postgresql/v1/config/postgresql11_1c' +export * as postgresql_config_postgresql12 from './postgresql/v1/config/postgresql12' +export * as postgresql_config_postgresql12_1c from './postgresql/v1/config/postgresql12_1c' +export * as postgresql_config_postgresql13 from './postgresql/v1/config/postgresql13' +export * as postgresql_config_postgresql13_1c from './postgresql/v1/config/postgresql13_1c' +export * as postgresql_config_postgresql14 from './postgresql/v1/config/postgresql14' +export * as postgresql_config_postgresql14_1c from './postgresql/v1/config/postgresql14_1c' +export * as postgresql_config_postgresql15 from './postgresql/v1/config/postgresql15' +export * as postgresql_config_postgresql15_1c from './postgresql/v1/config/postgresql15_1c' +export * as postgresql_config_postgresql16 from './postgresql/v1/config/postgresql16' +export * as postgresql_config_postgresql16_1c from './postgresql/v1/config/postgresql16_1c' +export * as postgresql_config_postgresql9_6 from './postgresql/v1/config/postgresql9_6' +export * as redis_config_redis from './redis/v1/config/redis' +export * as redis_config_redis5_0 from './redis/v1/config/redis5_0' +export * as redis_config_redis6_0 from './redis/v1/config/redis6_0' +export * as redis_config_redis6_2 from './redis/v1/config/redis6_2' +export * as redis_config_redis7_0 from './redis/v1/config/redis7_0' +export * as sqlserver_config_sqlserver2016sp2 from './sqlserver/v1/config/sqlserver2016sp2' +export * as sqlserver_config_sqlserver2017 from './sqlserver/v1/config/sqlserver2017' +export * as sqlserver_config_sqlserver2019 from './sqlserver/v1/config/sqlserver2019' \ No newline at end of file diff --git a/src/generated/yandex/cloud/mdb/mongodb/v1/cluster_service.ts b/src/generated/yandex/cloud/mdb/mongodb/v1/cluster_service.ts index 57106190..b4530af1 100644 --- a/src/generated/yandex/cloud/mdb/mongodb/v1/cluster_service.ts +++ b/src/generated/yandex/cloud/mdb/mongodb/v1/cluster_service.ts @@ -1817,7 +1817,7 @@ type ListClustersResponseType = { fromJSON(object: any): ListClustersResponse; toJSON(message: ListClustersResponse): unknown; fromPartial, I>>(object: I): ListClustersResponse; -} +}; export const ListClustersResponse: ListClustersResponseType = { $type: "yandex.cloud.mdb.mongodb.v1.ListClustersResponse" as const, diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/cluster.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/cluster.ts index 0129459b..28ad25b2 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/cluster.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/cluster.ts @@ -1290,7 +1290,7 @@ type ClusterConfigType = { fromJSON(object: any): ClusterConfig; toJSON(message: ClusterConfig): unknown; fromPartial, I>>(object: I): ClusterConfig; -} +}; export const ClusterConfig: ClusterConfigType = { $type: "yandex.cloud.mdb.postgresql.v1.ClusterConfig" as const, diff --git a/src/generated/yandex/cloud/mdb/postgresql/v1/cluster_service.ts b/src/generated/yandex/cloud/mdb/postgresql/v1/cluster_service.ts index 1cee110d..2776a577 100644 --- a/src/generated/yandex/cloud/mdb/postgresql/v1/cluster_service.ts +++ b/src/generated/yandex/cloud/mdb/postgresql/v1/cluster_service.ts @@ -1110,7 +1110,7 @@ type ListClustersResponseType = { fromJSON(object: any): ListClustersResponse; toJSON(message: ListClustersResponse): unknown; fromPartial, I>>(object: I): ListClustersResponse; -} +}; export const ListClustersResponse: ListClustersResponseType = { $type: "yandex.cloud.mdb.postgresql.v1.ListClustersResponse" as const, diff --git a/src/generated/yandex/cloud/organizationmanager/index.ts b/src/generated/yandex/cloud/organizationmanager/index.ts index b2c1d5ee..ba40c372 100644 --- a/src/generated/yandex/cloud/organizationmanager/index.ts +++ b/src/generated/yandex/cloud/organizationmanager/index.ts @@ -1,16 +1,16 @@ -export * as v1_group from './v1/group' -export * as v1_group_mapping from './v1/group_mapping' -export * as v1_group_mapping_service from './v1/group_mapping_service' -export * as v1_group_service from './v1/group_service' -export * as v1_organization from './v1/organization' -export * as v1_organization_service from './v1/organization_service' -export * as v1_os_login_service from './v1/os_login_service' -export * as v1_ssh_certificate_service from './v1/ssh_certificate_service' -export * as v1_user_account from './v1/user_account' -export * as v1_user_service from './v1/user_service' -export * as v1_user_ssh_key from './v1/user_ssh_key' -export * as v1_user_ssh_key_service from './v1/user_ssh_key_service' -export * as v1_saml_certificate from './v1/saml/certificate' -export * as v1_saml_certificate_service from './v1/saml/certificate_service' -export * as v1_saml_federation from './v1/saml/federation' -export * as v1_saml_federation_service from './v1/saml/federation_service' \ No newline at end of file +export * as group from './v1/group' +export * as group_mapping from './v1/group_mapping' +export * as group_mapping_service from './v1/group_mapping_service' +export * as group_service from './v1/group_service' +export * as organization from './v1/organization' +export * as organization_service from './v1/organization_service' +export * as os_login_service from './v1/os_login_service' +export * as ssh_certificate_service from './v1/ssh_certificate_service' +export * as user_account from './v1/user_account' +export * as user_service from './v1/user_service' +export * as user_ssh_key from './v1/user_ssh_key' +export * as user_ssh_key_service from './v1/user_ssh_key_service' +export * as saml_certificate from './v1/saml/certificate' +export * as saml_certificate_service from './v1/saml/certificate_service' +export * as saml_federation from './v1/saml/federation' +export * as saml_federation_service from './v1/saml/federation_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/resourcemanager/index.ts b/src/generated/yandex/cloud/resourcemanager/index.ts index 4932b02e..ec43d8e9 100644 --- a/src/generated/yandex/cloud/resourcemanager/index.ts +++ b/src/generated/yandex/cloud/resourcemanager/index.ts @@ -1,4 +1,4 @@ -export * as v1_cloud from './v1/cloud' -export * as v1_cloud_service from './v1/cloud_service' -export * as v1_folder from './v1/folder' -export * as v1_folder_service from './v1/folder_service' \ No newline at end of file +export * as cloud from './v1/cloud' +export * as cloud_service from './v1/cloud_service' +export * as folder from './v1/folder' +export * as folder_service from './v1/folder_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/serverless/index.ts b/src/generated/yandex/cloud/serverless/index.ts index 40099fc2..20136677 100644 --- a/src/generated/yandex/cloud/serverless/index.ts +++ b/src/generated/yandex/cloud/serverless/index.ts @@ -1,26 +1,26 @@ -export * as apigateway_v1_apigateway from './apigateway/v1/apigateway' -export * as apigateway_v1_apigateway_service from './apigateway/v1/apigateway_service' -export * as containers_v1_container from './containers/v1/container' -export * as containers_v1_container_service from './containers/v1/container_service' -export * as eventrouter_v1_bus from './eventrouter/v1/bus' -export * as eventrouter_v1_bus_service from './eventrouter/v1/bus_service' -export * as eventrouter_v1_connector from './eventrouter/v1/connector' -export * as eventrouter_v1_connector_service from './eventrouter/v1/connector_service' -export * as eventrouter_v1_event_service from './eventrouter/v1/event_service' -export * as eventrouter_v1_rule from './eventrouter/v1/rule' -export * as eventrouter_v1_rule_service from './eventrouter/v1/rule_service' -export * as functions_v1_function from './functions/v1/function' -export * as functions_v1_function_service from './functions/v1/function_service' -export * as functions_v1_network_service from './functions/v1/network_service' -export * as mdbproxy_v1_proxy from './mdbproxy/v1/proxy' -export * as mdbproxy_v1_proxy_service from './mdbproxy/v1/proxy_service' -export * as triggers_v1_predicate from './triggers/v1/predicate' -export * as triggers_v1_trigger from './triggers/v1/trigger' -export * as triggers_v1_trigger_service from './triggers/v1/trigger_service' -export * as workflows_v1_execution from './workflows/v1/execution' -export * as workflows_v1_execution_service from './workflows/v1/execution_service' -export * as workflows_v1_history_entry from './workflows/v1/history_entry' -export * as workflows_v1_workflow from './workflows/v1/workflow' -export * as workflows_v1_workflow_service from './workflows/v1/workflow_service' -export * as apigateway_websocket_v1_connection from './apigateway/websocket/v1/connection' -export * as apigateway_websocket_v1_connection_service from './apigateway/websocket/v1/connection_service' \ No newline at end of file +export * as apigateway_apigateway from './apigateway/v1/apigateway' +export * as apigateway_apigateway_service from './apigateway/v1/apigateway_service' +export * as containers_container from './containers/v1/container' +export * as containers_container_service from './containers/v1/container_service' +export * as eventrouter_bus from './eventrouter/v1/bus' +export * as eventrouter_bus_service from './eventrouter/v1/bus_service' +export * as eventrouter_connector from './eventrouter/v1/connector' +export * as eventrouter_connector_service from './eventrouter/v1/connector_service' +export * as eventrouter_event_service from './eventrouter/v1/event_service' +export * as eventrouter_rule from './eventrouter/v1/rule' +export * as eventrouter_rule_service from './eventrouter/v1/rule_service' +export * as functions_function from './functions/v1/function' +export * as functions_function_service from './functions/v1/function_service' +export * as functions_network_service from './functions/v1/network_service' +export * as mdbproxy_proxy from './mdbproxy/v1/proxy' +export * as mdbproxy_proxy_service from './mdbproxy/v1/proxy_service' +export * as triggers_predicate from './triggers/v1/predicate' +export * as triggers_trigger from './triggers/v1/trigger' +export * as triggers_trigger_service from './triggers/v1/trigger_service' +export * as workflows_execution from './workflows/v1/execution' +export * as workflows_execution_service from './workflows/v1/execution_service' +export * as workflows_history_entry from './workflows/v1/history_entry' +export * as workflows_workflow from './workflows/v1/workflow' +export * as workflows_workflow_service from './workflows/v1/workflow_service' +export * as apigateway_websocket_connection from './apigateway/websocket/v1/connection' +export * as apigateway_websocket_connection_service from './apigateway/websocket/v1/connection_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/service_clients.ts b/src/generated/yandex/cloud/service_clients.ts index 97124705..8ac9b406 100644 --- a/src/generated/yandex/cloud/service_clients.ts +++ b/src/generated/yandex/cloud/service_clients.ts @@ -1,189 +1,189 @@ import * as cloudApi from '.' -export const AssistantServiceClient = cloudApi.ai.assistants_v1_assistant_service.AssistantServiceClient; -export const TextRecognitionServiceClient = cloudApi.ai.ocr_v1_ocr_service.TextRecognitionServiceClient; +export const AssistantServiceClient = cloudApi.ai.assistants_assistant_service.AssistantServiceClient; +export const TextRecognitionServiceClient = cloudApi.ai.ocr_ocr_service.TextRecognitionServiceClient; export const SttServiceClient = cloudApi.ai.stt_v2_stt_service.SttServiceClient; export const TranslationServiceClient = cloudApi.ai.translate_v2_translation_service.TranslationServiceClient; export const SynthesizerClient = cloudApi.ai.tts_v3_tts_service.SynthesizerClient; -export const VisionServiceClient = cloudApi.ai.vision_v1_vision_service.VisionServiceClient; +export const VisionServiceClient = cloudApi.ai.vision_vision_service.VisionServiceClient; export const ImageClassifierServiceClient = cloudApi.ai.vision_v2_image_classifier_service.ImageClassifierServiceClient; -export const AssistantRunServiceClient = cloudApi.ai.assistants_v1_runs_run_service.RunServiceClient; -export const AssistantMessageServiceClient = cloudApi.ai.assistants_v1_threads_message_service.MessageServiceClient; -export const AssistantThreadServiceClient = cloudApi.ai.assistants_v1_threads_thread_service.ThreadServiceClient; -export const BackendGroupServiceClient = cloudApi.apploadbalancer.v1_backend_group_service.BackendGroupServiceClient; -export const HttpRouterServiceClient = cloudApi.apploadbalancer.v1_http_router_service.HttpRouterServiceClient; -export const LoadBalancerServiceClient = cloudApi.apploadbalancer.v1_load_balancer_service.LoadBalancerServiceClient; -export const AlbTargetGroupServiceClient = cloudApi.apploadbalancer.v1_target_group_service.TargetGroupServiceClient; -export const VirtualHostServiceClient = cloudApi.apploadbalancer.v1_virtual_host_service.VirtualHostServiceClient; -export const BackupBackupServiceClient = cloudApi.backup.v1_backup_service.BackupServiceClient; -export const BackupPolicyServiceClient = cloudApi.backup.v1_policy_service.PolicyServiceClient; -export const BackupProviderServiceClient = cloudApi.backup.v1_provider_service.ProviderServiceClient; -export const BackupResourceServiceClient = cloudApi.backup.v1_resource_service.ResourceServiceClient; -export const BillingAccountServiceClient = cloudApi.billing.v1_billing_account_service.BillingAccountServiceClient; -export const BudgetServiceClient = cloudApi.billing.v1_budget_service.BudgetServiceClient; -export const CustomerServiceClient = cloudApi.billing.v1_customer_service.CustomerServiceClient; -export const ServiceServiceClient = cloudApi.billing.v1_service_service.ServiceServiceClient; -export const SkuServiceClient = cloudApi.billing.v1_sku_service.SkuServiceClient; -export const CDNCacheServiceClient = cloudApi.cdn.v1_cache_service.CacheServiceClient; -export const CDNOriginGroupServiceClient = cloudApi.cdn.v1_origin_group_service.OriginGroupServiceClient; -export const CDNOriginServiceClient = cloudApi.cdn.v1_origin_service.OriginServiceClient; -export const CDNProviderServiceClient = cloudApi.cdn.v1_provider_service.ProviderServiceClient; -export const CDNRawLogsServiceClient = cloudApi.cdn.v1_raw_logs_service.RawLogsServiceClient; -export const CDNResourceServiceClient = cloudApi.cdn.v1_resource_service.ResourceServiceClient; -export const CertificateContentServiceClient = cloudApi.certificatemanager.v1_certificate_content_service.CertificateContentServiceClient; -export const CertificateServiceClient = cloudApi.certificatemanager.v1_certificate_service.CertificateServiceClient; -export const DiskPlacementGroupServiceClient = cloudApi.compute.v1_disk_placement_group_service.DiskPlacementGroupServiceClient; -export const DiskServiceClient = cloudApi.compute.v1_disk_service.DiskServiceClient; -export const DiskTypeServiceClient = cloudApi.compute.v1_disk_type_service.DiskTypeServiceClient; -export const FilesystemServiceClient = cloudApi.compute.v1_filesystem_service.FilesystemServiceClient; -export const GpuClusterServiceClient = cloudApi.compute.v1_gpu_cluster_service.GpuClusterServiceClient; -export const HostGroupServiceClient = cloudApi.compute.v1_host_group_service.HostGroupServiceClient; -export const HostTypeServiceClient = cloudApi.compute.v1_host_type_service.HostTypeServiceClient; -export const ComputeImageServiceClient = cloudApi.compute.v1_image_service.ImageServiceClient; -export const InstanceServiceClient = cloudApi.compute.v1_instance_service.InstanceServiceClient; -export const PlacementGroupServiceClient = cloudApi.compute.v1_placement_group_service.PlacementGroupServiceClient; -export const SnapshotScheduleServiceClient = cloudApi.compute.v1_snapshot_schedule_service.SnapshotScheduleServiceClient; -export const SnapshotServiceClient = cloudApi.compute.v1_snapshot_service.SnapshotServiceClient; -export const ZoneServiceClient = cloudApi.compute.v1_zone_service.ZoneServiceClient; -export const InstanceGroupServiceClient = cloudApi.compute.v1_instancegroup_instance_group_service.InstanceGroupServiceClient; -export const CrImageServiceClient = cloudApi.containerregistry.v1_image_service.ImageServiceClient; -export const LifecyclePolicyServiceClient = cloudApi.containerregistry.v1_lifecycle_policy_service.LifecyclePolicyServiceClient; -export const RegistryServiceClient = cloudApi.containerregistry.v1_registry_service.RegistryServiceClient; -export const RepositoryServiceClient = cloudApi.containerregistry.v1_repository_service.RepositoryServiceClient; -export const ScanPolicyServiceClient = cloudApi.containerregistry.v1_scan_policy_service.ScanPolicyServiceClient; -export const ScannerServiceClient = cloudApi.containerregistry.v1_scanner_service.ScannerServiceClient; -export const DataProcClusterServiceClient = cloudApi.dataproc.v1_cluster_service.ClusterServiceClient; -export const JobServiceClient = cloudApi.dataproc.v1_job_service.JobServiceClient; -export const ResourcePresetServiceClient = cloudApi.dataproc.v1_resource_preset_service.ResourcePresetServiceClient; -export const SubclusterServiceClient = cloudApi.dataproc.v1_subcluster_service.SubclusterServiceClient; -export const ManagerJobServiceClient = cloudApi.dataproc.manager_v1_job_service.JobServiceClient; -export const DataprocManagerServiceClient = cloudApi.dataproc.manager_v1_manager_service.DataprocManagerServiceClient; -export const AppTokenServiceClient = cloudApi.datasphere.v1_app_token_service.AppTokenServiceClient; -export const FolderBudgetServiceClient = cloudApi.datasphere.v1_folder_budget_service.FolderBudgetServiceClient; -export const NodeServiceClient = cloudApi.datasphere.v1_node_service.NodeServiceClient; -export const ProjectDataServiceClient = cloudApi.datasphere.v1_project_data_service.ProjectDataServiceClient; -export const ProjectServiceClient = cloudApi.datasphere.v1_project_service.ProjectServiceClient; +export const AssistantRunServiceClient = cloudApi.ai.assistants_runs_run_service.RunServiceClient; +export const AssistantMessageServiceClient = cloudApi.ai.assistants_threads_message_service.MessageServiceClient; +export const AssistantThreadServiceClient = cloudApi.ai.assistants_threads_thread_service.ThreadServiceClient; +export const BackendGroupServiceClient = cloudApi.apploadbalancer.backend_group_service.BackendGroupServiceClient; +export const HttpRouterServiceClient = cloudApi.apploadbalancer.http_router_service.HttpRouterServiceClient; +export const LoadBalancerServiceClient = cloudApi.apploadbalancer.load_balancer_service.LoadBalancerServiceClient; +export const AlbTargetGroupServiceClient = cloudApi.apploadbalancer.target_group_service.TargetGroupServiceClient; +export const VirtualHostServiceClient = cloudApi.apploadbalancer.virtual_host_service.VirtualHostServiceClient; +export const BackupBackupServiceClient = cloudApi.backup.backup_service.BackupServiceClient; +export const BackupPolicyServiceClient = cloudApi.backup.policy_service.PolicyServiceClient; +export const BackupProviderServiceClient = cloudApi.backup.provider_service.ProviderServiceClient; +export const BackupResourceServiceClient = cloudApi.backup.resource_service.ResourceServiceClient; +export const BillingAccountServiceClient = cloudApi.billing.billing_account_service.BillingAccountServiceClient; +export const BudgetServiceClient = cloudApi.billing.budget_service.BudgetServiceClient; +export const CustomerServiceClient = cloudApi.billing.customer_service.CustomerServiceClient; +export const ServiceServiceClient = cloudApi.billing.service_service.ServiceServiceClient; +export const SkuServiceClient = cloudApi.billing.sku_service.SkuServiceClient; +export const CDNCacheServiceClient = cloudApi.cdn.cache_service.CacheServiceClient; +export const CDNOriginGroupServiceClient = cloudApi.cdn.origin_group_service.OriginGroupServiceClient; +export const CDNOriginServiceClient = cloudApi.cdn.origin_service.OriginServiceClient; +export const CDNProviderServiceClient = cloudApi.cdn.provider_service.ProviderServiceClient; +export const CDNRawLogsServiceClient = cloudApi.cdn.raw_logs_service.RawLogsServiceClient; +export const CDNResourceServiceClient = cloudApi.cdn.resource_service.ResourceServiceClient; +export const CertificateContentServiceClient = cloudApi.certificatemanager.certificate_content_service.CertificateContentServiceClient; +export const CertificateServiceClient = cloudApi.certificatemanager.certificate_service.CertificateServiceClient; +export const DiskPlacementGroupServiceClient = cloudApi.compute.disk_placement_group_service.DiskPlacementGroupServiceClient; +export const DiskServiceClient = cloudApi.compute.disk_service.DiskServiceClient; +export const DiskTypeServiceClient = cloudApi.compute.disk_type_service.DiskTypeServiceClient; +export const FilesystemServiceClient = cloudApi.compute.filesystem_service.FilesystemServiceClient; +export const GpuClusterServiceClient = cloudApi.compute.gpu_cluster_service.GpuClusterServiceClient; +export const HostGroupServiceClient = cloudApi.compute.host_group_service.HostGroupServiceClient; +export const HostTypeServiceClient = cloudApi.compute.host_type_service.HostTypeServiceClient; +export const ComputeImageServiceClient = cloudApi.compute.image_service.ImageServiceClient; +export const InstanceServiceClient = cloudApi.compute.instance_service.InstanceServiceClient; +export const PlacementGroupServiceClient = cloudApi.compute.placement_group_service.PlacementGroupServiceClient; +export const SnapshotScheduleServiceClient = cloudApi.compute.snapshot_schedule_service.SnapshotScheduleServiceClient; +export const SnapshotServiceClient = cloudApi.compute.snapshot_service.SnapshotServiceClient; +export const ZoneServiceClient = cloudApi.compute.zone_service.ZoneServiceClient; +export const InstanceGroupServiceClient = cloudApi.compute.instancegroup_instance_group_service.InstanceGroupServiceClient; +export const CrImageServiceClient = cloudApi.containerregistry.image_service.ImageServiceClient; +export const LifecyclePolicyServiceClient = cloudApi.containerregistry.lifecycle_policy_service.LifecyclePolicyServiceClient; +export const RegistryServiceClient = cloudApi.containerregistry.registry_service.RegistryServiceClient; +export const RepositoryServiceClient = cloudApi.containerregistry.repository_service.RepositoryServiceClient; +export const ScanPolicyServiceClient = cloudApi.containerregistry.scan_policy_service.ScanPolicyServiceClient; +export const ScannerServiceClient = cloudApi.containerregistry.scanner_service.ScannerServiceClient; +export const DataProcClusterServiceClient = cloudApi.dataproc.cluster_service.ClusterServiceClient; +export const JobServiceClient = cloudApi.dataproc.job_service.JobServiceClient; +export const ResourcePresetServiceClient = cloudApi.dataproc.resource_preset_service.ResourcePresetServiceClient; +export const SubclusterServiceClient = cloudApi.dataproc.subcluster_service.SubclusterServiceClient; +export const ManagerJobServiceClient = cloudApi.dataproc.manager_job_service.JobServiceClient; +export const DataprocManagerServiceClient = cloudApi.dataproc.manager_manager_service.DataprocManagerServiceClient; +export const AppTokenServiceClient = cloudApi.datasphere.app_token_service.AppTokenServiceClient; +export const FolderBudgetServiceClient = cloudApi.datasphere.folder_budget_service.FolderBudgetServiceClient; +export const NodeServiceClient = cloudApi.datasphere.node_service.NodeServiceClient; +export const ProjectDataServiceClient = cloudApi.datasphere.project_data_service.ProjectDataServiceClient; +export const ProjectServiceClient = cloudApi.datasphere.project_service.ProjectServiceClient; export const CommunityServiceClient = cloudApi.datasphere.v2_community_service.CommunityServiceClient; -export const EndpointServiceClient = cloudApi.datatransfer.v1_endpoint_service.EndpointServiceClient; -export const TransferServiceClient = cloudApi.datatransfer.v1_transfer_service.TransferServiceClient; -export const DnsZoneServiceClient = cloudApi.dns.v1_dns_zone_service.DnsZoneServiceClient; -export const ApiKeyServiceClient = cloudApi.iam.v1_api_key_service.ApiKeyServiceClient; -export const IamTokenServiceClient = cloudApi.iam.v1_iam_token_service.IamTokenServiceClient; -export const KeyServiceClient = cloudApi.iam.v1_key_service.KeyServiceClient; -export const RoleServiceClient = cloudApi.iam.v1_role_service.RoleServiceClient; -export const ServiceAccountServiceClient = cloudApi.iam.v1_service_account_service.ServiceAccountServiceClient; -export const UserAccountServiceClient = cloudApi.iam.v1_user_account_service.UserAccountServiceClient; -export const YandexPassportUserAccountServiceClient = cloudApi.iam.v1_yandex_passport_user_account_service.YandexPassportUserAccountServiceClient; -export const AccessKeyServiceClient = cloudApi.iam.v1_awscompatibility_access_key_service.AccessKeyServiceClient; -export const BrokerDataServiceClient = cloudApi.iot.broker_v1_broker_data_service.BrokerDataServiceClient; -export const BrokerServiceClient = cloudApi.iot.broker_v1_broker_service.BrokerServiceClient; -export const DeviceDataServiceClient = cloudApi.iot.devices_v1_device_data_service.DeviceDataServiceClient; -export const DeviceServiceClient = cloudApi.iot.devices_v1_device_service.DeviceServiceClient; -export const RegistryDataServiceClient = cloudApi.iot.devices_v1_registry_data_service.RegistryDataServiceClient; -export const IotRegistryServiceClient = cloudApi.iot.devices_v1_registry_service.RegistryServiceClient; -export const K8sClusterServiceClient = cloudApi.k8s.v1_cluster_service.ClusterServiceClient; -export const NodeGroupServiceClient = cloudApi.k8s.v1_node_group_service.NodeGroupServiceClient; -export const VersionServiceClient = cloudApi.k8s.v1_version_service.VersionServiceClient; -export const SymmetricCryptoServiceClient = cloudApi.kms.v1_symmetric_crypto_service.SymmetricCryptoServiceClient; -export const SymmetricKeyServiceClient = cloudApi.kms.v1_symmetric_key_service.SymmetricKeyServiceClient; -export const AsymmetricEncryptionCryptoServiceClient = cloudApi.kms.v1_asymmetricencryption_asymmetric_encryption_crypto_service.AsymmetricEncryptionCryptoServiceClient; -export const AsymmetricEncryptionKeyServiceClient = cloudApi.kms.v1_asymmetricencryption_asymmetric_encryption_key_service.AsymmetricEncryptionKeyServiceClient; -export const AsymmetricSignatureCryptoServiceClient = cloudApi.kms.v1_asymmetricsignature_asymmetric_signature_crypto_service.AsymmetricSignatureCryptoServiceClient; -export const AsymmetricSignatureKeyServiceClient = cloudApi.kms.v1_asymmetricsignature_asymmetric_signature_key_service.AsymmetricSignatureKeyServiceClient; -export const NetworkLoadBalancerServiceClient = cloudApi.loadbalancer.v1_network_load_balancer_service.NetworkLoadBalancerServiceClient; -export const TargetGroupServiceClient = cloudApi.loadbalancer.v1_target_group_service.TargetGroupServiceClient; -export const LoadTestingAgentRegistrationServiceClient = cloudApi.loadtesting.agent_v1_agent_registration_service.AgentRegistrationServiceClient; -export const LoadTestingAgentServiceClient = cloudApi.loadtesting.agent_v1_agent_service.AgentServiceClient; -export const LoadTestingJobServiceClient = cloudApi.loadtesting.agent_v1_job_service.JobServiceClient; -export const LoadTestingMonitoringServiceClient = cloudApi.loadtesting.agent_v1_monitoring_service.MonitoringServiceClient; -export const LoadTestingTestServiceClient = cloudApi.loadtesting.agent_v1_test_service.TestServiceClient; -export const LoadTestingTrailServiceClient = cloudApi.loadtesting.agent_v1_trail_service.TrailServiceClient; -export const LoadTestingApiAgentServiceClient = cloudApi.loadtesting.api_v1_agent_service.AgentServiceClient; -export const PayloadServiceClient = cloudApi.lockbox.v1_payload_service.PayloadServiceClient; -export const SecretServiceClient = cloudApi.lockbox.v1_secret_service.SecretServiceClient; -export const ExportServiceClient = cloudApi.logging.v1_export_service.ExportServiceClient; -export const LogGroupServiceClient = cloudApi.logging.v1_log_group_service.LogGroupServiceClient; -export const LogIngestionServiceClient = cloudApi.logging.v1_log_ingestion_service.LogIngestionServiceClient; -export const LogReadingServiceClient = cloudApi.logging.v1_log_reading_service.LogReadingServiceClient; -export const SinkServiceClient = cloudApi.logging.v1_sink_service.SinkServiceClient; -export const MarketplaceInstanceServiceClient = cloudApi.marketplace.licensemanager_v1_instance_service.InstanceServiceClient; -export const MarketplaceLockServiceClient = cloudApi.marketplace.licensemanager_v1_lock_service.LockServiceClient; -export const MarketplaceImageProductUsageServiceClient = cloudApi.marketplace.metering_v1_image_product_usage_service.ImageProductUsageServiceClient; +export const EndpointServiceClient = cloudApi.datatransfer.endpoint_service.EndpointServiceClient; +export const TransferServiceClient = cloudApi.datatransfer.transfer_service.TransferServiceClient; +export const DnsZoneServiceClient = cloudApi.dns.dns_zone_service.DnsZoneServiceClient; +export const ApiKeyServiceClient = cloudApi.iam.api_key_service.ApiKeyServiceClient; +export const IamTokenServiceClient = cloudApi.iam.iam_token_service.IamTokenServiceClient; +export const KeyServiceClient = cloudApi.iam.key_service.KeyServiceClient; +export const RoleServiceClient = cloudApi.iam.role_service.RoleServiceClient; +export const ServiceAccountServiceClient = cloudApi.iam.service_account_service.ServiceAccountServiceClient; +export const UserAccountServiceClient = cloudApi.iam.user_account_service.UserAccountServiceClient; +export const YandexPassportUserAccountServiceClient = cloudApi.iam.yandex_passport_user_account_service.YandexPassportUserAccountServiceClient; +export const AccessKeyServiceClient = cloudApi.iam.awscompatibility_access_key_service.AccessKeyServiceClient; +export const BrokerDataServiceClient = cloudApi.iot.broker_broker_data_service.BrokerDataServiceClient; +export const BrokerServiceClient = cloudApi.iot.broker_broker_service.BrokerServiceClient; +export const DeviceDataServiceClient = cloudApi.iot.devices_device_data_service.DeviceDataServiceClient; +export const DeviceServiceClient = cloudApi.iot.devices_device_service.DeviceServiceClient; +export const RegistryDataServiceClient = cloudApi.iot.devices_registry_data_service.RegistryDataServiceClient; +export const IotRegistryServiceClient = cloudApi.iot.devices_registry_service.RegistryServiceClient; +export const K8sClusterServiceClient = cloudApi.k8s.cluster_service.ClusterServiceClient; +export const NodeGroupServiceClient = cloudApi.k8s.node_group_service.NodeGroupServiceClient; +export const VersionServiceClient = cloudApi.k8s.version_service.VersionServiceClient; +export const SymmetricCryptoServiceClient = cloudApi.kms.symmetric_crypto_service.SymmetricCryptoServiceClient; +export const SymmetricKeyServiceClient = cloudApi.kms.symmetric_key_service.SymmetricKeyServiceClient; +export const AsymmetricEncryptionCryptoServiceClient = cloudApi.kms.asymmetricencryption_asymmetric_encryption_crypto_service.AsymmetricEncryptionCryptoServiceClient; +export const AsymmetricEncryptionKeyServiceClient = cloudApi.kms.asymmetricencryption_asymmetric_encryption_key_service.AsymmetricEncryptionKeyServiceClient; +export const AsymmetricSignatureCryptoServiceClient = cloudApi.kms.asymmetricsignature_asymmetric_signature_crypto_service.AsymmetricSignatureCryptoServiceClient; +export const AsymmetricSignatureKeyServiceClient = cloudApi.kms.asymmetricsignature_asymmetric_signature_key_service.AsymmetricSignatureKeyServiceClient; +export const NetworkLoadBalancerServiceClient = cloudApi.loadbalancer.network_load_balancer_service.NetworkLoadBalancerServiceClient; +export const TargetGroupServiceClient = cloudApi.loadbalancer.target_group_service.TargetGroupServiceClient; +export const LoadTestingAgentRegistrationServiceClient = cloudApi.loadtesting.agent_agent_registration_service.AgentRegistrationServiceClient; +export const LoadTestingAgentServiceClient = cloudApi.loadtesting.agent_agent_service.AgentServiceClient; +export const LoadTestingJobServiceClient = cloudApi.loadtesting.agent_job_service.JobServiceClient; +export const LoadTestingMonitoringServiceClient = cloudApi.loadtesting.agent_monitoring_service.MonitoringServiceClient; +export const LoadTestingTestServiceClient = cloudApi.loadtesting.agent_test_service.TestServiceClient; +export const LoadTestingTrailServiceClient = cloudApi.loadtesting.agent_trail_service.TrailServiceClient; +export const LoadTestingApiAgentServiceClient = cloudApi.loadtesting.api_agent_service.AgentServiceClient; +export const PayloadServiceClient = cloudApi.lockbox.payload_service.PayloadServiceClient; +export const SecretServiceClient = cloudApi.lockbox.secret_service.SecretServiceClient; +export const ExportServiceClient = cloudApi.logging.export_service.ExportServiceClient; +export const LogGroupServiceClient = cloudApi.logging.log_group_service.LogGroupServiceClient; +export const LogIngestionServiceClient = cloudApi.logging.log_ingestion_service.LogIngestionServiceClient; +export const LogReadingServiceClient = cloudApi.logging.log_reading_service.LogReadingServiceClient; +export const SinkServiceClient = cloudApi.logging.sink_service.SinkServiceClient; +export const MarketplaceInstanceServiceClient = cloudApi.marketplace.licensemanager_instance_service.InstanceServiceClient; +export const MarketplaceLockServiceClient = cloudApi.marketplace.licensemanager_lock_service.LockServiceClient; +export const MarketplaceImageProductUsageServiceClient = cloudApi.marketplace.metering_image_product_usage_service.ImageProductUsageServiceClient; export const MarketplaceMeteringImageProductUsageServiceClient = cloudApi.marketplace.v1_metering_image_product_usage_service.ImageProductUsageServiceClient; -export const ClickHouseBackupServiceClient = cloudApi.mdb.clickhouse_v1_backup_service.BackupServiceClient; -export const ClickHouseClusterServiceClient = cloudApi.mdb.clickhouse_v1_cluster_service.ClusterServiceClient; -export const DatabaseServiceClient = cloudApi.mdb.clickhouse_v1_database_service.DatabaseServiceClient; -export const FormatSchemaServiceClient = cloudApi.mdb.clickhouse_v1_format_schema_service.FormatSchemaServiceClient; -export const MlModelServiceClient = cloudApi.mdb.clickhouse_v1_ml_model_service.MlModelServiceClient; -export const ClickHouseResourcePresetServiceClient = cloudApi.mdb.clickhouse_v1_resource_preset_service.ResourcePresetServiceClient; -export const ClickHouseUserServiceClient = cloudApi.mdb.clickhouse_v1_user_service.UserServiceClient; -export const VersionsServiceClient = cloudApi.mdb.clickhouse_v1_versions_service.VersionsServiceClient; -export const AuthServiceClient = cloudApi.mdb.elasticsearch_v1_auth_service.AuthServiceClient; -export const ElasticBackupServiceClient = cloudApi.mdb.elasticsearch_v1_backup_service.BackupServiceClient; -export const ElasticClusterServiceClient = cloudApi.mdb.elasticsearch_v1_cluster_service.ClusterServiceClient; -export const ElasticExtensionServiceClient = cloudApi.mdb.elasticsearch_v1_extension_service.ExtensionServiceClient; -export const ElasticResourcePresetServiceClient = cloudApi.mdb.elasticsearch_v1_resource_preset_service.ResourcePresetServiceClient; -export const ElasticUserServiceClient = cloudApi.mdb.elasticsearch_v1_user_service.UserServiceClient; -export const GreenplumBackupServiceClient = cloudApi.mdb.greenplum_v1_backup_service.BackupServiceClient; -export const GreenplumClusterServiceClient = cloudApi.mdb.greenplum_v1_cluster_service.ClusterServiceClient; -export const GreenplumResourcePresetServiceClient = cloudApi.mdb.greenplum_v1_resource_preset_service.ResourcePresetServiceClient; -export const KafkaClusterServiceClient = cloudApi.mdb.kafka_v1_cluster_service.ClusterServiceClient; -export const ConnectorServiceClient = cloudApi.mdb.kafka_v1_connector_service.ConnectorServiceClient; -export const KafkaResourcePresetServiceClient = cloudApi.mdb.kafka_v1_resource_preset_service.ResourcePresetServiceClient; -export const TopicServiceClient = cloudApi.mdb.kafka_v1_topic_service.TopicServiceClient; -export const KafkaUserServiceClient = cloudApi.mdb.kafka_v1_user_service.UserServiceClient; -export const MongoBackupServiceClient = cloudApi.mdb.mongodb_v1_backup_service.BackupServiceClient; -export const MongoClusterServiceClient = cloudApi.mdb.mongodb_v1_cluster_service.ClusterServiceClient; -export const MongoDatabaseServiceClient = cloudApi.mdb.mongodb_v1_database_service.DatabaseServiceClient; -export const MongoResourcePresetServiceClient = cloudApi.mdb.mongodb_v1_resource_preset_service.ResourcePresetServiceClient; -export const MongoUserServiceClient = cloudApi.mdb.mongodb_v1_user_service.UserServiceClient; -export const MysqlBackupServiceClient = cloudApi.mdb.mysql_v1_backup_service.BackupServiceClient; -export const MysqlClusterServiceClient = cloudApi.mdb.mysql_v1_cluster_service.ClusterServiceClient; -export const MysqlDatabaseServiceClient = cloudApi.mdb.mysql_v1_database_service.DatabaseServiceClient; -export const MysqlResourcePresetServiceClient = cloudApi.mdb.mysql_v1_resource_preset_service.ResourcePresetServiceClient; -export const MysqlUserServiceClient = cloudApi.mdb.mysql_v1_user_service.UserServiceClient; -export const OpenSearchBackupServiceClient = cloudApi.mdb.opensearch_v1_backup_service.BackupServiceClient; -export const OpenSearchClusterServiceClient = cloudApi.mdb.opensearch_v1_cluster_service.ClusterServiceClient; -export const OpenSearchResourcePresetServiceClient = cloudApi.mdb.opensearch_v1_resource_preset_service.ResourcePresetServiceClient; -export const PgsqlBackupServiceClient = cloudApi.mdb.postgresql_v1_backup_service.BackupServiceClient; -export const PgsqlClusterServiceClient = cloudApi.mdb.postgresql_v1_cluster_service.ClusterServiceClient; -export const PgsqlDatabaseServiceClient = cloudApi.mdb.postgresql_v1_database_service.DatabaseServiceClient; -export const PgsqlPerformanceDiagnosticsServiceClient = cloudApi.mdb.postgresql_v1_perf_diag_service.PerformanceDiagnosticsServiceClient; -export const PgsqlResourcePresetServiceClient = cloudApi.mdb.postgresql_v1_resource_preset_service.ResourcePresetServiceClient; -export const PgsqlUserServiceClient = cloudApi.mdb.postgresql_v1_user_service.UserServiceClient; -export const RedisBackupServiceClient = cloudApi.mdb.redis_v1_backup_service.BackupServiceClient; -export const RedisClusterServiceClient = cloudApi.mdb.redis_v1_cluster_service.ClusterServiceClient; -export const RedisResourcePresetServiceClient = cloudApi.mdb.redis_v1_resource_preset_service.ResourcePresetServiceClient; -export const SqlServerBackupServiceClient = cloudApi.mdb.sqlserver_v1_backup_service.BackupServiceClient; -export const SqlServerClusterServiceClient = cloudApi.mdb.sqlserver_v1_cluster_service.ClusterServiceClient; -export const SqlServerDatabaseServiceClient = cloudApi.mdb.sqlserver_v1_database_service.DatabaseServiceClient; -export const SqlServerResourcePresetServiceClient = cloudApi.mdb.sqlserver_v1_resource_preset_service.ResourcePresetServiceClient; -export const SqlServerUserServiceClient = cloudApi.mdb.sqlserver_v1_user_service.UserServiceClient; +export const ClickHouseBackupServiceClient = cloudApi.mdb.clickhouse_backup_service.BackupServiceClient; +export const ClickHouseClusterServiceClient = cloudApi.mdb.clickhouse_cluster_service.ClusterServiceClient; +export const DatabaseServiceClient = cloudApi.mdb.clickhouse_database_service.DatabaseServiceClient; +export const FormatSchemaServiceClient = cloudApi.mdb.clickhouse_format_schema_service.FormatSchemaServiceClient; +export const MlModelServiceClient = cloudApi.mdb.clickhouse_ml_model_service.MlModelServiceClient; +export const ClickHouseResourcePresetServiceClient = cloudApi.mdb.clickhouse_resource_preset_service.ResourcePresetServiceClient; +export const ClickHouseUserServiceClient = cloudApi.mdb.clickhouse_user_service.UserServiceClient; +export const VersionsServiceClient = cloudApi.mdb.clickhouse_versions_service.VersionsServiceClient; +export const AuthServiceClient = cloudApi.mdb.elasticsearch_auth_service.AuthServiceClient; +export const ElasticBackupServiceClient = cloudApi.mdb.elasticsearch_backup_service.BackupServiceClient; +export const ElasticClusterServiceClient = cloudApi.mdb.elasticsearch_cluster_service.ClusterServiceClient; +export const ElasticExtensionServiceClient = cloudApi.mdb.elasticsearch_extension_service.ExtensionServiceClient; +export const ElasticResourcePresetServiceClient = cloudApi.mdb.elasticsearch_resource_preset_service.ResourcePresetServiceClient; +export const ElasticUserServiceClient = cloudApi.mdb.elasticsearch_user_service.UserServiceClient; +export const GreenplumBackupServiceClient = cloudApi.mdb.greenplum_backup_service.BackupServiceClient; +export const GreenplumClusterServiceClient = cloudApi.mdb.greenplum_cluster_service.ClusterServiceClient; +export const GreenplumResourcePresetServiceClient = cloudApi.mdb.greenplum_resource_preset_service.ResourcePresetServiceClient; +export const KafkaClusterServiceClient = cloudApi.mdb.kafka_cluster_service.ClusterServiceClient; +export const ConnectorServiceClient = cloudApi.mdb.kafka_connector_service.ConnectorServiceClient; +export const KafkaResourcePresetServiceClient = cloudApi.mdb.kafka_resource_preset_service.ResourcePresetServiceClient; +export const TopicServiceClient = cloudApi.mdb.kafka_topic_service.TopicServiceClient; +export const KafkaUserServiceClient = cloudApi.mdb.kafka_user_service.UserServiceClient; +export const MongoBackupServiceClient = cloudApi.mdb.mongodb_backup_service.BackupServiceClient; +export const MongoClusterServiceClient = cloudApi.mdb.mongodb_cluster_service.ClusterServiceClient; +export const MongoDatabaseServiceClient = cloudApi.mdb.mongodb_database_service.DatabaseServiceClient; +export const MongoResourcePresetServiceClient = cloudApi.mdb.mongodb_resource_preset_service.ResourcePresetServiceClient; +export const MongoUserServiceClient = cloudApi.mdb.mongodb_user_service.UserServiceClient; +export const MysqlBackupServiceClient = cloudApi.mdb.mysql_backup_service.BackupServiceClient; +export const MysqlClusterServiceClient = cloudApi.mdb.mysql_cluster_service.ClusterServiceClient; +export const MysqlDatabaseServiceClient = cloudApi.mdb.mysql_database_service.DatabaseServiceClient; +export const MysqlResourcePresetServiceClient = cloudApi.mdb.mysql_resource_preset_service.ResourcePresetServiceClient; +export const MysqlUserServiceClient = cloudApi.mdb.mysql_user_service.UserServiceClient; +export const OpenSearchBackupServiceClient = cloudApi.mdb.opensearch_backup_service.BackupServiceClient; +export const OpenSearchClusterServiceClient = cloudApi.mdb.opensearch_cluster_service.ClusterServiceClient; +export const OpenSearchResourcePresetServiceClient = cloudApi.mdb.opensearch_resource_preset_service.ResourcePresetServiceClient; +export const PgsqlBackupServiceClient = cloudApi.mdb.postgresql_backup_service.BackupServiceClient; +export const PgsqlClusterServiceClient = cloudApi.mdb.postgresql_cluster_service.ClusterServiceClient; +export const PgsqlDatabaseServiceClient = cloudApi.mdb.postgresql_database_service.DatabaseServiceClient; +export const PgsqlPerformanceDiagnosticsServiceClient = cloudApi.mdb.postgresql_perf_diag_service.PerformanceDiagnosticsServiceClient; +export const PgsqlResourcePresetServiceClient = cloudApi.mdb.postgresql_resource_preset_service.ResourcePresetServiceClient; +export const PgsqlUserServiceClient = cloudApi.mdb.postgresql_user_service.UserServiceClient; +export const RedisBackupServiceClient = cloudApi.mdb.redis_backup_service.BackupServiceClient; +export const RedisClusterServiceClient = cloudApi.mdb.redis_cluster_service.ClusterServiceClient; +export const RedisResourcePresetServiceClient = cloudApi.mdb.redis_resource_preset_service.ResourcePresetServiceClient; +export const SqlServerBackupServiceClient = cloudApi.mdb.sqlserver_backup_service.BackupServiceClient; +export const SqlServerClusterServiceClient = cloudApi.mdb.sqlserver_cluster_service.ClusterServiceClient; +export const SqlServerDatabaseServiceClient = cloudApi.mdb.sqlserver_database_service.DatabaseServiceClient; +export const SqlServerResourcePresetServiceClient = cloudApi.mdb.sqlserver_resource_preset_service.ResourcePresetServiceClient; +export const SqlServerUserServiceClient = cloudApi.mdb.sqlserver_user_service.UserServiceClient; export const DashboardServiceClient = cloudApi.monitoring.v3_dashboard_service.DashboardServiceClient; export const OperationServiceClient = cloudApi.operation.operation_service.OperationServiceClient; -export const GroupMappingServiceClient = cloudApi.organizationmanager.v1_group_mapping_service.GroupMappingServiceClient; -export const GroupServiceClient = cloudApi.organizationmanager.v1_group_service.GroupServiceClient; -export const OrganizationServiceClient = cloudApi.organizationmanager.v1_organization_service.OrganizationServiceClient; -export const SshCertificateServiceClient = cloudApi.organizationmanager.v1_ssh_certificate_service.SshCertificateServiceClient; -export const UserServiceClient = cloudApi.organizationmanager.v1_user_service.UserServiceClient; -export const OmCertificateServiceClient = cloudApi.organizationmanager.v1_saml_certificate_service.CertificateServiceClient; -export const FederationServiceClient = cloudApi.organizationmanager.v1_saml_federation_service.FederationServiceClient; -export const CloudServiceClient = cloudApi.resourcemanager.v1_cloud_service.CloudServiceClient; -export const FolderServiceClient = cloudApi.resourcemanager.v1_folder_service.FolderServiceClient; -export const ApiGatewayServiceClient = cloudApi.serverless.apigateway_v1_apigateway_service.ApiGatewayServiceClient; -export const ContainerServiceClient = cloudApi.serverless.containers_v1_container_service.ContainerServiceClient; -export const FunctionServiceClient = cloudApi.serverless.functions_v1_function_service.FunctionServiceClient; -export const ProxyServiceClient = cloudApi.serverless.mdbproxy_v1_proxy_service.ProxyServiceClient; -export const TriggerServiceClient = cloudApi.serverless.triggers_v1_trigger_service.TriggerServiceClient; -export const WebSocketConnectionServiceClient = cloudApi.serverless.apigateway_websocket_v1_connection_service.ConnectionServiceClient; -export const BucketServiceClient = cloudApi.storage.v1_bucket_service.BucketServiceClient; -export const AddressServiceClient = cloudApi.vpc.v1_address_service.AddressServiceClient; -export const GatewayServiceClient = cloudApi.vpc.v1_gateway_service.GatewayServiceClient; -export const NetworkServiceClient = cloudApi.vpc.v1_network_service.NetworkServiceClient; -export const RouteTableServiceClient = cloudApi.vpc.v1_route_table_service.RouteTableServiceClient; -export const SecurityGroupServiceClient = cloudApi.vpc.v1_security_group_service.SecurityGroupServiceClient; -export const SubnetServiceClient = cloudApi.vpc.v1_subnet_service.SubnetServiceClient; -export const YdbBackupServiceClient = cloudApi.ydb.v1_backup_service.BackupServiceClient; -export const YdbDatabaseServiceClient = cloudApi.ydb.v1_database_service.DatabaseServiceClient; -export const LocationServiceClient = cloudApi.ydb.v1_location_service.LocationServiceClient; -export const YdbResourcePresetServiceClient = cloudApi.ydb.v1_resource_preset_service.ResourcePresetServiceClient; -export const StorageTypeServiceClient = cloudApi.ydb.v1_storage_type_service.StorageTypeServiceClient; \ No newline at end of file +export const GroupMappingServiceClient = cloudApi.organizationmanager.group_mapping_service.GroupMappingServiceClient; +export const GroupServiceClient = cloudApi.organizationmanager.group_service.GroupServiceClient; +export const OrganizationServiceClient = cloudApi.organizationmanager.organization_service.OrganizationServiceClient; +export const SshCertificateServiceClient = cloudApi.organizationmanager.ssh_certificate_service.SshCertificateServiceClient; +export const UserServiceClient = cloudApi.organizationmanager.user_service.UserServiceClient; +export const OmCertificateServiceClient = cloudApi.organizationmanager.saml_certificate_service.CertificateServiceClient; +export const FederationServiceClient = cloudApi.organizationmanager.saml_federation_service.FederationServiceClient; +export const CloudServiceClient = cloudApi.resourcemanager.cloud_service.CloudServiceClient; +export const FolderServiceClient = cloudApi.resourcemanager.folder_service.FolderServiceClient; +export const ApiGatewayServiceClient = cloudApi.serverless.apigateway_apigateway_service.ApiGatewayServiceClient; +export const ContainerServiceClient = cloudApi.serverless.containers_container_service.ContainerServiceClient; +export const FunctionServiceClient = cloudApi.serverless.functions_function_service.FunctionServiceClient; +export const ProxyServiceClient = cloudApi.serverless.mdbproxy_proxy_service.ProxyServiceClient; +export const TriggerServiceClient = cloudApi.serverless.triggers_trigger_service.TriggerServiceClient; +export const WebSocketConnectionServiceClient = cloudApi.serverless.apigateway_websocket_connection_service.ConnectionServiceClient; +export const BucketServiceClient = cloudApi.storage.bucket_service.BucketServiceClient; +export const AddressServiceClient = cloudApi.vpc.address_service.AddressServiceClient; +export const GatewayServiceClient = cloudApi.vpc.gateway_service.GatewayServiceClient; +export const NetworkServiceClient = cloudApi.vpc.network_service.NetworkServiceClient; +export const RouteTableServiceClient = cloudApi.vpc.route_table_service.RouteTableServiceClient; +export const SecurityGroupServiceClient = cloudApi.vpc.security_group_service.SecurityGroupServiceClient; +export const SubnetServiceClient = cloudApi.vpc.subnet_service.SubnetServiceClient; +export const YdbBackupServiceClient = cloudApi.ydb.backup_service.BackupServiceClient; +export const YdbDatabaseServiceClient = cloudApi.ydb.database_service.DatabaseServiceClient; +export const LocationServiceClient = cloudApi.ydb.location_service.LocationServiceClient; +export const YdbResourcePresetServiceClient = cloudApi.ydb.resource_preset_service.ResourcePresetServiceClient; +export const StorageTypeServiceClient = cloudApi.ydb.storage_type_service.StorageTypeServiceClient; \ No newline at end of file diff --git a/src/generated/yandex/cloud/smartcaptcha/index.ts b/src/generated/yandex/cloud/smartcaptcha/index.ts index de59b877..62dcae5a 100644 --- a/src/generated/yandex/cloud/smartcaptcha/index.ts +++ b/src/generated/yandex/cloud/smartcaptcha/index.ts @@ -1,2 +1,2 @@ -export * as v1_captcha from './v1/captcha' -export * as v1_captcha_service from './v1/captcha_service' \ No newline at end of file +export * as captcha from './v1/captcha' +export * as captcha_service from './v1/captcha_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/smartwebsecurity/index.ts b/src/generated/yandex/cloud/smartwebsecurity/index.ts index d675c034..2ebad344 100644 --- a/src/generated/yandex/cloud/smartwebsecurity/index.ts +++ b/src/generated/yandex/cloud/smartwebsecurity/index.ts @@ -1,8 +1,8 @@ -export * as v1_security_profile from './v1/security_profile' -export * as v1_security_profile_service from './v1/security_profile_service' -export * as v1_advanced_rate_limiter_advanced_rate_limiter_profile from './v1/advanced_rate_limiter/advanced_rate_limiter_profile' -export * as v1_advanced_rate_limiter_advanced_rate_limiter_profile_service from './v1/advanced_rate_limiter/advanced_rate_limiter_profile_service' -export * as v1_waf_rule_set_descriptor from './v1/waf/rule_set_descriptor' -export * as v1_waf_rule_set_descriptor_service from './v1/waf/rule_set_descriptor_service' -export * as v1_waf_waf_profile from './v1/waf/waf_profile' -export * as v1_waf_waf_profile_service from './v1/waf/waf_profile_service' \ No newline at end of file +export * as security_profile from './v1/security_profile' +export * as security_profile_service from './v1/security_profile_service' +export * as advanced_rate_limiter_advanced_rate_limiter_profile from './v1/advanced_rate_limiter/advanced_rate_limiter_profile' +export * as advanced_rate_limiter_advanced_rate_limiter_profile_service from './v1/advanced_rate_limiter/advanced_rate_limiter_profile_service' +export * as waf_rule_set_descriptor from './v1/waf/rule_set_descriptor' +export * as waf_rule_set_descriptor_service from './v1/waf/rule_set_descriptor_service' +export * as waf_waf_profile from './v1/waf/waf_profile' +export * as waf_waf_profile_service from './v1/waf/waf_profile_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/speechsense/index.ts b/src/generated/yandex/cloud/speechsense/index.ts index d0bab56c..cbf9186b 100644 --- a/src/generated/yandex/cloud/speechsense/index.ts +++ b/src/generated/yandex/cloud/speechsense/index.ts @@ -1,19 +1,19 @@ -export * as v1_audio from './v1/audio' -export * as v1_project from './v1/project' -export * as v1_project_service from './v1/project_service' -export * as v1_search from './v1/search' -export * as v1_talk from './v1/talk' -export * as v1_talk_service from './v1/talk_service' -export * as v1_text from './v1/text' -export * as v1_analysis_conversation_statistics from './v1/analysis/conversation_statistics' -export * as v1_analysis_interrupts_statistics from './v1/analysis/interrupts_statistics' -export * as v1_analysis_points from './v1/analysis/points' -export * as v1_analysis_predefined_classifiers from './v1/analysis/predefined_classifiers' -export * as v1_analysis_silence_statistics from './v1/analysis/silence_statistics' -export * as v1_analysis_speaker_statistics from './v1/analysis/speaker_statistics' -export * as v1_analysis_speech_statistics from './v1/analysis/speech_statistics' -export * as v1_analysis_statistics_common from './v1/analysis/statistics_common' -export * as v1_analysis_summarization from './v1/analysis/summarization' -export * as v1_analysis_text_classifiers from './v1/analysis/text_classifiers' -export * as v1_analysis_transcription from './v1/analysis/transcription' -export * as v1_analysis_utterance_statistics from './v1/analysis/utterance_statistics' \ No newline at end of file +export * as audio from './v1/audio' +export * as project from './v1/project' +export * as project_service from './v1/project_service' +export * as search from './v1/search' +export * as talk from './v1/talk' +export * as talk_service from './v1/talk_service' +export * as text from './v1/text' +export * as analysis_conversation_statistics from './v1/analysis/conversation_statistics' +export * as analysis_interrupts_statistics from './v1/analysis/interrupts_statistics' +export * as analysis_points from './v1/analysis/points' +export * as analysis_predefined_classifiers from './v1/analysis/predefined_classifiers' +export * as analysis_silence_statistics from './v1/analysis/silence_statistics' +export * as analysis_speaker_statistics from './v1/analysis/speaker_statistics' +export * as analysis_speech_statistics from './v1/analysis/speech_statistics' +export * as analysis_statistics_common from './v1/analysis/statistics_common' +export * as analysis_summarization from './v1/analysis/summarization' +export * as analysis_text_classifiers from './v1/analysis/text_classifiers' +export * as analysis_transcription from './v1/analysis/transcription' +export * as analysis_utterance_statistics from './v1/analysis/utterance_statistics' \ No newline at end of file diff --git a/src/generated/yandex/cloud/storage/index.ts b/src/generated/yandex/cloud/storage/index.ts index ea2c225b..a821f231 100644 --- a/src/generated/yandex/cloud/storage/index.ts +++ b/src/generated/yandex/cloud/storage/index.ts @@ -1,3 +1,3 @@ -export * as v1_bucket from './v1/bucket' -export * as v1_bucket_service from './v1/bucket_service' -export * as v1_s3api from './v1/s3api' \ No newline at end of file +export * as bucket from './v1/bucket' +export * as bucket_service from './v1/bucket_service' +export * as s3api from './v1/s3api' \ No newline at end of file diff --git a/src/generated/yandex/cloud/video/index.ts b/src/generated/yandex/cloud/video/index.ts index 96596092..20670e88 100644 --- a/src/generated/yandex/cloud/video/index.ts +++ b/src/generated/yandex/cloud/video/index.ts @@ -1,13 +1,13 @@ -export * as v1_channel from './v1/channel' -export * as v1_channel_service from './v1/channel_service' -export * as v1_episode from './v1/episode' -export * as v1_episode_service from './v1/episode_service' -export * as v1_manifest from './v1/manifest' -export * as v1_stream from './v1/stream' -export * as v1_stream_line from './v1/stream_line' -export * as v1_stream_line_service from './v1/stream_line_service' -export * as v1_stream_service from './v1/stream_service' -export * as v1_thumbnail from './v1/thumbnail' -export * as v1_thumbnail_service from './v1/thumbnail_service' -export * as v1_video from './v1/video' -export * as v1_video_service from './v1/video_service' \ No newline at end of file +export * as channel from './v1/channel' +export * as channel_service from './v1/channel_service' +export * as episode from './v1/episode' +export * as episode_service from './v1/episode_service' +export * as manifest from './v1/manifest' +export * as stream from './v1/stream' +export * as stream_line from './v1/stream_line' +export * as stream_line_service from './v1/stream_line_service' +export * as stream_service from './v1/stream_service' +export * as thumbnail from './v1/thumbnail' +export * as thumbnail_service from './v1/thumbnail_service' +export * as video from './v1/video' +export * as video_service from './v1/video_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/vpc/index.ts b/src/generated/yandex/cloud/vpc/index.ts index 8dd1d45c..51404c41 100644 --- a/src/generated/yandex/cloud/vpc/index.ts +++ b/src/generated/yandex/cloud/vpc/index.ts @@ -1,14 +1,14 @@ -export * as v1_address from './v1/address' -export * as v1_address_service from './v1/address_service' -export * as v1_gateway from './v1/gateway' -export * as v1_gateway_service from './v1/gateway_service' -export * as v1_network from './v1/network' -export * as v1_network_service from './v1/network_service' -export * as v1_route_table from './v1/route_table' -export * as v1_route_table_service from './v1/route_table_service' -export * as v1_security_group from './v1/security_group' -export * as v1_security_group_service from './v1/security_group_service' -export * as v1_subnet from './v1/subnet' -export * as v1_subnet_service from './v1/subnet_service' -export * as v1_privatelink_private_endpoint from './v1/privatelink/private_endpoint' -export * as v1_privatelink_private_endpoint_service from './v1/privatelink/private_endpoint_service' \ No newline at end of file +export * as address from './v1/address' +export * as address_service from './v1/address_service' +export * as gateway from './v1/gateway' +export * as gateway_service from './v1/gateway_service' +export * as network from './v1/network' +export * as network_service from './v1/network_service' +export * as route_table from './v1/route_table' +export * as route_table_service from './v1/route_table_service' +export * as security_group from './v1/security_group' +export * as security_group_service from './v1/security_group_service' +export * as subnet from './v1/subnet' +export * as subnet_service from './v1/subnet_service' +export * as privatelink_private_endpoint from './v1/privatelink/private_endpoint' +export * as privatelink_private_endpoint_service from './v1/privatelink/private_endpoint_service' \ No newline at end of file diff --git a/src/generated/yandex/cloud/ydb/index.ts b/src/generated/yandex/cloud/ydb/index.ts index a5ab6ddd..ade14f2a 100644 --- a/src/generated/yandex/cloud/ydb/index.ts +++ b/src/generated/yandex/cloud/ydb/index.ts @@ -1,10 +1,10 @@ -export * as v1_backup from './v1/backup' -export * as v1_backup_service from './v1/backup_service' -export * as v1_database from './v1/database' -export * as v1_database_service from './v1/database_service' -export * as v1_location from './v1/location' -export * as v1_location_service from './v1/location_service' -export * as v1_resource_preset from './v1/resource_preset' -export * as v1_resource_preset_service from './v1/resource_preset_service' -export * as v1_storage_type from './v1/storage_type' -export * as v1_storage_type_service from './v1/storage_type_service' \ No newline at end of file +export * as backup from './v1/backup' +export * as backup_service from './v1/backup_service' +export * as database from './v1/database' +export * as database_service from './v1/database_service' +export * as location from './v1/location' +export * as location_service from './v1/location_service' +export * as resource_preset from './v1/resource_preset' +export * as resource_preset_service from './v1/resource_preset_service' +export * as storage_type from './v1/storage_type' +export * as storage_type_service from './v1/storage_type_service' \ No newline at end of file diff --git a/src/session.ts b/src/session.ts index 153a09ac..c88cf599 100644 --- a/src/session.ts +++ b/src/session.ts @@ -24,10 +24,10 @@ const isIamToken = (config: SessionConfig): config is IamTokenCredentialsConfig const isServiceAccount = (config: SessionConfig): config is ServiceAccountCredentialsConfig => 'serviceAccountJson' in config; -const createIamToken = async (iamEndpoint: string, req: Partial) => { +const createIamToken = async (iamEndpoint: string, req: Partial) => { const channel = createChannel(iamEndpoint, credentials.createSsl()); const client = clientFactory.create(serviceClients.IamTokenServiceClient.service, channel); - const resp = await client.create(cloudApi.iam.v1_iam_token_service.CreateIamTokenRequest.fromPartial(req)); + const resp = await client.create(cloudApi.iam.iam_token_service.CreateIamTokenRequest.fromPartial(req)); return resp.iamToken; }; diff --git a/src/token-service/iam-token-service.ts b/src/token-service/iam-token-service.ts index 8af24d72..06edef5d 100644 --- a/src/token-service/iam-token-service.ts +++ b/src/token-service/iam-token-service.ts @@ -76,11 +76,11 @@ export class IamTokenService implements TokenService { } } - private async requestToken(): Promise { + private async requestToken(): Promise { const deadline = DateTime.now().plus({ millisecond: this.tokenRequestTimeout }).toJSDate(); return this.client().create( - cloudApi.iam.v1_iam_token_service.CreateIamTokenRequest.fromPartial({ + cloudApi.iam.iam_token_service.CreateIamTokenRequest.fromPartial({ jwt: this.getJwtRequest(), }), { deadline }, From 97c2452348e8afc84058f8115488570ed7d1a753 Mon Sep 17 00:00:00 2001 From: GermanVor Date: Fri, 11 Oct 2024 15:55:00 +0200 Subject: [PATCH 4/4] chore: update exemples --- examples/ai-translate.ts | 2 +- examples/chat-with-assistant.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/ai-translate.ts b/examples/ai-translate.ts index 04a6cb21..fba161db 100644 --- a/examples/ai-translate.ts +++ b/examples/ai-translate.ts @@ -2,7 +2,7 @@ import { serviceClients, Session, cloudApi } from '@yandex-cloud/nodejs-sdk'; import { getEnv } from './utils/get-env'; import { log } from './utils/logger'; -const { ai: { translate_translation_service: { TranslateRequest, TranslateRequest_Format: Format } } } = cloudApi; +const { ai: { translate_v2_translation_service: { TranslateRequest, TranslateRequest_Format: Format } } } = cloudApi; const TEXTS = ['NodeJS SDK examples', 'Powerful, but easy to use library']; const AUTH_TOKEN = getEnv('YC_OAUTH_TOKEN'); diff --git a/examples/chat-with-assistant.ts b/examples/chat-with-assistant.ts index 5e05c59a..b84e3ff8 100644 --- a/examples/chat-with-assistant.ts +++ b/examples/chat-with-assistant.ts @@ -22,10 +22,10 @@ const folderId = getEnv('YC_FOLDER_ID'); (async () => { const session = new Session({ iamToken }); - const assistantApi = cloudApi.ai.assistants_v1_assistant_service; - const messageApi = cloudApi.ai.assistants_v1_threads_message_service; - const threadApi = cloudApi.ai.assistants_v1_threads_thread_service; - const runApi = cloudApi.ai.assistants_v1_runs_run_service; + const assistantApi = cloudApi.ai.assistants_assistant_service; + const messageApi = cloudApi.ai.assistants_threads_message_service; + const threadApi = cloudApi.ai.assistants_threads_thread_service; + const runApi = cloudApi.ai.assistants_runs_run_service; // const assistantClient = session.client(assistantApi.AssistantServiceClient); const assistantClient = session.client( @@ -91,7 +91,7 @@ const folderId = getEnv('YC_FOLDER_ID'); runApi.ListenRunRequest.fromPartial({ runId: run.id }), ); - let lastStreamEvent: cloudApi.ai.assistants_v1_runs_run_service.StreamEvent | null = null; + let lastStreamEvent: cloudApi.ai.assistants_runs_run_service.StreamEvent | null = null; for await (const streamEvent of asyncIterableForStreamEvent) { lastStreamEvent = streamEvent;